Skip to content

Commit

Permalink
Merge branch 'yaacovCR-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
wulfsolter committed May 1, 2016
2 parents d24e7b3 + 4bd0f51 commit 607cc68
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Features
* Connect and authenticate to individual databases
* Authenticate as admin to view all databases
* Database blacklist/whitelist
* Custom CA and CA validation disabling


Screenshots
Expand Down Expand Up @@ -125,6 +126,7 @@ You can use the following [environment variables](https://docs.docker.com/refere
`ME_CONFIG_REQUEST_SIZE` | `100kb` | Used to configure maximum mongo update payload size. CRUD operations above this size will fail due to restrictions in [body-parser](https://www.npmjs.com/package/body-parser).
`ME_CONFIG_OPTIONS_EDITORTHEME` | `rubyblue` | Web editor color theme, [more here](http://codemirror.net/demo/theme.html).
`ME_CONFIG_SITE_SSL_ENABLED` | `false` | Enable SSL.
`ME_CONFIG_MONGODB_SSLVALIDATE` | `true` | Validate mongod server certificate against CA
`ME_CONFIG_SITE_SSL_CRT_PATH` | ` ` | SSL certificate file.
`ME_CONFIG_SITE_SSL_KEY_PATH` | ` ` | SSL key file.

Expand Down
10 changes: 8 additions & 2 deletions config.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ module.exports = {
server: process.env.ME_CONFIG_MONGODB_SERVER || mongo.host,
port: process.env.ME_CONFIG_MONGODB_PORT || mongo.port,

//useSSL: connect to the server using secure SSL
useSSL: process.env.ME_CONFIG_MONGODB_SSL || mongo.ssl,
//ssl: connect to the server using secure SSL
ssl: process.env.ME_CONFIG_MONGODB_SSL || mongo.ssl,

//sslValidate: validate mongod server certificate against CA
sslValidate: process.env.ME_CONFIG_MONGODB_SSLVALIDATE || true,

//sslCA: array of valid CA certificates
sslCA: [],

//autoReconnect: automatically reconnect if connection is lost
autoReconnect: true,
Expand Down
10 changes: 9 additions & 1 deletion lib/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@ let connect = function (config) {
// set up database stuff
let host = config.mongodb.server || 'localhost';
let port = config.mongodb.port || mongodb.Connection.DEFAULT_PORT;

if (config.mongodb.useSSL) {
console.error('Please update config file to use mongodb.ssl instead of mongodb.useSSL. Copying value for now.');
config.mongodb.ssl = config.mongodb.useSSL;
}

let dbOptions = {
auto_reconnect: config.mongodb.autoReconnect,
poolSize: config.mongodb.poolSize,
ssl: config.mongodb.useSSL,
ssl: config.mongodb.ssl,
sslValidate: config.mongodb.sslValidate,
sslCA: config.mongodb.sslCA,
};

let db;
Expand Down

0 comments on commit 607cc68

Please sign in to comment.