8 Commits

Author SHA1 Message Date
Hermes 607aea514b feat: harden SSE endpoint with typed events and Last-Event-ID
Build (Dev) / build (push) Failing after 0s
CI/CD / lint-and-typecheck (push) Failing after 1s
CI/CD / test (push) Has been skipped
CI/CD / build (push) Has been skipped
CI/CD / deploy (push) Has been skipped
- Added monotonic event ID (Last-Event-ID) for reconnection support
- Events now emit typed: 'event: camera_status' for client-side filtering
- Initial connection event sends 'event: connected' with ID
- Reconnection acknowledgment via Last-Event-ID header
- CORS preflight (OPTIONS) handler
- Access-Control-Allow-Headers: Last-Event-ID
- Initial heartbeat shortened to 15s for faster detect (30s for steady)

Closes CUB-233.
2026-05-21 21:18:24 +00:00
Hermes f200cd9782 feat: add MQTT subscriber for ESP32 camera status ingestion
Implements MQTT subscriber (internal/mqtt/subscriber.go) that:
- Connects to Mosquitto broker with auto-reconnect
- Subscribes to remoterig/cameras/+/status, +/heartbeat, +/announce
- Parses and validates incoming messages per MQTT contract
- Inserts status_logs with duplicate prevention
- Auto-detects recording state changes and manages recording_events
- Broadcasts camera status changes via SSE hub
- Camera auto-registration via announce (MAC-based, sequential cam-NNN)
- Heartbeat watchdog marks cameras offline after 120s silence
- Wired into main.go with graceful degradation (warns if broker unreachable)

Dependency: github.com/eclipse/paho.mqtt.golang v1.5.0

Closes CUB-232.
2026-05-21 21:16:08 +00:00
overseer 111cce4c84 CUB-187+188+191+193: Recording handlers, status ingestion, SSE endpoint
ci/verify Branch verified
2026-05-18 17:52:48 -04:00
overseer 5cc57446e5 CUB-186: Camera list and register API handlers + Chi router wiring 2026-05-18 17:48:58 -04:00
overseer 7a0a76bbd5 CUB-182: Chi router setup with auth middleware and graceful shutdown 2026-05-18 17:47:06 -04:00
overseer c0b2b4cf57 CUB-184: API key auth middleware 2026-05-18 17:45:25 -04:00
overseer dcd64ee199 CUB-183: SQLite schema migration + DB init 2026-05-18 17:44:50 -04:00
overseer ad55e94c9c CUB-181: Scaffold Go module, directory layout, config, and main.go entry point 2026-05-18 17:43:46 -04:00