88 Commits

Author SHA1 Message Date
Shadowbroker afaad93878 fix: graceful fallback when orjson unavailable on pre-AVX CPUs
orjson ships pre-built wheels with AVX2 SIMD instructions that cause
SIGILL (exit code 132) on older processors. This wraps the import in
a try/except and falls back to stdlib json for serialization.

Closes #127
2026-04-03 19:40:05 -06:00
anoracleofra-code 8f7bb417db fix: thread-safe SSE broadcast + node enabled by default
- SSE broadcast now uses loop.call_soon_threadsafe() when called from
  background threads (gate pull/push loops), fixing silent notification
  failures for peer-synced messages
- Chain hydration path now broadcasts SSE so gate messages arriving via
  public chain sync trigger frontend refresh
- Node participation defaults to enabled so fresh installs automatically
  join the mesh network (push + pull)
2026-03-28 07:05:19 -06:00
anoracleofra-code 1fd12beb7a fix: relay nodes now accept gate messages (skip gate-exists check)
Relay nodes run in store-and-forward mode with no local gate configs,
so gate_manager.can_enter() always returned "Gate does not exist" —
silently rejecting every pushed gate message. This broke cross-node
gate message delivery entirely since no relay ever stored anything.

Relay mode now skips the gate-existence check after signature
verification passes, allowing encrypted gate blobs to flow through.
2026-03-27 21:56:46 -06:00
anoracleofra-code c35978c64d fix: add version to health endpoint + warn users with stale compose files
Repo migration in March 2026 rewrote all commit hashes, leaving old
clones with a docker-compose.yml that builds from source instead of
pulling pre-built images.  Added detection warnings to compose.sh,
start.bat, and start.sh so affected users see clear instructions.
Also exposes APP_VERSION in /api/health for easier debugging.
2026-03-27 13:56:32 -06:00
anoracleofra-code c81d81ec41 feat: real-time gate messages via SSE + faster push/pull intervals
- Add Server-Sent Events endpoint at GET /api/mesh/gate/stream that
  broadcasts ALL gate events to connected frontends (privacy: no
  per-gate subscriptions, clients filter locally)
- Hook SSE broadcast into all gate event entry points: local append,
  peer push receiver, and pull loop
- Reduce push/pull intervals from 30s to 10s for faster relay sync
- Add useGateSSE hook for frontend EventSource integration
- GateView + MeshChat use SSE for instant refresh, polling demoted
  to 30s fallback

Latency: same-node instant, cross-node ~10s avg (was ~34s)
2026-03-27 09:35:53 -06:00
anoracleofra-code 40a3cbdfdc feat: add pull-based gate sync for cross-node message delivery
Nodes behind NAT could push gate messages to relays but had no way
to pull messages from OTHER nodes back.  The push loop only sends
outbound; the public chain sync carries encrypted blobs but peer-
pushed gate events never made it onto the relay's chain.

Adds:
- POST /api/mesh/gate/peer-pull: HMAC-authenticated endpoint that
  returns gate events a peer is missing (discovery mode returns all
  gate IDs with counts; per-gate mode returns event batches).
- _http_gate_pull_loop: background thread (30s interval) that pulls
  new gate events from relay peers into local gate_store.

This closes the loop: push sends YOUR messages out, pull fetches
EVERYONE ELSE's messages back.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 23:42:05 -06:00
anoracleofra-code b118840c7c fix: preserve gate_envelope and reply_to in peer push receiver
The gate_peer_push endpoint was stripping gate_envelope and reply_to
from incoming events, making cross-node message decryption impossible.
Messages would arrive but couldn't be read by the receiving node.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 22:46:41 -06:00
anoracleofra-code ae627a89d7 fix: align transport secret with cipher0 relay
Use cipher0's existing MESH_PEER_PUSH_SECRET so nodes connect
to the relay out of the box without configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 22:11:17 -06:00
anoracleofra-code 59b1723866 feat: fix gate message delivery + per-gate content encryption
Phase 1 — Transport layer fix:
- Bake in default MESH_PEER_PUSH_SECRET so peer push, real-time
  propagation, and pull-sync all work out of the box instead of
  silently no-oping on an empty secret.
- Pass secret through docker-compose.yml for container deployments.

