Add VPN flag for DNS and update TLSA record for mail
This commit is contained in:
parent
32e42626a1
commit
a7a8d17186
6 changed files with 23 additions and 17 deletions
|
@ -12,7 +12,7 @@ function mx_default(dkim) {
|
|||
TXT("_dmarc", "v=DMARC1; p=quarantine; rua=mailto:dmarcreports@serguzim.me; ruf=mailto:dmarcreports@serguzim.me; rf=afrf; sp=quarantine; fo=1; pct=100; ri=604800; adkim=r; aspf=r"),
|
||||
TXT("dkim._domainkey", "v=DKIM1; k=rsa; t=s; s=email; p=" + dkim),
|
||||
|
||||
TLSA("_25._tcp", 3, 1, 1, "e66a608a3ec459bda7fb1f2d500b8abeb78f2910f26641204b6bc454b8aa2a49"),
|
||||
TLSA("_25._tcp", 3, 1, 1, "70143145ab67680a3b61fe2d0eb63319625fa086f845cce59afdbf1dad79e561"),
|
||||
|
||||
MX("@", 10, "mail.serguzim.me."),
|
||||
MX("*", 10, "mail.serguzim.me."),
|
||||
|
|
|
@ -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)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue