Skip to content

1/6 Tech debt: dev docs, .env template, compose hardening, settings refactor - #617

Open
mcfrank wants to merge 6 commits into
masterfrom
phase1-tech-debt
Open

1/6 Tech debt: dev docs, .env template, compose hardening, settings refactor#617
mcfrank wants to merge 6 commits into
masterfrom
phase1-tech-debt

Conversation

@mcfrank

@mcfrank mcfrank commented Jul 9, 2026

Copy link
Copy Markdown
Member

First of a six-PR stack (merge in order: 1→6). Full-stack preview for clicking around: http://webcdi-preview.us-west-2.elasticbeanstalk.com — leave whole-picture comments on the draft rollup PR; leave line comments here.

  • DEVELOPMENT.md + .env.example: documented local setup (docker compose, migrate, populate, superuser). The .gitignore .env* pattern needed a !.env.example exception.
  • docker-compose: pins postgres:16 (unpinned image started pulling Postgres 18, which rejects the old volume layout), replaces the no-op db healthcheck with pg_isready, and makes web wait on service_healthy — fixes the startup race.
  • settings.py: the triplicated string-mangling for ALLOWED_HOSTS/ADMINS/TRUSTED_ORIGINS becomes two documented parser functions (verified byte-identical settings dump before/after). Fixes a real bug: DEBUG = bool(os.environ.get("DEBUG", False)) was True for ANY non-empty value, including DEBUG=False.
  • Removes dead stopper.bak (pre-R-API catsim leftover).

🤖 Generated with Claude Code

mcfrank and others added 4 commits July 9, 2026 11:34
.env.example documents every env var settings.py reads, with values
that work out of the box with docker-compose. DEVELOPMENT.md is the
setup guide (build, migrate, populate, day-to-day commands). The
.gitignore .env* pattern needed an exception so the example can be
tracked.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The unpinned postgres image began pulling Postgres 18, which changed
its data-directory layout and refuses the volume mount at
/var/lib/postgresql/data. The db healthcheck was a no-op ("exit 0"),
so web could start before the database accepted connections and
crash with a DNS/connection error; depends_on now waits for
pg_isready. Also drops the obsolete compose "version" key.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Leftover from the pre-R-API python (catsim) CAT implementation;
nothing references it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ALLOWED_HOSTS, ADMINS, and TRUSTED_ORIGINS shared triplicated
string-mangling; that logic now lives in two documented parser
functions accepting both the quoted-literal and unquoted EB
shorthand formats, with identical results (verified by diffing a
full settings dump before/after — the only change is that the
leaked TEMP_ADMINS/TEMP_ALLOWED_HOSTS intermediates are gone).

DEBUG used bool(os.environ.get(...)), which is True for ANY
non-empty string including "False"; it now uses the existing
is_true() helper.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gitguardian

gitguardian Bot commented Jul 9, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
9415972 Triggered Generic Password 8ba9af7 .env.example View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@HenryMehta

Copy link
Copy Markdown
Collaborator

No is uncovered. This in an example password in an example file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants