thermograph/deploy
Emi Griffith 78d8289627 Link a Thermograph account to Discord via OAuth2 (#208)
Lets a signed-in user connect their Discord account (OAuth2 identify), storing the
Discord user id that a later feature (DM alerts) will deliver to. Standard
authorization-code flow, all server-side:

- backend/discord_link.py: /discord/link/start redirects to Discord's consent
  screen; /discord/link/callback exchanges the code, reads the Discord user id, and
  stores it; /discord/unlink forgets it. The `state` is signed with the app auth
  secret (stdlib hmac, no new dependency) and carries the Thermograph user id, so a
  callback can't be replayed or bound to another account. Every route requires an
  active session, so linking acts on whoever is actually logged in.
- models.py: User.discord_id (unique, nullable). schemas.py exposes it on UserRead
  so the frontend can show link state.
- app.py: the router under /api/v2/discord.
- account.js: a "Link Discord" / "Unlink Discord" control in the account popover.
- deploy/migrations/001-user-discord-id.sql: the manual column add for the existing
  prod accounts DB. This project has no Alembic — create_all only makes missing
  tables, so an added column needs a hand-applied migration (documented in-file).
- env example: THERMOGRAPH_DISCORD_CLIENT_SECRET + the redirect to register.

Claude-Session: https://claude.ai/code/session_013dRZmX9D3JEntfMKWMTWZ8
2026-07-20 02:26:33 +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 Link a Thermograph account to Discord via OAuth2 (#208) 2026-07-20 02:26:33 +00:00
thermograph.service Gate the subscription notifier to one worker (#161) 2026-07-17 12:54:55 +00:00