fix(prod): production hardening for launch #194

Open
chihlasm wants to merge 2 commits from fix/production-hardening into main
Owner

Resolves the code-level findings from the 2026-06-11 production-readiness audit:

  • Gate Swagger/ReDoc/OpenAPI behind DEBUG
  • Sentry send_default_pii only in dev
  • Dockerfile CMD no longer races migrations with releaseCommand
  • RATE_LIMIT_ENABLED decouples rate limiting from DEBUG (PR envs were unlimited)
  • Boot-time failure when SELF_SERVE_ENABLED without RESEND_API_KEY/ANTHROPIC_API_KEY/FRONTEND_URL
  • Reject localhost OAUTH_REDIRECT_BASE outside DEBUG
  • pool_pre_ping + pool_recycle on the app engine
  • max_instances=1 on 4 scheduler jobs
  • Frontend: DEV-gate stale-async console.warn; Dockerfile VITE_* semantics documented

Ops follow-ups (env-var only, on the Phase O checklist): CSP_REPORT_ONLY=false, RATE_LIMIT_ENABLED=true in prod, pin backend to 1 replica, verify Railway backups.

Resolves the code-level findings from the 2026-06-11 production-readiness audit: - Gate Swagger/ReDoc/OpenAPI behind DEBUG - Sentry send_default_pii only in dev - Dockerfile CMD no longer races migrations with releaseCommand - RATE_LIMIT_ENABLED decouples rate limiting from DEBUG (PR envs were unlimited) - Boot-time failure when SELF_SERVE_ENABLED without RESEND_API_KEY/ANTHROPIC_API_KEY/FRONTEND_URL - Reject localhost OAUTH_REDIRECT_BASE outside DEBUG - pool_pre_ping + pool_recycle on the app engine - max_instances=1 on 4 scheduler jobs - Frontend: DEV-gate stale-async console.warn; Dockerfile VITE_* semantics documented Ops follow-ups (env-var only, on the Phase O checklist): CSP_REPORT_ONLY=false, RATE_LIMIT_ENABLED=true in prod, pin backend to 1 replica, verify Railway backups.
chihlasm added 1 commit 2026-06-12 23:41:30 +00:00
fix(prod): harden production configuration for launch
Some checks failed
Mirror to GitHub / mirror (push) Successful in 5s
CI / frontend (pull_request) Successful in 7m12s
CI / e2e (pull_request) Failing after 6m56s
CI / backend (pull_request) Failing after 9m55s
c4947218a4
- Gate Swagger/ReDoc/OpenAPI behind DEBUG (no public API schema in prod)
- Sentry send_default_pii only in dev (no auth headers/bodies in events)
- Remove alembic from Dockerfile CMD (releaseCommand owns migrations; CMD copy raced across replicas/restarts)
- Decouple rate limiting from DEBUG via RATE_LIMIT_ENABLED (PR envs with DEBUG=true were unlimited); tests disable the live limiter in conftest
- max_instances=1 on the 4 scheduler jobs missing it
- Boot-time failure when SELF_SERVE_ENABLED without RESEND_API_KEY/ANTHROPIC_API_KEY/FRONTEND_URL
- Reject localhost OAUTH_REDIRECT_BASE outside DEBUG
- pool_pre_ping + pool_recycle on the app engine
- Frontend: DEV-gate stale-async console.warn; document VITE_SELF_SERVE_ENABLED fallback semantics in Dockerfile

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
chihlasm force-pushed fix/production-hardening from 4dc4894fc7 to c4947218a4 2026-06-12 23:41:30 +00:00 Compare
chihlasm added 1 commit 2026-06-13 00:14:08 +00:00
test(e2e): disable rate limiting in the Playwright backend webserver
Some checks failed
Mirror to GitHub / mirror (push) Successful in 4s
CI / frontend (pull_request) Successful in 6m47s
CI / backend (pull_request) Failing after 9m24s
CI / e2e (pull_request) Successful in 10m26s
63e5881972
RATE_LIMIT_ENABLED now defaults on regardless of DEBUG; the e2e suite
logs in dozens of times per run from one IP and trips the per-minute
auth limits (429 at helpers/api.ts login).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Some checks failed
Mirror to GitHub / mirror (push) Successful in 4s
CI / frontend (pull_request) Successful in 6m47s
Required
Details
CI / backend (pull_request) Failing after 9m24s
Required
Details
CI / e2e (pull_request) Successful in 10m26s
Some required checks were not successful.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/production-hardening:fix/production-hardening
git checkout fix/production-hardening
Sign in to join this conversation.