aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/config.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/config.ts')
-rw-r--r--server/initializers/config.ts31
1 files changed, 27 insertions, 4 deletions
diff --git a/server/initializers/config.ts b/server/initializers/config.ts
index dadda2a77..f2e9f7088 100644
--- a/server/initializers/config.ts
+++ b/server/initializers/config.ts
@@ -1,12 +1,13 @@
1import bytes from 'bytes' 1import bytes from 'bytes'
2import { IConfig } from 'config' 2import { IConfig } from 'config'
3import decache from 'decache'
4import { dirname, join } from 'path' 3import { dirname, join } from 'path'
4import { decacheModule } from '@server/helpers/decache'
5import { VideoRedundancyConfigFilter } from '@shared/models/redundancy/video-redundancy-config-filter.type' 5import { VideoRedundancyConfigFilter } from '@shared/models/redundancy/video-redundancy-config-filter.type'
6import { BroadcastMessageLevel } from '@shared/models/server' 6import { BroadcastMessageLevel } from '@shared/models/server'
7import { VideosRedundancyStrategy } from '../../shared/models' 7import { VideoPrivacy, VideosRedundancyStrategy } from '../../shared/models'
8import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type' 8import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
9import { buildPath, parseBytes, parseDurationToMs, root } from '../helpers/core-utils' 9import { buildPath, root } from '../../shared/core-utils'
10import { parseBytes, parseDurationToMs } from '../helpers/core-utils'
10 11
11// Use a variable to reload the configuration if we need 12// Use a variable to reload the configuration if we need
12let config: IConfig = require('config') 13let config: IConfig = require('config')
@@ -63,6 +64,28 @@ const CONFIG = {
63 MINIATURE: { 64 MINIATURE: {
64 get PREFER_AUTHOR_DISPLAY_NAME () { return config.get<boolean>('client.videos.miniature.prefer_author_display_name') } 65 get PREFER_AUTHOR_DISPLAY_NAME () { return config.get<boolean>('client.videos.miniature.prefer_author_display_name') }
65 } 66 }
67 },
68 MENU: {
69 LOGIN: {
70 get REDIRECT_ON_SINGLE_EXTERNAL_AUTH () { return config.get<boolean>('client.menu.login.redirect_on_single_external_auth') }
71 }
72 }
73 },
74
75 DEFAULTS: {
76 PUBLISH: {
77 DOWNLOAD_ENABLED: config.get<boolean>('defaults.publish.download_enabled'),
78 COMMENTS_ENABLED: config.get<boolean>('defaults.publish.comments_enabled'),
79 PRIVACY: config.get<VideoPrivacy>('defaults.publish.privacy'),
80 LICENCE: config.get<number>('defaults.publish.licence')
81 },
82 P2P: {
83 WEBAPP: {
84 ENABLED: config.get<boolean>('defaults.p2p.webapp.enabled')
85 },
86 EMBED: {
87 ENABLED: config.get<boolean>('defaults.p2p.embed.enabled')
88 }
66 } 89 }
67 }, 90 },
68 91
@@ -497,7 +520,7 @@ export function reloadConfig () {
497 delete require.cache[fileName] 520 delete require.cache[fileName]
498 } 521 }
499 522
500 decache('config') 523 decacheModule('config')
501 } 524 }
502 525
503 purge() 526 purge()