aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/config.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-19 11:01:34 +0200
committerChocobozzz <me@florianbigard.com>2018-04-19 11:01:34 +0200
commit0883b3245bf0deb9106c4041e9afbd3521b79280 (patch)
treefcb73005e0b31a3b763ee5d22d5fc39c2da89907 /server/middlewares/validators/config.ts
parent04ed10b21e8e1339514faae0bb690e4d97c23b0a (diff)
downloadPeerTube-0883b3245bf0deb9106c4041e9afbd3521b79280.tar.gz
PeerTube-0883b3245bf0deb9106c4041e9afbd3521b79280.tar.zst
PeerTube-0883b3245bf0deb9106c4041e9afbd3521b79280.zip
Add ability to choose what policy we have for NSFW videos
There is a global instance setting and a per user setting
Diffstat (limited to 'server/middlewares/validators/config.ts')
-rw-r--r--server/middlewares/validators/config.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/middlewares/validators/config.ts b/server/middlewares/validators/config.ts
index ee6f6efa4..f58c0676c 100644
--- a/server/middlewares/validators/config.ts
+++ b/server/middlewares/validators/config.ts
@@ -1,6 +1,6 @@
1import * as express from 'express' 1import * as express from 'express'
2import { body } from 'express-validator/check' 2import { body } from 'express-validator/check'
3import { isUserVideoQuotaValid } from '../../helpers/custom-validators/users' 3import { isUserNSFWPolicyValid, isUserVideoQuotaValid } from '../../helpers/custom-validators/users'
4import { logger } from '../../helpers/logger' 4import { logger } from '../../helpers/logger'
5import { areValidationErrors } from './utils' 5import { areValidationErrors } from './utils'
6 6
@@ -9,6 +9,7 @@ const customConfigUpdateValidator = [
9 body('instance.description').exists().withMessage('Should have a valid instance description'), 9 body('instance.description').exists().withMessage('Should have a valid instance description'),
10 body('instance.terms').exists().withMessage('Should have a valid instance terms'), 10 body('instance.terms').exists().withMessage('Should have a valid instance terms'),
11 body('instance.defaultClientRoute').exists().withMessage('Should have a valid instance default client route'), 11 body('instance.defaultClientRoute').exists().withMessage('Should have a valid instance default client route'),
12 body('instance.defaultNSFWPolicy').custom(isUserNSFWPolicyValid).withMessage('Should have a valid NSFW policy'),
12 body('instance.customizations.css').exists().withMessage('Should have a valid instance CSS customization'), 13 body('instance.customizations.css').exists().withMessage('Should have a valid instance CSS customization'),
13 body('instance.customizations.javascript').exists().withMessage('Should have a valid instance JavaScript customization'), 14 body('instance.customizations.javascript').exists().withMessage('Should have a valid instance JavaScript customization'),
14 body('cache.previews.size').isInt().withMessage('Should have a valid previews size'), 15 body('cache.previews.size').isInt().withMessage('Should have a valid previews size'),