import { buildPath, parseBytes, parseDurationToMs, root } from '../helpers/core-utils'
import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
import * as bytes from 'bytes'
+import { VideoRedundancyConfigFilter } from '@shared/models/redundancy/video-redundancy-config-filter.type'
// Use a variable to reload the configuration if we need
let config: IConfig = require('config')
STRATEGIES: buildVideosRedundancy(config.get<any[]>('redundancy.videos.strategies'))
}
},
+ REMOTE_REDUNDANCY: {
+ VIDEOS: {
+ ACCEPT_FROM: config.get<VideoRedundancyConfigFilter>('remote_redundancy.videos.accept_from')
+ }
+ },
CSP: {
ENABLED: config.get<boolean>('csp.enabled'),
REPORT_ONLY: config.get<boolean>('csp.report_only'),
configChangedHandlers.push(fun)
}
+function isEmailEnabled () {
+ return !!CONFIG.SMTP.HOSTNAME && !!CONFIG.SMTP.PORT
+}
+
// ---------------------------------------------------------------------------
export {
CONFIG,
- registerConfigChangedHandler
+ registerConfigChangedHandler,
+ isEmailEnabled
}
// ---------------------------------------------------------------------------
if (process.env.NODE_ENV) filename += `-${process.env.NODE_ENV}`
if (process.env.NODE_APP_INSTANCE) filename += `-${process.env.NODE_APP_INSTANCE}`
- return join(dirname(configSources[ 0 ].name), filename + '.json')
+ return join(dirname(configSources[0].name), filename + '.json')
}
function buildVideosRedundancy (objs: any[]): VideosRedundancyStrategy[] {
function purge () {
for (const fileName in require.cache) {
- if (-1 === fileName.indexOf(directory())) {
+ if (fileName.includes(directory()) === false) {
continue
}