feat(dns): IPv4 for rescue01 #80

Merged
mdebray merged 1 commit from dns_for_rescue01 into main 2024-04-03 21:20:56 +02:00
3 changed files with 28 additions and 6 deletions

View file

@ -10,7 +10,22 @@ let
mkCNAME = host: { CNAME = [ host ]; }; mkCNAME = host: { CNAME = [ host ]; };
mkHosted = server: mapSingleFuse (_: mkCNAME "${server}.${meta.nodes.${server}.site}.infra"); mkHosted =

J'avoue que je vois pas l'intérêt de getLastDomain puisque c'est utilisé uniquement dans mkHosted qui n'est utilisé que sur hosted, si tu gardes juste rescue01 = [ "status" ] à la place de "web.rescue01" = [ "status" ] ça fait exactement pareil

J'avoue que je vois pas l'intérêt de `getLastDomain` puisque c'est utilisé uniquement dans `mkHosted` qui n'est utilisé que sur `hosted`, si tu gardes juste `rescue01 = [ "status" ]` à la place de `"web.rescue01" = [ "status" ]` ça fait exactement pareil

Il me semble que non parce que là j'ai

web.rescue01.hyp01.infra IN A
web.rescue01.hyp01.infra IN AAAA
rescue01.hyp01.infra IN AAAA

alors que ce que tu proposes

rescue01.hyp01.infra IN A
rescue01.hyp01.infra IN AAAA

Mon design permet de dissocier les trucs qui seront du HTTP (donc accessible en v4) des protocoles non http (SSH par ex) qui sont v6 only

Il me semble que non parce que là j'ai ``` web.rescue01.hyp01.infra IN A web.rescue01.hyp01.infra IN AAAA rescue01.hyp01.infra IN AAAA ``` alors que ce que tu proposes ``` rescue01.hyp01.infra IN A rescue01.hyp01.infra IN AAAA ``` Mon design permet de dissocier les trucs qui seront du HTTP (donc accessible en v4) des protocoles non http (SSH par ex) qui sont v6 only
server:
{
dual ? [ ],
v4 ? [ ],
v6 ? [ ],
}:
let
base = "${server}.${meta.nodes.${server}.site}.infra";
mkHost = host: mapSingleFuse (_: mkCNAME host);
in
fuseAttrs [
(mkHost base dual)
mdebray marked this conversation as resolved Outdated

Je pense que cette version est plus lisible

  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)
    ];
Je pense que cette version est plus lisible ``` 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) ]; ```
(mkHost "v4.${base}" v4)
(mkHost "v6.${base}" v6)
];
cnames = builtins.mapAttrs (_: to: { CNAME = [ to ]; }) { cnames = builtins.mapAttrs (_: to: { CNAME = [ to ]; }) {
"dev" = "dev.pages.codeberg.page."; "dev" = "dev.pages.codeberg.page.";
@ -27,7 +42,7 @@ let
hosted = fuseAttrs ( hosted = fuseAttrs (
builtins.attrValues ( builtins.attrValues (
builtins.mapAttrs mkHosted { builtins.mapAttrs mkHosted {
compute01 = [ compute01.dual = [
"arkheon" # Arkheon "arkheon" # Arkheon
"cloud" # Nextcloud "cloud" # Nextcloud
"code" # Collabora Online "code" # Collabora Online
@ -44,9 +59,7 @@ let
"telegraf" # Telegraf "telegraf" # Telegraf
]; ];
rescue01 = [ "status" ]; storage01.dual = [
storage01 = [
"cachix" # Attic "cachix" # Attic
"git" # Forgejo "git" # Forgejo
"influx" # InfluxDB "influx" # InfluxDB
@ -61,7 +74,9 @@ let
"s3" "s3"
]; ];
web01 = [ rescue01.dual = [ "status" ];
web01.dual = [
"*.wp" # Wordpress "*.wp" # Wordpress
"analytics" # Plausible Analytics "analytics" # Plausible Analytics
"calendrier" # Metis "calendrier" # Metis
@ -166,6 +181,10 @@ in
{ {
A = ipv4; A = ipv4;
AAAA = ipv6; AAAA = ipv6;
subdomains = {
v4.A = ipv4;
v6.AAAA = ipv6;
};
} }
) )
) meta.nodes; ) meta.nodes;

View file

@ -172,5 +172,6 @@
}; };
}; };
hostId = "007f0200"; hostId = "007f0200";
addresses.ipv4 = [ "82.67.34.230" ];
}; };
} }

View file

@ -74,6 +74,8 @@
rescue01 = { rescue01 = {
site = "luj01"; site = "luj01";
deployment.targetHost = "v6.rescue01.luj01.infra.dgnum.eu";
stateVersion = "23.11"; stateVersion = "23.11";
vm-cluster = "Hyperviseur Luj"; vm-cluster = "Hyperviseur Luj";
}; };