enable backups for bookstack

This commit is contained in:
TheWanderingCrow 2025-01-26 08:41:18 -05:00
parent a51a46ab31
commit f3a56262bd
2 changed files with 21 additions and 0 deletions

View file

@ -1,5 +1,9 @@
let
volumePath = "/overseer/services";
in
{
lib,
pkgs,
config,
...
}:
@ -7,6 +11,22 @@ lib.mkIf config.user.overseer.enable {
sops.secrets."bookstack/key" = {
owner = "bookstack";
};
services.restic.backups.bookstack = {
user = "root";
timerConfig = {
OnCalendar = "daily";
Persistent = true;
};
backupPrepareCommand = "${pkgs.mariadb}/bin/mysqldump -u root bookstack > ${volumePath}/tmp/bookstack.sql";
backupCleanupCommand = "rm ${volumePath}/tmp/bookstack.sql";
paths = [
"/var/lib/bookstack"
"${volumePath}/tmp/bookstack.sql"
];
repositoryFile = config.sops.secrets."restic/url".path;
passwordFile = config.sops.secrets."restic/key".path;
};
services.bookstack = {
enable = true;

View file

@ -12,6 +12,7 @@ in
# Base dir
systemd.tmpfiles.rules = [
"d ${volumePath}"
"D ${volumePath}/tmp - - - 30m"
];
# NGINX Ports