diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-08-26 09:17:20 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-08-26 09:17:20 +0200 |
commit | 3482688cce11495b51970f680f375ed56deb4464 (patch) | |
tree | f2553e582b07298930dd5857667a5840dfe5ee67 /server.ts | |
parent | c6720f0bf5ff3b28876d5f98eb09d1e83dbed39c (diff) | |
download | PeerTube-3482688cce11495b51970f680f375ed56deb4464.tar.gz PeerTube-3482688cce11495b51970f680f375ed56deb4464.tar.zst PeerTube-3482688cce11495b51970f680f375ed56deb4464.zip |
Fix config checker
Diffstat (limited to 'server.ts')
-rw-r--r-- | server.ts | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -23,28 +23,29 @@ process.title = 'peertube' | |||
23 | // Create our main app | 23 | // Create our main app |
24 | const app = express() | 24 | const app = express() |
25 | 25 | ||
26 | // ----------- Database ----------- | 26 | // ----------- Core checker ----------- |
27 | // Do not use barrels because we don't want to load all modules here (we need to initialize database first) | ||
28 | import { logger } from './server/helpers/logger' | ||
29 | import { API_VERSION, CONFIG, STATIC_PATHS } from './server/initializers/constants' | ||
30 | // Initialize database and models | ||
31 | import { database as db } from './server/initializers/database' | ||
32 | db.init(false).then(() => onDatabaseInitDone()) | ||
33 | |||
34 | // ----------- Checker ----------- | ||
35 | import { checkMissedConfig, checkFFmpeg, checkConfig } from './server/initializers/checker' | 27 | import { checkMissedConfig, checkFFmpeg, checkConfig } from './server/initializers/checker' |
36 | 28 | ||
37 | const missed = checkMissedConfig() | 29 | const missed = checkMissedConfig() |
38 | if (missed.length !== 0) { | 30 | if (missed.length !== 0) { |
39 | throw new Error('Miss some configurations keys : ' + missed) | 31 | throw new Error('Your configuration files miss keys: ' + missed) |
40 | } | 32 | } |
41 | checkFFmpeg() | 33 | |
34 | import { API_VERSION, CONFIG, STATIC_PATHS } from './server/initializers/constants' | ||
35 | checkFFmpeg(CONFIG) | ||
42 | 36 | ||
43 | const errorMessage = checkConfig() | 37 | const errorMessage = checkConfig() |
44 | if (errorMessage !== null) { | 38 | if (errorMessage !== null) { |
45 | throw new Error(errorMessage) | 39 | throw new Error(errorMessage) |
46 | } | 40 | } |
47 | 41 | ||
42 | // ----------- Database ----------- | ||
43 | // Do not use barrels because we don't want to load all modules here (we need to initialize database first) | ||
44 | import { logger } from './server/helpers/logger' | ||
45 | // Initialize database and models | ||
46 | import { database as db } from './server/initializers/database' | ||
47 | db.init(false).then(() => onDatabaseInitDone()) | ||
48 | |||
48 | // ----------- PeerTube modules ----------- | 49 | // ----------- PeerTube modules ----------- |
49 | import { migrate, installApplication } from './server/initializers' | 50 | import { migrate, installApplication } from './server/initializers' |
50 | import { JobScheduler, activateSchedulers, VideosPreviewCache } from './server/lib' | 51 | import { JobScheduler, activateSchedulers, VideosPreviewCache } from './server/lib' |