diff --git a/src/backups.js b/src/backups.js index 03abfed60..21652c150 100644 --- a/src/backups.js +++ b/src/backups.js @@ -26,8 +26,6 @@ exports = module.exports = { injectPrivateFields, removePrivateFields, - checkConfiguration, - configureCollectd, generateEncryptionKeysSync, @@ -1604,23 +1602,6 @@ function startCleanupTask(auditSource, callback) { }); } -function checkConfiguration(callback) { - assert.strictEqual(typeof callback, 'function'); - - settings.getBackupConfig(function (error, backupConfig) { - if (error) return callback(error); - - let message = ''; - if (backupConfig.provider === 'noop') { - message = 'tr:backups.check.noop'; - } else if (backupConfig.provider === 'filesystem') { - message = 'tr:backups.check.sameDisk'; - } - - callback(null, message); - }); -} - function configureCollectd(backupConfig, callback) { assert.strictEqual(typeof backupConfig, 'object'); assert.strictEqual(typeof callback, 'function'); diff --git a/src/cloudron.js b/src/cloudron.js index 851d16342..461fa3a62 100644 --- a/src/cloudron.js +++ b/src/cloudron.js @@ -83,12 +83,6 @@ function onActivated(options, callback) { async.series([ platform.start.bind(null, options), cron.startJobs, - function checkBackupConfiguration(done) { - backups.checkConfiguration(function (error, message) { - if (error) return done(error); - notifications.alert(notifications.ALERT_BACKUP_CONFIG, 'Backup configuration is unsafe', message, done); - }); - }, // disable responding to api calls via IP to not leak domain info. this is carefully placed as the last item, so it buys // the UI some time to query the dashboard domain in the restore code path (done) => setTimeout(() => reverseProxy.writeDefaultConfig({ activated :true }, done), 30000) diff --git a/src/routes/backups.js b/src/routes/backups.js index bd67f3a74..6b10ceeb1 100644 --- a/src/routes/backups.js +++ b/src/routes/backups.js @@ -4,7 +4,6 @@ exports = module.exports = { list, startBackup, cleanup, - check }; let auditSource = require('../auditsource.js'), @@ -42,11 +41,3 @@ function cleanup(req, res, next) { next(new HttpSuccess(202, { taskId })); }); } - -function check(req, res, next) { - backups.checkConfiguration(function (error, message) { - if (error) return next(BoxError.toHttpError(error)); - - next(new HttpSuccess(200, { ok: !message, message: message })); - }); -} diff --git a/src/routes/test/backups-test.js b/src/routes/test/backups-test.js index 824d8774a..32a19ac63 100644 --- a/src/routes/test/backups-test.js +++ b/src/routes/test/backups-test.js @@ -5,7 +5,7 @@ 'use strict'; -var appdb = require('../../appdb.js'), +const appdb = require('../../appdb.js'), async = require('async'), constants = require('../../constants.js'), database = require('../../database.js'), @@ -108,35 +108,4 @@ describe('Backups API', function () { }); }); }); - - describe('check', function () { - it('fails due to mising token', function (done) { - superagent.get(SERVER_URL + '/api/v1/backups/check') - .end(function (error, result) { - expect(result.statusCode).to.equal(401); - done(); - }); - }); - - it('fails due to wrong token', function (done) { - superagent.get(SERVER_URL + '/api/v1/backups/check') - .query({ access_token: token.toUpperCase() }) - .end(function (error, result) { - expect(result.statusCode).to.equal(401); - done(); - }); - }); - - it('succeeds', function (done) { - superagent.get(SERVER_URL + '/api/v1/backups/check') - .query({ access_token: token }) - .end(function (error, result) { - expect(result.statusCode).to.equal(200); - expect(result.body.ok).to.equal(false); - expect(result.body.message).to.not.be.empty(); - - done(); - }); - }); - }); }); diff --git a/src/server.js b/src/server.js index ae6696943..95423e6b8 100644 --- a/src/server.js +++ b/src/server.js @@ -140,7 +140,6 @@ function initializeExpressSync() { router.get ('/api/v1/backups', token, authorizeAdmin, routes.backups.list); router.post('/api/v1/backups/create', token, authorizeAdmin, routes.backups.startBackup); router.post('/api/v1/backups/cleanup', json, token, authorizeAdmin, routes.backups.cleanup); - router.get ('/api/v1/backups/check', token, authorizeAdmin, routes.backups.check); // config route (for dashboard). can return some private configuration unlike status router.get ('/api/v1/config', token, routes.cloudron.getConfig);