zones: resolve enthalpy addresses temporarily

This commit is contained in:
Lu Wang 2024-12-16 22:46:41 +08:00
parent c615e72739
commit acc70f889e
Signed by: rebmit
SSH key fingerprint: SHA256:3px8QV1zEerIrEWHaqtH5rR9kjetyRST5EipOPrd+bU
2 changed files with 25 additions and 11 deletions

View file

@ -12,6 +12,7 @@
ethtool ethtool
ipcalc ipcalc
iperf3 iperf3
knot-dns
nmap nmap
rsync rsync
socat socat

View file

@ -2,7 +2,9 @@
with dns.lib.combinators; with dns.lib.combinators;
let let
common = import ./common.nix; common = import ./common.nix;
hosts = lib.filterAttrs (_name: value: value.endpoints != [ ]) common.hosts; inherit (common) hosts;
publicHosts = lib.filterAttrs (_name: value: value.endpoints != [ ]) hosts;
enthalpyHosts = lib.filterAttrs (_name: value: value.enthalpy_node_address != null) hosts;
in in
dns.lib.toString "rebmit.link" { dns.lib.toString "rebmit.link" {
inherit (common) inherit (common)
@ -10,16 +12,27 @@ dns.lib.toString "rebmit.link" {
SOA SOA
NS NS
; ;
subdomains = builtins.mapAttrs (_name: value: { subdomains = lib.listToAttrs (
A = value.endpoints_v4; lib.mapAttrsToList (
AAAA = value.endpoints_v6; name: value:
HTTPS = [ lib.nameValuePair name {
{ A = value.endpoints_v4;
alpn = [ AAAA = value.endpoints_v6;
"h3" HTTPS = [
"h2" {
alpn = [
"h3"
"h2"
];
}
]; ];
} }
]; ) publicHosts
}) hosts; ++ lib.mapAttrsToList (
name: value:
lib.nameValuePair "${name}.enta" {
AAAA = [ value.enthalpy_node_address ];
}
) enthalpyHosts
);
} }