Thermograph monorepo: graded-climate API + SSR frontend + infra, domain-specific containerized deploys
Find a file
Emi Griffith d6a62cc2de Add ops metrics endpoint + SSH/Termux dashboard (#131)
Adds observability for the running app, viewable over SSH (e.g. Termux):

- backend/metrics.py: thread-safe, best-effort in-process counters for inbound
  requests (per category) and outbound calls (per external source), plus a
  phase->source map and snapshot(). Hooked into climate._request (outbound, all
  six weather/geocode sources) and the existing revalidate_static middleware
  (inbound). Never raises into the request path.
- GET /api/v2/metrics: token-gated JSON of the counters + warm-queue depth +
  thread names/uptime/pid. Returns 404 unless a valid THERMOGRAPH_METRICS_TOKEN
  is presented or the request is direct loopback with no proxy X-Forwarded-*
  header, so ops data is never exposed through Caddy on the public domain.
- scripts/dashboard.py (+ scripts/dash, make dashboard): stdlib-only terminal
  dashboard. Reads cache (parquet + SQLite), accounts (users + active
  subscriptions), and system resources (/proc + systemd) directly, and pulls
  traffic from the metrics endpoint over loopback. Live refresh, --once, --json;
  mobile-terminal width. Paths resolve relative to the script so the same tool
  works on the LAN dev and prod VPS checkouts.
- Monitoring sections in DEPLOY.md / DEPLOY-DEV.md; unit tests for the counters.
2026-07-16 20:46:59 +00:00
templates Add IndexNow, stable sitemap lastmod, and search-verification meta (#127) 2026-07-16 18:08:09 +00:00
tests Add ops metrics endpoint + SSH/Termux dashboard (#131) 2026-07-16 20:46:59 +00:00
api_accounts.py Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
app.py Add ops metrics endpoint + SSH/Termux dashboard (#131) 2026-07-16 20:46:59 +00:00
audit.py Initial commit: app + 2026-07-10 17:29:47 -07:00
cities.json SEO: values filter — trim cities in anti-LGBTQ countries, keep notable hubs (#102) 2026-07-16 02:20:41 +00:00
cities.py Climate hub: client-side search + alphabetical results (#110) 2026-07-16 04:44:18 +00:00
cities_flavor.json SEO: values filter — trim cities in anti-LGBTQ countries, keep notable hubs (#102) 2026-07-16 02:20:41 +00:00
city_events.py SEO: broaden curated weather events beyond the US/Anglosphere (#101) 2026-07-16 01:42:49 +00:00
climate.py Add ops metrics endpoint + SSH/Termux dashboard (#131) 2026-07-16 20:46:59 +00:00
content.py Add IndexNow, stable sitemap lastmod, and search-verification meta (#127) 2026-07-16 18:08:09 +00:00
db.py Fix mobile alerts dropdown overflow; add account API tests (#93) 2026-07-15 22:00:47 +00:00
gen_cities.py SEO: values filter — trim cities in anti-LGBTQ countries, keep notable hubs (#102) 2026-07-16 02:20:41 +00:00
gen_flavor.py SEO: expand city set to 1000 (extended English-speaking / high-proficiency) (#99) 2026-07-16 01:14:30 +00:00
grading.py Records: show longest dry streak instead of record-low precipitation (#105) 2026-07-16 03:28:26 +00:00
grid.py Warm neighbor cells server-side (/cell?neighbors=1) (#51) 2026-07-11 20:47:31 +00:00
indexnow.py Auto-submit IndexNow on deploy when the URL set changes (#130) 2026-07-16 13:38:59 -07:00
metrics.py Add ops metrics endpoint + SSH/Termux dashboard (#131) 2026-07-16 20:46:59 +00:00
migrate.py Migrate backend dataframe layer from pandas to polars (#90) 2026-07-15 19:07:38 +00:00
models.py Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
notify.py Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
places.py Move the suggestion policy into places.py (#45) 2026-07-11 20:00:24 +00:00
push.py Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
requirements-dev.txt Add backend test suite; gate direct pushes; serialize LAN deploys (#41) 2026-07-11 19:37:49 +00:00
requirements.txt SEO: crawlable programmatic climate pages + technical hygiene (#96) 2026-07-15 23:53:11 +00:00
schemas.py Add PWA + Web Push delivery for weather alerts (#95) 2026-07-15 23:21:06 +00:00
store.py Compare/calendar mobile polish: overflow fix, sheet load button, 6-yr default, country in names (#80) 2026-07-12 06:32:10 +00:00
users.py Account system with weather-notification subscriptions (#89) 2026-07-15 18:46:46 +00:00
views.py Migrate backend dataframe layer from pandas to polars (#90) 2026-07-15 19:07:38 +00:00
warm_cities.py SEO: crawlable programmatic climate pages + technical hygiene (#96) 2026-07-15 23:53:11 +00:00