Compare commits
No commits in common. "d780f18534f892ef993e07197af03e15bd89e380" and "e3b6cb72b4b85a8ae8d746ceb98843d4c91335b7" have entirely different histories.
d780f18534
...
e3b6cb72b4
|
@ -45,47 +45,5 @@ in
|
|||
resource.dnsimple_zone.vzfdfp_de = {
|
||||
name = "vzfdfp.de";
|
||||
};
|
||||
|
||||
resource.dnsimple_zone_record = let
|
||||
# https://registry.terraform.io/providers/dnsimple/dnsimple/latest/docs/resources/zone_record
|
||||
canonicalName = zoneName: record: let
|
||||
# TODO: make less fragile and have actual unique and stable names
|
||||
normalize = builtins.replaceStrings ["." "@"] ["_" "_root_"];
|
||||
zone = normalize zoneName;
|
||||
name = normalize record.name;
|
||||
in "${zone}_${record.type}_${name}";
|
||||
|
||||
record = name: ttl: type: value: {
|
||||
inherit name ttl type value;
|
||||
};
|
||||
|
||||
proxyRecords = name: ttl: type: value: [
|
||||
# kurisu.lahfa.xyz running a sniproxy:
|
||||
(record name ttl "A" "163.172.69.160")
|
||||
(record name ttl type value)
|
||||
];
|
||||
|
||||
# Creates a extra *.p record pointing to the sniproxy
|
||||
dualProxyRecords = name: ttl: type: value: lib.flatten [
|
||||
(record name ttl type value)
|
||||
(proxyRecords "${name}.p" ttl type value)
|
||||
];
|
||||
|
||||
domain = zoneName: records:
|
||||
builtins.listToAttrs (map (record: {
|
||||
name = canonicalName zoneName record;
|
||||
value = record // {
|
||||
zone_name = zoneName;
|
||||
};
|
||||
}
|
||||
) (lib.flatten records));
|
||||
zones = domains: lib.zipAttrs (lib.mapAttrsToList (zoneName: records: domain zoneName records) domains);
|
||||
in zones {
|
||||
"flowery.systems" = [
|
||||
(record "" 300 "CNAME" "news.forkos.org")
|
||||
];
|
||||
"vzfdfp.de" = [
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue