feat: limit the dns to explicitly servers we are using

Closes #134
This commit is contained in:
silver 2024-10-05 12:20:24 +01:00
parent 0b0db08f01
commit 91d76c08f1
Signed by: silver
GPG key ID: 36F93D61BAD3FD7D

View file

@ -13,11 +13,14 @@
current_date = self.lastModified;
# this gets a list of all domains we have records for
domains = lib.lists.naturalSort (
lib.lists.unique (
lib.lists.forEach records (x: x.domain)
)
);
domains = lib.lists.naturalSort (lib.lists.unique (
lib.lists.forEach records (x: x.domain)
));
# get the ip's of our servers
servers = lib.lists.naturalSort (lib.lists.unique (
lib.lists.forEach (sort_records_server records) (x: x.value)
));
domains_owned = [
# for historic reasons we own this
@ -175,7 +178,9 @@
);
# small function to tidy up the spam of the cache networks, would use teh subnet except all external traffic has the ip of teh router
create_cache_networks = map (x: "193.1.99.${toString x}/32") (lib.lists.range 71 126);
# now limited explicitly to servers that we are administering
# See i24-09-30_050 for more information
create_cache_networks = map (x: "${toString x}/32") servers;
# standard function to create the etc file, pass in the text and domain and it makes it
create_entry_etc_sub = domain: text: {
@ -238,7 +243,7 @@
*/
++ builtins.concatLists (
lib.attrsets.mapAttrsToList (
key: value: value.config.services.skynet."${name}".records
key: value: value.config.services.skynet.dns.records
)
nodes
);