diff --git a/SwarselSystems.org b/SwarselSystems.org index ff810a67..4b08fabe 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -6592,15 +6592,16 @@ Also, the system state version is set here. No need to touch it. http_addr = "127.0.0.1"; protocol = "https"; domain = "status.swarsel.win"; - root_url = "%(protocol)s://%(domain)s:%(http_port)s/grafana/"; }; }; }; services.prometheus = { + enable = true; webExternalUrl = "https://status.swarsel.win/prometheus"; port = 9090; listenAddress = "127.0.0.1"; + webConfigFile = /../../programs/server/prometheus/web.config; exporters = { zfs = { enable = true; @@ -6620,13 +6621,13 @@ Also, the system state version is set here. No need to touch it. acmeRoot = null; locations = { "/grafana" = { - proxyPass = "http://localhost:3000/grafana/"; + proxyPass = "http://localhost:3000"; extraConfig = '' client_max_body_size 0; ''; }; "/prometheus" = { - proxyPass = "http://localhost:9090/prometheus/"; + proxyPass = "http://localhost:9090"; extraConfig = '' client_max_body_size 0; ''; diff --git a/profiles/server/common/monitoring.nix b/profiles/server/common/monitoring.nix index 9df78bfb..15d80dc6 100644 --- a/profiles/server/common/monitoring.nix +++ b/profiles/server/common/monitoring.nix @@ -21,15 +21,16 @@ http_addr = "127.0.0.1"; protocol = "https"; domain = "status.swarsel.win"; - root_url = "%(protocol)s://%(domain)s:%(http_port)s/grafana/"; }; }; }; services.prometheus = { + enable = true; webExternalUrl = "https://status.swarsel.win/prometheus"; port = 9090; listenAddress = "127.0.0.1"; + webConfigFile = /../../programs/server/prometheus/web.config; exporters = { zfs = { enable = true; @@ -49,13 +50,13 @@ acmeRoot = null; locations = { "/grafana" = { - proxyPass = "http://localhost:3000/grafana/"; + proxyPass = "http://localhost:3000"; extraConfig = '' client_max_body_size 0; ''; }; "/prometheus" = { - proxyPass = "http://localhost:9090/prometheus/"; + proxyPass = "http://localhost:9090"; extraConfig = '' client_max_body_size 0; ''; diff --git a/programs/server/prometheus/web.config b/programs/server/prometheus/web.config new file mode 100644 index 00000000..19d9d313 --- /dev/null +++ b/programs/server/prometheus/web.config @@ -0,0 +1,2 @@ +basic_auth_users: + admin: $2a$12$UFCdK2B67OM.p51ON8eKLOxQ4Ek9jruJPtaLE4Owc4Ukf7jGx//LC