Phase 2 — Per-gate content keys:
- Generate a cryptographically random 32-byte secret per gate on
  creation (and backfill existing gates on startup).
- Upgrade HKDF envelope encryption to use per-gate secret as IKM
  so knowing a gate name alone no longer decrypts messages.
- 3-tier decryption fallback (phase2 key → legacy name-only →
  legacy node-local) preserves backward compatibility.
- Expose gate_secret via list_gates API for authorized members.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 22:00:36 -06:00
anoracleofra-code da09cf429e fix: cross-node gate decryption, UI text scaling, aircraft zoom
- Derive gate envelope AES key from gate ID via HKDF so all nodes
  sharing a gate can decrypt each other's messages (was node-local)
- Preserve gate_envelope/reply_to in chain payload normalization
- Bump Wormhole modal text from 9-10px to 12-13px
- Add aircraft icon zoom interpolation (0.8→2.0 across zoom 5-12)
- Reduce Mesh Chat panel text sizes for tighter layout
2026-03-26 20:00:30 -06:00
anoracleofra-code c6fc47c2c5 fix: bump Rust builder to 1.88 (darling 0.23 MSRV) 2026-03-26 17:58:58 -06:00
anoracleofra-code 39cc5d2e7c fix: compile privacy-core Rust library in Docker backend image
The MLS gate encryption system requires libprivacy_core.so — a Rust
shared library that was only compiled locally on the dev machine.
Docker users got "active gate identity is not mapped into the MLS
group" because the library was never built or included in the image.

Add a multi-stage Docker build:
- Stage 1: rust:1.87-slim-bookworm compiles privacy-core to .so
- Stage 2: copies libprivacy_core.so into the Python backend image
- Set PRIVACY_CORE_LIB env var so Python finds the library

Also track the privacy-core Rust source (Cargo.toml, Cargo.lock,
src/lib.rs) in git — they were previously untracked, which is why
the Docker build never had access to them.

Add root .dockerignore to exclude build caches and large directories
from the Docker build context.
2026-03-26 17:48:01 -06:00
anoracleofra-code 3cbe8090a9 fix: add default relay peer so fresh installs can sync Infonet
On a fresh Docker (or local) install, MESH_RELAY_PEERS was empty and
no bootstrap manifest existed, leaving the Infonet node with zero
peers to sync from — causing perpetual "RETRYING" status.

Set cipher0.shadowbroker.info:8000 as the default relay peer in both
the config defaults and docker-compose.yml so new installations sync
immediately after activating the wormhole.
2026-03-26 17:31:16 -06:00
anoracleofra-code 86d2145b97 fix: use paho-mqtt threaded loop for stable MQTT reconnection
The Meshtastic MQTT bridge was using client.loop(timeout=1.0) in a
blocking while loop. When the broker dropped the connection (common
after ~30s of idle in Docker), the client silently stopped receiving
messages with no auto-reconnect.

