import { CONFIG } from './constants'
import { logger } from '../helpers/logger'
import { getServerActor } from '../helpers/utils'
+import { VideosRedundancy } from '../../shared/models/redundancy'
+import { isArray } from '../helpers/custom-validators/misc'
+import { uniq } from 'lodash'
async function checkActivityPubUrls () {
const actor = await getServerActor()
return 'NSFW policy setting should be "do_not_list" or "blur" or "display" instead of ' + defaultNSFWPolicy
}
+ const redundancyVideos = config.get<VideosRedundancy[]>('redundancy.videos')
+ if (isArray(redundancyVideos)) {
+ for (const r of redundancyVideos) {
+ if ([ 'most-views', 'trending' ].indexOf(r.strategy) === -1) {
+ return 'Redundancy video entries should have "most-views" strategy instead of ' + r.strategy
+ }
+ }
+
+ const filtered = uniq(redundancyVideos.map(r => r.strategy))
+ if (filtered.length !== redundancyVideos.length) {
+ return 'Redundancy video entries should have uniq strategies'
+ }
+ }
+
return null
}
'signup.filters.cidr.whitelist', 'signup.filters.cidr.blacklist',
'transcoding.enabled', 'transcoding.threads',
'import.videos.http.enabled', 'import.videos.torrent.enabled',
+ 'trending.videos.interval_days',
'instance.name', 'instance.short_description', 'instance.description', 'instance.terms', 'instance.default_client_route',
- 'instance.default_nsfw_policy', 'instance.robots',
+ 'instance.default_nsfw_policy', 'instance.robots', 'instance.securitytxt',
'services.twitter.username', 'services.twitter.whitelisted'
]
const requiredAlternatives = [