diff options
author | Chocobozzz <me@florianbigard.com> | 2018-04-19 11:01:34 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-04-19 11:01:34 +0200 |
commit | 0883b3245bf0deb9106c4041e9afbd3521b79280 (patch) | |
tree | fcb73005e0b31a3b763ee5d22d5fc39c2da89907 /server/initializers/checker.ts | |
parent | 04ed10b21e8e1339514faae0bb690e4d97c23b0a (diff) | |
download | PeerTube-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/initializers/checker.ts')
-rw-r--r-- | server/initializers/checker.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/server/initializers/checker.ts b/server/initializers/checker.ts index 71f303963..739f623c6 100644 --- a/server/initializers/checker.ts +++ b/server/initializers/checker.ts | |||
@@ -5,12 +5,12 @@ import { ApplicationModel } from '../models/application/application' | |||
5 | import { OAuthClientModel } from '../models/oauth/oauth-client' | 5 | import { OAuthClientModel } from '../models/oauth/oauth-client' |
6 | 6 | ||
7 | // Some checks on configuration files | 7 | // Some checks on configuration files |
8 | // Return an error message, or null if everything is okay | ||
8 | function checkConfig () { | 9 | function checkConfig () { |
9 | if (config.has('webserver.host')) { | 10 | const defaultNSFWPolicy = config.get<string>('instance.default_nsfw_policy') |
10 | let errorMessage = '`host` config key was renamed to `hostname` but it seems you still have a `host` key in your configuration files!' | ||
11 | errorMessage += ' Please ensure to rename your `host` configuration to `hostname`.' | ||
12 | 11 | ||
13 | return errorMessage | 12 | if ([ 'do_not_list', 'blur', 'display' ].indexOf(defaultNSFWPolicy) === -1) { |
13 | return 'NSFW policy setting should be "do_not_list" or "blur" or "display" instead of ' + defaultNSFWPolicy | ||
14 | } | 14 | } |
15 | 15 | ||
16 | return null | 16 | return null |
@@ -28,7 +28,8 @@ function checkMissedConfig () { | |||
28 | 'log.level', | 28 | 'log.level', |
29 | 'user.video_quota', | 29 | 'user.video_quota', |
30 | 'cache.previews.size', 'admin.email', 'signup.enabled', 'signup.limit', 'transcoding.enabled', 'transcoding.threads', | 30 | 'cache.previews.size', 'admin.email', 'signup.enabled', 'signup.limit', 'transcoding.enabled', 'transcoding.threads', |
31 | 'instance.name', 'instance.short_description', 'instance.description', 'instance.terms', 'instance.default_client_route' | 31 | 'instance.name', 'instance.short_description', 'instance.description', 'instance.terms', 'instance.default_client_route', |
32 | 'instance.default_nsfw_policy' | ||
32 | ] | 33 | ] |
33 | const miss: string[] = [] | 34 | const miss: string[] = [] |
34 | 35 | ||