thermograph/deploy
Emi Griffith eaf0cac321 Serve a /grade Discord slash command over HTTP interactions (#207)
Adds Discord slash commands with no bot process and no gateway connection: Discord
POSTs each interaction to a FastAPI route, and the app answers it. First command is
/grade <city>, returning today's grade for a curated city from the warm cache
(reusing homepage._grade_city, so it answers well within the 3-second deadline and
costs no upstream quota).

- backend/discord_interactions.py: Ed25519 verification (PyNaCl) over the RAW
  request body — Discord probes the endpoint with bad signatures and disables it if
  they aren't rejected with 401. Routes PING to PONG and application-commands to
  their handler; unknown/unsupported interactions are acknowledged, not errored.
  City lookup is exact-name-then-prefix over the population-sorted city set; unknown
  or not-yet-warm cities get an ephemeral note.
- app.py: POST {BASE}/discord/interactions, reading request.body() (not json()) so
  the bytes match the signature.
- scripts/register_discord_commands.py: one-off upsert of the command definitions
  via Discord REST (app id + bot token).
- PyNaCl added to requirements; Discord public-key / app-id / bot-token documented
  in the env example. Endpoint URL: https://thermograph.org/discord/interactions.

Claude-Session: https://claude.ai/code/session_013dRZmX9D3JEntfMKWMTWZ8
2026-07-20 02:19:29 +00:00
..
Caddyfile Serve the app on thermograph.org at root; redirect emigriffith.dev/thermograph (#91) 2026-07-15 19:58:32 +00:00
deploy.sh Auto-submit IndexNow on deploy when the URL set changes (#130) 2026-07-16 13:38:59 -07:00
provision-mail.sh Rebuild the homepage as a distribution landing; add an SMTP seam (#178) 2026-07-18 07:39:47 +00:00
thermograph-dev.service Add dev CI/CD pipeline deploying to a LAN server (#6) 2026-07-11 02:13:18 +00:00
thermograph.env.example Serve a /grade Discord slash command over HTTP interactions (#207) 2026-07-20 02:19:29 +00:00
thermograph.service Gate the subscription notifier to one worker (#161) 2026-07-17 12:54:55 +00:00