mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 15:11:34 +01:00
Deduce gatus endpoint group from domain when possible
This commit is contained in:
parent
efe6da5582
commit
dbe87bc88a
7 changed files with 11 additions and 20 deletions
|
|
@ -26,9 +26,6 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
custom.services.gatus.endpoints."Actual Budget" = {
|
||||
group = "Private";
|
||||
url = "https://${cfg.domain}/";
|
||||
};
|
||||
custom.services.gatus.endpoints."Actual Budget".url = "https://${cfg.domain}/";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,14 +96,10 @@ in
|
|||
|
||||
custom.services.gatus.endpoints = {
|
||||
"Forgejo" = {
|
||||
group = "Public";
|
||||
url = "https://${cfg.domain}/api/healthz";
|
||||
extraConditions = [ "[BODY].status == pass" ];
|
||||
};
|
||||
"Forgejo SSH" = {
|
||||
group = "Public";
|
||||
url = "ssh://${cfg.domain}";
|
||||
};
|
||||
"Forgejo SSH".url = "ssh://${cfg.domain}";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ in
|
|||
default = name;
|
||||
};
|
||||
group = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
};
|
||||
url = lib.mkOption {
|
||||
type = lib.types.nonEmptyStr;
|
||||
|
|
@ -101,8 +101,13 @@ in
|
|||
url,
|
||||
extraConditions,
|
||||
}:
|
||||
let
|
||||
isPrivate = lib.hasInfix config.custom.services.tailscale.domain url;
|
||||
deducedGroup = if isPrivate then "Private" else "Public";
|
||||
in
|
||||
{
|
||||
inherit name group url;
|
||||
inherit name url;
|
||||
group = if group == null then deducedGroup else group;
|
||||
interval = "30s";
|
||||
alerts = [ { type = "ntfy"; } ];
|
||||
ssh = lib.mkIf (lib.hasPrefix "ssh" url) {
|
||||
|
|
|
|||
|
|
@ -81,7 +81,6 @@ in
|
|||
environment.shellAliases.hedgedoc-manage-users = "sudo --user=${user} ${manage_users}";
|
||||
|
||||
custom.services.gatus.endpoints."Hedgedoc" = {
|
||||
group = "Public";
|
||||
url = "https://${cfg.domain}/_health";
|
||||
extraConditions = [ "[BODY].ready == true" ];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ in
|
|||
};
|
||||
|
||||
custom.services.gatus.endpoints."IT Tools" = {
|
||||
group = "Public";
|
||||
url = "https://${cfg.domain}/health";
|
||||
extraConditions = [ "[BODY] == OK" ];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -74,7 +74,6 @@ in
|
|||
};
|
||||
|
||||
custom.services.gatus.endpoints."Nextcloud" = {
|
||||
group = "Private";
|
||||
url = "https://${cfg.domain}/status.php";
|
||||
extraConditions = [
|
||||
"[BODY].installed == true"
|
||||
|
|
|
|||
|
|
@ -99,12 +99,8 @@ in
|
|||
};
|
||||
|
||||
custom.services.gatus.endpoints = lib.mkIf cfg.isServer {
|
||||
"Syncthing" = {
|
||||
group = "Private";
|
||||
url = "tcp://${config.networking.hostName}.${tailscaleCfg.domain}:22000";
|
||||
};
|
||||
"Syncthing".url = "tcp://${config.networking.hostName}.${tailscaleCfg.domain}:22000";
|
||||
"Syncthing GUI" = {
|
||||
group = "Private";
|
||||
url = "https://${cfg.gui.domain}/rest/noauth/health";
|
||||
extraConditions = [ "[BODY].status == OK" ];
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue