Queue-North-Website/scripts
Neo b24cf3589f fix(deploy): stop two ways this tooling would have broken production
Both found by checking before running, not by running.

1. release.sh would have shipped a site whose contact form cannot be submitted.
   .dockerignore excludes .env from the build context, and the script passed
   --build-arg VITE_RECAPTCHA_SITE_KEY=${VITE_RECAPTCHA_SITE_KEY:-} without ever
   loading .env — and the variable is unset in every shell. The `:-` made empty
   silently acceptable. An empty key makes RecaptchaPlaceholder render "Security
   verification is not configured." and produce no token, and the server has
   RECAPTCHA_ENABLED=true, so every submission is rejected. Lead capture stops.
   Now: loads VITE_* from .env, refuses an empty key outright, and greps the
   BUILT image's bundle for it before pushing — ask the artifact, do not trust
   the wiring, the same move already used for the version label.

2. deploy.sh's default would have rolled production back two months. The newest
   published NUMBERED tag is v0.8.3, built 2026-05-28; the running :dev image
   was built 2026-08-01. v0.8.3 has no privacy policy and no prerendered routes
   at all. Now: the target's build date is read from the registry without
   pulling it, compared against what is running, and refused if older unless
   --rollback is passed.

Also in deploy.sh:
- --fix-cors removes the trailing slash from CORS_ORIGIN (#212), and
  --watchtower-off adds com.centurylinklabs.watchtower.enable=false. Both ride
  in the same PUT so production restarts once, not three times.
- The stack file is now read to a temp file instead of $( ), which was stripping
  its trailing newline — a change beyond the lines the script claims to touch.
- The env-line count is asserted before sending. Verified with `docker compose
  config` why that matters: without the Env array the ${VAR:-false} defaults
  resolve reCAPTCHA and Zoho WebToLead to false, so the container would come
  back healthy and quietly stop capturing leads.
- Post-deploy it checks health, both origins, AND that the live bundle carries
  the site key the stack declares — the failure no health check can see.
- Any of those failing triggers an automatic rollback to the original stack
  bytes, once. If the rollback also fails it stops and says so rather than
  retrying, because a script retrying an outage is how a short one becomes long.

The resulting stack file was validated with `docker compose config`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-18 03:33:20 -05:00
..
verify.d chore: adopt template scripts and git hooks, retire phase-versioning 2026-08-18 01:18:20 -05:00
backup.sh chore: adopt template scripts and git hooks, retire phase-versioning 2026-08-18 01:18:20 -05:00
check-env.sh fix(infra): queuenorth.com is the production origin, and it is this deployment 2026-08-18 02:08:12 -05:00
deploy.sh fix(deploy): stop two ways this tooling would have broken production 2026-08-18 03:33:20 -05:00
doc-triggers.py chore: adopt template scripts and git hooks, retire phase-versioning 2026-08-18 01:18:20 -05:00
docker-test.sh chore: add docker-push.sh, docker-test.sh, npm scripts, bump v0.5.0 2026-05-14 01:18:44 -05:00
forgejo-issue.py chore: adopt template scripts and git hooks, retire phase-versioning 2026-08-18 01:18:20 -05:00
healthcheck.sh fix(infra): queuenorth.com is the production origin, and it is this deployment 2026-08-18 02:08:12 -05:00
preflight.sh fix(infra): queuenorth.com is the production origin, and it is this deployment 2026-08-18 02:08:12 -05:00
prerender.js feat(seo): publish privacy policy, remove street address, prerender all routes (batch 0.9.3) 2026-08-01 01:45:52 -05:00
release.sh fix(deploy): stop two ways this tooling would have broken production 2026-08-18 03:33:20 -05:00
restore-check.sh chore: adopt template scripts and git hooks, retire phase-versioning 2026-08-18 01:18:20 -05:00
secrets.sh fix(security): stop secrets.sh flagging every prerendered page, and clear the dangling doc claims 2026-08-18 01:40:46 -05:00
status.sh chore: adopt template scripts and git hooks, retire phase-versioning 2026-08-18 01:18:20 -05:00
verify.sh chore: adopt template scripts and git hooks, retire phase-versioning 2026-08-18 01:18:20 -05:00