dont generate domains, doesnt work for mon.adm.htw for example

This commit is contained in:
goeranh 2026-04-20 11:52:40 +02:00
parent d435d8d487
commit 5ef710f8f2
No known key found for this signature in database

View file

@ -295,43 +295,43 @@
"127.0.0.1" "127.0.0.1"
]; ];
listenOnIpv6 = [ ]; listenOnIpv6 = [ ];
zones = { # zones = {
"htw.stura-dresden.de" = { # "htw.stura-dresden.de" = {
master = true; # master = true;
file = pkgs.writeText "htw.stura-dresden.de.zone" '' # file = pkgs.writeText "htw.stura-dresden.de.zone" ''
$TTL 3600 # $TTL 3600
@ IN SOA proxy.htw.stura-dresden.de. hostmaster.htw.stura-dresden.de. ( # @ IN SOA proxy.htw.stura-dresden.de. hostmaster.htw.stura-dresden.de. (
2026031301 ; Serial (YYYYMMDDNN) # 2026031301 ; Serial (YYYYMMDDNN)
3600 ; Refresh (1 hour) # 3600 ; Refresh (1 hour)
1800 ; Retry (30 minutes) # 1800 ; Retry (30 minutes)
604800 ; Expire (1 week) # 604800 ; Expire (1 week)
86400 ) ; Minimum TTL (1 day) # 86400 ) ; Minimum TTL (1 day)
#
; Name servers # ; Name servers
@ IN NS proxy.htw.stura-dresden.de. # @ IN NS proxy.htw.stura-dresden.de.
#
; Proxy host - main IPv4 gateway # ; Proxy host - main IPv4 gateway
proxy IN A 141.56.51.1 # proxy IN A 141.56.51.1
proxy IN AAAA 2a01:4f8:1c19:96f8::1 # proxy IN AAAA 2a01:4f8:1c19:96f8::1
#
; Auto-generated CNAME records for all subdomains pointing to proxy # ; Auto-generated CNAME records for all subdomains pointing to proxy
${lib.foldlAttrs ( # ${lib.foldlAttrs (
prev: name: value: # prev: name: value:
let # let
zoneSuffix = ".htw.stura-dresden.de"; # zoneSuffix = ".htw.stura-dresden.de";
# Check if this domain belongs to our zone # # Check if this domain belongs to our zone
isInZone = lib.hasSuffix zoneSuffix value.domain; # isInZone = lib.hasSuffix zoneSuffix value.domain;
# Extract subdomain by removing the zone suffix # # Extract subdomain by removing the zone suffix
subdomain = lib.removeSuffix zoneSuffix value.domain; # subdomain = lib.removeSuffix zoneSuffix value.domain;
in # in
if isInZone && subdomain != "" && subdomain != "htw.stura-dresden.de" then # if isInZone && subdomain != "" && subdomain != "htw.stura-dresden.de" then
prev + "${subdomain}${" "}IN${" "}CNAME${" "}proxy.htw.stura-dresden.de.\n" # prev + "${subdomain}${" "}IN${" "}CNAME${" "}proxy.htw.stura-dresden.de.\n"
else # else
prev # prev
) "" forwards} # ) "" forwards}
''; # '';
}; # };
}; # };
}; };
# Chrony NTP server for the internal network # Chrony NTP server for the internal network