chore(monitoring): clean up hass changes

This commit is contained in:
arcnmx 2024-06-06 12:31:39 -07:00
parent 3991badf2c
commit 409d711175
5 changed files with 36 additions and 54 deletions

View file

@ -3,7 +3,7 @@
lib,
...
}: let
inherit (lib.modules) mkIf mkDefault;
inherit (lib.modules) mkIf mkForce mkDefault;
inherit (config.services) nginx home-assistant;
name.shortServer = mkDefault "home";
listen' = {
@ -81,8 +81,9 @@ in {
};
};
"/api/prometheus" = {
local.denyGlobal = true;
proxy.enable = true;
#proxy.enable = true;
#local.denyGlobal = true;
extraConfig = mkForce "deny all;";
};
};
in {
@ -109,10 +110,11 @@ in {
reverseProxy = {
enable = mkDefault true;
auth = {
enable = mkIf (nginx.virtualHosts.home-assistant.enable && nginx.virtualHosts.home-assistant.vouch.enable) true;
enable = mkIf (nginx.virtualHosts.home-assistant.enable && nginx.virtualHosts.home-assistant.vouch.enable) (mkDefault true);
userHeader = "X-Hass-User";
};
};
config.prometheus.requires_auth = mkDefault false;
};
config.networking.firewall.allowedTCPPorts = let
inherit (nginx.virtualHosts.home-assistant'local) listen';