Skip to content

Name every environment file for its server and environment - #50

Merged
ptr727 merged 2 commits into
developfrom
standardize-environment-file-names
Aug 8, 2026
Merged

Name every environment file for its server and environment#50
ptr727 merged 2 commits into
developfrom
standardize-environment-file-names

Conversation

@ptr727

@ptr727 ptr727 commented Aug 8, 2026

Copy link
Copy Markdown
Owner

What

The four environment files under secrets/ named their environment three different ways: by omission for the local production mirror, by a bare word for local staging, and by a server prefix for the two VPS files. Every file is now secrets/<server>.<environment>.env, both halves spelled out.

Was Now
secrets/.env secrets/local.production.env
secrets/staging.env secrets/local.staging.env
secrets/vps.env secrets/vps.production.env
secrets/vps.staging.env unchanged, already conformant

The files themselves are untracked, so this PR is the script default, the template, and the prose that names them.

Why

The default file's name said nothing about which of the four environments it was, and that is the one name a reader most needs, because it is what a bare deploy/make-release.sh publishes through. The naming also now matches the rule the environment name already follows in every other position: production and staging, spelled out, never prod or stage, because the value gets compared by EXPECT_SITE_ENV and by the deploy.

Also in here

  • .gitignore: the bare .env pattern matched nothing under the new naming, so it becomes *.env, matching the shape those files are named for. deploy/env.example does not end in .env and stays committed, confirmed with git check-ignore.
  • A wrong file reference the rename surfaced: OPERATIONS.md "Checking a Site Behind the Auth Gate" sourced the local staging mirror's file for a Pangolin token that only the VPS staging file carries. The gate belongs to the VPS environment; the local mirror sits behind Traefik and holds neither half of the pair. Corrected, with a sentence saying which is which.
  • deploy/README.md gains the DEPLOY_SSH_HOST guard, which the file did not document: a remote environment's file describes a root on another machine, so the script asks for a local path to assemble a bundle into.

Verification

CI reads no environment file, so nothing here reaches the pipeline. Checked locally instead:

  • Default resolution: a bare run prints ==> environment: .../secrets/local.production.env.
  • A named file that does not exist still hard-fails rather than falling through.
  • A file with DEPLOY_SSH_HOST set still hits the remote-root guard before building.
  • Released to both local mirrors and ran the live check against each: PASS - 1245 URLs honored, served by mirror-production and mirror-staging respectively.
  • Swept for stale references across the repo; none remain.

🤖 Generated with Claude Code

The four environment files under secrets/ named their environment three
different ways: by omission for the local production mirror, by a bare
word for local staging, and by a server prefix for the two VPS files. The
default file's name said nothing at all about which of the four it was,
which is the one name a reader most needs, since it is what a bare
make-release.sh run publishes through.

Every file is now secrets/<server>.<environment>.env with both halves
spelled out, matching the production-and-staging-in-every-position rule
the environment name already follows because it gets compared:

  .env            -> local.production.env
  staging.env     -> local.staging.env
  vps.env         -> vps.production.env
  vps.staging.env unchanged

The gitignore's bare `.env` pattern matched nothing under the new naming,
so it becomes `*.env`, which matches the shape those files are named for.
deploy/env.example does not end in `.env` and stays committed.

Documenting the four files by name also surfaced a wrong one:
OPERATIONS.md "Checking a Site Behind the Auth Gate" sourced the local
staging mirror's file for a Pangolin token that only the VPS staging file
carries. The gate belongs to the VPS environment, and the local mirror
sits behind Traefik and holds neither half of the pair.

Verified by releasing to both local mirrors and running the live check
against each: PASS, 1245 URLs honored, mirror-production and
mirror-staging respectively.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 8, 2026 03:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Standardizes environment-file naming across the repo by making the default and documented secret env files explicitly include both server and environment (e.g., secrets/local.production.env), and updates tooling/docs to match so environment selection is unambiguous.

Changes:

  • Update deploy/make-release.sh to default ENV_FILE to secrets/local.production.env (and update its help text accordingly).
  • Sweep documentation to reference secrets/<server>.<environment>.env consistently, including correcting the Pangolin auth-gate token source to secrets/vps.staging.env.
  • Adjust .gitignore to ignore the new *.env naming shape (while keeping deploy/env.example tracked).

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
TODO.md Updates the referenced secrets file naming pattern in the deploy-root note.
README.md Documents the <server>.<environment>.env naming and the default secrets/local.production.env.
OPERATIONS.md Updates the environment table and procedures to the new env-file names; fixes which env file carries the auth-gate token.
deploy/README.md Updates env-file setup instructions and documents the DEPLOY_SSH_HOST guard behavior.
deploy/make-release.sh Changes the default env file to secrets/local.production.env and keeps relative-path resolution behavior.
deploy/env.example Updates the template guidance and examples to the new naming scheme.
checks/README.md Updates CAPTURE_ROOT documentation to point at secrets/local.production.env.
.gitignore Switches the backstop ignore from .env to *.env to match the new env-file suffix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread deploy/make-release.sh
The DEPLOY_SSH_HOST guard exits with its own message, so the CLI help was
the one place a reader could learn the requirement before hitting it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 8, 2026 03:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated no new comments.

@ptr727
ptr727 merged commit 09c8fe6 into develop Aug 8, 2026
5 checks passed
@ptr727
ptr727 deleted the standardize-environment-file-names branch August 8, 2026 03:17
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