Uptime-Kuma
This commit is contained in:
parent
c505db0d60
commit
b10ea494cb
3 changed files with 26 additions and 3 deletions
|
|
@ -24,6 +24,14 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
subdomain = lib.mkOption {
|
||||
default = "up";
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
The subdomain where Prometheus is reachable
|
||||
'';
|
||||
};
|
||||
|
||||
host = lib.mkOption {
|
||||
default = "localhost";
|
||||
type = lib.types.str;
|
||||
|
|
@ -41,17 +49,23 @@ in
|
|||
services.uptime-kuma = {
|
||||
enable = true;
|
||||
settings = {
|
||||
HOST = "::";
|
||||
HOST = "0.0.0.0";
|
||||
PORT = toString port;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.uptime-kuma.serviceConfig = {
|
||||
SupplementaryGroups = "docker";
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ port ];
|
||||
|
||||
})
|
||||
|
||||
(lib.mkIf cfg.proxy.enable {
|
||||
services.caddy = with cfg.proxy; {
|
||||
virtualHosts."up.${domain}".extraConfig = ''
|
||||
reverse_proxy http://${host}:${port}
|
||||
virtualHosts."${subdomain}.${domain}".extraConfig = ''
|
||||
reverse_proxy http://${host}:${toString port}
|
||||
import cloudflare_${domain}
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue