Files
homelabstack/stacks/backup
ginnoirandClaude Opus 5.5 39b26e68d1
Deploy Caddyfile to valhalla / deploy (push) Successful in 1m24s
chore(dev): remove Plane
Plane had been broken since the June env_file cutover (bare DATABASE_URL /
SECRET_KEY entries overrode stack.env with empty values, so the migrator
never connected) and TB-018 already dropped it. It held one empty project.

Removes the 8 Plane services and their env from the dev stack, the
plane.ginnoir.com Caddy block, the Authentik forward-auth provider/app,
the nightly pg_dump and minio snapshot path, and stale doc references.
A final pg_dump + minio tarball is kept at ~/plane-final-20261026 on valhalla.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 03:02:49 -05:00
..
2026-10-26 03:02:49 -05:00
2026-10-26 03:02:49 -05:00
2026-10-26 03:02:49 -05:00
2026-10-26 03:02:49 -05:00

backup stack

Kopia → Backblaze B2. Backs up /config, selected labdata paths (see SCOPE.md), and nightly SQL dumps.

Before first deploy

  1. Backblaze B2 (recommended offsite — ~$6/TB/mo)

    • Create a bucket (e.g. valhalla-homelab-backup)
    • Create an Application Key scoped to that bucket
    • Note the S3 endpoint for your region
  2. Fill stack.env

    • KOPIA_REPOSITORY_PASSWORD — openssl rand -hex 32
    • B2_KEY_ID, B2_APPLICATION_KEY, B2_BUCKET, B2_ENDPOINT
  3. Host paths

    • /config/kopia/{config,cache,logs} — Kopia state
    • /config/backup/dumps — nightly SQL dumps
    • /config/backup/{init-kopia.sh,snapshot-paths.txt,crontab,scripts/} — copied from this repo (Portainer CE cannot bind-mount relative git paths; sync after editing those files)
  4. Register new Portainer git stack → stacks/backup (one-time)

  5. Push → Portainer redeploys within 5 min

After deploy

  • UI: https://backup.ginnoir.com (LAN/Tailscale) — username kopia, password = KOPIA_REPOSITORY_PASSWORD in stack.env
  • Subscribe phone to ntfy topic backup (or path in NTFY_URL)
  • Restore test (done 2026-06-11): postgres_resume SQL dump + Gitea repos Kopia snapshot from B2

Schedule

Time What
02:50 backup-dump-databases.sh — SQL dumps (backup_scheduler cron)
03:00 Kopia snapshots — kopia server's own policy schedule (paths in snapshot-paths.txt)
hh:15 backup-check-freshness.sh — pushes to Uptime Kuma monitor Backups fresh

Alerting

backup-check-freshness.sh runs hourly and pushes UP/DOWN to the Uptime Kuma push monitor "Backups fresh (kopia + SQL dumps)" (KUMA_PUSH_URL in stack.env). DOWN when any Kopia source or the newest SQL dump is older than 26h, or a dump file is a near-empty stub. Kuma also goes DOWN if no push arrives for 2h (scheduler dead, kopia crash-looping), and notifies via ntfy.

backup-run-snapshots.sh is for manual runs only — cron'ing it would duplicate the server's scheduled uploads.

If B2 creds are empty

Kopia still starts with UI — configure repository manually, then set policies for each path in snapshot-paths.txt.