mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 14:05:46 +01:00
configure secondary db modules
This commit is contained in:
@@ -117,7 +117,7 @@ var async = require('async'),
|
||||
if (!setupVal['admin:email']) {
|
||||
winston.error(' admin:email');
|
||||
}
|
||||
|
||||
|
||||
process.exit();
|
||||
}
|
||||
} else {
|
||||
@@ -163,8 +163,6 @@ var async = require('async'),
|
||||
|
||||
var database = (config.redis || config.mongo || config.level) ? config.secondary_database : config.database;
|
||||
|
||||
winston.info('Now configuring ' + database + ' database:');
|
||||
|
||||
var dbQuestionsSuccess = function (err, databaseConfig) {
|
||||
if (!databaseConfig) {
|
||||
return next(new Error('aborted'));
|
||||
@@ -248,11 +246,13 @@ var async = require('async'),
|
||||
prompt.get(install.questions, function(err, config) {
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
winston.info('Now configuring ' + config.database + ' database:');
|
||||
success(err, config, next);
|
||||
},
|
||||
function(config, next) {
|
||||
winston.info('Now configuring ' + config.secondary_database + ' database:');
|
||||
if (config.secondary_database && ALLOWED_DATABASES.indexOf(config.secondary_database) !== -1) {
|
||||
success(err, config, next);
|
||||
getSecondaryDatabaseModules(config, next);
|
||||
} else {
|
||||
next(err, config);
|
||||
}
|
||||
@@ -271,6 +271,17 @@ var async = require('async'),
|
||||
success(null, config, completeConfigSetup);
|
||||
}
|
||||
|
||||
function getSecondaryDatabaseModules(config, next) {
|
||||
prompt.get({
|
||||
"name": "secondary_db_modules",
|
||||
"description": "Which database modules should " + config.secondary_database + " store?",
|
||||
"default": nconf.get('secondary_db_modules') || "hash, list, sets, sorted"
|
||||
}, function(err, db) {
|
||||
config.secondary_db_modules = db.secondary_db_modules;
|
||||
success(err, config, next);
|
||||
});
|
||||
}
|
||||
|
||||
function completeConfigSetup(err, config) {
|
||||
config.bcrypt_rounds = 12;
|
||||
config.upload_path = '/public/uploads';
|
||||
|
||||
Reference in New Issue
Block a user