fix(demo): harden Hetzner deploy — read-only plumbing, Traefik/Docker 29, security-headers; default EN - #521
Merged
Merged
Conversation
… 29, security-headers; default EN The public read-only demo path was never validated end-to-end on a current host (Ubuntu 24.04 + Docker Engine 29). Fix the blockers found bringing up the Hetzner CX23/CAX11 demo: - Plumb DEMO_READ_ONLY / DEMO_ALLOW_SANDBOX_SCANS into backend/worker/beat via the demo overlay. They lived only in .env (compose-interpolation scope) and never reached the container, so the backend read them as unset and the public read-only lock silently stayed OFF (writes accepted). Verified with /health demo_read_only:true and a POST write probe returning 403. - Bump Traefik v3.2.1 -> v3.6.1. Docker 29 raised its minimum negotiable API to 1.44 and rejects Traefik's legacy 1.24 client; the docker provider found no routers and served a self-signed default cert. v3.6.1 negotiates the API version with the daemon. - Define the security-headers middleware. Both routers referenced security-headers@file, but no file provider / dynamic config ever defined it, so a working docker provider left both routers invalid. Define it via docker-provider labels and reference it as @docker. - Default first-time visitors to English: drop 'navigator' from the language detector order so a fresh visitor (no stored choice) uses the English fallback instead of the browser locale. An explicit pick is still persisted to localStorage.
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.
Why
Bringing up the public read-only demo on a fresh Hetzner CX23 (Ubuntu 24.04 + Docker Engine 29) surfaced blockers that made the documented deploy path fail — the read-only demo path had never been validated end-to-end on a current host. This fixes them.
Changes
DEMO_READ_ONLY/DEMO_ALLOW_SANDBOX_SCANSlived only in.env(compose-interpolation scope) and were never passed into the backend container — so the backend read them as unset and the public read-only boundary silently stayed off (writes accepted). The demo overlay now plumbs both into backend/worker/beat. Verified:/health→demo_read_only:true,POST /v1/projects→403,POST /auth/login→200.security-headersmiddleware defined. Backend + frontend routers referencedsecurity-headers@file, but no file provider / dynamic config ever defined it → with a working docker provider both routers were invalid. Now defined via docker-provider labels, referenced as@docker(HSTS, nosniff, frame-deny, referrer-policy).navigatorfrom the language-detector order so a fresh visitor (no stored choice) uses the English fallback instead of the browser locale. An explicit pick is still persisted tolocalStorage.Verification (live on the demo host)
/→ 200), API routed (/v1/projects→ 401 unauth), security headers present.Notes
[Unreleased]demo sandbox scan feature (feat(demo): opt-in public sandbox scans + BomLens SBOM upload (CAX11-friendly) #519); target release v0.19.0.docker-compose.ymlworkerdeploy.resources.limits.cpus: "4.0"breaksinstall.sh's base-onlyup -don a <4-CPU box under Compose V2 (V1 ignoreddeploy:). The demo works via the overlay (caps worker at 2.0); the standalone install path on small boxes needs a separate fix.