mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 16:21: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, ... }:
|
||||||
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";
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue