diff --git a/hosts/cube/grafana.nix b/hosts/cube/grafana.nix index 8639097..ccf1da4 100644 --- a/hosts/cube/grafana.nix +++ b/hosts/cube/grafana.nix @@ -5,7 +5,7 @@ let fqdn = "metrics.${domain}"; in serverSystemConfiguration { - age.secrets."cube.mail.password.grafana" = { + age.secrets."cube.grafana.password" = { owner = "grafana"; group = "grafana"; }; @@ -27,7 +27,7 @@ in serverSystemConfiguration { settings.security = { admin_email = "metrics@${domain}"; - admin_password = "$__file{${config.age.secrets."cube.mail.password.grafana".path}}"; + admin_password = "$__file{${config.age.secrets."cube.grafana.password".path}}"; }; }; diff --git a/hosts/cube/mail.nix b/hosts/cube/mail.nix index 15dd34e..102c430 100644 --- a/hosts/cube/mail.nix +++ b/hosts/cube/mail.nix @@ -5,46 +5,17 @@ let fqdn = "mail.${domain}"; in serverSystemConfiguration { - age.secrets."cube.mail.password.dmarc" = { - owner = "dmarc-exporter"; - group = "dmarc-exporter"; - }; - - services.prometheus.exporters = { - dmarc = enabled { - imap.host = domain; - imap.passwordFile = config.age.secrets."cube.mail.password.dmarc".path; - imap.username = "contact@${domain}"; - - listenAddress = "::"; - port = 9020; - }; - - dovecot = enabled { - port = 9021; - socketPath = "/var/run/dovecot2/old-stats"; - user = "root"; - }; - - postfix = enabled { - port = 9022; - }; - - rspamd = enabled { - port = 9023; - }; + services.prometheus.exporters.postfix = enabled { + port = 9020; }; services.prometheus.scrapeConfigs = [{ job_name = "mail"; static_configs = [{ - labels.job = "mail"; + labels.job = "postfix"; targets = [ - "[::]:${toString config.services.prometheus.exporters.dmarc.port}" - "[::]:${toString config.services.prometheus.exporters.dovecot.port}" "[::]:${toString config.services.prometheus.exporters.postfix.port}" - "[::]:${toString config.services.prometheus.exporters.rspamd.port}" ]; }]; }]; diff --git a/secrets/cube.mail.password.dmarc.age b/secrets/cube.grafana.password.age similarity index 100% rename from secrets/cube.mail.password.dmarc.age rename to secrets/cube.grafana.password.age diff --git a/secrets/cube.mail.password.grafana.age b/secrets/cube.mail.password.grafana.age deleted file mode 100644 index 8be0058..0000000 --- a/secrets/cube.mail.password.grafana.age +++ /dev/null @@ -1,5 +0,0 @@ -age-encryption.org/v1 --> ssh-ed25519 +rZ0Tw 9dsCOc/hpTof2yjqGKzAJozjXnc0RPgnv3pNaccmBAQ -s6+1D/Sn6tuIh3aIbgBHYKTATyGbQKcaKPW+6HvMNFQ ---- pr1ZimpiaA8RO8Oayn6tHJN+rTGSLxcaddmYWpSiWLs -"LPw5& C"\TQDIZdV\d \ No newline at end of file diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 80fc98e..3d3b84c 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -6,8 +6,7 @@ rec { "acme.age".publicKeys = [ keys.cube ]; "cube.id.age".publicKeys = [ keys.rgbcube ]; - "cube.mail.password.dmarc.age".publicKeys = [ keys.cube ]; - "cube.mail.password.grafana.age".publicKeys = [ keys.cube ]; + "cube.grafana.password.age".publicKeys = [ keys.cube ]; "cube.mail.password.hash.age".publicKeys = [ keys.cube ]; "cube.nextcloud.password.age".publicKeys = [ keys.cube ]; "cube.rgb.password.hash.age".publicKeys = [ keys.cube ];