mirror of
https://github.com/TheWanderingCrow/CrOS.git
synced 2026-01-11 17:54:08 -05:00
enable backups for bookstack
This commit is contained in:
parent
a51a46ab31
commit
f3a56262bd
2 changed files with 21 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ in
|
|||
# Base dir
|
||||
systemd.tmpfiles.rules = [
|
||||
"d ${volumePath}"
|
||||
"D ${volumePath}/tmp - - - 30m"
|
||||
];
|
||||
|
||||
# NGINX Ports
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue