rename alternateDomains to redirectDomains
This commit is contained in:
@@ -254,8 +254,8 @@ async function waitForDnsPropagation(app) {
|
||||
if (error) throw new BoxError(BoxError.DNS_ERROR, `DNS AAAA Record is not synced yet: ${error.message}`, { ipv6, subdomain: app.location, domain: app.domain });
|
||||
}
|
||||
|
||||
// now wait for alternateDomains and aliasDomains, if any
|
||||
for (const domain of app.alternateDomains.concat(app.aliasDomains)) {
|
||||
// now wait for redirectDomains and aliasDomains, if any
|
||||
for (const domain of app.redirectDomains.concat(app.aliasDomains)) {
|
||||
[error] = await safe(dns.waitForDnsRecord(domain.subdomain, domain.domain, 'A', ipv4, { times: 240 }));
|
||||
if (error) throw new BoxError(BoxError.DNS_ERROR, `DNS A Record is not synced yet: ${error.message}`, { ipv4, subdomain: domain.subdomain, domain: domain.domain });
|
||||
if (ipv6Enabled) {
|
||||
@@ -346,7 +346,7 @@ async function install(app, args, progressCallback) {
|
||||
if (!skipDnsSetup) {
|
||||
await progressCallback({ percent: 30, message: 'Registering subdomains' });
|
||||
|
||||
await dns.registerLocations([ { subdomain: app.location, domain: app.domain }].concat(app.alternateDomains).concat(app.aliasDomains), { overwriteDns }, progressCallback);
|
||||
await dns.registerLocations([ { subdomain: app.location, domain: app.domain }].concat(app.redirectDomains).concat(app.aliasDomains), { overwriteDns }, progressCallback);
|
||||
}
|
||||
|
||||
await progressCallback({ percent: 40, message: 'Downloading image' });
|
||||
@@ -462,8 +462,8 @@ async function changeLocation(app, args, progressCallback) {
|
||||
await deleteContainers(app, { managedOnly: true });
|
||||
|
||||
// unregister old domains
|
||||
let obsoleteDomains = oldConfig.alternateDomains.filter(function (o) {
|
||||
return !app.alternateDomains.some(function (n) { return n.subdomain === o.subdomain && n.domain === o.domain; });
|
||||
let obsoleteDomains = oldConfig.redirectDomains.filter(function (o) {
|
||||
return !app.redirectDomains.some(function (n) { return n.subdomain === o.subdomain && n.domain === o.domain; });
|
||||
});
|
||||
|
||||
if (oldConfig.aliasDomains) {
|
||||
@@ -479,7 +479,7 @@ async function changeLocation(app, args, progressCallback) {
|
||||
// setup dns
|
||||
if (!skipDnsSetup) {
|
||||
await progressCallback({ percent: 30, message: 'Registering subdomains' });
|
||||
await dns.registerLocations([ { subdomain: app.location, domain: app.domain }].concat(app.alternateDomains).concat(app.aliasDomains), { overwriteDns }, progressCallback);
|
||||
await dns.registerLocations([ { subdomain: app.location, domain: app.domain }].concat(app.redirectDomains).concat(app.aliasDomains), { overwriteDns }, progressCallback);
|
||||
}
|
||||
|
||||
// re-setup addons since they rely on the app's fqdn (e.g oauth)
|
||||
@@ -723,7 +723,7 @@ async function uninstall(app, args, progressCallback) {
|
||||
await docker.deleteImage(app.manifest);
|
||||
|
||||
await progressCallback({ percent: 70, message: 'Unregistering domains' });
|
||||
await dns.unregisterLocations([ { subdomain: app.location, domain: app.domain } ].concat(app.alternateDomains).concat(app.aliasDomains), progressCallback);
|
||||
await dns.unregisterLocations([ { subdomain: app.location, domain: app.domain } ].concat(app.redirectDomains).concat(app.aliasDomains), progressCallback);
|
||||
|
||||
await progressCallback({ percent: 90, message: 'Cleanup logs' });
|
||||
await cleanupLogs(app);
|
||||
|
||||
Reference in New Issue
Block a user