Add VPN flag for DNS and update TLSA record for mail

This commit is contained in:
Tobias Reisinger 2025-04-18 13:00:00 +02:00
parent 32e42626a1
commit a7a8d17186
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
6 changed files with 23 additions and 17 deletions

View file

@ -1,11 +1,12 @@
function service(target, domain, host, alias) {
function service(target, domain, host, alias, vpn) {
return {
target: target,
domain: domain,
host: hosts[host],
alias: alias,
vpn: vpn,
record: function() {
return my_host_record(this.target, this.resolve_host());
return my_host_record(this.target, this.resolve_host(), this.vpn);
},
resolve_host: function() {
if (this.alias) {
@ -27,18 +28,18 @@ function collect_services(domain) {
return result;
}
function my_host_record(target, host) {
switch (target) {
case "db":
return [
A(target, host.ipv4_address_vpn),
AAAA(target, host.ipv6_address_vpn)
];
default:
return [
A(target, host.ipv4_address),
AAAA(target, host.ipv6_address)
];
function my_host_record(target, host, vpn) {
if (vpn) {
return [
A(target, host.ipv4_address_vpn),
AAAA(target, host.ipv6_address_vpn)
];
}
else {
return [
A(target, host.ipv4_address),
AAAA(target, host.ipv6_address)
];
}
}