X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Finitializers%2Fchecker-after-init.ts;h=44efd346ccb9187efd4dceb82b676a167f023adc;hb=f0ad47100748ba5f660b597787422b1b302e64c0;hp=85f7522848cd888f3a14605ba8a28ce5df125a51;hpb=1ed9b8ee69ba42b2be70512eb8df239be4676674;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/initializers/checker-after-init.ts b/server/initializers/checker-after-init.ts index 85f752284..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') @@ -100,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 }