mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
added authentication to mongo
This commit is contained in:
@@ -28,10 +28,14 @@
|
||||
|
||||
|
||||
// TODO : what is the db user name??
|
||||
/*if(nconf.get('mongo:password')) {
|
||||
db.authenticate(dbUser, nconf.get('mongo:password'), function (err) {
|
||||
if(nconf.get('mongo:password') && nconf.get('mongo:username')) {
|
||||
db.authenticate(nconf.get('mongo:username'), nconf.get('mongo:password'), function (err) {
|
||||
if(err) {
|
||||
winston.error(err.message);
|
||||
}
|
||||
process.exit();
|
||||
});
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
db.createCollection('objects', function(err, collection) {
|
||||
@@ -60,7 +64,7 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
callback(err);
|
||||
});
|
||||
|
||||
@@ -64,6 +64,9 @@ var async = require('async'),
|
||||
name: 'mongo:port',
|
||||
description: 'Host port of your MongoDB instance',
|
||||
'default': nconf.get('mongo:port') || 27017
|
||||
}, {
|
||||
name: 'mongo:user',
|
||||
description: 'MongoDB username'
|
||||
}, {
|
||||
name: 'mongo:password',
|
||||
description: 'Password of your MongoDB database'
|
||||
|
||||
Reference in New Issue
Block a user