Switch to client.loop_start() which runs the MQTT network loop in a
background thread with built-in automatic reconnection. Also:
- Add on_disconnect callback for visibility into disconnection events
- Set reconnect_delay_set(1, 30) for fast exponential-backoff reconnect
- Lower keepalive from 60s to 30s to stay within Docker network timeouts
2026-03-26 16:48:06 -06:00
anoracleofra-code 81b99c0571 fix: add meshtastic, PyNaCl, vaderSentiment to dependencies
Full import audit found these packages used but missing from
pyproject.toml — all silently broken in Docker:
- meshtastic: MQTT protobuf decode (why US/LongFast chat was empty)
- PyNaCl: DM sealed-box encryption
- vaderSentiment: oracle sentiment analysis (unguarded, would crash)
2026-03-26 16:19:24 -06:00
anoracleofra-code 6140e9b7da fix: pin paho-mqtt to v1.x (v2 broke callback API)
paho-mqtt v2 changed Client constructor and on_connect callback
signatures, breaking the Meshtastic MQTT bridge. Pin to <2.0.0
so the existing v1 code works correctly in Docker.
2026-03-26 15:57:14 -06:00
anoracleofra-code 12cf5c0824 fix: add paho-mqtt dependency + improve Infonet sync status labels
paho-mqtt was missing from pyproject.toml, causing the Meshtastic MQTT
bridge to silently disable itself in Docker — no live chat messages
could be received. Also improve Infonet node status labels: show
RETRYING when sync fails instead of misleading SYNCING, and WAITING
when node is enabled but no sync has run yet.
2026-03-26 15:45:11 -06:00
anoracleofra-code b03dc936df fix: auto-enable raw secure storage fallback in Docker containers
Docker/Linux containers have no DPAPI or native keyring, causing all
wormhole persona/gate/identity endpoints to crash with
SecureStorageError. Detect /.dockerenv and auto-allow raw fallback
so mesh features work out of the box in Docker.
2026-03-26 15:28:44 -06:00
anoracleofra-code 6cf325142e fix: increase wormhole readiness deadline from 8s to 20s
In Docker the wormhole subprocess takes 10-15s to start (loading
Plane-Alert DB, env checks, uvicorn startup). The 8s deadline was
expiring before the health probe could succeed, leaving ready=false
permanently even though the subprocess was healthy.
2026-03-26 11:00:44 -06:00
anoracleofra-code 81c90a9faf fix: stop AIS proxy crash-loop when API key is not set
Exit early from _ais_stream_loop() if AIS_API_KEY is empty instead of
endlessly spawning the Node proxy which immediately prints FATAL and
exits. This was flooding docker logs with hundreds of lines per minute.
2026-03-26 10:53:30 -06:00
anoracleofra-code 4897a54803 fix: allow Docker internal IPs for local operator + bump changelog text sizes
- require_local_operator now recognizes Docker bridge network IPs
  (172.x, 192.168.x, 10.x) as local, fixing "Forbidden — local operator
  access only" when frontend container calls wormhole/mesh endpoints
