82 lines
1.7 KiB
JavaScript
82 lines
1.7 KiB
JavaScript
const config = require('../config')
|
|
const fs = require('fs')
|
|
|
|
const not_valid = (message) => {
|
|
console.error('not valid (config.js): ', message)
|
|
}
|
|
|
|
const test_config = () => {
|
|
var config_pass = true
|
|
|
|
if (!config) {
|
|
not_valid('config')
|
|
config_pass = false
|
|
}
|
|
|
|
if (!config.port) {
|
|
not_valid('port')
|
|
config_pass = false
|
|
}
|
|
|
|
if (!config.external_domain) {
|
|
not_valid('external_domain')
|
|
config_pass = false
|
|
}
|
|
|
|
if (!config.coordinator_url) {
|
|
not_valid('coordinator_url')
|
|
config_pass = false
|
|
}
|
|
|
|
if (!config.database_url) {
|
|
not_valid('database_url')
|
|
config_pass = false
|
|
}
|
|
|
|
if (!config.database_name) {
|
|
not_valid('database_name')
|
|
config_pass = false
|
|
}
|
|
|
|
if (!config.webrtc_port_begin) {
|
|
not_valid('webrtc_port_begin')
|
|
config_pass = false
|
|
}
|
|
|
|
if (!config.session_limit) {
|
|
not_valid('session_limit')
|
|
config_pass = false
|
|
}
|
|
|
|
if (!config.log_path) {
|
|
not_valid('log_path')
|
|
config_pass = false
|
|
}
|
|
|
|
if (!config.webrtc_server_path) {
|
|
not_valid('webrtc_server_path')
|
|
config_pass = false
|
|
}
|
|
|
|
if (!config.sfu_server_path) {
|
|
not_valid('sfu_server_path')
|
|
config_pass = false
|
|
}
|
|
|
|
if (config.webrtc_server_path) {
|
|
if (!fs.existsSync(config.webrtc_server_path)) {
|
|
not_valid('wbertc_server_path exists in config BUT not in the filesystem (file not exists)')
|
|
config_pass = false
|
|
}
|
|
}
|
|
|
|
if (!config.app_args) {
|
|
not_valid('webrtc_server_path')
|
|
config_pass = false
|
|
}
|
|
return config_pass
|
|
}
|
|
|
|
module.exports = {
|
|
test_config
|
|
} |