Add ability to accept or not remote redundancies

This commit is contained in:
Chocobozzz
2020-04-07 15:32:20 +02:00
parent bc30363602
commit 8c9e787526
12 changed files with 279 additions and 2 deletions
@@ -11,6 +11,7 @@ import { RecentlyAddedStrategy } from '../../shared/models/redundancy'
import { isArray } from '../helpers/custom-validators/misc'
import { uniq } from 'lodash'
import { WEBSERVER } from './constants'
import { VideoRedundancyConfigFilter } from '@shared/models/redundancy/video-redundancy-config-filter.type'
async function checkActivityPubUrls () {
const actor = await getServerActor()
@@ -87,6 +88,13 @@ function checkConfig () {
return 'Videos redundancy should be an array (you must uncomment lines containing - too)'
}
// Remote redundancies
const acceptFrom = CONFIG.REMOTE_REDUNDANCY.VIDEOS.ACCEPT_FROM
const acceptFromValues = new Set<VideoRedundancyConfigFilter>([ 'nobody', 'anybody', 'followings' ])
if (acceptFromValues.has(acceptFrom) === false) {
return 'remote_redundancy.videos.accept_from has an incorrect value'
}
// Check storage directory locations
if (isProdInstance()) {
const configStorage = config.get('storage')