Skip to content

ops(deploy): CLOUDFLARED_DIR preflight + fold frontend into core stack#17

Merged
NetworkTheoryAppliedResearchInstitute merged 1 commit into
mainfrom
feat/redeploy-hardening
Jul 13, 2026
Merged

ops(deploy): CLOUDFLARED_DIR preflight + fold frontend into core stack#17
NetworkTheoryAppliedResearchInstitute merged 1 commit into
mainfrom
feat/redeploy-hardening

Conversation

@NetworkTheoryAppliedResearchInstitute

Copy link
Copy Markdown
Contributor

Hardening after the 2026-07-13 redeploy outage (#7 of the operator-readiness plan).

1. redeploy.sh CLOUDFLARED_DIR preflight. The M5 audit replaced a hardcoded home path with ${CLOUDFLARED_DIR:-./deploy/cloudflared}; when .env lacked CLOUDFLARED_DIR, the recreate mounted the empty default dir and cloudflared crash-looped on tunnel credentials file not found — soholink.org was down ~3 min. The preflight now aborts the deploy (before touching any container) if CLOUDFLARED_DIR is unset or contains no *.json credential.

2. Frontend folded into the core stack. It served the public homepage (cloudflared → frontend:80) from a separate docker-compose.frontend.yml overlay the core lifecycle didn't manage — a docker compose down/up on the core stack would drop the homepage. It's now a first-class service (cloudflared depends_on it; redeploy.sh builds it alongside portal/orchestrator). Overlay file removed.

Verified: docker compose config parses with the frontend service rendered; redeploy.sh passes sh -n.

Author does not self-merge — for review.

Two hardening fixes after the 2026-07-13 redeploy outage.

1. redeploy.sh gains a CLOUDFLARED_DIR preflight. The M5 audit replaced a
   hardcoded home path with ${CLOUDFLARED_DIR:-./deploy/cloudflared}; when .env
   lacks CLOUDFLARED_DIR the recreate mounted the wrong (empty) dir and
   cloudflared crash-looped on "tunnel credentials file not found", taking
   soholink.org down for ~3 minutes. The preflight aborts the deploy if
   CLOUDFLARED_DIR is unset or holds no *.json credential, before any container
   is touched.

2. The frontend edge moves from the docker-compose.frontend.yml overlay into
   the core stack. It served soholink.org (cloudflared -> frontend:80) from a
   separate overlay container that the core lifecycle did not manage; a
   docker compose down/up on the core stack would drop the homepage. Now it is
   a first-class service, cloudflared depends_on it, and redeploy.sh builds it
   alongside portal/orchestrator. Overlay file deleted.

docker compose config parses; redeploy.sh passes sh -n.

Signed-off-by: Jodson Graves <info@ntari.org>
@NetworkTheoryAppliedResearchInstitute
NetworkTheoryAppliedResearchInstitute merged commit 0246518 into main Jul 13, 2026
7 checks passed
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.

1 participant