$ cat how-it-works.md

How this site works

This site is part of the work it describes: it runs on a small server at home, behind the same layers I would put in front of anything public. Here is the path of a request, what protects it, and how a new version gets there.

Live · measured by this server while it rendered this page
Deployed commit
67c90c5
Built
2026-11-01 21:52 UTC
Since last restart
5 d 15 h (since 2026-11-25 06:28 UTC)
Database
reachable (answered in 5 ms)

A restart happens on every deploy, so “since last restart” is not the site's uptime history.

FIG. 1

The path of a request

How a request reaches this site, and how a new version gets thereA visitor's browser connects over HTTPS to Cloudflare's edge. The edge forwards the request through a tunnel that the server opened from the inside, so the server has no open ports. On the server, a virtual machine in a DMZ runs the tunnel connector, the web app, a read-only media server and the database, which only the web app can reach. New versions are built and tested by GitHub Actions and pulled by the server.Your browserHTTPS only (.dev is on the HSTS preload list)HTTPSCloudflare edgeDNS, TLS, caching of imagesTurnstile on the public formsAccess sign-in in front of the admintunnel, opened from insideno open ports, no port forwardingDMZ virtual machinereaches the internet; cannot open connections homeTunnel connectorWeb appNext.js serverread-only, not rootMediaimages and PDFsread-only file serverinternal networkPostgreSQLno published portnightly backupsEach containerno Linux capabilitiesno privilege escalationpulled by a personnothing pushes inGitHub Actionstypecheck, lint, tests, browser testssecret scan, dependency audit, image scanimage tagged with the commit SHA
FIG. 1 · From your browser to the database, and from a commit to the server.
  1. Your browser connects to Cloudflare over HTTPS. Cloudflare answers cached images itself and checks the public forms with Turnstile.
  2. Everything else travels through a tunnel that the server opened from the inside. The server has no open ports.
  3. On the server, a virtual machine in a DMZ runs the tunnel connector, the web app, a read-only media server and the database.
  4. The web app renders the page on the server and is the only thing that can reach the database.
  5. The page arrives with a Content Security Policy that only allows the scripts the server put in it.
$ ls security/

The security layers

At the edge

  • HTTPS everywhere: the .dev domain is HTTPS-only by design, and TLS ends at Cloudflare.
  • The public forms are protected by Cloudflare Turnstile and per-visitor rate limits. IP addresses are never stored, only a keyed hash, cleared after 30 days.
  • The admin area sits behind two locks: a Cloudflare Access sign-in, then a GitHub sign-in that only accounts on an allowlist in the server configuration can pass.

On the network

  • No open ports: the server opens an outbound tunnel to Cloudflare, so nothing on the internet can connect to it directly.
  • The site runs in a DMZ: it can reach the internet, but it cannot open connections into the home network.
  • The database is on an internal container network that only the web app joins; it has no published port.

In the containers

  • One stack per app, each with its own database.
  • Every container has a read-only filesystem, runs as an unprivileged user, drops all Linux capabilities and cannot gain new privileges.
  • Uploaded images are re-encoded on the server (which strips location and camera metadata), stored under random names, and served by a separate read-only file server.

In the application

  • A strict Content Security Policy with a fresh nonce on every request: no inline script runs unless the server put it there.
  • Posts and case studies are Markdown, rendered on the server and sanitized before they reach the page.
  • Every form is validated again on the server, and every admin action checks the sign-in again, whatever the page showed.

In the supply chain

  • Dependencies come from a lockfile, new releases wait two weeks before they are taken (unless a security fix needs them), and every build action is pinned to an exact commit.
  • Every change runs the type checker, the linter, unit, database and browser tests, a secret scan, a dependency audit and a scan of the finished image before it can be published.
$ git push

How a new version gets here

  1. Every change goes through a pull request; nothing is merged until every check passes.
  2. On the main branch, GitHub Actions builds the image once and tags it with the commit it was built from. There is no “latest” tag.
  3. I deploy by hand: the server pulls that exact image, applies any database migrations, and restarts. Nothing can push to the server.
  4. Database changes are made in two steps (add first, remove in a later release), so going back to the previous version always works.
  5. The database is backed up every night. Restore tested before launch: a nightly dump restored into a fresh database, row counts matched, then swapped in.
$ cat privacy.txt

What it does not do

No analytics, no tracking cookies, no third-party scripts except Turnstile on the forms. What the forms store, and for how long, is on the privacy page.