2026-07-07 17:50:51 -04:00
|
|
|
|
# OSINT Dashboard — environment configuration
|
|
|
|
|
|
# Copy to `.env` and adjust. All values have safe defaults for local compose.
|
|
|
|
|
|
|
|
|
|
|
|
# ── PostgreSQL / TimescaleDB ───────────────────────────────────────────────
|
|
|
|
|
|
DB_USER=osint
|
|
|
|
|
|
DB_PASSWORD=osint
|
|
|
|
|
|
DB_HOST=db
|
|
|
|
|
|
DB_PORT=5432
|
|
|
|
|
|
DB_NAME=osint_data
|
|
|
|
|
|
|
|
|
|
|
|
# ── NATS JetStream (optional — only needed when profile `ingest` is used) ──
|
|
|
|
|
|
NATS_URL=nats://nats:4222
|
|
|
|
|
|
|
|
|
|
|
|
# ── MinIO (optional — document storage; endpoint used if wired later) ──────
|
|
|
|
|
|
MINIO_ENDPOINT=minio:9000
|
|
|
|
|
|
MINIO_ACCESS_KEY=
|
|
|
|
|
|
MINIO_SECRET_KEY=
|
|
|
|
|
|
# "true" for TLS endpoints (e.g. S3-compatible prod); "false" for local HTTP.
|
|
|
|
|
|
MINIO_SECURE=false
|
Add NASA FIRMS active-fire ingest + /api/fires; API keys management page
Coherent merge of two coordinated features on the shared working tree:
FIRMS fire heatmap (backend, t_6e404c14):
- app/fire_sources.py: fetch FIRMS VIIRS area CSV (free MAP_KEY) -> NATS events.fire
- fires hypertable (TimescaleDB, 1-day chunks) with natural-key PK
(latitude, longitude, acq_time, satellite); idempotent ON CONFLICT DO NOTHING
- alembic/versions/002_fires.py; GET /api/fires?bbox=&since= (JSON only)
- POST /api/ingest/fires; ~15 min poll loop (FIRMS_INTERVAL=900) in ingester
- env-driven config (FIRMS_MAP_KEY/DATASET/BBOX/INTERVAL); docs/firms.md covers
the zero-cost GIBS VIIRS_SNPP_Thermal_Anomalies_375m_All tile alternative
- 18 tests (parser, mapping, idempotency, API contract) verified vs real
TimescaleDB+PostGIS (localhost/osint-dashboard-pg image)
API keys page (frontend, t_4433cff2):
- app/keystore.py: api_keys table (self-creating), FIRMS/GEMINI/TELEGRAM
registry with format validation, ****last4 masking, get_api_key()
- GET/POST/DELETE /api/keys (never returns full values); Keys tab in index.html
DB_NULL_POOL env switch in app/database.py enables a NullPool for tests /
short-lived processes that open a fresh event loop per unit.
2026-08-24 15:37:42 -04:00
|
|
|
|
|
2026-08-24 14:54:51 -04:00
|
|
|
|
# ── Camera discovery scraper ───────────────────────────────────────────────
|
2026-08-27 15:46:49 -04:00
|
|
|
|
# Comma-separated public directory/list/API URLs (Insecam-style pages,
|
|
|
|
|
|
# plain-text lists, or the ALERTWest JSON API). Empty = built-in defaults
|
2026-08-27 15:54:54 -04:00
|
|
|
|
# (public-ip-cams README + ALERTCalifornia/ALERTWest official JPEGs +
|
|
|
|
|
|
# Live-Environment-Streams HLS/YouTube GeoJSON).
|
2026-08-24 14:54:51 -04:00
|
|
|
|
CAMERA_SOURCE_URLS=
|
|
|
|
|
|
CAMERA_SCRAPE_INTERVAL=3600
|
|
|
|
|
|
CAMERA_REQUEST_DELAY=2.0
|
2026-08-27 15:46:49 -04:00
|
|
|
|
CAMERA_MAX_PER_SOURCE=20000
|
2026-08-24 14:54:51 -04:00
|
|
|
|
NOMINATIM_URL=https://nominatim.openstreetmap.org
|
|
|
|
|
|
NOMINATIM_MIN_INTERVAL=1.1
|
|
|
|
|
|
SNAPSHOT_TTL_SECONDS=300
|
2026-08-24 15:40:31 -04:00
|
|
|
|
|
Add NASA FIRMS active-fire ingest + /api/fires; API keys management page
Coherent merge of two coordinated features on the shared working tree:
FIRMS fire heatmap (backend, t_6e404c14):
- app/fire_sources.py: fetch FIRMS VIIRS area CSV (free MAP_KEY) -> NATS events.fire
- fires hypertable (TimescaleDB, 1-day chunks) with natural-key PK
(latitude, longitude, acq_time, satellite); idempotent ON CONFLICT DO NOTHING
- alembic/versions/002_fires.py; GET /api/fires?bbox=&since= (JSON only)
- POST /api/ingest/fires; ~15 min poll loop (FIRMS_INTERVAL=900) in ingester
- env-driven config (FIRMS_MAP_KEY/DATASET/BBOX/INTERVAL); docs/firms.md covers
the zero-cost GIBS VIIRS_SNPP_Thermal_Anomalies_375m_All tile alternative
- 18 tests (parser, mapping, idempotency, API contract) verified vs real
TimescaleDB+PostGIS (localhost/osint-dashboard-pg image)
API keys page (frontend, t_4433cff2):
- app/keystore.py: api_keys table (self-creating), FIRMS/GEMINI/TELEGRAM
registry with format validation, ****last4 masking, get_api_key()
- GET/POST/DELETE /api/keys (never returns full values); Keys tab in index.html
DB_NULL_POOL env switch in app/database.py enables a NullPool for tests /
short-lived processes that open a fresh event loop per unit.
2026-08-24 15:37:42 -04:00
|
|
|
|
# ── NASA FIRMS (active fire / hotspot ingest) ──────────────────────────────
|
|
|
|
|
|
# MAP_KEY is FREE — get one at https://firms.modaps.eosdis.nasa.gov/api/map_key_info/
|
|
|
|
|
|
# (1-minute signup, no payment). Leave blank to keep fire ingest idle.
|
|
|
|
|
|
FIRMS_MAP_KEY=
|
|
|
|
|
|
# NRT VIIRS S-NPP 375m active fire detection (near-real-time).
|
|
|
|
|
|
FIRMS_DATASET=VIIRS_SNPP_NRT
|
|
|
|
|
|
# Area to poll as "minlon,minlat,maxlon,maxlat". Narrow it to reduce payload
|
|
|
|
|
|
# (e.g. CONUS "-125,24,-66,50"). Default covers most of the inhabited globe.
|
|
|
|
|
|
FIRMS_BBOX=-180,-60,180,75
|
|
|
|
|
|
# Poll cadence in seconds (~15 min). FIRMS NRT updates every ~5-10 min.
|
|
|
|
|
|
FIRMS_INTERVAL=900
|
|
|
|
|
|
# Set to 0 to disable the fire loop entirely.
|
|
|
|
|
|
INGEST_FIRES=1
|
|
|
|
|
|
|
2026-08-29 00:58:57 -04:00
|
|
|
|
# ── VesselAPI (commercial REST AIS — Hormuz, 5×/day, 150 calls/mo cap) ─────
|
|
|
|
|
|
# Independent of AISStream (open/shared live US-coast WebSocket). Both stay
|
|
|
|
|
|
# on when their keys are set; missing one never disables the other.
|
|
|
|
|
|
# Prefer pasting VESSELAPI_API_KEY on the dashboard Keys page.
|
|
|
|
|
|
# The poller idles when the key is unset. Never called from map pans
|
|
|
|
|
|
# (GET /api/vessels serves the shared last-known cache only).
|
2026-08-29 00:18:49 -04:00
|
|
|
|
VESSELAPI_API_KEY=
|
|
|
|
|
|
# Bounding box(es) as minlat,minlon,maxlat,maxlon (lat/lon order). Semicolon-
|
|
|
|
|
|
# separated for multiple boxes. Default = Strait of Hormuz (span 3.6 ≤ 4° cap).
|
|
|
|
|
|
VESSELAPI_BBOX=25.5,55.4,27.3,57.2
|
|
|
|
|
|
# Poll cadence in seconds (17280 = 4.8h → 5 polls/day = 150/mo).
|
|
|
|
|
|
VESSELAPI_INTERVAL=17280
|
|
|
|
|
|
# Local hard cap on successful 2xx calls per UTC day (persisted in Postgres).
|
|
|
|
|
|
VESSELAPI_MAX_CALLS_PER_DAY=5
|
|
|
|
|
|
# 1 = run the poller inside the dashboard process (default); ingester off.
|
|
|
|
|
|
VESSELAPI_IN_APP=1
|
|
|
|
|
|
VESSELAPI_IN_INGEST=0
|
|
|
|
|
|
|
Add NASA FIRMS active-fire ingest + /api/fires; API keys management page
Coherent merge of two coordinated features on the shared working tree:
FIRMS fire heatmap (backend, t_6e404c14):
- app/fire_sources.py: fetch FIRMS VIIRS area CSV (free MAP_KEY) -> NATS events.fire
- fires hypertable (TimescaleDB, 1-day chunks) with natural-key PK
(latitude, longitude, acq_time, satellite); idempotent ON CONFLICT DO NOTHING
- alembic/versions/002_fires.py; GET /api/fires?bbox=&since= (JSON only)
- POST /api/ingest/fires; ~15 min poll loop (FIRMS_INTERVAL=900) in ingester
- env-driven config (FIRMS_MAP_KEY/DATASET/BBOX/INTERVAL); docs/firms.md covers
the zero-cost GIBS VIIRS_SNPP_Thermal_Anomalies_375m_All tile alternative
- 18 tests (parser, mapping, idempotency, API contract) verified vs real
TimescaleDB+PostGIS (localhost/osint-dashboard-pg image)
API keys page (frontend, t_4433cff2):
- app/keystore.py: api_keys table (self-creating), FIRMS/GEMINI/TELEGRAM
registry with format validation, ****last4 masking, get_api_key()
- GET/POST/DELETE /api/keys (never returns full values); Keys tab in index.html
DB_NULL_POOL env switch in app/database.py enables a NullPool for tests /
short-lived processes that open a fresh event loop per unit.
2026-08-24 15:37:42 -04:00
|
|
|
|
# ── API keys (managed from the dashboard UI) ──────────────────────────────
|
2026-08-27 23:24:45 -04:00
|
|
|
|
# Keys such as NOUS_API_KEY and TELEGRAM_TOKEN are stored in the Postgres
|
2026-08-24 15:40:31 -04:00
|
|
|
|
# `api_keys` table and managed from the dashboard's "Keys" tab
|
|
|
|
|
|
# (GET/POST/DELETE /api/keys/{name}) — see app/keystore.py. The FIRMS ingestor
|
|
|
|
|
|
# currently reads FIRMS_MAP_KEY from .env (above); wiring the Keys-UI store as
|
|
|
|
|
|
# its lookup/fallback is a planned follow-up.
|
feat(auth): public read-only HUD, admin-only API keys and mutations
Adds single-admin authentication to the dashboard. Anonymous visitors get a
read-only site (map + news); the one admin unlocks everything else.
- app/auth.py: deny-by-default ASGI middleware on /api/* with an explicit
public read allowlist; /login page; /api/auth/{login,logout,me}; PBKDF2
password hashing; HMAC-signed HttpOnly SameSite=Lax session cookie (7d,
Secure behind X-Forwarded-Proto: https); 5-fail/15-min per-IP login limit;
Origin/Referer host check on state-changing admin requests.
- Fails closed: missing ADMIN_PASSWORD_HASH or ADMIN_SESSION_SECRET -> admin
routes 403 'admin auth not configured', public site unaffected.
- app/main.py: mounts the middleware + router (6 lines, no per-route decorators).
- app/static/index.html: hides Ingest/API Keys/Settings, the summarizer panel
and geofence write controls until /api/auth/me says admin; adds a discreet
SIGN IN link to /login. CSS gates fail closed without JS.
- tests/test_auth.py: 42 tests (anonymous 401s, login/logout, tampered and
expired cookies, fail-closed, rate limit, CSRF, HUD markup).
- Existing API tests now send an admin session cookie for admin routes.
Public allowlist extends the spec's list with the remaining read-only GETs the
HUD calls (/api/stats, /api/conflicts, /api/place, /api/satellites,
/api/infrastructure, /api/map/gpsjam, /api/map/times, /api/fire-incidents,
/api/fire-perimeters, /api/weather-alerts, /api/storms, /api/geofences/{id}/at)
so an anonymous HUD is not half-broken.
2026-11-13 20:56:07 -05:00
|
|
|
|
#
|
|
|
|
|
|
# Key management is ADMIN-ONLY (single admin, no user table). Visitors get a
|
|
|
|
|
|
# read-only map + news. Configure the three vars below or admin endpoints
|
|
|
|
|
|
# answer 403 {"detail": "admin auth not configured"} (fail closed — the public
|
|
|
|
|
|
# site keeps working). In the cluster they come from Secret `osint-admin`.
|
|
|
|
|
|
# Generate the hash: python app/auth.py hash 'your password'
|
|
|
|
|
|
# Generate the secret: python -c 'import secrets; print(secrets.token_urlsafe(48))'
|
|
|
|
|
|
ADMIN_USER=
|
|
|
|
|
|
ADMIN_PASSWORD_HASH=
|
|
|
|
|
|
ADMIN_SESSION_SECRET=
|
2026-11-13 21:15:05 -05:00
|
|
|
|
# Optional: force the session cookie's Secure flag (1/true/yes) when the app is
|
|
|
|
|
|
# reached over plain HTTP behind a TLS-terminating proxy that rewrites
|
|
|
|
|
|
# X-Forwarded-Proto to http (the cluster: Cloudflare tunnel -> Cilium Gateway).
|
|
|
|
|
|
# Leave unset locally so the cookie works over http://localhost.
|
|
|
|
|
|
ADMIN_COOKIE_SECURE=
|
2026-08-24 17:28:46 -04:00
|
|
|
|
|
|
|
|
|
|
# ── News pipeline (scraper + summarizer, profile `ingest`) ────────────────
|
2026-08-28 20:53:32 -04:00
|
|
|
|
# Scraper crawls urls.txt continuously (default 10s between crawls).
|
|
|
|
|
|
# Summarizer runs Nous map-reduce every 15 min (NEWS_SUMMARIZE_INTERVAL_S=900).
|
2026-08-27 23:24:45 -04:00
|
|
|
|
# NOUS_API_KEY is also (preferably) set in the Keys UI; env is an override.
|
|
|
|
|
|
# Unset in both env and api_keys = summarizer logs and idles (never crashes).
|
|
|
|
|
|
NOUS_API_KEY=
|
|
|
|
|
|
NOUS_BASE_URL=https://inference-api.nousresearch.com/v1
|
2026-08-24 17:28:46 -04:00
|
|
|
|
# Optional LLM knobs
|
2026-08-28 00:02:51 -04:00
|
|
|
|
# SUMMARY_MODEL is an optional override. Leave unset so Settings
|
|
|
|
|
|
# (app_settings.SUMMARY_MODEL) can reach the summarizer. Code default
|
|
|
|
|
|
# Hermes-4.3-36B remains after a Postgres miss. Env wins when set.
|
|
|
|
|
|
# SUMMARY_MODEL=
|
2026-08-24 17:28:46 -04:00
|
|
|
|
NEWS_BATCH_SIZE=50
|
2026-11-13 21:47:30 -05:00
|
|
|
|
# Map-phase grading: the map model scores each article 0-100, and only blocks
|
|
|
|
|
|
# with score >= SUMMARY_MIN_SCORE reach the reduce brief (best first).
|
|
|
|
|
|
# If nothing clears the bar, the top SUMMARY_FALLBACK_TOP blocks are used
|
|
|
|
|
|
# (0 = honour the threshold and pass an empty DATA section instead).
|
|
|
|
|
|
SUMMARY_MIN_SCORE=60
|
|
|
|
|
|
SUMMARY_TOP_N=12
|
|
|
|
|
|
SUMMARY_FALLBACK_TOP=3
|
2026-08-28 20:53:32 -04:00
|
|
|
|
SUMMARY_WINDOW_MINUTES=15
|
2026-08-24 17:28:46 -04:00
|
|
|
|
# Futures/markets coupling from the upstream pipeline is OFF by default
|
|
|
|
|
|
# (irrelevant to OSINT). Set INCLUDE_FUTURES=1 + install yfinance to enable.
|
|
|
|
|
|
INCLUDE_FUTURES=0
|
2026-08-28 20:53:32 -04:00
|
|
|
|
NEWS_SCRAPE_INTERVAL_S=10
|
|
|
|
|
|
NEWS_SUMMARIZE_INTERVAL_S=900
|
2026-08-24 17:28:46 -04:00
|
|
|
|
NEWS_SCRAPE_RUN_ON_START=1
|
|
|
|
|
|
NEWS_SUMMARIZE_RUN_ON_START=1
|
2026-08-28 20:53:32 -04:00
|
|
|
|
# "1" ignores the interval idempotency skip (double-pins on recreate).
|
2026-08-27 23:24:45 -04:00
|
|
|
|
NEWS_SUMMARIZE_FORCE=0
|
2026-08-24 17:28:46 -04:00
|
|
|
|
NEWS_LOG_LEVEL=INFO
|
|
|
|
|
|
# Reserved for the (out-of-scope) Telegram delivery bot.
|
|
|
|
|
|
TELEGRAM_TOKEN=
|
|
|
|
|
|
TELEGRAM_CHAT_ID=
|
2026-08-28 03:55:00 +00:00
|
|
|
|
|
|
|
|
|
|
# =============================================================================
|
|
|
|
|
|
# Forgejo container registry (CI publishes here; NOT ghcr.io)
|
|
|
|
|
|
# =============================================================================
|
|
|
|
|
|
# forgejo.siriusdevops.com/sirius/osint-dashboard[:tag]
|
|
|
|
|
|
# forgejo.siriusdevops.com/sirius/osint-dashboard-pg[:tag]
|
|
|
|
|
|
# forgejo.siriusdevops.com/sirius/osint-news-scraper[:tag]
|
|
|
|
|
|
# forgejo.siriusdevops.com/sirius/osint-news-summarizer[:tag]
|
|
|
|
|
|
FORGEJO_REGISTRY=forgejo.siriusdevops.com
|
|
|
|
|
|
FORGEJO_OWNER=sirius
|