feat: backup improvements (AlbyHub restic, Gitea dump, Immich MinIO sync) #16

Closed
klaatu wants to merge 4 commits from backup-improvements into main
Showing only changes of commit 51aa72d5b6 - Show all commits
+30
View File
@@ -26,6 +26,13 @@ in
owner = "grafana";
};
# NOTE: Before deploying, create the secret with:
# agenix -e secrets/albyhub-restic-password.age
age.secrets.albyhub-restic-password = {
file = ../../../secrets/albyhub-restic-password.age;
owner = "root";
};
# Bootloader
boot = {
loader = {
@@ -103,6 +110,29 @@ in
workDir = "/chain/alby";
};
};
restic.backups.albyhub = {
# Backs up AlbyHub's LDK state directory to the nas1 Restic REST server.
# The service is stopped before backup to ensure LDK state consistency
# and restarted afterward.
repository = "rest:https://nas1.shire-zebra.ts.net:30248/albyhub";
passwordFile = config.age.secrets.albyhub-restic-password.path;
paths = [ "/chain/alby" ];
timerConfig = {
OnCalendar = "daily";
RandomizedDelaySec = "1h";
};
backupPrepareCommand = ''
systemctl stop albyhub.service || true
'';
backupCleanupCommand = ''
systemctl start albyhub.service || true
'';
pruneOpts = [
"--keep-daily 7"
"--keep-weekly 4"
"--keep-monthly 3"
];
};
jellyfin = {
enable = true;
openFirewall = true;