diff --git a/src/cloudron.js b/src/cloudron.js index 7112be34b..ecbb8258c 100644 --- a/src/cloudron.js +++ b/src/cloudron.js @@ -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); diff --git a/src/routes/cloudron.js b/src/routes/cloudron.js index da9f2dd8d..f50745afe 100644 --- a/src/routes/cloudron.js +++ b/src/routes/cloudron.js @@ -16,7 +16,7 @@ exports = module.exports = { checkForUpdates: checkForUpdates, getLogs: getLogs, getLogStream: getLogStream, - setDashboardAndMailDomain: setDashboardAndMailDomain, + updateDashboardDomain, prepareDashboardDomain: prepareDashboardDomain, renewCerts: renewCerts, getServerIp: getServerIp, @@ -274,10 +274,10 @@ function getLogStream(req, res, next) { }); } -function setDashboardAndMailDomain(req, res, next) { +function updateDashboardDomain(req, res, next) { if (!req.body.domain || typeof req.body.domain !== 'string') return next(new HttpError(400, 'domain must be a string')); - cloudron.setDashboardAndMailDomain(req.body.domain, auditSource.fromRequest(req), function (error) { + cloudron.updateDashboardDomain(req.body.domain, auditSource.fromRequest(req), function (error) { if (error) return next(BoxError.toHttpError(error)); next(new HttpSuccess(204, {})); diff --git a/src/server.js b/src/server.js index 63093d4f5..efe9d58c2 100644 --- a/src/server.js +++ b/src/server.js @@ -106,7 +106,7 @@ function initializeExpressSync() { router.get ('/api/v1/cloudron/update', token, authorizeAdmin, routes.cloudron.getUpdateInfo); router.post('/api/v1/cloudron/update', json, token, authorizeAdmin, routes.cloudron.update); router.post('/api/v1/cloudron/prepare_dashboard_domain', json, token, authorizeAdmin, routes.cloudron.prepareDashboardDomain); - router.post('/api/v1/cloudron/set_dashboard_domain', json, token, authorizeAdmin, routes.cloudron.setDashboardAndMailDomain); + router.post('/api/v1/cloudron/set_dashboard_domain', json, token, authorizeAdmin, routes.cloudron.updateDashboardDomain); router.post('/api/v1/cloudron/renew_certs', json, token, authorizeAdmin, routes.cloudron.renewCerts); router.post('/api/v1/cloudron/check_for_updates', json, token, authorizeAdmin, routes.cloudron.checkForUpdates); router.get ('/api/v1/cloudron/reboot', token, authorizeAdmin, routes.cloudron.isRebootRequired);