Files
homelab-infra/ops/restore-tests/run-restore-checks.sh
T
Micha 3e9c12eb75 Add Hetzner Storage Box snapshot restore test
Make the off-site snapshot protection a repeatable, monitored proof (DECISIONS 2026-06-11/-23): a read-only restore-test that lists .zfs/snapshot on the Storage Box, checks retention and newest-snapshot age, and SFTP-fetches one small file from the newest snapshot (size + SHA256). Connection is derived from the borg-ui repo URL and runs via docker exec borg-ui; no secret in the script, no write access. Wired into the run-restore-checks.sh dispatcher; runbook documents the pending one-time live validation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 12:18:44 +02:00

117 lines
3.4 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
MODE="${1:-}"
WHATIF="${2:-}"
case "$MODE" in
freshness)
exec "$SCRIPT_DIR/check-restore-freshness.sh"
;;
freshness-negative)
exec "$SCRIPT_DIR/negative-freshness-alert-test.sh"
;;
vaultwarden)
if [ "$WHATIF" = "--what-if" ]; then
exec "$SCRIPT_DIR/vaultwarden-restore-test.sh" --what-if
fi
exec "$SCRIPT_DIR/vaultwarden-restore-test.sh"
;;
gitea)
if [ "$WHATIF" = "--what-if" ]; then
exec "$SCRIPT_DIR/gitea-restore-test.sh" --what-if
fi
exec "$SCRIPT_DIR/gitea-restore-test.sh"
;;
paperless)
if [ "$WHATIF" = "--what-if" ]; then
exec "$SCRIPT_DIR/paperless-restore-test.sh" --what-if
fi
exec "$SCRIPT_DIR/paperless-restore-test.sh"
;;
immich)
if [ "$WHATIF" = "--what-if" ]; then
exec "$SCRIPT_DIR/immich-restore-test.sh" --what-if
fi
exec "$SCRIPT_DIR/immich-restore-test.sh"
;;
authelia)
if [ "$WHATIF" = "--what-if" ]; then
exec "$SCRIPT_DIR/authelia-restore-test.sh" --what-if
fi
exec "$SCRIPT_DIR/authelia-restore-test.sh"
;;
adguard)
if [ "$WHATIF" = "--what-if" ]; then
exec "$SCRIPT_DIR/adguard-restore-test.sh" --what-if
fi
exec "$SCRIPT_DIR/adguard-restore-test.sh"
;;
redis)
if [ "$WHATIF" = "--what-if" ]; then
exec "$SCRIPT_DIR/redis-restore-test.sh" --what-if
fi
exec "$SCRIPT_DIR/redis-restore-test.sh"
;;
homeassistant)
if [ "$WHATIF" = "--what-if" ]; then
exec "$SCRIPT_DIR/homeassistant-restore-test.sh" --what-if
fi
exec "$SCRIPT_DIR/homeassistant-restore-test.sh"
;;
nextcloud)
if [ "$WHATIF" = "--what-if" ]; then
exec "$SCRIPT_DIR/nextcloud-restore-test.sh" --what-if
fi
exec "$SCRIPT_DIR/nextcloud-restore-test.sh"
;;
komodo-bootstrap)
if [ "$WHATIF" = "--what-if" ]; then
exec "$SCRIPT_DIR/komodo-bootstrap-test.sh" --what-if
fi
exec "$SCRIPT_DIR/komodo-bootstrap-test.sh"
;;
komodo-mongo-restore)
if [ "$WHATIF" = "--what-if" ]; then
exec "$SCRIPT_DIR/komodo-mongo-restore-test.sh" --what-if
fi
exec "$SCRIPT_DIR/komodo-mongo-restore-test.sh"
;;
traefik)
if [ "$WHATIF" = "--what-if" ]; then
exec "$SCRIPT_DIR/traefik-restore-test.sh" --what-if
fi
exec "$SCRIPT_DIR/traefik-restore-test.sh"
;;
mailarchiver)
if [ "$WHATIF" = "--what-if" ]; then
exec "$SCRIPT_DIR/mailarchiver-restore-test.sh" --what-if
fi
exec "$SCRIPT_DIR/mailarchiver-restore-test.sh"
;;
mealie)
if [ "$WHATIF" = "--what-if" ]; then
exec "$SCRIPT_DIR/mealie-restore-test.sh" --what-if
fi
exec "$SCRIPT_DIR/mealie-restore-test.sh"
;;
shared-pg-cluster)
if [ "$WHATIF" = "--what-if" ]; then
exec "$SCRIPT_DIR/shared-pg-cluster-restore-test.sh" --what-if
fi
exec "$SCRIPT_DIR/shared-pg-cluster-restore-test.sh"
;;
hetzner-snapshot)
if [ "$WHATIF" = "--what-if" ]; then
exec "$SCRIPT_DIR/hetzner-snapshot-restore-test.sh" --what-if
fi
exec "$SCRIPT_DIR/hetzner-snapshot-restore-test.sh"
;;
*)
echo "Usage: $0 {freshness|freshness-negative|vaultwarden|gitea|paperless|immich|authelia|adguard|redis|homeassistant|nextcloud|komodo-bootstrap|komodo-mongo-restore|traefik|mailarchiver|mealie|shared-pg-cluster|hetzner-snapshot} [--what-if]" >&2
exit 1
;;
esac