Case study · Static portfolio on the edge

The problem, the limitations, the infrastructure, and what I learned.

← All projects
STATIC PORTFOLIO ON THE EDGE · active

THIS SITE

Static Astro build served from Cloudflare Workers static assets. No database, no server code, no admin panel, strict security headers.

astrocloudflarestaticsecurity-headers
OUTCOME

A site that stays up even when the homelab is down.

// problem

Publish a portfolio without adding anything to the home network attack surface.

// limitations

  • Zero runtime JavaScript frameworks.
  • Free tier.

// infrastructure used

  • Astro renders every page to HTML at build time.
  • Cloudflare serves the files from the edge. The homelab is never in the request path.
  • A _headers file sets CSP, HSTS, and frame protections on every response.

// lessons learned

  1. 01
    GitHub rejected the first push.

    The commits used a private email address, which GitHub's push protection blocks. Commits now use the GitHub no-reply address.

  2. 02
    Merged was not the same as live.

    The redesign sat on main while the old site was still served. A workflow now builds and deploys on every push to main.

  3. 03
    A new font broke the build.

    The redesign added a font package that wasn't installed locally. Installing from the lockfile with npm ci keeps builds reproducible.

  4. 04
    The security policy blocked inline styles.

    The Content-Security-Policy only allows styles from the site's own files, so dynamic colors use classes and CSS variables instead of style attributes.