The DOC 2.0 API is per-IP quota'd (429 with no Retry-After) and only lands a
fetch every 5-6 cycles, so gdel-t2 coverage was near zero. GDELT publishes the
same articles every 15 minutes as static files with no key and no quota.
ingest_gdelt now parses lastupdate.txt, downloads the newest *.gkg.csv.zip,
filters rows to the CONFIG GDELT query terms (matched against GKG theme
tokens), and maps each surviving row into the existing events.gdelt shape:
title from PAGE_TITLE, url from DocumentIdentifier (so event_dedup on URL is
unchanged), body = source domain, location_name/lat/lon from V2Locations, and
PAGE_PRECISEPUBTIMESTAMP as source_timestamp. Publishing goes through
_publish_unknown, so known URLs are skipped before they hit NATS.
The DOC path (with its 429 backoff) still runs, but only when the bulk fetch
itself fails.
GDELT's DOC 2.0 API answers 429 with a plain-text body, no Retry-After, and
a per-IP block window that widens with request volume. The https->http retry
only doubled the request count against that quota and could never succeed,
and every cycle logged a full traceback.
- ingest_gdelt: a 429 (or a 200 with a prose body) now sets a backoff window
(GDELT_BACKOFF_BASE=300s, doubling to GDELT_BACKOFF_MAX=1800s, Retry-After
honoured when present) and returns 0 instead of raising.
- cycles inside the window skip the call entirely, logging one line.
- the https->http fallback now only covers TransportError (TLS/connect), not
HTTP error statuses.
- producer_loop logs a GDELT failure as one WARNING line, no traceback.
- tests/test_gdelt_backoff.py covers no-retry-on-429, cooldown skip, doubling
and cap, Retry-After, 200-prose, success reset, transport fallback.
The ADSB refresh loop only persisted positions for registered WS viewports,
so aircraft_positions went silent for a day whenever nobody had the map open
(max(ts) frozen at 2026-11-20 04:58 while USGS/news ingest kept running).
When no client viewport is registered the loop now sweeps the chokepoint
presets (ADSB_WATCH_ENABLED=1, ADSB_WATCH_INTERVAL=30s, 5 boxes ~65-81 nm)
through the same fetch_aircraft(persist=True) path, so the hypertable and
aircraft_tracks_1min keep advancing unattended. Viewport polling keeps its
8 s cadence when a tab is connected.
- initMap preferred chain: BlueMarble_ShadedRelief_Bathymetry first (static,
gap-free); VIIRS/MODIS satellite remain selectable. No basemap persistence
exists (osint.mapDefaults stores overlay prefs only), so first-load default
is the whole change. has_time=false hides time controls via mapLayerChanged.
- News ticker: animation-duration computed from rendered group width for a
constant 28 px/s regardless of headline count, recomputed on every 3-min
rebuild; CSS fallback raised 90s -> 240s. Seamless two-copy -50% loop kept;
market ticker untouched (60s CSS, no inline override).
Verified in real browser vs mock API + live GIBS tiles: fresh load selects
Blue Marble (8/8 tiles), Terra satellite round-trip renders with time controls,
measured ticker speed 28.01 px/s (was ~88), critical-news/blips toggles clean
(1 shared canvas -> 0, no reload), zero console errors.
loadNewsPins() called renderer: pointCanvas() INSIDE the per-pin .map(),
giving every critical pin its own full-viewport L.canvas (~19 MB each at
retina 2x). Renderers were never removed on refresh (Leaflet keeps empty
renderers mounted), so canvases grew without bound (35 after 6 refreshes
measured) and stacked pointer-events:auto siblings at z100 meant only the
LAST pin's canvas received clicks — Kyiv (first) was dead, Kherson (last)
worked. This is the user-reported 'selecting Critical News reloads the
site': unbounded full-viewport canvases stall the GPU/main thread.
Fix (mirrors T2's articlesRenderer pattern):
- hoist one persistent L.canvas({padding:0.5}) into module-level
newsRenderer, shared by all pins and reused across refreshes; L.Canvas
hit-tests every drawn path so ALL pins are clickable
- remove the renderer on toggle-off (0 canvases when layer off)
- guard L.Canvas.prototype._redraw against detached renderers: Leaflet
1.9.4's moveend-driven _updatePaths() calls _redraw() directly, nulling
_redrawRequest without cancelling a pending animation frame; removing
the renderer before that orphaned frame fires crashes on the deleted
2d context ('clearRect of undefined'). No-op when detached, unchanged
when live.
Verified in real browser against local mock of /api/news/map (5 pins) +
/api/news/blips (1398-row T2 fixture):
- all 5 pins open their popups on click, Article Blips ON and OFF
- canvas count flat at 1 across 12 pan/zoom refreshes (was +5/refresh);
0 when toggled off, 1 when back on
- 6 toggle off/on cycles: every CDP eval 1-2 ms, no navigation/reload
(boot sentinel + navigation entries unchanged), counts/HUD 0<->5
- 4 toggles mid-map-motion (race stress): zero errors
- article blips still clickable above the canvas (svg z200 pe:none)
- popup content, cyan styling, counts/HUD byte-identical; zero console
errors across the full session
app/static/index.html only, +19/-2.
Additive 'Article Blips' layer on the HUD map (default OFF), separate
from the critical-news pins:
- GET /api/news/blips?bbox=&limit=1000 (frozen T1 contract), own
superseded-request counter + overlayAbort handling, bbox refresh on
pan/zoom and a NEWS_REFRESH_MS timer while enabled
- small radius-3 violet circleMarkers in a chunked markerClusterGroup
(maxClusterRadius 40) with quiet violet cluster icons; one persistent
SVG renderer (clickable paths, click-through root, no container leak)
- click -> .blip-pop popup: headline, domain, category, location_name +
confidence, score, source link (esc() on every field)
- legend toggle + count, ARTICLES HUD chip, syncHud wiring
- graceful 404/failure: warn + idle at 0, map and critical pins unaffected
- .leaflet-heatmap-layer pointer-events:none — the visual-only FIRMS
canvas sat on top of the overlay pane and ate clicks meant for vector
blips/pins (pre-existing; fixes click-through for canvas pins too)
Critical-news layer and /api/news/map consumption unchanged.
Every graded article now carries best-effort geo on article_scores:
- parse_map_scores extracts Location/Lat/Lon/Confidence per block
(clamp_coords-validated; Unknown -> no geo; never invent a place)
- place-name-only blocks resolve via a vendored offline GeoNames
gazetteer (cities15000 + admin1 + country->capital), confidence approx
- nullable location_name/lat/lon/location_confidence columns (alembic
014, single head; idempotent ensure_tables mirror) + partial bbox index
- GET /api/news/blips: frozen contract, dedup by article id (latest geo
wins), finite coords only, created_at DESC, bbox/since/limit, default
1000 max 5000, public read like /api/news/map
- critical/high map pins, ticker, grading thresholds, dedupe unchanged
Tests: 50 new summarizer geo tests (161 total), 18 new blips API
contract tests; alembic upgrade heads proven on fresh DBs both start
orders; forced batch on test DB yielded 10 non-critical blips with geo.
Card: t_bc15eb53
A hit with evidence keeps the meta line and adds a second line: camera
count, the first camera name, and the first headline. A non-empty news
url is an anchor; an empty url stays text. Hits without evidence stay
the one-liner. snapshot_url is never written into the inbox.
Excelsior rows store the feed's CDATA wrapper as the title text, including
the surrounding whitespace. Strip a whole-title wrapper before insert and
again on GET /api/news so existing rows read clean without an UPDATE.
Plain titles and real HTML are unchanged.
/api/health articles.age_s used max(timestamp) with no future-date filter,
so rows ahead of now() reported a negative age. Use the same closed window
as the news list (timestamp <= now(); NULL timestamps are not fresh). If
every non-null timestamp is in the future, age_s is null and ok is false.
GET /api/stats keeps existing counters and adds feeds.vessels.configured
and feeds.fires.configured from non-empty api_keys values only. The stored
value is never returned.
Camera scrapes still upsert the cameras table. They no longer
JetStream-publish events.camera messages, which the ingester was
inserting as HUD event spam.
wiseye.org public-affairs event listings carry pubDate 3-6 days ahead; with
ORDER BY timestamp DESC they pinned the top of the feed for a week and made
the news list look frozen.
- PostgresPipeline drops items whose parsed publish date is >2h in the
future, counts future_dated_dropped (stats + one INFO line per run).
Unparseable dates keep the old behaviour (kept, timestamped now()).
- GET /api/news filters timestamp > now() in the query while still returning
timestamp IS NULL rows; limit/offset/domain/since unchanged.
- docs/news.md documents the guard.
- tests: pipeline drop/keep unit tests, API future-row exclusion + limit.
Behind the cluster's HTTP origin listener Envoy normalizes
X-Forwarded-Proto to http, so _is_https() never fires and the session
cookie was issued without Secure. Add an explicit deploy-time flag:
set_session_cookie() now marks the cookie Secure when the env var is
1/true/yes (case-insensitive, stripped) or the header inference says
https. clear_session_cookie() is unchanged, SameSite stays Lax.
Tests cover flag-over-http, header-without-flag, and the local-dev path;
docs/auth.md and .env.example document the variable.
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.
Phone can finish a polygon without double-click. List is mute/go/rename/delete.
Inbox seeds from /api/geofence-alerts and appends WS hits. Watch all fence
ids on /ws/live. Selected-fence DVR uses GET /api/geofences/{id}/at.
Off-viewport clients that send {type:watch_geofences,ids} on /ws/live
still receive geofence_alert; AIS/ADS-B stay viewport-only.
GET /api/geofence-alerts accepts geofence_id/since/until/source_kind.
GET /api/geofences/{id}/at returns CAGG+FIRMS inside the fence at T
(404 if missing, empty lists if DB down). DELETE missing fences 404s.
Reject private/loopback/link-local hosts on POST /api/ingest/rss and
URL-shaped GDELT queries via camera_scraper.is_public_url (HTTP 400).
PATCH /api/sources/{id} only accepts name, url, config, enabled (422 else).
Pin titiler to the Pi-running digest, make workers=1 explicit for
in-memory WS/layer caches, and add PostGIS GIST indexes for events/fires
bbox pans without dropping the existing btree indexes.