aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/checker-after-init.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-04-07 15:27:41 +0200
committerChocobozzz <me@florianbigard.com>2020-04-07 15:32:20 +0200
commit8c9e7875269a990ed3000e1d4995d808e4ff50f7 (patch)
tree896f60aedf0fac0dc64b57ff76a63e7a718c0a5b /server/initializers/checker-after-init.ts
parentbc30363602ad504d784662a9373c0a114d05042c (diff)
downloadPeerTube-8c9e7875269a990ed3000e1d4995d808e4ff50f7.tar.gz
PeerTube-8c9e7875269a990ed3000e1d4995d808e4ff50f7.tar.zst
PeerTube-8c9e7875269a990ed3000e1d4995d808e4ff50f7.zip
Add ability to accept or not remote redundancies
Diffstat (limited to 'server/initializers/checker-after-init.ts')
-rw-r--r--server/initializers/checker-after-init.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/server/initializers/checker-after-init.ts b/server/initializers/checker-after-init.ts
index bc4aae957..a57d552df 100644
--- a/server/initializers/checker-after-init.ts
+++ b/server/initializers/checker-after-init.ts
@@ -11,6 +11,7 @@ import { RecentlyAddedStrategy } from '../../shared/models/redundancy'
11import { isArray } from '../helpers/custom-validators/misc' 11import { isArray } from '../helpers/custom-validators/misc'
12import { uniq } from 'lodash' 12import { uniq } from 'lodash'
13import { WEBSERVER } from './constants' 13import { WEBSERVER } from './constants'
14import { VideoRedundancyConfigFilter } from '@shared/models/redundancy/video-redundancy-config-filter.type'
14 15
15async function checkActivityPubUrls () { 16async function checkActivityPubUrls () {
16 const actor = await getServerActor() 17 const actor = await getServerActor()
@@ -87,6 +88,13 @@ function checkConfig () {
87 return 'Videos redundancy should be an array (you must uncomment lines containing - too)' 88 return 'Videos redundancy should be an array (you must uncomment lines containing - too)'
88 } 89 }
89 90
91 // Remote redundancies
92 const acceptFrom = CONFIG.REMOTE_REDUNDANCY.VIDEOS.ACCEPT_FROM
93 const acceptFromValues = new Set<VideoRedundancyConfigFilter>([ 'nobody', 'anybody', 'followings' ])
94 if (acceptFromValues.has(acceptFrom) === false) {
95 return 'remote_redundancy.videos.accept_from has an incorrect value'
96 }
97
90 // Check storage directory locations 98 // Check storage directory locations
91 if (isProdInstance()) { 99 if (isProdInstance()) {
92 const configStorage = config.get('storage') 100 const configStorage = config.get('storage')