1.8 KiB
1.8 KiB
Disaster Recovery: Git + Docs stack
Goal: restore git.frostlabs.me and the docs sites after losing the VPS.
What state actually matters
| Thing | Where | Rebuildable? |
|---|---|---|
| Gitea data (repos, DB, config) | /opt/gitea/gitea/ (SQLite + repos) |
No — back this up |
| Runner registration | /opt/gitea/runner/.runner |
No (but re-registerable in minutes) |
| Built sites | /srv/www/ |
Yes — rebuilt on next push |
| Tunnel / nginx / compose config | /opt/gitea/*.yml, .env, nginx.conf |
Keep a copy off-box |
The docs repos themselves are safe as long as one clone survives (VPS, homelab, laptop). This runbook is about restoring the server.
Backup (do this on a schedule)
# Off-box snapshot of everything stateful on the VPS
rsync -aP /opt/gitea/ backup-target:/backups/gitea/
!!! tip
A gitea dump is the "proper" way, but for a single-user SQLite instance an
rsync of /opt/gitea while the stack is stopped is simplest and complete.
Restore onto a fresh VPS
- Provision the box, install Docker + compose.
- Recreate
/opt/gitea/and restore the backup into it. - Recreate
.envwithTUNNEL_TOKENand (optionally)RUNNER_TOKEN. mkdir -p /srv/www/docs-public /srv/www/docs-privatedocker compose up -d- In Cloudflare Zero Trust, point the tunnel at the new box (token is the same
tunnel, so hostnames just reattach). Confirm
git.frostlabs.meloads. - If the runner didn't reconnect, re-register it (Site Admin → Actions → Runners).
- Push any repo (or hit Run workflow) to rebuild both sites into
/srv/www.
Verify
git.frostlabs.mereachable, repos presentrunbook.frostlabs.merebuilt and gated by CF Accessdocs.frostlabs.merebuilt and public- a test push triggers a green Actions run