setting dashboard domain now only updates dashboard domain (and not mail)

part of #721
This commit is contained in:
Girish Ramakrishnan
2020-08-15 22:53:05 -07:00
parent d1e14ed691
commit 1eef239392
3 changed files with 7 additions and 8 deletions

View File

@@ -13,7 +13,7 @@ exports = module.exports = {
prepareDashboardDomain: prepareDashboardDomain,
setDashboardDomain: setDashboardDomain,
setDashboardAndMailDomain: setDashboardAndMailDomain,
updateDashboardDomain: updateDashboardDomain,
renewCerts: renewCerts,
setupDashboard: setupDashboard,
@@ -317,19 +317,18 @@ function setDashboardDomain(domain, auditSource, callback) {
}
// call this only post activation because it will restart mail server
function setDashboardAndMailDomain(domain, auditSource, callback) {
function updateDashboardDomain(domain, auditSource, callback) {
assert.strictEqual(typeof domain, 'string');
assert.strictEqual(typeof auditSource, 'object');
assert.strictEqual(typeof callback, 'function');
debug(`setDashboardAndMailDomain: ${domain}`);
debug(`updateDashboardDomain: ${domain}`);
if (settings.isDemo()) return callback(new BoxError(BoxError.CONFLICT, 'Not allowed in demo mode'));
setDashboardDomain(domain, auditSource, function (error) {
if (error) return callback(error);
mail.onMailFqdnChanged(NOOP_CALLBACK); // this will update dns and re-configure mail server
addons.restartService('turn', NOOP_CALLBACK); // to update the realm variable
callback(null);