diff --git a/src/appdb.js b/src/appdb.js index b73321458..2afb8af84 100644 --- a/src/appdb.js +++ b/src/appdb.js @@ -221,16 +221,17 @@ function add(id, appStoreId, manifest, location, domain, portBindings, data, cal const mailboxDomain = data.mailboxDomain || null; const reverseProxyConfigJson = data.reverseProxyConfig ? JSON.stringify(data.reverseProxyConfig) : null; const servicesConfigJson = data.servicesConfig ? JSON.stringify(data.servicesConfig) : null; + const enableMailbox = data.enableMailbox || false; const icon = data.icon || null; let queries = []; queries.push({ query: 'INSERT INTO apps (id, appStoreId, manifestJson, installationState, runState, accessRestrictionJson, memoryLimit, cpuShares, ' - + 'sso, debugModeJson, mailboxName, mailboxDomain, label, tagsJson, reverseProxyConfigJson, servicesConfigJson, icon) ' - + ' VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', + + 'sso, debugModeJson, mailboxName, mailboxDomain, label, tagsJson, reverseProxyConfigJson, servicesConfigJson, icon, enableMailbox) ' + + ' VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', args: [ id, appStoreId, manifestJson, installationState, runState, accessRestrictionJson, memoryLimit, cpuShares, - sso, debugModeJson, mailboxName, mailboxDomain, label, tagsJson, reverseProxyConfigJson, servicesConfigJson, icon ] + sso, debugModeJson, mailboxName, mailboxDomain, label, tagsJson, reverseProxyConfigJson, servicesConfigJson, icon, enableMailbox ] }); queries.push({ diff --git a/src/apps.js b/src/apps.js index c6f76c879..8fa5d9e68 100644 --- a/src/apps.js +++ b/src/apps.js @@ -749,6 +749,7 @@ function install(data, auditSource, callback) { overwriteDns = 'overwriteDns' in data ? data.overwriteDns : false, skipDnsSetup = 'skipDnsSetup' in data ? data.skipDnsSetup : false, appStoreId = data.appStoreId, + enableMailbox = 'enabledMailbox' in data ? data.enableMailbox : true, manifest = data.manifest; let error = manifestFormat.parse(manifest); @@ -817,6 +818,7 @@ function install(data, auditSource, callback) { label, tags, icon, + enableMailbox, runState: exports.RSTATE_RUNNING, installationState: exports.ISTATE_PENDING_INSTALL }; @@ -1696,7 +1698,8 @@ function clone(app, data, user, auditSource, callback) { label: app.label ? `${app.label}-clone` : '', tags: app.tags, enableAutomaticUpdate: app.enableAutomaticUpdate, - icon: icons.icon + icon: icons.icon, + enableMailbox: app.enableMailbox }; appdb.add(newAppId, appStoreId, manifest, location, domain, translatePortBindings(portBindings, manifest), data, function (error) { diff --git a/src/routes/apps.js b/src/routes/apps.js index e6d55ee64..4a7a97444 100644 --- a/src/routes/apps.js +++ b/src/routes/apps.js @@ -145,6 +145,7 @@ function install(req, res, next) { if ('overwriteDns' in req.body && typeof req.body.overwriteDns !== 'boolean') return next(new HttpError(400, 'overwriteDns must be boolean')); if ('skipDnsSetup' in req.body && typeof req.body.skipDnsSetup !== 'boolean') return next(new HttpError(400, 'skipDnsSetup must be boolean')); + if ('enableMailbox' in req.body && typeof req.body.enableMailbox !== 'boolean') return next(new HttpError(400, 'enableMailbox must be boolean')); apps.downloadManifest(data.appStoreId, data.manifest, function (error, appStoreId, manifest) { if (error) return next(BoxError.toHttpError(error));