prometheus: format
This commit is contained in:
parent
4f8e8119b8
commit
93d428d98d
|
@ -111,33 +111,35 @@
|
|||
webExternalUrl = "https://prometheus.serv.zentralwerk.org/";
|
||||
};
|
||||
|
||||
services.alert2muc = {
|
||||
services = {
|
||||
alert2muc = {
|
||||
enable = true;
|
||||
configFile = config.sops.secrets."alert2muc/config".path;
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
nginx = {
|
||||
enable = true;
|
||||
|
||||
virtualHosts."prometheus.serv.zentralwerk.org" = {
|
||||
# serverAliases = [ "registry.serv.zentralwerk.org" ];
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
locations = {
|
||||
"/" = {
|
||||
proxyPass = "http://localhost:${toString config.services.prometheus.port}";
|
||||
extraConfig = ''
|
||||
auth_basic "Prometheus";
|
||||
auth_basic_user_file ${config.sops.secrets."nginx/httpAuth".path};
|
||||
'';
|
||||
};
|
||||
locations."/alertmanager" = {
|
||||
"/alertmanager" = {
|
||||
proxyPass = "http://localhost:${toString config.services.prometheus.alertmanager.port}";
|
||||
extraConfig = ''
|
||||
auth_basic "Prometheus";
|
||||
auth_basic_user_file ${config.sops.secrets."nginx/httpAuth".path};
|
||||
'';
|
||||
};
|
||||
locations."/alert2muc" = {
|
||||
"/alert2muc" = {
|
||||
proxyPass = "http://localhost:9022";
|
||||
extraConfig = ''
|
||||
rewrite ^/alert2muc/(.*) /$1 break;
|
||||
|
@ -145,12 +147,16 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sops = {
|
||||
defaultSopsFile = ./secrets.yaml;
|
||||
secrets."nginx/httpAuth".owner = config.systemd.services.nginx.serviceConfig.User;
|
||||
secrets."alertmanager/xmpp-password".owner = config.systemd.services.prometheus-xmpp-alerts.serviceConfig.User;
|
||||
secrets."alert2muc/config".owner = config.services.alert2muc.user;
|
||||
secrets = {
|
||||
"nginx/httpAuth".owner = config.systemd.services.nginx.serviceConfig.User;
|
||||
"alertmanager/xmpp-password".owner = config.systemd.services.prometheus-xmpp-alerts.serviceConfig.User;
|
||||
"alert2muc/config".owner = config.services.alert2muc.user;
|
||||
};
|
||||
};
|
||||
|
||||
system.stateVersion = "22.11";
|
||||
|
|
Loading…
Reference in New Issue