diff --git a/src/routes/apps.js b/src/routes/apps.js index 5ede9337a..063fb7234 100644 --- a/src/routes/apps.js +++ b/src/routes/apps.js @@ -133,8 +133,6 @@ function installApp(req, res, next) { if ('overwriteDns' in req.body && typeof req.body.overwriteDns !== 'boolean') return next(new HttpError(400, 'overwriteDns must be boolean')); - debug('Installing app :%j', data); - apps.install(data, req.user, auditSource.fromRequest(req), function (error, result) { if (error) return next(BoxError.toHttpError(error)); @@ -360,8 +358,6 @@ function repairApp(req, res, next) { assert.strictEqual(typeof req.body, 'object'); assert.strictEqual(typeof req.params.id, 'string'); - debug('Repair app id:%s', req.params.id); - const data = req.body; if ('manifest' in data) { @@ -385,8 +381,6 @@ function restoreApp(req, res, next) { var data = req.body; - debug('Restore app id:%s', req.params.id); - if (!data.backupId || typeof data.backupId !== 'string') return next(new HttpError(400, 'backupId must be non-empty string')); apps.restore(req.params.id, data.backupId, auditSource.fromRequest(req), function (error, result) { @@ -402,8 +396,6 @@ function importApp(req, res, next) { var data = req.body; - debug('Importing app id:%s', req.params.id); - if ('backupId' in data) { // if not provided, we import in-place if (typeof data.backupId !== 'string') return next(new HttpError(400, 'backupId must be string')); if (typeof data.backupFormat !== 'string') return next(new HttpError(400, 'backupFormat must be string')); @@ -435,8 +427,6 @@ function cloneApp(req, res, next) { var data = req.body; - debug('Clone app id:%s', req.params.id); - if (typeof data.backupId !== 'string') return next(new HttpError(400, 'backupId must be a string')); if (typeof data.location !== 'string') return next(new HttpError(400, 'location is required')); if (typeof data.domain !== 'string') return next(new HttpError(400, 'domain is required')); @@ -454,8 +444,6 @@ function cloneApp(req, res, next) { function backupApp(req, res, next) { assert.strictEqual(typeof req.params.id, 'string'); - debug('Backup app id:%s', req.params.id); - apps.backup(req.params.id, function (error, result) { if (error) return next(BoxError.toHttpError(error)); @@ -466,8 +454,6 @@ function backupApp(req, res, next) { function uninstallApp(req, res, next) { assert.strictEqual(typeof req.params.id, 'string'); - debug('Uninstalling app id:%s', req.params.id); - apps.uninstall(req.params.id, auditSource.fromRequest(req), function (error, result) { if (error) return next(BoxError.toHttpError(error)); @@ -478,8 +464,6 @@ function uninstallApp(req, res, next) { function startApp(req, res, next) { assert.strictEqual(typeof req.params.id, 'string'); - debug('Start app id:%s', req.params.id); - apps.start(req.params.id, auditSource.fromRequest(req), function (error, result) { if (error) return next(BoxError.toHttpError(error)); @@ -490,8 +474,6 @@ function startApp(req, res, next) { function stopApp(req, res, next) { assert.strictEqual(typeof req.params.id, 'string'); - debug('Stop app id:%s', req.params.id); - apps.stop(req.params.id, auditSource.fromRequest(req), function (error, result) { if (error) return next(BoxError.toHttpError(error)); @@ -502,8 +484,6 @@ function stopApp(req, res, next) { function restartApp(req, res, next) { assert.strictEqual(typeof req.params.id, 'string'); - debug('Restart app id:%s', req.params.id); - apps.restart(req.params.id, auditSource.fromRequest(req), function (error, result) { if (error) return next(BoxError.toHttpError(error)); @@ -525,8 +505,6 @@ function updateApp(req, res, next) { if ('skipBackup' in data && typeof data.skipBackup !== 'boolean') return next(new HttpError(400, 'skipBackup must be a boolean')); if ('force' in data && typeof data.force !== 'boolean') return next(new HttpError(400, 'force must be a boolean')); - debug('Update app id:%s to manifest:%j', req.params.id, data.manifest); - apps.update(req.params.id, req.body, auditSource.fromRequest(req), function (error, result) { if (error) return next(BoxError.toHttpError(error)); @@ -538,8 +516,6 @@ function updateApp(req, res, next) { function getLogStream(req, res, next) { assert.strictEqual(typeof req.params.id, 'string'); - debug('Getting logstream of app id:%s', req.params.id); - var lines = 'lines' in req.query ? parseInt(req.query.lines, 10) : 10; // we ignore last-event-id if (isNaN(lines)) return next(new HttpError(400, 'lines must be a valid number')); @@ -580,8 +556,6 @@ function getLogs(req, res, next) { var lines = 'lines' in req.query ? parseInt(req.query.lines, 10) : 10; if (isNaN(lines)) return next(new HttpError(400, 'lines must be a number')); - debug('Getting logs of app id:%s', req.params.id); - var options = { lines: lines, follow: false, @@ -626,8 +600,6 @@ function demuxStream(stream, stdin) { function exec(req, res, next) { assert.strictEqual(typeof req.params.id, 'string'); - debug('Execing into app id:%s and cmd:%s', req.params.id, req.query.cmd); - var cmd = null; if (req.query.cmd) { cmd = safe.JSON.parse(req.query.cmd); @@ -666,8 +638,6 @@ function exec(req, res, next) { function execWebSocket(req, res, next) { assert.strictEqual(typeof req.params.id, 'string'); - debug('Execing websocket into app id:%s and cmd:%s', req.params.id, req.query.cmd); - var cmd = null; if (req.query.cmd) { cmd = safe.JSON.parse(req.query.cmd); @@ -685,8 +655,6 @@ function execWebSocket(req, res, next) { apps.exec(req.params.id, { cmd: cmd, rows: rows, columns: columns, tty: tty }, function (error, duplexStream) { if (error) return next(BoxError.toHttpError(error)); - debug('Connected to terminal'); - req.clearTimeout(); res.handleUpgrade(function (ws) { @@ -732,16 +700,12 @@ function listBackups(req, res, next) { function uploadFile(req, res, next) { assert.strictEqual(typeof req.params.id, 'string'); - debug('uploadFile: %s %j -> %s', req.params.id, req.files, req.query.file); - if (typeof req.query.file !== 'string' || !req.query.file) return next(new HttpError(400, 'file query argument must be provided')); if (!req.files.file) return next(new HttpError(400, 'file must be provided as multipart')); apps.uploadFile(req.params.id, req.files.file.path, req.query.file, function (error) { if (error) return next(BoxError.toHttpError(error)); - debug('uploadFile: done'); - next(new HttpSuccess(202, {})); }); } @@ -749,8 +713,6 @@ function uploadFile(req, res, next) { function downloadFile(req, res, next) { assert.strictEqual(typeof req.params.id, 'string'); - debug('downloadFile: ', req.params.id, req.query.file); - if (typeof req.query.file !== 'string' || !req.query.file) return next(new HttpError(400, 'file query argument must be provided')); apps.downloadFile(req.params.id, req.query.file, function (error, stream, info) { diff --git a/src/routes/cloudron.js b/src/routes/cloudron.js index 407b4abba..f9f5ec25e 100644 --- a/src/routes/cloudron.js +++ b/src/routes/cloudron.js @@ -29,7 +29,6 @@ let assert = require('assert'), BoxError = require('../boxerror.js'), cloudron = require('../cloudron.js'), constants = require('../constants.js'), - debug = require('debug')('box:routes/cloudron'), eventlog = require('../eventlog.js'), externalLdap = require('../externalldap.js'), HttpError = require('connect-lastmile').HttpError, @@ -128,8 +127,6 @@ function setupAccount(req, res, next) { if (!req.body.username || typeof req.body.username !== 'string') return next(new HttpError(400, 'username must be a non-empty string')); if (!req.body.displayName || typeof req.body.displayName !== 'string') return next(new HttpError(400, 'displayName must be a non-empty string')); - debug(`setupAccount: for email ${req.body.email} and username ${req.body.username} with token ${req.body.resetToken}`); - users.getByResetToken(req.body.resetToken, function (error, userObject) { if (error) return next(new HttpError(401, 'Invalid Reset Token')); diff --git a/src/routes/services.js b/src/routes/services.js index ae0ce5607..4890ec4f8 100644 --- a/src/routes/services.js +++ b/src/routes/services.js @@ -12,7 +12,6 @@ exports = module.exports = { var addons = require('../addons.js'), assert = require('assert'), BoxError = require('../boxerror.js'), - debug = require('debug')('box:routes/addons'), HttpError = require('connect-lastmile').HttpError, HttpSuccess = require('connect-lastmile').HttpSuccess; @@ -60,8 +59,6 @@ function getLogs(req, res, next) { var lines = 'lines' in req.query ? parseInt(req.query.lines, 10) : 10; // we ignore last-event-id if (isNaN(lines)) return next(new HttpError(400, 'lines must be a number')); - debug(`Getting logs of service ${req.params.service}`); - var options = { lines: lines, follow: false, @@ -85,8 +82,6 @@ function getLogs(req, res, next) { function getLogStream(req, res, next) { assert.strictEqual(typeof req.params.service, 'string'); - debug(`Getting logstream of service ${req.params.service}`); - var lines = 'lines' in req.query ? parseInt(req.query.lines, 10) : 10; // we ignore last-event-id if (isNaN(lines)) return next(new HttpError(400, 'lines must be a valid number')); @@ -124,8 +119,6 @@ function getLogStream(req, res, next) { function restart(req, res, next) { assert.strictEqual(typeof req.params.service, 'string'); - debug(`Restarting service ${req.params.service}`); - addons.restartService(req.params.service, function (error) { if (error) return next(BoxError.toHttpError(error));