mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-06-08 18:09:06 +02:00
feat: add initial setup for declarative uptime-kuma monitors
This commit is contained in:
parent
f3001378ad
commit
4bad661036
4 changed files with 41 additions and 21 deletions
|
@ -59,6 +59,39 @@ in
|
|||
'';
|
||||
|
||||
systemConfig = _: {
|
||||
statelessUptimeKuma.probesConfig.monitors = lib.mkIf (name != "default") {
|
||||
"${name} - IPv4" = {
|
||||
url = "https://${
|
||||
if (hasSuffix "luj" name) then
|
||||
config.machine.meta.ips.vpn.ipv4
|
||||
else
|
||||
config.machine.meta.ips.public.ipv4
|
||||
}";
|
||||
type = "http";
|
||||
accepted_statuscodes = [ "200-299" ];
|
||||
headers = ''
|
||||
{
|
||||
"Host": "${name}"
|
||||
}
|
||||
'';
|
||||
};
|
||||
"${name} - IPv6" = {
|
||||
url = "https://[${
|
||||
if (hasSuffix "luj" name) then
|
||||
config.machine.meta.ips.vpn.ipv6
|
||||
else
|
||||
config.machine.meta.ips.public.ipv6
|
||||
}]";
|
||||
type = "http";
|
||||
accepted_statuscodes = [ "200-299" ];
|
||||
headers = ''
|
||||
{
|
||||
"Host": "${name}"
|
||||
}
|
||||
'';
|
||||
|
||||
};
|
||||
};
|
||||
security.acme.certs = lib.optionalAttrs (hasSuffix "luj" name) {
|
||||
"${name}".server = lib.mkIf (hasSuffix "luj" name) "https://ca.luj/acme/acme/directory";
|
||||
};
|
||||
|
@ -134,6 +167,7 @@ in
|
|||
];
|
||||
|
||||
machine = mergeSub (c: c.machine);
|
||||
statelessUptimeKuma = mergeSub (c: c.statelessUptimeKuma);
|
||||
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue