syncDns: sync secondary dns records
This commit is contained in:
@@ -299,7 +299,10 @@ async function syncDnsRecords(options, progressCallback) {
|
||||
if (domain.domain === settings.mailDomain() && settings.mailFqdn() !== settings.dashboardFqdn()) locations.push({ subdomain: mailSubdomain, domain: settings.mailDomain() });
|
||||
|
||||
for (const app of allApps) {
|
||||
const appLocations = [{ subdomain: app.subdomain, domain: app.domain }].concat(app.redirectDomains).concat(app.aliasDomains);
|
||||
const appLocations = [{ subdomain: app.subdomain, domain: app.domain }]
|
||||
.concat(app.secondaryDomains)
|
||||
.concat(app.redirectDomains)
|
||||
.concat(app.aliasDomains);
|
||||
locations = locations.concat(appLocations.filter(al => al.domain === domain.domain));
|
||||
}
|
||||
|
||||
|
||||
@@ -45,9 +45,9 @@ async function sync(auditSource) {
|
||||
if (app.installationState !== apps.ISTATE_INSTALLED) continue;
|
||||
|
||||
const locations = [{ domain: app.domain, subdomain: app.subdomain }]
|
||||
.concat(app.secondaryDomains.map(sd => { return { domain: sd.domain, subdomain: sd.subdomain }; }))
|
||||
.concat(app.redirectDomains.map(rd => { return { domain: rd.domain, subdomain: rd.subdomain }; }))
|
||||
.concat(app.aliasDomains.map(ad => { return { domain: ad.domain, subdomain: ad.subdomain }; }));
|
||||
.concat(app.secondaryDomains)
|
||||
.concat(app.redirectDomains)
|
||||
.concat(app.aliasDomains);
|
||||
|
||||
for (const location of locations) {
|
||||
if (ipv4Changed) await dns.upsertDnsRecords(location.subdomain, location.domain, 'A', [ ipv4 ]);
|
||||
|
||||
Reference in New Issue
Block a user