mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 15:11:34 +01:00
gatus: Remove host endpoints
This commit is contained in:
parent
7d8a4e50cc
commit
3cbec59b6d
2 changed files with 3 additions and 28 deletions
|
|
@ -1,9 +1,4 @@
|
|||
{
|
||||
config,
|
||||
self,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{ config, ... }:
|
||||
{
|
||||
system.stateVersion = "24.11";
|
||||
|
||||
|
|
@ -31,7 +26,6 @@
|
|||
enable = true;
|
||||
domain = "status.${config.custom.services.tailscale.domain}";
|
||||
domainsToMonitor = config.meta.domains.globalList;
|
||||
hostsToMonitor = self.nixosConfigurations |> lib.attrNames;
|
||||
customEndpoints = {
|
||||
"alerts" = {
|
||||
group = "Monitoring";
|
||||
|
|
|
|||
|
|
@ -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
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue