mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
configure secondary db modules
This commit is contained in:
@@ -163,8 +163,6 @@ var async = require('async'),
|
|||||||
|
|
||||||
var database = (config.redis || config.mongo || config.level) ? config.secondary_database : config.database;
|
var database = (config.redis || config.mongo || config.level) ? config.secondary_database : config.database;
|
||||||
|
|
||||||
winston.info('Now configuring ' + database + ' database:');
|
|
||||||
|
|
||||||
var dbQuestionsSuccess = function (err, databaseConfig) {
|
var dbQuestionsSuccess = function (err, databaseConfig) {
|
||||||
if (!databaseConfig) {
|
if (!databaseConfig) {
|
||||||
return next(new Error('aborted'));
|
return next(new Error('aborted'));
|
||||||
@@ -248,11 +246,13 @@ var async = require('async'),
|
|||||||
prompt.get(install.questions, function(err, config) {
|
prompt.get(install.questions, function(err, config) {
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function(next) {
|
function(next) {
|
||||||
|
winston.info('Now configuring ' + config.database + ' database:');
|
||||||
success(err, config, next);
|
success(err, config, next);
|
||||||
},
|
},
|
||||||
function(config, next) {
|
function(config, next) {
|
||||||
|
winston.info('Now configuring ' + config.secondary_database + ' database:');
|
||||||
if (config.secondary_database && ALLOWED_DATABASES.indexOf(config.secondary_database) !== -1) {
|
if (config.secondary_database && ALLOWED_DATABASES.indexOf(config.secondary_database) !== -1) {
|
||||||
success(err, config, next);
|
getSecondaryDatabaseModules(config, next);
|
||||||
} else {
|
} else {
|
||||||
next(err, config);
|
next(err, config);
|
||||||
}
|
}
|
||||||
@@ -271,6 +271,17 @@ var async = require('async'),
|
|||||||
success(null, config, completeConfigSetup);
|
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) {
|
function completeConfigSetup(err, config) {
|
||||||
config.bcrypt_rounds = 12;
|
config.bcrypt_rounds = 12;
|
||||||
config.upload_path = '/public/uploads';
|
config.upload_path = '/public/uploads';
|
||||||
|
|||||||
Reference in New Issue
Block a user