mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-09 15:27:30 -05:00
24 lines
920 B
JavaScript
24 lines
920 B
JavaScript
/** Important **/
|
|
/** You should not be committing this file to GitHub **/
|
|
/** Repeat: DO! NOT! COMMIT! THIS! FILE! TO! YOUR! REPO! **/
|
|
const mongo_host = typeof process.env['MONGO_HOST'] !== 'undefined' ? process.env['MONGO_HOST'] : 'mongo';
|
|
const mongo_port = typeof process.env['MONGO_PORT'] !== 'undefined' ? process.env['MONGO_PORT'] : 27017;
|
|
const mongo_user = process.env['MONGO_USER'];
|
|
const mongo_password = process.env['MONGO_PASSWORD'];
|
|
|
|
let mongoUrl;
|
|
|
|
if ((typeof mongo_user !== 'undefined') && (typeof mongo_password !== 'undefined')) {
|
|
console.log("Using authentication for MongoDB - user: " + mongo_user);
|
|
mongoUrl = 'mongodb://' + mongo_user + ':' + mongo_password + '@' + mongo_host + ':' + mongo_port + '/scanner';
|
|
} else {
|
|
mongoUrl = 'mongodb://' + mongo_host + ':' + mongo_port + '/scanner';
|
|
}
|
|
|
|
const secrets = {
|
|
db: mongoUrl,
|
|
sessionSecret: "letthisbeyoursecret"
|
|
}
|
|
|
|
module.exports = secrets
|