feat: backup improvements — AlbyHub Restic, Gitea dump CronJob, Immich → MinIO #17

Merged
greg merged 5 commits from klaatu/nixos:feature/backup-improvements into main 2026-04-04 18:00:19 +00:00
Showing only changes of commit c74d647ec3 - Show all commits
+61
View File
@@ -0,0 +1,61 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: gitea-dump
spec:
schedule: "0 3 * * *"
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 3
jobTemplate:
spec:
template:
spec:
restartPolicy: Never
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
volumes:
- name: gitea-data
persistentVolumeClaim:
claimName: gitea-shared-storage
- name: dump-output
nfs:
path: /mnt/all/backups/gitea-dumps
server: nas1.shire-zebra.ts.net
initContainers:
- name: gitea-dump
image: "gitea/gitea:1.25.4"
command:
- /bin/sh
- "-c"
- |
set -e
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
OUTFILE="/dump-output/gitea-dump-${TIMESTAMP}.zip"
gitea dump \
--config /data/gitea/conf/app.ini \
--file "${OUTFILE}" \
--type zip \
--skip-log \
--skip-custom-dir \
--skip-db
greg marked this conversation as resolved
Review

There is no need to skip items. Let's make the backup complete.

There is no need to skip items. Let's make the backup complete.
echo "Dump written to ${OUTFILE}"
volumeMounts:
- name: gitea-data
mountPath: /data
readOnly: true
- name: dump-output
mountPath: /dump-output
containers:
- name: cleanup
image: "busybox:1.36"
command:
- /bin/sh
- "-c"
- |
ls -t /dump-output/gitea-dump-*.zip 2>/dev/null | tail -n +31 | xargs rm -f
greg marked this conversation as resolved Outdated
Outdated
Review

Let's change this to use the S3 backups as well, where we can set the items with a 30 day expiration time. I've created the bucket backup-gitea for holding them. No need for the NFS loading.

Let's change this to use the S3 backups as well, where we can set the items with a 30 day expiration time. I've created the bucket `backup-gitea` for holding them. No need for the NFS loading.
echo "Cleanup done."
volumeMounts:
- name: dump-output
mountPath: /dump-output