diff --git a/CHANGES b/CHANGES index c7eeded09..db3ae285c 100644 --- a/CHANGES +++ b/CHANGES @@ -2128,5 +2128,4 @@ * sftp: disable access to non-admins by default * postgresql: whitelist pgcrypto extension for loomio * filemanager: Add new file creation action and collapse new and upload actions -* rsync: add warning to remove lifecycle rules diff --git a/src/routes/services.js b/src/routes/services.js index db4b87ec7..0e28fe3e5 100644 --- a/src/routes/services.js +++ b/src/routes/services.js @@ -15,7 +15,7 @@ var addons = require('../addons.js'), HttpError = require('connect-lastmile').HttpError, HttpSuccess = require('connect-lastmile').HttpSuccess; -function getAll(req, next) { +function getAll(req, res, next) { req.clearTimeout(); // can take a while to get status of all services addons.getServices(function (error, result) { @@ -25,7 +25,7 @@ function getAll(req, next) { }); } -function get(req, next) { +function get(req, res, next) { assert.strictEqual(typeof req.params.service, 'string'); addons.getService(req.params.service, function (error, result) { @@ -35,7 +35,7 @@ function get(req, next) { }); } -function configure(req, next) { +function configure(req, res, next) { assert.strictEqual(typeof req.params.service, 'string'); if (typeof req.body.memory !== 'number') return next(new HttpError(400, 'memory must be a number')); @@ -46,14 +46,9 @@ function configure(req, next) { memorySwap: req.body.memorySwap }; - const [ name ] = req.params.service.split(':'); - - if (name === 'sftp' && 'requireAdmin' in req.body) { + if (req.params.service === 'sftp' && 'requireAdmin' in req.body) { if (typeof req.body.requireAdmin !== 'boolean') return next(new HttpError(400, 'requireAdmin must be a boolean')); data.requireAdmin = req.body.requireAdmin; - } else if (name === 'redis') { - if ('disabled' in req.body && typeof req.body.disabled !== 'boolean') return next(new HttpError(400, 'disabled must be a boolean')); - data.disabled = !!req.body.disabled; } addons.configureService(req.params.service, data, function (error) { @@ -126,7 +121,7 @@ function getLogStream(req, res, next) { }); } -function restart(req, next) { +function restart(req, res, next) { assert.strictEqual(typeof req.params.service, 'string'); addons.restartService(req.params.service, function (error) {