diff options
Diffstat (limited to '')
-rw-r--r-- | zones/default.nix | 4 | ||||
-rw-r--r-- | zones/vhack.eu/zone.nix | 66 |
2 files changed, 58 insertions, 12 deletions
diff --git a/zones/default.nix b/zones/default.nix index cde6def..babb531 100644 --- a/zones/default.nix +++ b/zones/default.nix @@ -1,3 +1,3 @@ -{...}: { - "vhack.eu" = import ./vhack.eu/zone.nix {}; +{lib, ...}: { + "vhack.eu" = import ./vhack.eu/zone.nix {inherit lib;}; } diff --git a/zones/vhack.eu/zone.nix b/zones/vhack.eu/zone.nix index 9c261e4..070b58a 100644 --- a/zones/vhack.eu/zone.nix +++ b/zones/vhack.eu/zone.nix @@ -1,8 +1,44 @@ -{...}: { +{lib, ...}: let + /* + Computes a reasonable value for the DNS serial number from the date of last change + and the iteration of that day. + + # Type + + mkSerial :: Number -> Number -> Number -> Number -> Number + + # Arguments + + year + : The year of the last change in the format YYYY. + + month + : The month of the last change in the format MM. + + day + : The day of the last change in the format DD. + + iteration + : The number of change on that day. The format should be CC (assuming there are less + than 100 changes happening on a day) . + + # Examples + + mkSerial 2025 04 01 01 + => 2025040101 + */ + mkSerial = year: month: day: iteration: let + n2 = lib.strings.fixedWidthNumber 2; + n4 = lib.strings.fixedWidthNumber 4; + in + lib.strings.toIntBase10 "${n4 year}${n2 month}${n2 day}${n2 iteration}"; +in { SOA = { - nameServer = "name-server.foss-syndicate.org."; + nameServer = "name-server1.vhack.eu."; adminEmail = "dns-admin@foss-syndicate.org"; - serial = 2025031001; + # NOTE(@bpeetz): ALWAYS change the serial number, when you change something in the + # zone file! <2025-04-01> + serial = mkSerial 2025 06 11 01; }; useOrigin = false; @@ -29,9 +65,13 @@ # Mail section {{{ MX = [ + # { + # preference = 10; + # exchange = "mail.vhack.eu."; + # } { preference = 10; - exchange = "mail.vhack.eu."; + exchange = "mail.foss-syndicate.org."; } ]; @@ -50,8 +90,8 @@ DKIM = [ { selector = "mail"; - k = "rsa"; - p = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8KXSkQD0ZFk3EetJ1qaoqevvdBoV93dRh5X2GCcc7hWBtLWtj31F3BefgfcrbdACVitdmJcRu7ed8qZMpxZM9pN5TrPMebAkjxMvMH554Wvi1FSwzuPSR724NHPKIgveU8pgiYffks5Mu1ejZmBvlnhXjpbDCEL1reWk+OtmB+QIDAQAB"; + k = "ed25519"; + p = "U0eOxgLD3yK7PKzQRSZdJ3EH/UwVxPeYmfm42gYXsDg="; s = ["email"]; t = ["s"]; } @@ -77,7 +117,7 @@ priority = 0; weight = 1; port = 993; - target = "mail.vhack.eu"; + target = "mail.vhack.eu."; } { service = "pop3s"; @@ -85,7 +125,7 @@ priority = 0; weight = 1; port = 995; - target = "mail.vhack.eu"; + target = "mail.vhack.eu."; } { service = "smtps"; @@ -93,7 +133,7 @@ priority = 0; weight = 1; port = 465; - target = "mail.vhack.eu"; + target = "mail.vhack.eu."; } ]; # }}} @@ -104,7 +144,10 @@ source.CNAME = ["server2.vhack.eu."]; - mail.CNAME = ["server2.vhack.eu."]; + mail.CNAME = ["server3.vhack.eu."]; + + taskchampion.CNAME = ["server2.vhack.eu."]; + atuin-sync.CNAME = ["server2.vhack.eu."]; dav.CNAME = ["server2.vhack.eu."]; etebase.CNAME = ["server2.vhack.eu."]; @@ -114,6 +157,9 @@ libreddit.CNAME = ["server2.vhack.eu."]; redlib.CNAME = ["server2.vhack.eu."]; + nextcloud.CNAME = ["server2.vhack.eu."]; + sharkey.CNAME = ["server2.vhack.eu."]; + mastodon.CNAME = ["server3.vhack.eu."]; matrix.CNAME = ["server3.vhack.eu."]; |