diff options
author | Chocobozzz <me@florianbigard.com> | 2020-05-28 11:15:38 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-05-29 09:32:12 +0200 |
commit | 72c33e716fecd1826dcf645957f8669821f91ff3 (patch) | |
tree | 31d270c2afc2f07303fa491189d6b6b1c0ea8bb1 /server/initializers/config.ts | |
parent | 8adf0a767f0816465ac3a8f4a6c63f53dd05fe3d (diff) | |
download | PeerTube-72c33e716fecd1826dcf645957f8669821f91ff3.tar.gz PeerTube-72c33e716fecd1826dcf645957f8669821f91ff3.tar.zst PeerTube-72c33e716fecd1826dcf645957f8669821f91ff3.zip |
Support broadcast messages
Diffstat (limited to 'server/initializers/config.ts')
-rw-r--r-- | server/initializers/config.ts | 7 |
1 files changed, 7 insertions, 0 deletions
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- | |||
6 | import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type' | 6 | import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type' |
7 | import * as bytes from 'bytes' | 7 | import * as bytes from 'bytes' |
8 | import { VideoRedundancyConfigFilter } from '@shared/models/redundancy/video-redundancy-config-filter.type' | 8 | import { VideoRedundancyConfigFilter } from '@shared/models/redundancy/video-redundancy-config-filter.type' |
9 | import { 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 |
11 | let config: IConfig = require('config') | 12 | let 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 | ||