Work / CS-14

A self-hosted platform with its own CI/CD and automatic rollback

Year
2025–2026
Type
Personal project
Themes
Platform/DevOps, Security, Personal
Stack
Proxmox, LXC, ZFS, Forgejo Actions, Python, Traefik, Cloudflare Tunnel, Tailscale

Result, up front

  • 26apps deploying through the gate
  • 2-stageautomatic rollback
  • ~90%false-positive alert feed replaced by a daily digest

Situation

I run my own apps and services at home, about 29 isolated containers on one server, and wanted deploys to be as safe as they are at work.

How I framed it

The deploy path is the security boundary. CI should be able to say which app and which commit, and nothing else.

What I did

  • Built a CI/CD pipeline on Forgejo Actions that deploys through a locked-down deploy gate (about 600 lines of Python). For each deploy it:
    • renders the app’s environment from a secrets store
    • snapshots the container
    • unpacks a versioned release and switches to it atomically
    • runs a health check
    • rolls back automatically in two stages: first the previous release, then the snapshot
  • 26 apps deploy this way, and a test workflow keeps checking that the gate refuses anything outside its contract.
  • Supply-chain safety: third-party artefacts are pulled by digest and checksum-verified, and my patches to upstream code are checksum-pinned, so a build fails if upstream changes underneath them.
  • Secrets live in a self-hosted secrets manager with least-privilege machine identities. CI never sees app secrets.
  • Networking: a reverse proxy with automatic wildcard TLS, a Cloudflare Tunnel so public services need no open inbound web ports, and Tailscale access rules kept as code with tests.
  • Security: default-deny firewall groups stop a compromised container from reaching the rest of the network. On top of that: intrusion detection, file-integrity checks, audit logging, fail2ban and key-only SSH.
  • Backups: nightly deduplicated backups of every container to a second machine, kept 7 daily / 4 weekly / 3 monthly and verified weekly.
  • Monitoring: replaced an alert feed that was about 90% false positives with a daily digest I wrote (about 1,400 lines of Python). It checks services, certificates, firewall baselines, backups and intrusion alerts against known-benign traffic.

Result

Deploys are boring, which is the goal. Rollback is automatic, and the whole platform is documented.

→ Contact

Have a problem worth measuring?

I'm a Senior Software Engineer in the UK. The quickest way to reach me is email.