From e52324209f14618fd8de2b5f387e996b18cd617b Mon Sep 17 00:00:00 2001 From: teutat3s Date: Wed, 15 May 2024 17:15:46 +0200 Subject: [PATCH] alertmanager: fix SMTP secret --- modules/grafana/default.nix | 1 - modules/prometheus/default.nix | 11 +++++--- secrets/alertmanager-envfile.age | 43 ++++++++++++++++++++++++++++++++ secrets/secrets.nix | 1 + 4 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 secrets/alertmanager-envfile.age diff --git a/modules/grafana/default.nix b/modules/grafana/default.nix index 624caf3..1080a1d 100644 --- a/modules/grafana/default.nix +++ b/modules/grafana/default.nix @@ -15,7 +15,6 @@ file = "${flake.self}/secrets/grafana-smtp-password.age"; mode = "440"; owner = "grafana"; - group = "prometheus"; }; age.secrets.grafana-keycloak-client-secret = { file = "${flake.self}/secrets/grafana-keycloak-client-secret.age"; diff --git a/modules/prometheus/default.nix b/modules/prometheus/default.nix index b1f8fdd..f77081a 100644 --- a/modules/prometheus/default.nix +++ b/modules/prometheus/default.nix @@ -11,6 +11,11 @@ mode = "600"; owner = "prometheus"; }; + age.secrets.alertmanager-envfile = { + file = "${flake.self}/secrets/alertmanager-envfile.age"; + mode = "600"; + owner = "alertmanager"; + }; services.caddy.virtualHosts."alerts.${config.pub-solar-os.networking.domain}" = { logFormat = lib.mkForce '' @@ -104,7 +109,7 @@ enable = true; # port = 9093; # Default webExternalUrl = "https://alerts.pub.solar"; - # environmentFile = "${config.age.secrets.nachtigall-alertmanager-envfile.path}"; + environmentFile = "${config.age.secrets.alertmanager-envfile.path}"; configuration = { route = { @@ -126,8 +131,8 @@ from = "alerts@pub.solar"; smarthost = "mail.greenbaum.zone:465"; auth_username = "admins@pub.solar"; - auth_password_file = "${config.age.secrets.grafana-smtp-password.path}"; - require_tls = true; + auth_password = "$SMTP_AUTH_PASSWORD"; + require_tls = false; } ]; # TODO: diff --git a/secrets/alertmanager-envfile.age b/secrets/alertmanager-envfile.age new file mode 100644 index 0000000..17191dc --- /dev/null +++ b/secr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1usiLtWxAPQE +F9uhFyCPK46kIy+ud4V5/ESacQgc9R0JV+JTEZO6nBI +-> ssh-ed25519 +3V2lQ G4yT1e7B5O2Gy6tusRMxuWOFScynWfFY5AjrJvxMK1o +n1OVFRqzijWlc+B93cBNdFPz+8CBYOsI5hpF1wz7xr0 +--- 61u55uUc7z59iHF1IeyBLmcR6u7STUhpOPb/ODf75Vc +<$kxp H:}*/T$bJ \F*Wz6 <̹>e?񼐟6ڵ~! \ No newline at end of file diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 94a3b11..36202b5 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -60,6 +60,7 @@ in "grafana-keycloak-client-secret.age".publicKeys = flora6Keys ++ adminKeys; "grafana-smtp-password.age".publicKeys = flora6Keys ++ adminKeys; + "alertmanager-envfile.age".publicKeys = flora6Keys ++ adminKeys; "nachtigall-metrics-nginx-basic-auth.age".publicKeys = nachtigallKeys ++ adminKeys; "nachtigall-metrics-prometheus-basic-auth-password.age".publicKeys = flora6Keys ++ nachtigallKeys ++ adminKeys;