ADR-0007: Docs-as-source with a zero-dependency build#

  • Status: accepted
  • Date: 2026-07-30

Context#

The product is a detailed walkthrough of how the domain is configured. That content has to live somewhere, and the obvious failure mode is having two copies — repository documentation and website content — that diverge within months.

Separately: the site's subject matter is its own security posture. Whatever builds it becomes part of that posture.

Decision#

The Markdown in docs/ is the website. It is rendered by site/build.py, a standard-library-only Python script with a ~250-line Markdown renderer in site/markdown.py.

No npm, no PyPI packages, no lockfile, no node_modules.

Facts — DNS records, TLS settings, certificate parameters — are injected from tofu output -json site_facts at <!-- FACTS:name --> markers rather than written by hand.

Alternatives considered#

Hugo. A single Go binary, no node_modules, mature, good theming. The strongest alternative and a reasonable choice. Rejected because it is still a dependency to pin, audit and keep current, and because full control over the output HTML is what makes default-src 'none' with Trusted Types achievable without fighting a theme.

Astro. Best-looking result, islands architecture, minimal shipped JS. Rejected because it reintroduces the npm dependency tree that is otherwise this project's most concrete security claim. Hundreds of transitive packages in the build path of a site whose selling point is having none would be self-defeating.

Hand-written HTML with no build step. Maximum CSP purity, zero toolchain. It fails the actual requirement: the docs and the site would drift apart, which is the exact problem being solved.

Markdown rendered by markdown-it-py or mistune. One small pinned dependency, a proper CommonMark implementation, far less code to maintain. Genuinely tempting. Rejected because "this site ships and builds with zero third-party code" is a claim worth more here than full CommonMark compliance — and the docs use a small, known subset of Markdown.

Consequences#

Positive: one source of truth that cannot drift. No supply chain in the build path at all — no transitive CVEs, nothing to audit, no lockfile. Complete control over output HTML, which is what makes the strict CSP practical. Builds in under a second with no install step. The published documentation is generated from the configuration it describes, so weakening the configuration changes the page in the same commit.

Negative: a hand-written Markdown renderer is a maintenance liability and supports only the subset the docs use. Unsupported syntax renders as literal text — visible, but still wrong. No syntax highlighting. Mermaid diagrams do not render on the site: they need a ~1MB JavaScript library, which would mean either a CDN request (blocked by the CSP) or vendoring a dependency, so the source is shown labelled instead and renders properly on GitHub. No incremental builds, no live reload.

Neutral: the site looks like documentation rather than a designed product. Appropriate for what it is.

Revisit when#

  • site/markdown.py exceeds ~400 lines or accumulates real bugs. At that point

the maintenance cost has overtaken the dependency it was avoiding, and Hugo becomes the right answer.

  • The site needs genuine interactivity beyond the /api/whoami panel.
  • Diagram rendering becomes important enough to justify a dependency.

Built 2026-11-25 from commit 33bfabf6a27d4baeecf228c31bd5d636a3965070. This page was generated from the same source that provisions the infrastructure it describes.