feat: lean-Pi WS fan-out, geofences, DVR playback, fire/aircraft correlation #7

Merged
sirius merged 1 commit from feat/osint-lean-pi-geofence-dvr into master 2026-08-28 09:40:33 -04:00
Owner

Summary

  • Phase 1: in-memory WebSocket ConnectionManager with viewport-filtered AIS/ADS-B fan-out, 500ms map moveend debounce, cachetools TTLCache for FIRMS/RSS, background masscan/ffmpeg, compose memory caps (db 3G / app 2G, shared_buffers=2GB).
  • Phase 2: PostGIS geofence CRUD + ST_Intersects ingest alerts, Timescale 1-minute CAGGs + DVR ?timestamp= playback slider, FIRMS/WFIGS × firefighting ADS-B within 20 miles.
  • Rebased onto current master so AIS viewport subscribe (POST /api/vessels/subscribe) is kept.

Motivation

Kanban t_93b74d04 + t_05aa0e54 (backend profile). Pi 5 8GB, Tailnet. No Redis / Kafka / Celery.

Changes

  • app/ws_manager.py + /ws/live — viewport-intersect fan-out
  • app/upstream_cache.py — TTLCache (FIRMS 5 min, RSS 1 min)
  • app/bg_jobs.py — masscan 200 pps cap via BackgroundTasks; ffmpeg via asyncio.create_task
  • app/geofence.py, app/tracks.py, app/fire_aircraft.py, alembic 005_phase2.py
  • docker-compose.yml memory limits + postgres shared_buffers=2GB
  • Map HUD: 500ms debounce, DVR slider, geofence draw hook

Test Plan

  • PYTHONPATH=app pytest tests/test_ws_manager.py tests/test_upstream_cache.py tests/test_bg_jobs.py tests/test_phase1_guardrails.py tests/test_geofence.py tests/test_tracks.py tests/test_fire_aircraft.py tests/test_phase2_api.py tests/test_api_live_layers.py -q → 37 passed after rebase
  • CI build on this PR (does not deploy; deploy is push to master)
  • Do not merge until you want Pi compose to pick it up

Notes for Reviewers

  • Masscan stays @200pps. Never emit rtsp:// in camera popups.
  • Worktree was originally off fix/news-ticker-hud; this PR is replayed onto forgejo/master (8978324).
  • GitHub origin not updated (stale master); Forgejo is the deploy path.
## Summary - Phase 1: in-memory WebSocket ConnectionManager with viewport-filtered AIS/ADS-B fan-out, 500ms map `moveend` debounce, cachetools TTLCache for FIRMS/RSS, background masscan/ffmpeg, compose memory caps (db 3G / app 2G, `shared_buffers=2GB`). - Phase 2: PostGIS geofence CRUD + `ST_Intersects` ingest alerts, Timescale 1-minute CAGGs + DVR `?timestamp=` playback slider, FIRMS/WFIGS × firefighting ADS-B within 20 miles. - Rebased onto current `master` so AIS viewport subscribe (`POST /api/vessels/subscribe`) is kept. ## Motivation Kanban t_93b74d04 + t_05aa0e54 (backend profile). Pi 5 8GB, Tailnet. **No Redis / Kafka / Celery.** ## Changes - `app/ws_manager.py` + `/ws/live` — viewport-intersect fan-out - `app/upstream_cache.py` — TTLCache (FIRMS 5 min, RSS 1 min) - `app/bg_jobs.py` — masscan 200 pps cap via BackgroundTasks; ffmpeg via `asyncio.create_task` - `app/geofence.py`, `app/tracks.py`, `app/fire_aircraft.py`, alembic `005_phase2.py` - `docker-compose.yml` memory limits + postgres `shared_buffers=2GB` - Map HUD: 500ms debounce, DVR slider, geofence draw hook ## Test Plan - [x] `PYTHONPATH=app pytest tests/test_ws_manager.py tests/test_upstream_cache.py tests/test_bg_jobs.py tests/test_phase1_guardrails.py tests/test_geofence.py tests/test_tracks.py tests/test_fire_aircraft.py tests/test_phase2_api.py tests/test_api_live_layers.py -q` → 37 passed after rebase - [ ] CI build on this PR (does **not** deploy; deploy is push to `master`) - [ ] Do not merge until you want Pi compose to pick it up ## Notes for Reviewers - Masscan stays @200pps. Never emit `rtsp://` in camera popups. - Worktree was originally off `fix/news-ticker-hud`; this PR is replayed onto `forgejo/master` (`8978324`). - GitHub `origin` not updated (stale `master`); Forgejo is the deploy path.
sirius added 1 commit 2026-08-28 09:33:54 -04:00
Phase 1: in-memory ConnectionManager viewport fan-out, 500ms map debounce,
cachetools TTLCache, background masscan/ffmpeg, compose memory caps.

Phase 2: PostGIS geofences + ST_Intersects alerts, Timescale 1-min CAGGs
and timestamp playback, FIRMS/WFIGS x firefighting ADS-B within 20 miles.

No Redis/Kafka/Celery.
sirius merged commit 104fb2072a into master 2026-08-28 09:40:33 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: sirius/osint-dashboard#7
No description provided.