0013 — Public website: Astro static site on Cloudflare Pages, deployed from Actions
Status: accepted · Date: 2026-11-29 · AI-written; the maintainer has not confirmed this text. Plan: 0014 (on GitHub).
Context. ServerDock needs a public site that tells the truth about a pre-release product: a home page, the feature list, the benchmark evidence and the docs, rendered from the same Markdown that lives in this repo. The site must follow the product's own promises: small, fast, no tracking, no client JavaScript, and usable with a keyboard and a screen reader. It must not become a second thing to keep in sync by hand, and it must not hold secrets or weaken the repository's security.
Decision.
- Astro, static output, no client JavaScript.
site/is a separate npm project, not embedded in the binary and not benched. The docs pages are built from an explicit allowlist of repo Markdown files (site/src/docs.config.ts); anything not listed is not published. Links, anchors and images are checked at build time; a broken one fails the build. - Cloudflare Pages, Direct Upload. The project
serverdockhas the production branchmain; the custom domain isserverdock.oday-bakkour.com. A static_headersfile sets a strict CSP (default-src 'none', no script) and the other security headers, and marks*.pages.devhostnamesnoindexso only the custom domain is indexed. The site uses no Pages Functions and no_worker.js. - Deploy from GitHub Actions, from
mainonly. Thedeployjob in.github/workflows/site.ymlneeds bothbuildand everye2eshard, so a failing test, an accessibility violation or a WebKit failure stops it. The build job has no secrets. The deploy job runs the build's own artifact (not a rebuild), re-checks it withgates.mjs --dist-only, and then runswrangler pages deploy. It is not a required check, because a path-filtered required check that is skipped would block merges; a broken site only stops the deploy, and the last good version stays live. - Token controls.
- The Cloudflare API token is an account token with only the permission Account → Cloudflare Pages → Edit (the dashboard summary shows it as "Pages Write"), expires after 90 days, and is stored as a secret of the GitHub environment
production, which onlymainmay deploy to (a branch policy, no tag rules). Decision: no required reviewer on the environment (maintainer, 2026-11-29). The environment hascan_admins_bypass: true. - It reaches exactly one step, the wrangler step, as step-level
env. The job haspermissions: {}and a sparse checkout of onlysite/deploy/andsite/scripts/gates.mjs, withpersist-credentials: false. - Wrangler is the only dependency of the job. It is pinned to an exact version in its own lockfile (
site/deploy/), installed withnpm ci --ignore-scriptsbefore the token exists, and was at least two weeks old when pinned.WRANGLER_SEND_METRICSisfalse.site/deploy/,gates.mjs,_headersand the docs allowlist are in CODEOWNERS; Dependabot updates the lockfile weekly. - Deploys share one concurrency group,
site-deploy-main, with no cancelling. GitHub keeps one run going and at most one pending, and a newer pending run replaces an older pending one, so the newest commit is always the last to deploy. - Wrangler runs from a new empty folder, by the full path of the lockfile-pinned binary, because it reads
functions/,wrangler.tomland.npmrcfrom its working folder. The deploy job'ssite/deployfolder holds onlypackage.jsonand the lockfile (a unit test). - The job summary says "deployed" only after wrangler exits 0.
- The Cloudflare API token is an account token with only the permission Account → Cloudflare Pages → Edit (the dashboard summary shows it as "Pages Write"), expires after 90 days, and is stored as a secret of the GitHub environment
- Same Cloudflare account as the zone (accepted risk). The
oday-bakkour.comzone is in the account that also serves the maintainer's other Pages sites, so a Pages-write token could deploy to, or change, those projects. The maintainer chose this knowingly (plan 0014, Q3) rather than a dedicated account. The controls above (a narrow token, one step, the isolated lockfile, an environment limited tomain, a 90-day expiry) are what limit it. Moving the project to a dedicated account later means a new token and a DNS-only CNAME in the zone; nothing else changes. - JavaScript detections stays on for the zone (Q5). Cloudflare injects a script that the site's CSP blocks. That one console message is recorded as a known, harmless exception in the launch checklist; every other CSP violation fails it. Email Obfuscation is turned off for this hostname only, by a Configuration Rule.
- What actually holds, and what does not. The controls that hold today: the narrow token, its use in a single step, the isolated lockfile (installed without scripts and before the token exists), the
main-only branch policy of the environment, the 90-day expiry, and the gates that run on the artifact before the token step. Not counted as controls: CODEOWNERS and themainruleset.Docker-Hunterpediais the only collaborator and is an admin, and one account cannot approve its own pull request, so every merge tomainuses the admin bypass; neither blocks anything today. Known gap: whoever controls that account (or a token with its rights) can changesite.ymlorsite/deploy/onmainand so reach the Cloudflare token. The recommended fix is an agent-only fine-grained token without admin or Workflows permission, so that agents cannot push workflow changes or bypass the ruleset. Pending: a maintainer decision. - CI scope.
site/is excluded from the bench and integration trigger (bench-needed.sh,ci-scope.sh), but a.gofile anywhere still counts, and.github/workflows/site.ymlis not excluded, so changing the workflow still runs the bench.
Consequences.
- The site costs the product nothing at run time: no server, no embedded files, no change to the idle numbers. It costs CI minutes on
site/anddocs/changes. - Publishing is automatic on merge to
main, so the build gates and the end-to-end tests are the only review of a site change after merge. The token-holding path is small enough to review in one file. - Every 90 days the token must be rotated by hand; an expired token makes the deploy fail visibly (the job reads "failed"), and the old site stays up. A
workflow_dispatchonmainredeploys after a rotation. - Re-running an old
mainrun of this workflow within the 7-day artifact retention redeploys that old build and rolls the site back. Rule: redeploy only byworkflow_dispatchonmain, never by re-running an old run. - The accepted same-account risk stays until the maintainer moves the project; it is recorded here so it is a decision, not an oversight.
- Docs pages are published twice in one case (
/roadmap/and/docs/roadmap/, the second canonical to the first). The phase chart in the roadmap is a drawn image and can go stale; the page says so. - If Cloudflare Pages stops fitting (limits, pricing, a policy change), the output is plain static files and moves to any static host; only the
deployjob and_headershandling change.
Addendum (2026-12-02): ws override in the deploy lockfile. Advisory GHSA-37g9-w4hg-h9qr (high, a memory-exhaustion DoS in ws 8.0.0 to 8.22.2) made the npm audit (deploy lockfile) step fail. wrangler 4.162.0 brings ws 8.21.0 through miniflare, and the newest miniflare still pins 8.21.0, so upgrading wrangler does not help. site/deploy/package.json now overrides ws to 8.23.1 (main pinned 8.23.1 in #37 on the same day; 8.23.0 is the first patched release), in the same major version. This adds no package and changes only that one lockfile entry. wrangler --version still runs. The advisory is about a ws client that a server can flood with Pings; the deploy job runs only wrangler pages deploy over HTTPS and opens no WebSocket connection, client or server, so the advisory does not reach it; the override is there to keep the audit gate green without an exception. Remove the override once a wrangler release brings a patched ws by itself.