aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/constants.ts
diff options
context:
space:
mode:
authorGérald Niel <gerald.niel@gegeweb.org>2018-04-19 19:28:55 +0200
committerGérald Niel <gerald.niel@gegeweb.org>2018-04-19 19:28:55 +0200
commit0db1a226507a39b0a663e3e63f04851836a44d5a (patch)
tree8c8dad658ea5608afaae238cfb6fe803292f908f /server/initializers/constants.ts
parent0030284b0df2983914291d6fe83675e2aa892e6a (diff)
parentd4f3fea659163749f9ea879a5e1dd313106353c6 (diff)
downloadPeerTube-0db1a226507a39b0a663e3e63f04851836a44d5a.tar.gz
PeerTube-0db1a226507a39b0a663e3e63f04851836a44d5a.tar.zst
PeerTube-0db1a226507a39b0a663e3e63f04851836a44d5a.zip
Merge branch 'develop' of framagit.org:chocobozzz/PeerTube into develop
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r--server/initializers/constants.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 5ee13389d..d1915586a 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -6,13 +6,14 @@ import { FollowState } from '../../shared/models/actors'
6import { VideoPrivacy } from '../../shared/models/videos' 6import { VideoPrivacy } from '../../shared/models/videos'
7// Do not use barrels, remain constants as independent as possible 7// Do not use barrels, remain constants as independent as possible
8import { buildPath, isTestInstance, root, sanitizeHost, sanitizeUrl } from '../helpers/core-utils' 8import { buildPath, isTestInstance, root, sanitizeHost, sanitizeUrl } from '../helpers/core-utils'
9import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
9 10
10// Use a variable to reload the configuration if we need 11// Use a variable to reload the configuration if we need
11let config: IConfig = require('config') 12let config: IConfig = require('config')
12 13
13// --------------------------------------------------------------------------- 14// ---------------------------------------------------------------------------
14 15
15const LAST_MIGRATION_VERSION = 200 16const LAST_MIGRATION_VERSION = 205
16 17
17// --------------------------------------------------------------------------- 18// ---------------------------------------------------------------------------
18 19
@@ -167,6 +168,7 @@ const CONFIG = {
167 get DESCRIPTION () { return config.get<string>('instance.description') }, 168 get DESCRIPTION () { return config.get<string>('instance.description') },
168 get TERMS () { return config.get<string>('instance.terms') }, 169 get TERMS () { return config.get<string>('instance.terms') },
169 get DEFAULT_CLIENT_ROUTE () { return config.get<string>('instance.default_client_route') }, 170 get DEFAULT_CLIENT_ROUTE () { return config.get<string>('instance.default_client_route') },
171 get DEFAULT_NSFW_POLICY () { return config.get<NSFWPolicyType>('instance.default_nsfw_policy') },
170 CUSTOMIZATIONS: { 172 CUSTOMIZATIONS: {
171 get JAVASCRIPT () { return config.get<string>('instance.customizations.javascript') }, 173 get JAVASCRIPT () { return config.get<string>('instance.customizations.javascript') },
172 get CSS () { return config.get<string>('instance.customizations.css') } 174 get CSS () { return config.get<string>('instance.customizations.css') }
@@ -378,6 +380,12 @@ const BCRYPT_SALT_SIZE = 10
378 380
379const USER_PASSWORD_RESET_LIFETIME = 60000 * 5 // 5 minutes 381const USER_PASSWORD_RESET_LIFETIME = 60000 * 5 // 5 minutes
380 382
383const NSFW_POLICY_TYPES: { [ id: string]: NSFWPolicyType } = {
384 DO_NOT_LIST: 'do_not_list',
385 BLUR: 'blur',
386 DISPLAY: 'display'
387}
388
381// --------------------------------------------------------------------------- 389// ---------------------------------------------------------------------------
382 390
383// Express static paths (router) 391// Express static paths (router)
@@ -474,6 +482,7 @@ export {
474 PRIVATE_RSA_KEY_SIZE, 482 PRIVATE_RSA_KEY_SIZE,
475 SORTABLE_COLUMNS, 483 SORTABLE_COLUMNS,
476 FEEDS, 484 FEEDS,
485 NSFW_POLICY_TYPES,
477 STATIC_MAX_AGE, 486 STATIC_MAX_AGE,
478 STATIC_PATHS, 487 STATIC_PATHS,
479 ACTIVITY_PUB, 488 ACTIVITY_PUB,