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>
This commit is contained in:
anoracleofra-code
2026-03-26 22:00:36 -06:00
co-authored by Claude Opus 4.6
parent 5f4d52c288
commit 59b1723866
6 changed files with 92 additions and 31 deletions
+2
View File
@@ -15,6 +15,8 @@ services:
- CORS_ORIGINS=${CORS_ORIGINS:-}
# Default Infonet relay peer so fresh installs can sync immediately.
- MESH_RELAY_PEERS=${MESH_RELAY_PEERS:-http://cipher0.shadowbroker.info:8000}
# Shared transport auth for mesh peer push (default matches baked-in testnet secret).
- MESH_PEER_PUSH_SECRET=${MESH_PEER_PUSH_SECRET:-sb-public-testnet-v1-2026}
volumes:
- backend_data:/app/data
restart: unless-stopped