-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
poc(monitoring): add monitoring for gitserver backup job
- Loading branch information
1 parent
ddfcebc
commit 37988f8
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
age-encryption.org/v1 | ||
-> ssh-ed25519 N8lbiw 8r4vdhOkcRzbxR9EaCjSToJoqb6AZnYAOZ71IvfigU4 | ||
+1YesObAVKnq3Pol129VxS7xmNMTKXrOOGDwM6U75Q4 | ||
-> ssh-ed25519 Zy726Q HDV3dD0FGrejPT/nwBwO8BUbTmFf6HklGtwDN1cZqjM | ||
bsitFgTgV+QELXFxP3l5zpFuiDWfiec4BriwdPyXBYE | ||
--- uLQsTpLAAddVG9mnyGS3GhC3w+ZioQclTzkrea6XZJ0 | ||
C&��l\)���9�{I����V aJG8��p�r��m��'��F������t���-# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ | |
paths = [ | ||
"/var/lib/git-server" | ||
]; | ||
backupPrepareCommand = "${pkgs.curl}/bin/curl -fsS -m 10 --retry 5 https://hc-ping.com/$(${pkgs.coreutils}/bin/cat ${config.age.secrets.healthchecksIoUuid.path})/backup-gitserver/start"; | ||
pruneOpts = [ | ||
"--keep-hourly 48" | ||
"--keep-daily 7" | ||
|
@@ -55,6 +56,26 @@ | |
Persistent = true; | ||
}; | ||
}; | ||
|
||
systemd.services."restic-backups-gitserver" = { | ||
onSuccess = [ "[email protected]" ]; | ||
onFailure = [ "[email protected]" ]; | ||
}; | ||
|
||
systemd.services."restic-notify-gitserver@" = | ||
let | ||
script = pkgs.writeText "restic-notify-gitserver.sh" | ||
'' | ||
${pkgs.curl}/bin/curl -fsS -m 10 --retry 5 https://hc-ping.com/$(cat ${config.age.secrets.healthchecksIoUuid.path})/backup-gitserver/''${MONITOR_EXIT_STATUS} | ||
''; | ||
in | ||
{ | ||
serviceConfig = { | ||
Type = "oneshot"; | ||
User = "git"; | ||
ExecStart = "${pkgs.bash}/bin/bash ${script}"; | ||
}; | ||
}; | ||
}; | ||
} | ||
|