aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/checker-after-init.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-07-06 15:44:14 +0200
committerChocobozzz <me@florianbigard.com>2022-07-06 16:12:17 +0200
commit9452d4fd3321148fb80b64a67bd9983fee6c208e (patch)
tree62ad9be8d3f4bfcf63196274ad4b736372c05f2c /server/initializers/checker-after-init.ts
parent630d0a1bf5897fff203cb07e426223f55dcc882d (diff)
downloadPeerTube-9452d4fd3321148fb80b64a67bd9983fee6c208e.tar.gz
PeerTube-9452d4fd3321148fb80b64a67bd9983fee6c208e.tar.zst
PeerTube-9452d4fd3321148fb80b64a67bd9983fee6c208e.zip
/!\ Use a dedicated config file for development
It means you have to replace NODE_ENV=test to NODE_ENV=dev if you use it npm run dev:* commands are already updated
Diffstat (limited to 'server/initializers/checker-after-init.ts')
-rw-r--r--server/initializers/checker-after-init.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/initializers/checker-after-init.ts b/server/initializers/checker-after-init.ts
index f65798c42..e542a5395 100644
--- a/server/initializers/checker-after-init.ts
+++ b/server/initializers/checker-after-init.ts
@@ -4,7 +4,7 @@ import { URL } from 'url'
4import { getFFmpegVersion } from '@server/helpers/ffmpeg' 4import { getFFmpegVersion } from '@server/helpers/ffmpeg'
5import { VideoRedundancyConfigFilter } from '@shared/models/redundancy/video-redundancy-config-filter.type' 5import { VideoRedundancyConfigFilter } from '@shared/models/redundancy/video-redundancy-config-filter.type'
6import { RecentlyAddedStrategy } from '../../shared/models/redundancy' 6import { RecentlyAddedStrategy } from '../../shared/models/redundancy'
7import { isProdInstance, isTestInstance, parseSemVersion } from '../helpers/core-utils' 7import { isProdInstance, parseSemVersion } from '../helpers/core-utils'
8import { isArray } from '../helpers/custom-validators/misc' 8import { isArray } from '../helpers/custom-validators/misc'
9import { logger } from '../helpers/logger' 9import { logger } from '../helpers/logger'
10import { ApplicationModel, getServerActor } from '../models/application/application' 10import { ApplicationModel, getServerActor } from '../models/application/application'
@@ -34,6 +34,9 @@ async function checkActivityPubUrls () {
34// Some checks on configuration files or throw if there is an error 34// Some checks on configuration files or throw if there is an error
35function checkConfig () { 35function checkConfig () {
36 36
37 const configFiles = config.util.getConfigSources().map(s => s.name).join(' -> ')
38 logger.info('Using following configuration file hierarchy: %s.', configFiles)
39
37 // Moved configuration keys 40 // Moved configuration keys
38 if (config.has('services.csp-logger')) { 41 if (config.has('services.csp-logger')) {
39 logger.warn('services.csp-logger configuration has been renamed to csp.report_uri. Please update your configuration file.') 42 logger.warn('services.csp-logger configuration has been renamed to csp.report_uri. Please update your configuration file.')
@@ -128,7 +131,7 @@ function checkLocalRedundancyConfig () {
128 } 131 }
129 132
130 // Lifetime should not be < 10 hours 133 // Lifetime should not be < 10 hours
131 if (!isTestInstance() && r.minLifetime < 1000 * 3600 * 10) { 134 if (isProdInstance() && r.minLifetime < 1000 * 3600 * 10) {
132 throw new Error('Video redundancy minimum lifetime should be >= 10 hours for strategy ' + r.strategy) 135 throw new Error('Video redundancy minimum lifetime should be >= 10 hours for strategy ' + r.strategy)
133 } 136 }
134 } 137 }