backups: make filename encryption optional

This commit is contained in:
Girish Ramakrishnan
2022-06-26 09:28:21 -07:00
parent 2e5d89be6b
commit c9f7b9a8a6
5 changed files with 25 additions and 4 deletions

View File

@@ -73,7 +73,11 @@ async function setBackupConfig(req, res, next) {
if (typeof req.body.provider !== 'string') return next(new HttpError(400, 'provider is required'));
if (typeof req.body.schedulePattern !== 'string') return next(new HttpError(400, 'schedulePattern is required'));
if ('password' in req.body && typeof req.body.password !== 'string') return next(new HttpError(400, 'password must be a string'));
if ('password' in req.body) {
if (typeof req.body.password !== 'string') return next(new HttpError(400, 'password must be a string'));
if (typeof req.body.encryptFilenames !== 'boolean') return next(new HttpError(400, 'encryptFilenames must be a boolean'));
}
if ('syncConcurrency' in req.body) {
if (typeof req.body.syncConcurrency !== 'number') return next(new HttpError(400, 'syncConcurrency must be a positive integer'));
if (req.body.syncConcurrency < 1) return next(new HttpError(400, 'syncConcurrency must be a positive integer'));