SkateSpots/scripts/restic.env.example
SkateSpots 5b63a69a2c chore(backup): support a second offsite repo (restic-2.env)
backup-relay.sh now pushes the archive to restic.env AND, if present,
restic-2.env — so adding an R2/B2 bucket gives true 3-2-1 (local + CVM +
object storage) instead of replacing one offsite with another. Each repo is
sourced in its own subshell so RESTIC_* don't leak between them.

Verified with a throwaway local second repo: both pushes ran, both snapshots
exist. Also documents the umask trap (mode-600 cache dirs break restic).
2026-09-28 14:24:57 +07:00

36 lines
1.4 KiB
Text

# Template for the offsite backup target used by scripts/backup-relay.sh.
# Copy to ~/.config/skatespots/restic.env and fill in — that file is outside the
# repo and must never be committed.
#
# Any restic backend works. Examples:
# Backblaze B2: RESTIC_REPOSITORY=b2:my-bucket:skatespots/relay
# S3 / R2: RESTIC_REPOSITORY=s3:https://<account>.r2.cloudflarestorage.com/<bucket>
# SFTP directly: RESTIC_REPOSITORY=sftp:user@host:/srv/skatespots-backups
# SFTP via an ~/.ssh/config alias (keeps the key path out of this file):
# Host my-backup
# HostName <host>
# User <user>
# IdentityFile ~/.ssh/backup_key
# → RESTIC_REPOSITORY=sftp:my-backup:/path/to/repo
#
# Configured here: the CVM host over SFTP using the `skatespots-cvm` ssh alias
# (see AGENTS.md → Relay archive).
#
# Optional SECOND offsite: copy this file to ~/.config/skatespots/restic-2.env
# and point it at another repo (e.g. Cloudflare R2 / Backblaze B2). backup-relay.sh
# pushes to BOTH, so you get true 3-2-1: local + CVM host + object storage.
#
# One-time init, from this machine:
# set -a; . ~/.config/skatespots/restic.env; set +a
# restic init
#
# Then the weekly timer will keep it in sync (restic backup + forget --prune).
RESTIC_REPOSITORY=
RESTIC_PASSWORD=
# Backend credentials (only the ones your backend needs):
# AWS_ACCESS_KEY_ID=
# AWS_SECRET_ACCESS_KEY=
# B2_ACCOUNT_ID=
# B2_ACCOUNT_KEY=