]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - src/checker.js
4 var config
= require('config')
5 var mkdirp
= require('mkdirp')
9 // Check the config files
10 checker
.checkConfig = function () {
11 var required
= [ 'listen.port',
12 'webserver.https', 'webserver.host', 'webserver.port',
13 'database.host', 'database.port', 'database.suffix',
14 'storage.certs', 'storage.uploads', 'storage.logs',
18 for (var key
of required
) {
19 if (!config
.has(key
)) {
27 // Create directories for the storage if it doesn't exist
28 checker
.createDirectoriesIfNotExist = function () {
29 var storages
= config
.get('storage')
31 for (var key
of Object
.keys(storages
)) {
32 var path
= storages
[key
]
34 mkdirp
.sync(__dirname
+ '/../' + path
)
37 console
.error('Cannot create ' + path
+ ':' + error
)
43 // ----------- Export -----------
44 module
.exports
= checker