cfsite

Hosting

One Cloudflare Worker per site, serving a folder of static files on the site's own hostname. Configured in wrangler.jsonc.

An assets-only Worker

The Worker has no script, only static assets: every request is a free static-asset request, and there is no code to break or keep up to date.

One hostname, nothing on workers.dev

routes with custom_domain: true attaches the Worker to its hostname, here cfsite.klaska.net. On the first deploy Cloudflare creates the DNS record and the certificate itself; HTTPS works within a minute or two, and plain HTTP redirects to it.

workers_dev: false keeps production off the shared *.workers.dev domain, so the site has exactly one address. preview_urls: true still allows the per-PR previews there, and Cloudflare marks those noindex.

Custom 404 page

not_found_handling: "404-page" serves the nearest 404.html with status 404. A single-page app would use "single-page-application" instead. See a missing page.

Redirects

Optional. A _redirects file in the site folder holds 301s for moved URLs: exact paths first, then splats such as /old/* https://new.example/:splat 301. Here it only demonstrates the feature: /new goes to the New site page. Jekyll skips files starting with _, so a Jekyll site needs include: ["_redirects"] in _config.yml.

Analytics

Cloudflare Web Analytics is switched on for the whole klaska.net zone with automatic setup: the analytics script is added to every HTML page a Cloudflare-served host returns. No tag in the code, no cookies, no consent banner.

Pinned tooling

Exact versions in package.json (wrangler, Playwright, Lighthouse, qrcode), a committed package-lock.json that CI installs with npm ci, and a fixed compatibility_date. Updates are deliberate pull requests, and their previews show what changed.

Its own deploy token

Each repository gets its own Cloudflare API token, stored as the repository secrets CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID. It can do only what a deploy needs and expires after a year:

scripts/create-deploy-token.sh creates it through the API, stores both secrets and verifies the token, without ever printing it. A leaked token from one repository cannot touch DNS or any other site's settings.

Production deploys

A push to main runs wrangler deploy. The workflow can also be started by hand (Actions → Deploy to Cloudflare → Run workflow) to redeploy without a commit. Only one production deploy runs at a time.