rouse-context/scripts
Jason Monk 7c5397661f
Fix #215: Render relay env + firebase-sa from GH secrets at deploy time (#219)
Move all relay runtime secrets off manually-maintained /etc/rouse-relay/env
and into GitHub repo secrets. The deploy workflow now renders both the
systemd EnvironmentFile and the Firebase service account JSON from repo
secrets on each run, scps them to /tmp, then moves them into
/etc/rouse-relay/ with the correct ownership and mode.

Rotation is now a gh secret set + workflow_dispatch instead of an SSH
session. Bootstrapping a fork only needs the secrets populated — no more
remembering which env vars the VPS needs.

- relay-deploy.yml: new "Render" step writes env + firebase-sa.json into a
  mode-0700 tempdir using printf + file redirection (never echo, never
  secret values on argv). Deploy step scps and installs alongside the
  binary. Tempdir is shredded on exit.
- scripts/backfill-relay-secrets.sh: maintainer tool that re-syncs GH
  secrets from the live VPS. Explicit "yes" prompt, set -u -o pipefail
  (no -x to avoid leaking values), shred -u on exit, never echoes
  secret values.
- docs/self-hosting.md: new appendix documenting the secret inventory,
  naming convention split (existing CLOUDFLARE_* unprefixed; new
  RELAY_*), rotation procedure, and pointer to the backfill script.

Secrets already populated on the repo (values pulled from the running
VPS and verified byte-for-byte parity with the workflow-rendered output):
  CLOUDFLARE_API_TOKEN, CLOUDFLARE_ZONE_ID (pre-existing, re-synced),
  RELAY_RUST_LOG, RELAY_GTS_EAB_KID, RELAY_GTS_EAB_HMAC,
  RELAY_FIREBASE_SERVICE_ACCOUNT_JSON (base64 of firebase-sa.json).

First post-merge deploy will overwrite /etc/rouse-relay/env and
firebase-sa.json with the workflow-rendered versions. Parity confirmed
before merging; flagging for user's eyes on the first run.

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>
2026-04-17 19:39:41 -04:00
..
backfill-relay-secrets.sh Fix #215: Render relay env + firebase-sa from GH secrets at deploy time (#219) 2026-04-17 19:39:41 -04:00
check-zombie-screens.sh Fix #85: Delete unused OnboardingErrorScreen 2026-04-12 22:07:51 -04:00