gitea: use own backup solution

This commit is contained in:
Antoine Martin 2021-02-02 18:09:10 +01:00
parent 039fa5a930
commit fca8f6cb4c

View file

@ -56,11 +56,10 @@ in {
other.SHOW_FOOTER_VERSION = false; other.SHOW_FOOTER_VERSION = false;
}; };
dump = { # NixOS module uses `gitea dump` to backup repositories and the database,
enable = true; # but it produces a single .zip file that's not very borg-backup friendly.
# Borg backup starts at midnight so create dump before # I configure my backup system manually below.
interval = "*-*-* 23:40:00"; dump.enable = false;
};
database = { database = {
type = "postgres"; type = "postgres";
@ -69,8 +68,19 @@ in {
}; };
}; };
# FIXME: Borg *could* be backing up files while they're being edited by
# gitea, so it may produce corrupt files in the snapshot if I push stuff
# around midnight. I'm not sure how `gitea dump` handles this either,
# though.
my.services.borg-backup = mkIf cfg.enable { my.services.borg-backup = mkIf cfg.enable {
paths = [ config.services.gitea.dump.backupDir ]; paths = [
config.services.gitea.lfs.contentDir
config.services.gitea.repositoryRoot
];
};
services.postgresqlBackup = mkIf my.services.postgresql-backup.enable {
databases = [ "gitea" ];
}; };
services.nginx = { services.nginx = {