Compare commits
2 Commits
793547d0ca
...
a49408c480
Author | SHA1 | Date |
---|---|---|
Sandro - | a49408c480 | |
Sandro - | f308cbb292 |
|
@ -88,6 +88,7 @@ in
|
||||||
{
|
{
|
||||||
id = "dyndns";
|
id = "dyndns";
|
||||||
action = "update";
|
action = "update";
|
||||||
|
key = "dyndns";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
id = "zone_xfr";
|
id = "zone_xfr";
|
||||||
|
@ -177,15 +178,13 @@ in
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
zone = [
|
zone = [ {
|
||||||
{
|
acl = "zone_xfr";
|
||||||
acl = "zone_xfr";
|
catalog-role = "generate";
|
||||||
catalog-role = "generate";
|
domain = "zentralwerk.";
|
||||||
domain = "zentralwerk.";
|
notify = [ "ns1.supersandro.de" ];
|
||||||
notify = [ "ns1.supersandro.de" ];
|
storage = "/var/lib/knot/catalog";
|
||||||
storage = "/var/lib/knot/catalog";
|
} ] ++ map generateZone config.site.dns.localZones;
|
||||||
}
|
|
||||||
] ++ map generateZone config.site.dns.localZones;
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -203,9 +202,7 @@ in
|
||||||
cp ${generateZoneFile zone} /var/lib/knot/zones/${name}.zone
|
cp ${generateZoneFile zone} /var/lib/knot/zones/${name}.zone
|
||||||
chown -R knot /var/lib/knot/zones
|
chown -R knot /var/lib/knot/zones
|
||||||
chmod -R u+rwX /var/lib/knot/zones
|
chmod -R u+rwX /var/lib/knot/zones
|
||||||
'') (
|
'') (builtins.filter ({ dynamic, ... }: dynamic) config.site.dns.localZones)}
|
||||||
builtins.filter ({ dynamic, ... }: dynamic) config.site.dns.localZones
|
|
||||||
)}
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -215,22 +212,18 @@ in
|
||||||
after = [ "knot.service" ];
|
after = [ "knot.service" ];
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
path = [ pkgs.dnsutils ];
|
path = [ pkgs.dnsutils ];
|
||||||
script = ''
|
script = lib.concatMapStrings (zone: ''
|
||||||
${lib.concatMapStrings (zone: ''
|
nsupdate -v -y "hmac-sha256:dyndns:${config.site.dyndnsKey}" <<EOF
|
||||||
nsupdate -v -y "hmac-sha256:dyndns:${config.site.dyndnsKey}" <<EOF
|
server localhost
|
||||||
server localhost
|
|
||||||
|
|
||||||
${lib.concatMapStringsSep "\n" ({ name, type, data }: ''
|
${lib.concatMapStringsSep "\n" ({ name, type, data }: ''
|
||||||
delete ${name}.${zone.name}. IN ${type}
|
delete ${name}.${zone.name}. IN ${type}
|
||||||
add ${name}.${zone.name}. 3600 IN ${type} ${data}
|
add ${name}.${zone.name}. 3600 IN ${type} ${data}
|
||||||
'') zone.records}
|
'') zone.records}
|
||||||
|
|
||||||
send
|
send
|
||||||
EOF
|
EOF
|
||||||
'') (
|
'') (builtins.filter ({ dynamic, ... }: dynamic) config.site.dns.localZones);
|
||||||
builtins.filter ({ dynamic, ... }: dynamic) config.site.dns.localZones
|
|
||||||
)}
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue