Uptime-Kuma

This commit is contained in:
pazpi 2025-09-14 12:58:21 +02:00
parent c505db0d60
commit b10ea494cb
3 changed files with 26 additions and 3 deletions

View file

@ -118,6 +118,12 @@ in
host = p.hosts.metrics; host = p.hosts.metrics;
}; };
}; };
uptime-kuma.proxy = {
enable = true;
domain = p.domains.public;
host = p.hosts.portainer;
};
}; };
networking = { networking = {

View file

@ -16,6 +16,9 @@ in
commons.enable = true; commons.enable = true;
lxc-standard.enable = true; lxc-standard.enable = true;
}; };
monitoring.uptime-kuma.enable = true;
virtualisation = { virtualisation = {
proxmox.enable = true; proxmox.enable = true;
portainer = { portainer = {

View file

@ -24,6 +24,14 @@ in
''; '';
}; };
subdomain = lib.mkOption {
default = "up";
type = lib.types.str;
description = ''
The subdomain where Prometheus is reachable
'';
};
host = lib.mkOption { host = lib.mkOption {
default = "localhost"; default = "localhost";
type = lib.types.str; type = lib.types.str;
@ -41,17 +49,23 @@ in
services.uptime-kuma = { services.uptime-kuma = {
enable = true; enable = true;
settings = { settings = {
HOST = "::"; HOST = "0.0.0.0";
PORT = toString port; PORT = toString port;
}; };
}; };
systemd.services.uptime-kuma.serviceConfig = {
SupplementaryGroups = "docker";
};
networking.firewall.allowedTCPPorts = [ port ];
}) })
(lib.mkIf cfg.proxy.enable { (lib.mkIf cfg.proxy.enable {
services.caddy = with cfg.proxy; { services.caddy = with cfg.proxy; {
virtualHosts."up.${domain}".extraConfig = '' virtualHosts."${subdomain}.${domain}".extraConfig = ''
reverse_proxy http://${host}:${port} reverse_proxy http://${host}:${toString port}
import cloudflare_${domain} import cloudflare_${domain}
''; '';
}; };