automate wellknown setup
the main reason this is under app and not domain is because it let's the user know that an app has to be installed for the whole thing to work. part of #703
This commit is contained in:
19
src/apps.js
19
src/apps.js
@@ -20,6 +20,7 @@ exports = module.exports = {
|
||||
setMemoryLimit,
|
||||
setCpuShares,
|
||||
setMounts,
|
||||
setWellKnown,
|
||||
setAutomaticBackup,
|
||||
setAutomaticUpdate,
|
||||
setReverseProxyConfig,
|
||||
@@ -405,7 +406,7 @@ function removeInternalFields(app) {
|
||||
'location', 'domain', 'fqdn', 'mailboxName', 'mailboxDomain',
|
||||
'accessRestriction', 'manifest', 'portBindings', 'iconUrl', 'memoryLimit', 'cpuShares',
|
||||
'sso', 'debugMode', 'reverseProxyConfig', 'enableBackup', 'creationTime', 'updateTime', 'ts', 'tags',
|
||||
'label', 'alternateDomains', 'env', 'enableAutomaticUpdate', 'dataDir', 'mounts');
|
||||
'label', 'alternateDomains', 'env', 'enableAutomaticUpdate', 'dataDir', 'mounts', 'wellKnown');
|
||||
}
|
||||
|
||||
// non-admins can only see these
|
||||
@@ -982,6 +983,22 @@ function setMounts(app, mounts, auditSource, callback) {
|
||||
});
|
||||
}
|
||||
|
||||
function setWellKnown(app, wellKnown, auditSource, callback) {
|
||||
assert.strictEqual(typeof app, 'object');
|
||||
assert.strictEqual(typeof wellKnown, 'object');
|
||||
assert.strictEqual(typeof auditSource, 'object');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
const appId = app.id;
|
||||
appdb.update(appId, { wellKnown }, function (error) {
|
||||
if (error) return callback(error);
|
||||
|
||||
eventlog.add(eventlog.ACTION_APP_CONFIGURE, auditSource, { appId, app, wellKnown });
|
||||
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
function setEnvironment(app, env, auditSource, callback) {
|
||||
assert.strictEqual(typeof app, 'object');
|
||||
assert.strictEqual(typeof env, 'object');
|
||||
|
||||
Reference in New Issue
Block a user