gatus: Remove host endpoints

This commit is contained in:
SebastianStork 2025-08-23 23:42:01 +02:00
parent 7d8a4e50cc
commit 3cbec59b6d
2 changed files with 3 additions and 28 deletions

View file

@ -38,7 +38,7 @@ in
)
);
defaultDomainEndpoints =
defaultEndpoints =
let
getSubdomain = domain: domain |> lib.splitString "." |> lib.head;
in
@ -46,19 +46,6 @@ in
|> lib.filter (domain: domain != cfg.domain)
|> lib.map (domain: lib.nameValuePair (getSubdomain domain) { url = "https://${domain}"; })
|> lib.listToAttrs;
defaultHostEndpoints =
cfg.hostsToMonitor
|> lib.filter (hostName: hostName != config.networking.hostName)
|> lib.map (
hostName:
lib.nameValuePair hostName {
group = "Hosts";
url = "icmp://${hostName}.${config.custom.services.tailscale.domain}";
enableAlerts = false;
}
)
|> lib.listToAttrs;
in
{
enable = lib.mkEnableOption "";
@ -74,17 +61,13 @@ in
type = lib.types.listOf lib.types.nonEmptyStr;
default = [ ];
};
hostsToMonitor = lib.mkOption {
type = lib.types.listOf lib.types.nonEmptyStr;
default = [ ];
};
customEndpoints = lib.mkOption {
type = endpointType;
default = { };
};
finalEndpoints = lib.mkOption {
type = endpointType;
default = defaultDomainEndpoints // defaultHostEndpoints // cfg.customEndpoints;
default = defaultEndpoints // cfg.customEndpoints;
readOnly = true;
};
};
@ -180,7 +163,5 @@ in
cfg.finalEndpoints |> lib.attrValues |> lib.map (entry: mkEndpoint entry);
};
};
systemd.services.gatus.serviceConfig.AmbientCapabilities = "CAP_NET_RAW"; # Allow icmp/pings
};
}