aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers')
-rw-r--r--server/initializers/checker-after-init.ts14
-rw-r--r--server/initializers/config.ts7
2 files changed, 19 insertions, 2 deletions
diff --git a/server/initializers/checker-after-init.ts b/server/initializers/checker-after-init.ts
index f111be2ae..b5b854137 100644
--- a/server/initializers/checker-after-init.ts
+++ b/server/initializers/checker-after-init.ts
@@ -107,6 +107,10 @@ function checkConfig () {
107 } 107 }
108 } 108 }
109 109
110 if (CONFIG.STORAGE.VIDEOS_DIR === CONFIG.STORAGE.REDUNDANCY_DIR) {
111 logger.warn('Redundancy directory should be different than the videos folder.')
112 }
113
110 // Transcoding 114 // Transcoding
111 if (CONFIG.TRANSCODING.ENABLED) { 115 if (CONFIG.TRANSCODING.ENABLED) {
112 if (CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false && CONFIG.TRANSCODING.HLS.ENABLED === false) { 116 if (CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false && CONFIG.TRANSCODING.HLS.ENABLED === false) {
@@ -114,8 +118,14 @@ function checkConfig () {
114 } 118 }
115 } 119 }
116 120
117 if (CONFIG.STORAGE.VIDEOS_DIR === CONFIG.STORAGE.REDUNDANCY_DIR) { 121 // Broadcast message
118 logger.warn('Redundancy directory should be different than the videos folder.') 122 if (CONFIG.BROADCAST_MESSAGE.ENABLED) {
123 const currentLevel = CONFIG.BROADCAST_MESSAGE.LEVEL
124 const available = [ 'info', 'warning', 'error' ]
125
126 if (available.includes(currentLevel) === false) {
127 return 'Broadcast message level should be ' + available.join(' or ') + ' instead of ' + currentLevel
128 }
119 } 129 }
120 130
121 return null 131 return null
diff --git a/server/initializers/config.ts b/server/initializers/config.ts
index 6932b41e1..e2920ce9e 100644
--- a/server/initializers/config.ts
+++ b/server/initializers/config.ts
@@ -6,6 +6,7 @@ import { buildPath, parseBytes, parseDurationToMs, root } from '../helpers/core-
6import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type' 6import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
7import * as bytes from 'bytes' 7import * as bytes from 'bytes'
8import { VideoRedundancyConfigFilter } from '@shared/models/redundancy/video-redundancy-config-filter.type' 8import { VideoRedundancyConfigFilter } from '@shared/models/redundancy/video-redundancy-config-filter.type'
9import { BroadcastMessageLevel } from '@shared/models/server'
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')
@@ -285,6 +286,12 @@ const CONFIG = {
285 }, 286 },
286 THEME: { 287 THEME: {
287 get DEFAULT () { return config.get<string>('theme.default') } 288 get DEFAULT () { return config.get<string>('theme.default') }
289 },
290 BROADCAST_MESSAGE: {
291 get ENABLED () { return config.get<boolean>('broadcast_message.enabled') },
292 get MESSAGE () { return config.get<string>('broadcast_message.message') },
293 get LEVEL () { return config.get<BroadcastMessageLevel>('broadcast_message.level') },
294 get DISMISSABLE () { return config.get<boolean>('broadcast_message.dismissable') }
288 } 295 }
289} 296}
290 297