X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Finitializers%2Fchecker-after-init.ts;h=44efd346ccb9187efd4dceb82b676a167f023adc;hb=562724a1ed13fe93aba08ca1a0f8e029819e9f32;hp=a99dbba3713effd5dfd4be4f7cd5c6389c1229d9;hpb=d85798c4e7b18f3b464fa819ffc5bec06137e3e9;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/initializers/checker-after-init.ts b/server/initializers/checker-after-init.ts index a99dbba37..44efd346c 100644 --- a/server/initializers/checker-after-init.ts +++ b/server/initializers/checker-after-init.ts @@ -4,19 +4,20 @@ import { UserModel } from '../models/account/user' import { ApplicationModel } from '../models/application/application' import { OAuthClientModel } from '../models/oauth/oauth-client' import { parse } from 'url' -import { CONFIG } from './constants' +import { CONFIG } from './config' import { logger } from '../helpers/logger' import { getServerActor } from '../helpers/utils' import { RecentlyAddedStrategy } from '../../shared/models/redundancy' import { isArray } from '../helpers/custom-validators/misc' import { uniq } from 'lodash' import { Emailer } from '../lib/emailer' +import { WEBSERVER } from './constants' async function checkActivityPubUrls () { const actor = await getServerActor() const parsed = parse(actor.url) - if (CONFIG.WEBSERVER.HOST !== parsed.host) { + if (WEBSERVER.HOST !== parsed.host) { const NODE_ENV = config.util.getEnv('NODE_ENV') const NODE_CONFIG_DIR = config.util.getEnv('NODE_CONFIG_DIR') @@ -61,7 +62,6 @@ function checkConfig () { // Redundancies const redundancyVideos = CONFIG.REDUNDANCY.VIDEOS.STRATEGIES - console.log(redundancyVideos) if (isArray(redundancyVideos)) { const available = [ 'most-views', 'trending', 'recently-added' ] for (const r of redundancyVideos) { @@ -101,6 +101,17 @@ function checkConfig () { } } + // Transcoding + if (CONFIG.TRANSCODING.ENABLED) { + if (CONFIG.TRANSCODING.WEBTORRENT.ENABLED === false && CONFIG.TRANSCODING.HLS.ENABLED === false) { + return 'You need to enable at least WebTorrent transcoding or HLS transcoding.' + } + } + + if (CONFIG.STORAGE.VIDEOS_DIR === CONFIG.STORAGE.REDUNDANCY_DIR) { + logger.warn('Redundancy directory should be different than the videos folder.') + } + return null }