From 92c2ff4521d79b8286bc8b31b6ac7263b3915d0d Mon Sep 17 00:00:00 2001 From: sinavir Date: Fri, 29 Mar 2024 11:41:13 +0100 Subject: [PATCH] feat(dns): IPv4 for rescue01 --- meta/dns.nix | 31 +++++++++++++++++++++++++------ meta/network.nix | 1 + meta/nodes.nix | 2 ++ 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/meta/dns.nix b/meta/dns.nix index e68ac7f..cbae7a3 100644 --- a/meta/dns.nix +++ b/meta/dns.nix @@ -10,7 +10,22 @@ let mkCNAME = host: { CNAME = [ host ]; }; - mkHosted = server: mapSingleFuse (_: mkCNAME "${server}.${meta.nodes.${server}.site}.infra"); + mkHosted = + server: + { + dual ? [ ], + v4 ? [ ], + v6 ? [ ], + }: + let + base = "${server}.${meta.nodes.${server}.site}.infra"; + mkHost = host: mapSingleFuse (_: mkCNAME host); + in + fuseAttrs [ + (mkHost base dual) + (mkHost "v4.${base}" v4) + (mkHost "v6.${base}" v6) + ]; cnames = builtins.mapAttrs (_: to: { CNAME = [ to ]; }) { "dev" = "dev.pages.codeberg.page."; @@ -27,7 +42,7 @@ let hosted = fuseAttrs ( builtins.attrValues ( builtins.mapAttrs mkHosted { - compute01 = [ + compute01.dual = [ "arkheon" # Arkheon "cloud" # Nextcloud "code" # Collabora Online @@ -44,9 +59,7 @@ let "telegraf" # Telegraf ]; - rescue01 = [ "status" ]; - - storage01 = [ + storage01.dual = [ "cachix" # Attic "git" # Forgejo "influx" # InfluxDB @@ -61,7 +74,9 @@ let "s3" ]; - web01 = [ + rescue01.dual = [ "status" ]; + + web01.dual = [ "*.wp" # Wordpress "analytics" # Plausible Analytics "calendrier" # Metis @@ -166,6 +181,10 @@ in { A = ipv4; AAAA = ipv6; + subdomains = { + v4.A = ipv4; + v6.AAAA = ipv6; + }; } ) ) meta.nodes; diff --git a/meta/network.nix b/meta/network.nix index 70e0222..c57223a 100644 --- a/meta/network.nix +++ b/meta/network.nix @@ -172,5 +172,6 @@ }; }; hostId = "007f0200"; + addresses.ipv4 = [ "82.67.34.230" ]; }; } diff --git a/meta/nodes.nix b/meta/nodes.nix index 7cd7b10..70b4877 100644 --- a/meta/nodes.nix +++ b/meta/nodes.nix @@ -74,6 +74,8 @@ rescue01 = { site = "luj01"; + deployment.targetHost = "v6.rescue01.luj01.infra.dgnum.eu"; + stateVersion = "23.11"; vm-cluster = "Hyperviseur Luj"; };