diff --git a/src/apps.js b/src/apps.js index 2da7c5db3..73beeae18 100644 --- a/src/apps.js +++ b/src/apps.js @@ -54,7 +54,6 @@ exports = module.exports = { restoreInstalledApps: restoreInstalledApps, configureInstalledApps: configureInstalledApps, - getAppConfig: getAppConfig, getDataDir: getDataDir, getIconPath: getIconPath, @@ -406,25 +405,6 @@ function getDuplicateErrorDetails(errorMessage, location, domainObject, portBind return new AppsError(AppsError.ALREADY_EXISTS, `${match[2]} '${match[1]}' is in use`); } -// app configs that is useful for 'archival' into the app backup config.json -function getAppConfig(app) { - return { - manifest: app.manifest, - location: app.location, - domain: app.domain, - fqdn: app.fqdn, - accessRestriction: app.accessRestriction, - portBindings: app.portBindings, - memoryLimit: app.memoryLimit, - - robotsTxt: app.robotsTxt, - sso: app.sso, - alternateDomains: app.alternateDomains || [], - env: app.env, - dataDir: app.dataDir - }; -} - function getDataDir(app, dataDir) { return dataDir || path.join(paths.APPS_DATA_DIR, app.id, 'data'); } @@ -1729,7 +1709,7 @@ function configureInstalledApps(callback) { appdb.update(app.id, { taskId: null }, function (error) { // clear any stale taskId if (error) debug(`Error marking ${app.fqdn} for reconfigure: ${JSON.stringify(error)}`); - scheduleTask(app.id, { oldConfig: getAppConfig(app) }, { installationState: exports.ISTATE_PENDING_CONFIGURE }, () => iteratorDone()); // always succeed + scheduleTask(app.id, { oldConfig: app }, { installationState: exports.ISTATE_PENDING_CONFIGURE }, () => iteratorDone()); // always succeed }); }, callback); }); diff --git a/src/backups.js b/src/backups.js index b47ed0cfa..f7ababe38 100644 --- a/src/backups.js +++ b/src/backups.js @@ -859,7 +859,7 @@ function snapshotApp(app, progressCallback, callback) { progressCallback({ message: `Snapshotting app ${app.fqdn}` }); - if (!safe.fs.writeFileSync(path.join(paths.APPS_DATA_DIR, app.id + '/config.json'), JSON.stringify(apps.getAppConfig(app)))) { + if (!safe.fs.writeFileSync(path.join(paths.APPS_DATA_DIR, app.id + '/config.json'), JSON.stringify(app))) { return callback(new BackupsError(BackupsError.EXTERNAL_ERROR, 'Error creating config.json: ' + safe.error.message)); }