#25 Gitlab backup options #116

Open
esy wants to merge 6 commits from gitlab_backup into main

View file

@ -6,6 +6,7 @@
}: }:
with lib; let with lib; let
cfg = config.services.skynet_gitlab; cfg = config.services.skynet_gitlab;
backup_path = "/etc/skynet/backups/gitlab";
domain_base = "${cfg.domain.base}.${cfg.domain.tld}"; domain_base = "${cfg.domain.base}.${cfg.domain.tld}";
domain_full = "${cfg.domain.sub}.${domain_base}"; domain_full = "${cfg.domain.sub}.${domain_base}";
@ -178,6 +179,10 @@ in {
domain = lib.mkForce domain_base; domain = lib.mkForce domain_base;
}; };
services.skynet_backup.normal.backups = [
backup_path
];
services.gitlab = { services.gitlab = {
enable = true; enable = true;
@ -213,6 +218,14 @@ in {
}; };
}; };
# see https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/misc/gitlab.nix#L295
backup = {
startAt = "Sat *-*-* 04:00:00"; # Sat 4am weekly
path = backup_path;
keepTime = 24; # (Hours) Backups are uploaded to seperate server
skip = ["builds" "artifacts" "registry" "tar"]; # see https://docs.gitlab.com/ee/administration/backup_restore/backup_gitlab.html#excluding-specific-data-from-the-backup
};
# use the local email client # use the local email client
smtp.enable = true; smtp.enable = true;