aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/checker.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/checker.ts')
-rw-r--r--server/initializers/checker.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/server/initializers/checker.ts b/server/initializers/checker.ts
index 9dd104035..6a2badd35 100644
--- a/server/initializers/checker.ts
+++ b/server/initializers/checker.ts
@@ -7,6 +7,9 @@ import { parse } from 'url'
7import { CONFIG } from './constants' 7import { CONFIG } from './constants'
8import { logger } from '../helpers/logger' 8import { logger } from '../helpers/logger'
9import { getServerActor } from '../helpers/utils' 9import { getServerActor } from '../helpers/utils'
10import { VideosRedundancy } from '../../shared/models/redundancy'
11import { isArray } from '../helpers/custom-validators/misc'
12import { uniq } from 'lodash'
10 13
11async function checkActivityPubUrls () { 14async function checkActivityPubUrls () {
12 const actor = await getServerActor() 15 const actor = await getServerActor()
@@ -35,6 +38,20 @@ function checkConfig () {
35 return 'NSFW policy setting should be "do_not_list" or "blur" or "display" instead of ' + defaultNSFWPolicy 38 return 'NSFW policy setting should be "do_not_list" or "blur" or "display" instead of ' + defaultNSFWPolicy
36 } 39 }
37 40
41 const redundancyVideos = config.get<VideosRedundancy[]>('redundancy.videos')
42 if (isArray(redundancyVideos)) {
43 for (const r of redundancyVideos) {
44 if ([ 'most-views' ].indexOf(r.strategy) === -1) {
45 return 'Redundancy video entries should have "most-views" strategy instead of ' + r.strategy
46 }
47 }
48
49 const filtered = uniq(redundancyVideos.map(r => r.strategy))
50 if (filtered.length !== redundancyVideos.length) {
51 return 'Redundancy video entries should have uniq strategies'
52 }
53 }
54
38 return null 55 return null
39} 56}
40 57