bigbluebutton-Github/bigbluebutton-html5/imports/startup/server/settings.js

21 lines
618 B
JavaScript
Raw Normal View History

/* global __meteor_runtime_config__ */
2018-09-19 00:12:16 +08:00
import { Meteor } from 'meteor/meteor';
import fs from 'fs';
import YAML from 'yaml';
2018-09-19 00:12:16 +08:00
const YAML_FILE_PATH = process.env.BBB_HTML5_SETTINGS || 'assets/app/config/settings.yml';
2018-09-19 00:12:16 +08:00
try {
if (fs.existsSync(YAML_FILE_PATH)) {
const SETTINGS = YAML.parse(fs.readFileSync(YAML_FILE_PATH, 'utf-8'));
2018-09-19 00:12:16 +08:00
Meteor.settings = SETTINGS;
__meteor_runtime_config__.PUBLIC_SETTINGS = SETTINGS.public;
} else {
throw new Error('File doesn\'t exists');
2018-09-19 00:12:16 +08:00
}
} catch (error) {
// eslint-disable-next-line no-console
console.error('Error on load configuration file.', error);
2018-09-19 00:12:16 +08:00
}