backups: add mounting config

This commit is contained in:
Girish Ramakrishnan
2021-05-14 15:07:29 -07:00
parent 24dbf53c5d
commit aae40f506b
4 changed files with 154 additions and 104 deletions

View File

@@ -8,7 +8,7 @@ exports = module.exports = {
setBackupConfig
};
var assert = require('assert'),
const assert = require('assert'),
backups = require('../backups.js'),
BoxError = require('../boxerror.js'),
docker = require('../docker.js'),
@@ -106,6 +106,9 @@ function setBackupConfig(req, res, next) {
if (!req.body.retentionPolicy || typeof req.body.retentionPolicy !== 'object') return next(new HttpError(400, 'retentionPolicy is required'));
if ('mountType' in req.body && typeof req.body.mountType !== 'string') return next(new HttpError(400, 'mountType must be a string'));
if ('mountOptions' in req.body && typeof req.body.mountOptions !== 'object') return next(new HttpError(400, 'mountOptions must be a object'));
// testing the backup using put/del takes a bit of time at times
req.clearTimeout();