BRD-001 — Secure, Low-Cost Public Website Hosting
Business requirements for hosting the public blog and articles website at near-zero running cost, with a minimal attack surface, perimeter protection, and globally fast, always-available delivery.
astro-static-site documents how the astro-static-site Astro site is built, secured, delivered, and hosted. Because the site is pure static output with no server execution, database APIs, or authentication overhead, the primary design goal is achieving the smallest possible attack surface at near-zero running cost.
Showing every doc across all sections.
Business requirements for hosting the public blog and articles website at near-zero running cost, with a minimal attack surface, perimeter protection, and globally fast, always-available delivery.
Business requirements for delivering large architecture diagrams and images at no egress cost, keeping the source repository lightweight, and protecting media traffic at the network edge.
Business requirements for serving the website and its large media under the one domain the business owns: the website at its main address and media at an address beneath it, with one security perimeter and no second domain or certificate to manage, at no base cost.
Business requirements for automatically checking the website's dependencies and source for known vulnerabilities and leaked secrets before every release, without per-developer licence fees.
Business requirements for releasing the website and its infrastructure: a change is prepared for an environment only when it is released there, production receives what was tested, the test environment always comes first, and nothing reaches production without a person's recorded decision.
Business requirements for publishing website changes and infrastructure changes automatically, in separate controlled paths, with credentials limited to the access each path needs.
Business requirements for protecting the public website, its media files and its infrastructure records against abuse, tampering and exposure through several independent layers of defence, at near-zero running cost.
Functional and non-functional requirements for building the Astro site as static output, deploying it to Cloudflare Pages, and securing it with Cloudflare DDoS/WAF protection, rate limiting, security headers, immutable caching, and enforced HTTPS.
Functional and non-functional requirements for storing architecture diagrams and images in a Cloudflare R2 bucket served at the assets subdomain of the site's own domain, through the CDN, keeping binaries out of Git, with zero-egress pricing, edge security, and long-term caching.
Functional and non-functional requirements for serving pages from Cloudflare Pages on the domain's apex and media from a Cloudflare R2 bucket on the assets subdomain of the same zone, with one certificate, one set of firewall rules and long-lived caching.
Functional and non-functional requirements for scanning dependencies and the repository for known vulnerabilities and secrets on every change using Trivy, with results published for review and severity-based release gating.
Functional and non-functional requirements for releasing with GitHub Actions: nothing runs by itself; a person starts infra.yml (plan, then apply) and app.yml for a commit of main and a target, nonprod first, and each run scans and plans or builds for its own target.
Functional and non-functional requirements for the jobs of app.yml: scanning with Trivy, building the Astro static site once per environment, and deploying a stored build to the target Cloudflare Pages project when it is promoted.
Requirements for where the two release workflows get their values: one GitHub environment per target holding only a read-only password-manager identity, every other value loaded by reference from that environment's vault in the step that needs it.
Functional and non-functional requirements for defence in depth across Cloudflare's WAF, CDN, R2 storage and Pages hosting: rate limiting, managed rules, bot control, TLS and HSTS, security headers, private buckets, versioned state, immutable builds, protected previews and least-privilege tokens.
Architecture decision record for rendering astro-static-site as ahead-of-time static output and hosting it on Cloudflare Pages — options evaluated (dynamic CMS, AWS S3 + CloudFront, Firebase Hosting) and why the single-provider edge platform won.
Architecture decision record for keeping architecture diagrams and heavy images out of Git and serving them from Cloudflare R2 behind a CDN-backed custom domain — options evaluated (images in Git, AWS S3 + CloudFront) and why R2 won.
Architecture decision record for serving media from Cloudflare R2 at assets.<domain>, an R2 custom domain inside the site's own zone: no Worker and no per-request cost, one zone with one set of TLS, firewall and rate-limit rules, and no CORS for plain images.
Architecture decision record for choosing Trivy over Snyk to scan dependencies and secrets for the static Astro site — zero licence cost, no vendor lock-in, scope matched to a site with no server code.
Architecture decision record for how images reach production: each site release copies, inside R2, only the images its tested pages link from the non-production media bucket into the target environment's bucket, with a per-environment credential limited to those two buckets.
How a reader's request reaches the site: one Cloudflare zone per environment with DNS, strict TLS and a firewall in front of a Pages project for the pages and an R2 bucket on its own media address, all declared in OpenTofu.
How images reach readers without entering Git: authors keep them in a git-ignored folder and upload them to the non-production media bucket, the build points every image at the bucket's own address on the site's zone, and each release copies the images its pages link into that environment's bucket server-side in R2.
The steps of app.yml: started by a person for one commit and one environment, it scans, builds the site for that environment, stores the nonprod build or compares the prod build with it, and deploys to the target Pages project.
The steps of infra.yml: started by a person for one commit and one environment, it scans and plans; with the apply action it applies that plan and, only if the apply succeeded, copies the new state to a retention-locked history.
Which workflow job can read which value: checks hold none, app jobs read a Pages-only token, infrastructure jobs read the infrastructure token, the state key pair and the passphrase; every value lives in the target environment's vault, read through a read-only service account whose value is the target GitHub environment's only secret.
How a change becomes a release: Git carries intent, nothing runs by itself, and a person starts infra.yml (plan, then apply) and app.yml for a commit of main, nonprod before prod, with the site and the infrastructure on separate release life cycles, each run scanning and building or planning only for its own target.
Functional and non-functional requirements for the jobs of infra.yml: scanning with Trivy, planning one environment with OpenTofu against encrypted state in a private R2 bucket, and, on request, applying that plan.
Architecture decision record for releasing the site and its infrastructure through two GitHub Actions pipelines that run only when a person releases a commit of main to one target, nonprod first, with production checked against the tested nonprod build and the site and infrastructure on separate release life cycles.
Single source of truth for every secret, variable and credential used by the infrastructure and site workflows: classification, per-workflow scoping, protected environments, token separation, injection rules, rotation and recovery.
No docs in this section yet.