mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-02-04 09:10:01 +01:00
bicep/{postgres,mysql}: add rsync pull targets for backups
This commit is contained in:
@@ -44,6 +44,22 @@ in
|
|||||||
location = "/var/lib/mysql/backups";
|
location = "/var/lib/mysql/backups";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.rsync-pull-targets = lib.mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
locations.${config.services.mysqlBackup.location} = {
|
||||||
|
user = "root";
|
||||||
|
rrsyncArgs.ro = true;
|
||||||
|
authorizedKeysAttrs = [
|
||||||
|
"restrict"
|
||||||
|
"no-agent-forwarding"
|
||||||
|
"no-port-forwarding"
|
||||||
|
"no-pty"
|
||||||
|
"no-X11-forwarding"
|
||||||
|
];
|
||||||
|
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJgj55/7Cnj4cYMJ5sIkl+OwcGeBe039kXJTOf2wvo9j mysql rsync backup";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = lib.mkIf cfg.enable [ 3306 ];
|
networking.firewall.allowedTCPPorts = lib.mkIf cfg.enable [ 3306 ];
|
||||||
|
|
||||||
systemd.tmpfiles.settings."10-mysql".${dataDir}.d = lib.mkIf cfg.enable {
|
systemd.tmpfiles.settings."10-mysql".${dataDir}.d = lib.mkIf cfg.enable {
|
||||||
|
|||||||
@@ -121,7 +121,23 @@
|
|||||||
|
|
||||||
services.postgresqlBackup = {
|
services.postgresqlBackup = {
|
||||||
enable = true;
|
enable = true;
|
||||||
location = "/var/lib/postgres/backups";
|
location = "/var/lib/postgres-backups";
|
||||||
backupAll = true;
|
backupAll = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.rsync-pull-targets = {
|
||||||
|
enable = true;
|
||||||
|
locations.${config.services.postgresqlBackup.location} = {
|
||||||
|
user = "root";
|
||||||
|
rrsyncArgs.ro = true;
|
||||||
|
authorizedKeysAttrs = [
|
||||||
|
"restrict"
|
||||||
|
"no-agent-forwarding"
|
||||||
|
"no-port-forwarding"
|
||||||
|
"no-pty"
|
||||||
|
"no-X11-forwarding"
|
||||||
|
];
|
||||||
|
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGvO7QX7QmwSiGLXEsaxPIOpAqnJP3M+qqQRe5dzf8gJ postgresql rsync backup";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user