diff options
Diffstat (limited to '')
| -rw-r--r-- | zones/b-peetz.de/zone.nix | 104 | ||||
| -rw-r--r-- | zones/default.nix | 42 | ||||
| -rw-r--r-- | zones/j-schoeffel.de/zone.nix | 115 | ||||
| -rw-r--r-- | zones/jaki-schoeffel.de/zone.nix | 115 | ||||
| -rw-r--r-- | zones/jaki.li/zone.nix | 115 | ||||
| -rw-r--r-- | zones/vhack.eu/zone.nix | 38 |
6 files changed, 516 insertions, 13 deletions
diff --git a/zones/b-peetz.de/zone.nix b/zones/b-peetz.de/zone.nix new file mode 100644 index 0000000..1b15b24 --- /dev/null +++ b/zones/b-peetz.de/zone.nix @@ -0,0 +1,104 @@ +{mkSerial, ...}: { + SOA = { + nameServer = "name-server1.vhack.eu."; + adminEmail = "dns-admin@foss-syndicate.org"; + # NOTE(@bpeetz): ALWAYS change the serial number, when you change something in the + # zone file! <2025-04-01> + serial = mkSerial 2026 10 28 01; + }; + useOrigin = false; + + AAAA = [ + "2a03:4000:33:25b::4f4e" + ]; + A = [ + "92.60.38.179" + ]; + + NS = [ + "name-server1.vhack.eu." + "name-server2.vhack.eu." + ]; + + CAA = [ + { + issuerCritical = false; + tag = "issue"; + value = "letsencrypt.org"; + } + ]; + + # Mail section {{{ + MX = [ + { + preference = 10; + exchange = "mail.foss-syndicate.org."; + } + ]; + + # https://www.rfc-editor.org/rfc/rfc7208.html + TXT = [ + (builtins.concatStringsSep " " [ + "v=spf1" # The version. + "+mx" # Allow mail from this domain MX record. + "-all" # Reject all other emails if the previous mechanism did not match. + ]) + ]; + + # https://www.rfc-editor.org/rfc/rfc6376.html#section-3.6.1 + # https://www.rfc-editor.org/rfc/rfc6376.html#section-7.5 + DKIM = [ + { + selector = "mail"; + k = "ed25519"; + p = "U0eOxgLD3yK7PKzQRSZdJ3EH/UwVxPeYmfm42gYXsDg="; + s = ["email"]; + t = ["s"]; + } + ]; + + # https://www.rfc-editor.org/rfc/rfc7489.html#section-6.3 + DMARC = [ + { + adkim = "strict"; + aspf = "strict"; + fo = [ + "0" + "1" + "d" + "s" + ]; + p = "reject"; + rua = "admin@foss-syndicate.org"; + ruf = ["admin@foss-syndicate.org"]; + } + ]; + + # https://www.rfc-editor.org/rfc/rfc2782.txt + SRV = [ + { + service = "imaps"; + proto = "tcp"; + priority = 0; + weight = 1; + port = 993; + target = "mail.foss-syndicate.org."; + } + { + service = "pop3s"; + proto = "tcp"; + priority = 0; + weight = 1; + port = 995; + target = "mail.foss-snydicate.org."; + } + { + service = "smtps"; + proto = "tcp"; + priority = 0; + weight = 1; + port = 465; + target = "mail.foss-syndicate.org."; + } + ]; +} diff --git a/zones/default.nix b/zones/default.nix index cde6def..5b91623 100644 --- a/zones/default.nix +++ b/zones/default.nix @@ -1,3 +1,41 @@ -{...}: { - "vhack.eu" = import ./vhack.eu/zone.nix {}; +{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 { + "b-peetz.de" = import ./b-peetz.de/zone.nix {inherit mkSerial;}; + "j-schoeffel.de" = import ./j-schoeffel.de/zone.nix {inherit mkSerial;}; + "jaki-schoeffel.de" = import ./jaki-schoeffel.de/zone.nix {inherit mkSerial;}; + "jaki.li" = import ./jaki.li/zone.nix {inherit mkSerial;}; + "vhack.eu" = import ./vhack.eu/zone.nix {inherit mkSerial;}; } diff --git a/zones/j-schoeffel.de/zone.nix b/zones/j-schoeffel.de/zone.nix new file mode 100644 index 0000000..655f937 --- /dev/null +++ b/zones/j-schoeffel.de/zone.nix @@ -0,0 +1,115 @@ +{mkSerial, ...}: { + SOA = { + nameServer = "name-server1.j-schoeffel.de."; + adminEmail = "dns-admin@foss-syndicate.org"; + # NOTE(@bpeetz): ALWAYS change the serial number, when you change something in the + # zone file! <2025-04-01> + serial = mkSerial 2026 08 14 01; + }; + useOrigin = false; + + # NOTE: matrix/mastodon need to have the point from `vhack.eu` to their IP <2025-03-10> + A = [ + "92.60.38.179" + ]; + AAAA = [ + "2a03:4000:33:25b::4f4e" + ]; + + NS = [ + "name-server1.j-schoeffel.de." + "name-server2.j-schoeffel.de." + ]; + + CAA = [ + { + issuerCritical = false; + tag = "issue"; + value = "letsencrypt.org"; + } + ]; + + # Mail section {{{ + MX = [ + # { + # preference = 10; + # exchange = "mail.vhack.eu."; + # } + { + preference = 10; + exchange = "mail.foss-syndicate.org."; + } + ]; + + # https://www.rfc-editor.org/rfc/rfc7208.html + TXT = [ + (builtins.concatStringsSep " " [ + "v=spf1" # The version. + "+mx" # Allow mail from this domain MX record. + "-all" # Reject all other emails if the previous mechanism did not match. + ]) + ]; + + # https://www.rfc-editor.org/rfc/rfc6376.html#section-3.6.1 + # https://www.rfc-editor.org/rfc/rfc6376.html#section-7.5 + DKIM = [ + { + selector = "mail"; + k = "ed25519"; + p = "U0eOxgLD3yK7PKzQRSZdJ3EH/UwVxPeYmfm42gYXsDg="; + s = ["email"]; + t = ["s"]; + } + ]; + + # https://www.rfc-editor.org/rfc/rfc7489.html#section-6.3 + DMARC = [ + { + adkim = "strict"; + aspf = "strict"; + fo = [ + "0" + "1" + "d" + "s" + ]; + p = "reject"; + rua = "admin@foss-syndicate.org"; + ruf = ["admin@foss-syndicate.org"]; + } + ]; + + # https://www.rfc-editor.org/rfc/rfc2782.txt + SRV = [ + { + service = "imaps"; + proto = "tcp"; + priority = 0; + weight = 1; + port = 993; + target = "mail.foss-syndicate.org."; + } + { + service = "pop3s"; + proto = "tcp"; + priority = 0; + weight = 1; + port = 995; + target = "mail.foss-snydicate.org."; + } + { + service = "smtps"; + proto = "tcp"; + priority = 0; + weight = 1; + port = 465; + target = "mail.foss-syndicate.org."; + } + ]; + # }}} + + subdomains = { + name-server1.CNAME = ["server2.vhack.eu."]; + name-server2.CNAME = ["server3.vhack.eu."]; + }; +} diff --git a/zones/jaki-schoeffel.de/zone.nix b/zones/jaki-schoeffel.de/zone.nix new file mode 100644 index 0000000..94830e0 --- /dev/null +++ b/zones/jaki-schoeffel.de/zone.nix @@ -0,0 +1,115 @@ +{mkSerial, ...}: { + SOA = { + nameServer = "name-server1.jaki-schoeffel.de."; + adminEmail = "dns-admin@foss-syndicate.org"; + # NOTE(@bpeetz): ALWAYS change the serial number, when you change something in the + # zone file! <2025-04-01> + serial = mkSerial 2026 08 14 01; + }; + useOrigin = false; + + # NOTE: matrix/mastodon need to have the point from `vhack.eu` to their IP <2025-03-10> + A = [ + "92.60.38.179" + ]; + AAAA = [ + "2a03:4000:33:25b::4f4e" + ]; + + NS = [ + "name-server1.jaki-schoeffel.de." + "name-server2.jaki-schoeffel.de." + ]; + + CAA = [ + { + issuerCritical = false; + tag = "issue"; + value = "letsencrypt.org"; + } + ]; + + # Mail section {{{ + MX = [ + # { + # preference = 10; + # exchange = "mail.vhack.eu."; + # } + { + preference = 10; + exchange = "mail.foss-syndicate.org."; + } + ]; + + # https://www.rfc-editor.org/rfc/rfc7208.html + TXT = [ + (builtins.concatStringsSep " " [ + "v=spf1" # The version. + "+mx" # Allow mail from this domain MX record. + "-all" # Reject all other emails if the previous mechanism did not match. + ]) + ]; + + # https://www.rfc-editor.org/rfc/rfc6376.html#section-3.6.1 + # https://www.rfc-editor.org/rfc/rfc6376.html#section-7.5 + DKIM = [ + { + selector = "mail"; + k = "ed25519"; + p = "U0eOxgLD3yK7PKzQRSZdJ3EH/UwVxPeYmfm42gYXsDg="; + s = ["email"]; + t = ["s"]; + } + ]; + + # https://www.rfc-editor.org/rfc/rfc7489.html#section-6.3 + DMARC = [ + { + adkim = "strict"; + aspf = "strict"; + fo = [ + "0" + "1" + "d" + "s" + ]; + p = "reject"; + rua = "admin@foss-syndicate.org"; + ruf = ["admin@foss-syndicate.org"]; + } + ]; + + # https://www.rfc-editor.org/rfc/rfc2782.txt + SRV = [ + { + service = "imaps"; + proto = "tcp"; + priority = 0; + weight = 1; + port = 993; + target = "mail.foss-syndicate.org."; + } + { + service = "pop3s"; + proto = "tcp"; + priority = 0; + weight = 1; + port = 995; + target = "mail.foss-snydicate.org."; + } + { + service = "smtps"; + proto = "tcp"; + priority = 0; + weight = 1; + port = 465; + target = "mail.foss-syndicate.org."; + } + ]; + # }}} + + subdomains = { + name-server1.CNAME = ["server2.vhack.eu."]; + name-server2.CNAME = ["server3.vhack.eu."]; + }; +} diff --git a/zones/jaki.li/zone.nix b/zones/jaki.li/zone.nix new file mode 100644 index 0000000..3e55907 --- /dev/null +++ b/zones/jaki.li/zone.nix @@ -0,0 +1,115 @@ +{mkSerial, ...}: { + SOA = { + nameServer = "name-server1.jaki.li."; + adminEmail = "dns-admin@foss-syndicate.org"; + # NOTE(@bpeetz): ALWAYS change the serial number, when you change something in the + # zone file! <2025-04-01> + serial = mkSerial 2026 08 14 02; + }; + useOrigin = false; + + # NOTE: matrix/mastodon need to have the point from `vhack.eu` to their IP <2025-03-10> + A = [ + "92.60.38.179" + ]; + AAAA = [ + "2a03:4000:33:25b::4f4e" + ]; + + NS = [ + "name-server1.jaki.li." + "name-server2.jaki.li." + ]; + + CAA = [ + { + issuerCritical = false; + tag = "issue"; + value = "letsencrypt.org"; + } + ]; + + # Mail section {{{ + MX = [ + # { + # preference = 10; + # exchange = "mail.vhack.eu."; + # } + { + preference = 10; + exchange = "mail.foss-syndicate.org."; + } + ]; + + # https://www.rfc-editor.org/rfc/rfc7208.html + TXT = [ + (builtins.concatStringsSep " " [ + "v=spf1" # The version. + "+mx" # Allow mail from this domain MX record. + "-all" # Reject all other emails if the previous mechanism did not match. + ]) + ]; + + # https://www.rfc-editor.org/rfc/rfc6376.html#section-3.6.1 + # https://www.rfc-editor.org/rfc/rfc6376.html#section-7.5 + DKIM = [ + { + selector = "mail"; + k = "ed25519"; + p = "U0eOxgLD3yK7PKzQRSZdJ3EH/UwVxPeYmfm42gYXsDg="; + s = ["email"]; + t = ["s"]; + } + ]; + + # https://www.rfc-editor.org/rfc/rfc7489.html#section-6.3 + DMARC = [ + { + adkim = "strict"; + aspf = "strict"; + fo = [ + "0" + "1" + "d" + "s" + ]; + p = "reject"; + rua = "admin@foss-syndicate.org"; + ruf = ["admin@foss-syndicate.org"]; + } + ]; + + # https://www.rfc-editor.org/rfc/rfc2782.txt + SRV = [ + { + service = "imaps"; + proto = "tcp"; + priority = 0; + weight = 1; + port = 993; + target = "mail.foss-syndicate.org."; + } + { + service = "pop3s"; + proto = "tcp"; + priority = 0; + weight = 1; + port = 995; + target = "mail.foss-snydicate.org."; + } + { + service = "smtps"; + proto = "tcp"; + priority = 0; + weight = 1; + port = 465; + target = "mail.foss-syndicate.org."; + } + ]; + # }}} + + subdomains = { + name-server1.CNAME = ["server2.vhack.eu."]; + name-server2.CNAME = ["server3.vhack.eu."]; + }; +} diff --git a/zones/vhack.eu/zone.nix b/zones/vhack.eu/zone.nix index 9c261e4..079437c 100644 --- a/zones/vhack.eu/zone.nix +++ b/zones/vhack.eu/zone.nix @@ -1,8 +1,10 @@ -{...}: { +{mkSerial, ...}: { 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 2026 07 19 02; }; useOrigin = false; @@ -29,9 +31,13 @@ # Mail section {{{ MX = [ + # { + # preference = 10; + # exchange = "mail.vhack.eu."; + # } { preference = 10; - exchange = "mail.vhack.eu."; + exchange = "mail.foss-syndicate.org."; } ]; @@ -50,8 +56,8 @@ DKIM = [ { selector = "mail"; - k = "rsa"; - p = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8KXSkQD0ZFk3EetJ1qaoqevvdBoV93dRh5X2GCcc7hWBtLWtj31F3BefgfcrbdACVitdmJcRu7ed8qZMpxZM9pN5TrPMebAkjxMvMH554Wvi1FSwzuPSR724NHPKIgveU8pgiYffks5Mu1ejZmBvlnhXjpbDCEL1reWk+OtmB+QIDAQAB"; + k = "ed25519"; + p = "U0eOxgLD3yK7PKzQRSZdJ3EH/UwVxPeYmfm42gYXsDg="; s = ["email"]; t = ["s"]; } @@ -77,7 +83,7 @@ priority = 0; weight = 1; port = 993; - target = "mail.vhack.eu"; + target = "mail.vhack.eu."; } { service = "pop3s"; @@ -85,7 +91,7 @@ priority = 0; weight = 1; port = 995; - target = "mail.vhack.eu"; + target = "mail.vhack.eu."; } { service = "smtps"; @@ -93,7 +99,7 @@ priority = 0; weight = 1; port = 465; - target = "mail.vhack.eu"; + target = "mail.vhack.eu."; } ]; # }}} @@ -104,7 +110,13 @@ 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."]; + + grafana.CNAME = ["server2.vhack.eu."]; + prometheus-server2.CNAME = ["server2.vhack.eu."]; dav.CNAME = ["server2.vhack.eu."]; etebase.CNAME = ["server2.vhack.eu."]; @@ -112,10 +124,14 @@ invidious-router.CNAME = ["server2.vhack.eu."]; libreddit.CNAME = ["server2.vhack.eu."]; - redlib.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."]; + rocie.CNAME = ["server3.vhack.eu."]; miniflux.CNAME = ["server3.vhack.eu."]; rss.CNAME = ["server3.vhack.eu."]; |
