do not restart mail container when not activated

provision code is calling setDashboardDomain() which is restarting
the mail server
This commit is contained in:
Girish Ramakrishnan
2019-02-26 19:43:18 -08:00
parent 20c0deeac4
commit 27f6177fc9
4 changed files with 28 additions and 10 deletions

View File

@@ -10,7 +10,7 @@ exports = module.exports = {
checkForUpdates: checkForUpdates,
getLogs: getLogs,
getLogStream: getLogStream,
setDashboardDomain: setDashboardDomain,
setDashboardAndMailDomain: setDashboardAndMailDomain,
prepareDashboardDomain: prepareDashboardDomain,
renewCerts: renewCerts
};
@@ -151,10 +151,10 @@ function getLogStream(req, res, next) {
});
}
function setDashboardDomain(req, res, next) {
function setDashboardAndMailDomain(req, res, next) {
if (!req.body.domain || typeof req.body.domain !== 'string') return next(new HttpError(400, 'domain must be a string'));
cloudron.setDashboardDomain(req.body.domain, auditSource(req), function (error) {
cloudron.setDashboardAndMailDomain(req.body.domain, auditSource(req), function (error) {
if (error && error.reason === CloudronError.BAD_FIELD) return next(new HttpError(404, error.message));
if (error) return next(new HttpError(500, error));