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

@ -1,9 +1,4 @@
{ { config, ... }:
config,
self,
lib,
...
}:
{ {
system.stateVersion = "24.11"; system.stateVersion = "24.11";
@ -31,7 +26,6 @@
enable = true; enable = true;
domain = "status.${config.custom.services.tailscale.domain}"; domain = "status.${config.custom.services.tailscale.domain}";
domainsToMonitor = config.meta.domains.globalList; domainsToMonitor = config.meta.domains.globalList;
hostsToMonitor = self.nixosConfigurations |> lib.attrNames;
customEndpoints = { customEndpoints = {
"alerts" = { "alerts" = {
group = "Monitoring"; group = "Monitoring";

View file

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