- Bumped all changelog modal text from 8-9px to 11-13px for readability
2026-03-26 10:23:31 -06:00
anoracleofra-code 8b52cbfe30 fix: allow startup without ADMIN_KEY for fresh Docker installs
Changed _validate_admin_startup() from sys.exit(1) to a warning when
ADMIN_KEY is not set. Regular dashboard users don't need admin/mesh
endpoints — the app should start and serve the dashboard without them.
2026-03-26 10:01:07 -06:00
anoracleofra-code fb6d098adf fix: add missing orjson, beautifulsoup4, cryptography deps to pyproject.toml
Docker image was crash-looping with `ModuleNotFoundError: No module named 'orjson'`
because these packages were imported but not declared as dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 08:03:17 -06:00
anoracleofra-code 09e39de4ef fix: add dev dependency group to pyproject.toml for CI
CI runs `uv sync --group dev` but only a `test` group existed.
Renamed to `dev` and added ruff + black so Docker Publish can pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 06:33:35 -06:00
Shadowbroker 3cca19b9dd Merge pull request #112 from BigBodyCobain/dependabot/pip/backend/python-dotenv-1.2.2
chore(deps): bump python-dotenv from 1.0.1 to 1.2.2 in /backend
2026-03-26 06:22:41 -06:00
anoracleofra-code ac6b209c37 fix: Docker self-update shows pull instructions instead of silently failing
The self-updater extracted files inside the container but Docker restarts
from the original image, discarding all changes. Now detects Docker via
/.dockerenv and returns pull commands for the user to run on their host.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 06:18:23 -06:00
dependabot[bot] f3946d9b0d chore(deps): bump python-dotenv from 1.0.1 to 1.2.2 in /backend
Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 1.0.1 to 1.2.2.
- [Release notes](https://github.com/theskumar/python-dotenv/releases)
- [Changelog](https://github.com/theskumar/python-dotenv/blob/main/CHANGELOG.md)
- [Commits](https://github.com/theskumar/python-dotenv/compare/v1.0.1...v1.2.2)

---
updated-dependencies:
- dependency-name: python-dotenv
  dependency-version: 1.2.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-26 11:59:51 +00:00
anoracleofra-code 668ce16dc7 v0.9.6: InfoNet hashchain, Wormhole gate encryption, mesh reputation, 16 community contributors
Gate messages now propagate via the Infonet hashchain as encrypted blobs — every node syncs them
through normal chain sync while only Gate members with MLS keys can decrypt. Added mesh reputation
system, peer push workers, voluntary Wormhole opt-in for node participation, fork recovery,
killwormhole scripts, obfuscated terminology, and hardened the self-updater to protect encryption
keys and chain state during updates.

New features: Shodan search, train tracking, Sentinel Hub imagery, 8 new intelligence layers,
CCTV expansion to 11,000+ cameras across 6 countries, Mesh Terminal CLI, prediction markets,
desktop-shell scaffold, and comprehensive mesh test suite (215 frontend + backend tests passing).

Community contributors: @wa1id, @AlborzNazari, @adust09, @Xpirix, @imqdcr, @csysp, @suranyami,
@chr0n1x, @johan-martensson, @singularfailure, @smithbh, @OrfeoTerkuci, @deuza, @tm-const,
@Elhard1, @ttulttul
2026-03-26 05:58:04 -06:00
Orfeo Terkuci 212b1051a7 Reorder Dockerfile instructions: move source code copy before dependency installation 2026-03-24 20:03:58 +01:00
Orfeo Terkuci fa2d47ca66 Refactor project structure: separate backend dependencies into pyproject.toml 2026-03-24 20:03:51 +01:00
Orfeo Terkuci 698ca0287d Remove old requirements.txt files 2026-03-22 15:39:33 +01:00
Orfeo Terkuci 1034d95145 Update dockerfile to use UV
Change backend context from . to ./backend in docker-compose.
This is necessary for copying the pyproject.toml and uv.lock files from project root level
2026-03-22 15:39:23 +01:00
Shadowbroker c2f2f99cf4 Merge pull request #98 from johan-martensson/feat/satellite-data-quality
fix: correct COSMO-SkyMed key and add missing satellite classifications
2026-03-22 01:49:19 -06:00
Johan Martensson 7a02bf6178 fix: correct COSMO-SKYMED key and add missing satellite classifications (COSMOS, WGS, AEHF, MUOS, SENTINEL, CSS) 2026-03-22 05:31:28 +00:00
Johan Martensson 98a9293166 fix: replace concurrent yfinance fetches with single batch download to avoid rate limiting 2026-03-22 05:31:28 +00:00
Singular Failure 3a2d8ddd75 feat: add Spanish CCTV feeds and fix image loading
- Add 5 native ingestors to cctv_pipeline.py: DGT (~1,917 cameras),
  Madrid (~357), Málaga (~134), Vigo (~59), Vitoria-Gasteiz (~17)
- Fix DGT DATEX2 parser to match actual XML schema (device elements,
  not CctvCameraRecord)
- Wire all new ingestors into the scheduler via data_fetcher.py
- Remove standalone spain_cctv.py by Alborz Nazari, replaced by native
  pipeline ingestors that integrate with the existing scheduler pattern
- Fix CCTV image loading for servers with Referer-based hotlink
  protection (referrerPolicy="no-referrer")
- Replace external via.placeholder.com fallbacks with inline SVG data
  URIs to avoid dependency on unreachable third-party service
- Surface source_agency attribution in CCTV panel UI for open data
  license compliance (CC BY / Spain Ley 37/2007)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 15:10:43 +01:00
Wa1iD 231f0afc4e fix: restore CCTV layer ingestion and map rendering 2026-03-20 22:05:05 +01:00
Alborz Nazari 335b1f78f6 feat: add Spain DGT/Madrid CCTV sources and STIX 2.1 export endpoint 2026-03-20 17:27:13 +01:00
adust09 b40f9d1fd0 feat: add power plants layer with WRI Global Power Plant Database
Map ~35,000 power generation facilities from 164 countries using the
WRI Global Power Plant Database (CC BY 4.0). Follows the existing
datacenter layer pattern with clustered icon symbols, amber color
scheme, and click popups showing fuel type, capacity, and operator.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 16:56:24 +09:00
adust09 44147da205 fix: resolve merge conflicts between JSDF bases and East Asia adversary bases
Merge both feature sets: keep JSDF bases (gsdf/msdf/asdf branches) from
PR #77 and East Asia adversary bases (missile/nuclear branches) from main.
Union all branch types in tests and MaplibreViewer labels.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 01:10:19 +09:00
adust09 457f00ca42 feat: add 18 JSDF bases to military bases layer
Add ASDF (8), MSDF (6), and GSDF (4) bases to military_bases.json.
Colocated bases (Misawa, Yokosuka, Sasebo) have offset coordinates
to avoid overlap with existing US entries. Add branchLabel entries
for GSDF/MSDF/ASDF in MaplibreViewer popup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 14:44:32 +09:00
adust09 27506bbaa9 test: add JSDF bases tests (RED phase)
- Add gsdf/msdf/asdf to known_branches in test_branch_values_are_known
- Add test_includes_jsdf_bases for Yonaguni, Naha, Kure
- Add test_colocated_bases_have_separate_entries for Misawa
- Add buildMilitaryBasesGeoJSON tests with ASDF branch validation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 14:43:01 +09:00
adust09 910d1fd633 feat: enhance East Asia coverage with adversary bases, news sources, ICAO ranges, and PLAN vessel DB
- Add 68 military bases (PLA, Russia, DPRK, ROC, Philippines, Australia)
  with data-driven color coding (red/blue/green) on the map
- Add 6 news RSS feeds (Yonhap, Nikkei Asia, Taipei Times, Asia Times,
  Defense News, Japan Times) and 15 geocoding keywords for islands,
  straits, and disputed areas
- Extend ICAO country ranges for Russia, Australia, Philippines,
  Singapore, DPRK and add Russian aircraft classification (fighters,
  bombers, cargo, recon)
- Create PLAN/CCG vessel enrichment module (90+ ships) following
  yacht_alert pattern for automatic MMSI-based identification
- Update frontend types and popup styling for adversary/allied/ROC
  color distinction

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 12:46:40 +09:00
adust09 4b9765791f feat: enrich military aircraft with ICAO country/force and East Asia model classification
Infer country and military force (PLA, JSDF, ROK, ROC) from ICAO hex
address blocks when the flag field is Unknown. Extract and extend aircraft
model classification to cover East Asian fighters, cargo, recon, and
tanker types with hyphen-normalized matching.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 01:05:44 +09:00
adust09 05de14af9d feat: add military bases map layer for Western Pacific
Add 18 US military bases (Japan, Guam, South Korea, Hawaii, Diego Garcia)
as a toggleable map layer. Follows the existing data center layer pattern:
static JSON → backend fetcher → slow-tier API → frontend GeoJSON layer.

Includes red circle markers with labels, click popups showing operator
and branch info, and a toggle in the left panel.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 00:33:35 +09:00
adust09 130287bb49 feat: add East Asia news sources and improve geocoding for Taiwan contingency
Add 5 East Asia-focused RSS feeds (FocusTaiwan, Kyodo, SCMP, The Diplomat,
Stars and Stripes) and 22 geographic keywords (Taiwan Strait, South/East
China Sea, Okinawa, Guam, military bases, etc.) to improve coverage of
Taiwan contingency scenarios.

Refactor keyword matching into a pure _resolve_coords() function with
longest-match-first sorting so specific locations like "Taiwan Strait"
are not absorbed by generic "Taiwan".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 23:19:55 +09:00
Shadowbroker b5f49fe882 Update README.md
Former-commit-id: 85110e82cc09ab746d323f8625b8ecb5b1c03500
2026-03-14 19:26:50 -06:00
anoracleofra-code b37bfc0162 fix: add path traversal guard to updater extraction
Validates that every destination path stays within project_root
before writing. Prevents a malicious zip from writing outside
the project directory via ../traversal entries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Former-commit-id: 3140416e80b1b56e4e6cccc930d11c2d5f9b1611
2026-03-14 14:48:47 -06:00
anoracleofra-code 95474c3ac5 fix: updater resolves project_root to / in Docker containers
In Docker, main.py lives at /app/main.py so Path.parent.parent
resolves to filesystem root /, causing PermissionError on .github
and other dirs. Now detects this case and falls back to cwd.
Also grants backenduser write access to /app for auto-update.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Former-commit-id: 12c8bb5816a70161d5ab5d79f9240e7eab6e6e15
2026-03-14 14:34:11 -06:00
anoracleofra-code b99a5e5d66 fix: updater crashes on os.makedirs PermissionError + prune protected dirs
os.makedirs was outside try/except so permission-denied on .github
directory creation crashed the entire update. Now both makedirs and
copy are caught. Also prunes protected dirs from os.walk so the
updater never even enters .github, .git, .claude, etc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Former-commit-id: d4bdef4604095a82860a4bc91bec3435a878f899
2026-03-14 14:29:37 -06:00