Closed linksgo2011 closed 9 years ago
ok like this? this.dbpassword = (config.dbpassword==="") ? "" : config.dbpassword || "ydoc";
someone has better idea's ?
Johan.
But it probably is wrong too in (our template startup script in doc/empty/index.js)
// 2. if -c exists, overwrite customized config values if(process.argv.indexOf("-c") != -1){ var extraConfigFilePath = process.argv[process.argv.indexOf("-c") + 1]; var obj = JSON.parse(fs.readFileSync(extraConfigFilePath, 'utf8')); Object.keys(cody.config).forEach(function (name) { cody.config[name] = obj[name] || cody.config[name]; }); }
// 3. overwrite environment variable values Object.keys(cody.config).forEach(function (name) { cody.config[name] = process.env[name] || cody.config[name]; });
I guess we should use
this.dbpassword = (typeof config.dbpassword === "undefined") ? "ydoc" : config.dbpassword;
and
cody.config[name] = (typeof obj[name] === "undefined") ? cody.config[name] : obj[name];
?
commit on github and new npm version
this.dbuser = config.dbuser || "cody"; this.dbpassword = config.dbpassword || "ydoc"; // When the user password is empty, this can lead to wrong password this.dbhost = config.dbhost || "localhost"; this.db = config.db || "cody"; this.smtp = config.smtp || "smtp.telenet.be"; this.smtpoptions = config.smtpoptions; // see https://github.com/andris9/Nodemailer this.mailFrom = config.mailFrom || "info@cody-cms.org";