diff --git a/nix/modules/monitoring/default.nix b/nix/modules/monitoring/default.nix index 49267ed..bc9099b 100644 --- a/nix/modules/monitoring/default.nix +++ b/nix/modules/monitoring/default.nix @@ -58,6 +58,20 @@ in settings = { web.port = 4242; endpoints = import ./gatus-endpoints.nix; + + alerting.email = { + from = "gatus@kun.is"; + host = "mail.smtp2go.com"; + port = 2525; + to = "pim@kunis.nl"; + client.insecure = true; + default-alert = { + enabled = true; + failure-threshold = 2; + success-threshold = 1; + send-on-resolved = true; + }; + }; }; }; }; diff --git a/nix/modules/monitoring/gatus-endpoints.nix b/nix/modules/monitoring/gatus-endpoints.nix index 3aae24d..92a7f66 100644 --- a/nix/modules/monitoring/gatus-endpoints.nix +++ b/nix/modules/monitoring/gatus-endpoints.nix @@ -20,7 +20,7 @@ let "[BODY].installed == true" "[BODY].maintenance == false" "[BODY].needsDbUpgrade == false" - (maxResponseTime 750) + (maxResponseTime 1000) ]; } { @@ -184,4 +184,9 @@ let } ]; in -map (endpoint: endpoint // { interval = "5m"; }) endpoints +map + (endpoint: endpoint // { + interval = "5m"; + alerts = [{ type = "email"; }]; + }) + endpoints diff --git a/nix/modules/networking/dmz_services/zones/kun.is.nix b/nix/modules/networking/dmz_services/zones/kun.is.nix index a527c96..a13c443 100644 --- a/nix/modules/networking/dmz_services/zones/kun.is.nix +++ b/nix/modules/networking/dmz_services/zones/kun.is.nix @@ -21,6 +21,10 @@ in (mx.mx 10 "mail.kun.is.") ]; + TXT = [ + (with spf; soft [ "include:spf.glasnet.nl" ]) + ]; + subdomains = { "*" = { A = [ cfg.public.ipv4.router ]; @@ -60,17 +64,17 @@ in AAAA = [ cfg.dmz.ipv6.router ]; }; -#for SMTP2GO to be able send emails from kun.is domain + #for SMTP2GO to be able send emails from kun.is domain em670271 = { - CNAME = ["return.smtp2go.net."]; + CNAME = [ "return.smtp2go.net." ]; }; "s670271._domainkey" = { - CNAME = ["dkim.smtp2go.net."]; + CNAME = [ "dkim.smtp2go.net." ]; }; link = { - CNAME = ["track.smtp2go.net."]; + CNAME = [ "track.smtp2go.net." ]; }; };