diff --git a/example.env b/example.env index ef94775..e907f93 100644 --- a/example.env +++ b/example.env @@ -25,6 +25,8 @@ MONGO_MEMORY_DB=framework-proto # Encryption secret CRYPTO_SECRET=verySecretSecret +# See Server.js for how it's used, not used for anything user related +CRYPTO_SALT=salty # Session secret SECRET=verySecretSecret diff --git a/src/server/Server.js b/src/server/Server.js index d1e9790..72c7952 100644 --- a/src/server/Server.js +++ b/src/server/Server.js @@ -33,9 +33,10 @@ class Server extends EventEmitter { super(); const { MARIA_HOST, MARIA_USER, MARIA_PORT, MARIA_PASS, MARIA_DB, - MONGO_HOST, MONGO_USER, MONGO_PORT, MONGO_PASS, MONGO_DB, - NODE_ENV, SECRET, CRYPTO_SECRET, CRYPTO_SALT, MONGO_AUTH_DB, - MONGO_MEMORY_HOST, MONGO_MEMORY_USER, MONGO_MEMORY_PORT, + MONGO_URI, MONGO_HOST, MONGO_USER, + MONGO_PORT, MONGO_PASS, MONGO_DB, MONGO_AUTH_DB, + NODE_ENV, SECRET, CRYPTO_SECRET, CRYPTO_SALT, + MONGO_MEMORY_URI, MONGO_MEMORY_HOST, MONGO_MEMORY_USER, MONGO_MEMORY_PORT, MONGO_MEMORY_PASS, MONGO_MEMORY_DB, MONGO_MEMORY_AUTH_DB } = process.env; const { http: httpOpts, databases, validUserTypes } = options; @@ -77,6 +78,7 @@ class Server extends EventEmitter { // Mongo is used for session and user storage this.mongodb = new MongoDB(this, { options: databases.mongodb, + MONGO_URI, MONGO_HOST, MONGO_USER, MONGO_PORT, @@ -89,6 +91,7 @@ class Server extends EventEmitter { // Distributed memory storage, using mongo in this case, but this could be redis or whatever this.memoryStoreProvider = new MongoDB(this, { options: databases.mongodb, + MONGO_URI: MONGO_MEMORY_URI, MONGO_HOST: MONGO_MEMORY_HOST, MONGO_USER: MONGO_MEMORY_USER, MONGO_PORT: MONGO_MEMORY_PORT,