diff --git a/config/env/cloud-foundry.js b/config/env/cloud-foundry.js index 8ee7e63225..3a00da099d 100644 --- a/config/env/cloud-foundry.js +++ b/config/env/cloud-foundry.js @@ -66,5 +66,29 @@ module.exports = { pass: getCred('mean-mail', 'password') || 'MAILER_PASSWORD' } } + }, + seedDB: { + seed: process.env.MONGO_SEED === 'true' ? true : false, + options: { + logResults: process.env.MONGO_SEED_LOG_RESULTS === 'false' ? false : true, + seedUser: { + username: process.env.MONGO_SEED_USER_USERNAME || 'user', + provider: 'local', + email: process.env.MONGO_SEED_USER_EMAIL || 'user@localhost.com', + firstName: 'User', + lastName: 'Local', + displayName: 'User Local', + roles: ['user'] + }, + seedAdmin: { + username: process.env.MONGO_SEED_ADMIN_USERNAME || 'admin', + provider: 'local', + email: process.env.MONGO_SEED_ADMIN_EMAIL || 'admin@localhost.com', + firstName: 'Admin', + lastName: 'Local', + displayName: 'Admin Local', + roles: ['user', 'admin'] + } + } } }; diff --git a/config/lib/app.js b/config/lib/app.js index d9d0b0be09..42a8f5b420 100644 --- a/config/lib/app.js +++ b/config/lib/app.js @@ -10,7 +10,7 @@ var config = require('../config'), seed = require('./seed'); function seedDB() { - if (config.seedDB.seed) { + if (config.seedDB && config.seedDB.seed) { console.log(chalk.bold.red('Warning: Database seeding is turned on')); seed.start(); }