diff --git a/src/apps.js b/src/apps.js index 4fcc72dff..59adcc71a 100644 --- a/src/apps.js +++ b/src/apps.js @@ -1346,7 +1346,7 @@ async function install(data, auditSource) { const taskId = await addTask(appId, app.installationState, task, auditSource); - const newApp = _.extend({}, _.omit(app, 'icon'), { appStoreId, manifest, location: subdomain, domain, portBindings }); + const newApp = _.extend({}, _.omit(app, 'icon'), { appStoreId, manifest, subdomain, domain, portBindings }); newApp.fqdn = dns.fqdn(newApp.subdomain, domainObjectMap[newApp.domain]); newApp.secondaryDomains.forEach(function (ad) { ad.fqdn = dns.fqdn(ad.subdomain, domainObjectMap[ad.domain]); }); newApp.redirectDomains.forEach(function (ad) { ad.fqdn = dns.fqdn(ad.subdomain, domainObjectMap[ad.domain]); }); @@ -1697,8 +1697,8 @@ async function setLocation(app, data, auditSource) { let error = checkAppState(app, exports.ISTATE_PENDING_LOCATION_CHANGE); if (error) throw error; - let values = { - location: data.subdomain.toLowerCase(), + const values = { + subdomain: data.subdomain.toLowerCase(), domain: data.domain.toLowerCase(), // these are intentionally reset, if not set portBindings: null, @@ -1744,7 +1744,7 @@ async function setLocation(app, data, auditSource) { const task = { args: { - oldConfig: _.pick(app, 'location', 'domain', 'fqdn', 'secondaryDomains', 'redirectDomains', 'aliasDomains', 'portBindings'), + oldConfig: _.pick(app, 'subdomain', 'domain', 'fqdn', 'secondaryDomains', 'redirectDomains', 'aliasDomains', 'portBindings'), skipDnsSetup: !!data.skipDnsSetup, overwriteDns: !!data.overwriteDns }, @@ -2220,7 +2220,7 @@ async function clone(app, data, user, auditSource) { }; const taskId = await addTask(newAppId, exports.ISTATE_PENDING_CLONE, task, auditSource); - const newApp = _.extend({}, _.omit(obj, 'icon'), { appStoreId, manifest, location: subdomain, domain, portBindings }); + const newApp = _.extend({}, _.omit(obj, 'icon'), { appStoreId, manifest, subdomain, domain, portBindings }); newApp.fqdn = dns.fqdn(newApp.subdomain, domainObjectMap[newApp.domain]); newApp.secondaryDomains.forEach(function (ad) { ad.fqdn = dns.fqdn(ad.subdomain, domainObjectMap[ad.domain]); }); newApp.redirectDomains.forEach(function (ad) { ad.fqdn = dns.fqdn(ad.subdomain, domainObjectMap[ad.domain]); });