chore(prod): Sprint 6 — production readiness & deployment hardening - #5
Merged
Merged
Conversation
Configuration/infra/docs only. No business logic, GraphQL schema, or model changes; Flutter compatibility fully preserved. Config (Parts 1/4): DEBUG/ALLOWED_HOSTS/SECRET_KEY/DB/email all env-driven with safe defaults; DATABASE_URL (Postgres) support; static via WhiteNoise; fail-fast startup validation refuses to boot in prod when SECRET_KEY, hosts, JWT secret, email, database, or cache are misconfigured (skipped for tests). Security (Parts 2/3): HSTS, X-Frame-Options DENY, nosniff, Referrer-Policy, Permissions-Policy (middleware), secure+HttpOnly+SameSite cookies, SSL redirect (prod-gated). CORS allow-all removed — explicit env allow-list; CSRF trusted origins from env. Logging (Part 5): structured stdout logging, separate app/security loggers, rotation-friendly; sensitive values already scrubbed. Ops (Part 6): /health/, /live/, /ready/ (DB + cache), /version/. Deployment (Part 7): multi-stage non-root Dockerfile, docker-compose (web+ postgres+redis), gunicorn.conf.py, entrypoint.sh, .env.example, .dockerignore, requirements.txt/-dev.txt (dependency pinning — previously none). Backup (Part 8): scripts/backup_db.sh, restore_db.sh, backup_media.sh. CI (Part 9): GitHub Actions — ruff, migration check, system + deploy checks, tests+coverage, bandit, pip-audit, docker build. Docs (Part 10): docs/DEPLOYMENT.md, PRODUCTION_CHECKLIST.md, BACKUP_RESTORE.md. Hygiene: add .gitignore; untrack committed .env (secrets), db.sqlite3, and all __pycache__/*.pyc. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Configuration / infrastructure / docs only. No business logic, GraphQL schema, or model changes — Flutter compatibility fully preserved.
Highlights
DATABASE_URL; WhiteNoise static; startup validation refuses to boot in prod when secrets/hosts/JWT/email/DB/cache are missing (skipped for tests).X-Frame-Options: DENY, nosniff, Referrer-Policy, Permissions-Policy, secure/HttpOnly/SameSite cookies, SSL redirect (prod-gated). CORS allow-all removed → explicit env allow-list; CSRF trusted origins from env./health/,/live/,/ready/(DB + cache),/version/.gunicorn.conf.py,entrypoint.sh,.env.example,.dockerignore,requirements.txt/-dev.txt(dependency pinning — none existed).scripts/backup_db.sh,restore_db.sh,backup_media.sh.check --deploy, tests+coverage, bandit, pip-audit, docker build.docs/DEPLOYMENT.md,PRODUCTION_CHECKLIST.md,BACKUP_RESTORE.md..gitignore; untracked committed.env(secrets),db.sqlite3, and all__pycache__/*.pyc.Notes
.pyfilespy_compile-clean. CI will run the real gates. The most likely first CI catch ismakemigrations --check(verifies the hand-written constraint/index migrations match models).cp .env.example .env(setsDJANGO_DEBUG=True).🤖 Generated with Claude Code