Skip to content

Commit

Permalink
Added connect-redis to package.all.json (#4)
Browse files Browse the repository at this point in the history
* Added connect-redis to package.all.json. See Haufe-Lexware/wicked.haufe.io#83

* Redis Sessionstore - add section in globals.json at config update for 0.12.0.

* Redis sessions - default configuration settings (default to using redis).
  • Loading branch information
achwie authored and DonMartin76 committed Sep 15, 2017
1 parent 6250f3a commit ffaeb3a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
12 changes: 12 additions & 0 deletions config-updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ function saveAuthServer(config, authServerId, authServer) {
* Adapt the Kong configuration of the APIs to the new Kong API as of
* Kong 0.10.x, most notably change request_uri to an array uris and
* map strip_request_path to strip_uri.
*
* Add a new section sessionStore to globals, prefill with 'file'.
*/
function updateStep6_Aug2017(targetConfig, sourceConfig, configKey) {
debug('Performing updateStep6_Aug2017()');
Expand Down Expand Up @@ -222,6 +224,16 @@ function updateStep6_Aug2017(targetConfig, sourceConfig, configKey) {
}
}

if (!targetGlobals.sessionStore) {
debug('Adding a default sessionStore property.');
targetGlobals.sessionStore = {
type: 'file',
host: 'portal-redis',
port: 6379,
password: ''
};
}

saveGlobals(targetConfig, targetGlobals);
}

Expand Down
2 changes: 1 addition & 1 deletion env-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function loadEnvironment(staticConfigPath, keyText, envName) {
var envFile = JSON.parse(fs.readFileSync(envFileName, 'utf8'));
for (var varName in envFile) {
if (process.env[varName]) {
console.log('Environment variable ' + varName + ' is already set. Skipping in this configuration.');
debug('Environment variable ' + varName + ' is already set to "' + process.env[varName] + '". Skipping in this configuration.');
continue;
}
var varProps = envFile[varName];
Expand Down
8 changes: 8 additions & 0 deletions initial-config/static/env/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,13 @@
"PORTAL_CHATBOT_URL": {
"encrypted": false,
"value": "http://portal-chatbot:3004"
},
"PORTAL_SESSIONSTORE_TYPE": {
"encrypted": false,
"value": "redis"
},
"PORTAL_SESSIONSTORE_HOST": {
"encrypted": false,
"value": "portal-redis"
}
}
6 changes: 6 additions & 0 deletions initial-config/static/globals.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
"mailerUrl": "$PORTAL_MAILER_URL",
"chatbotUrl": "$PORTAL_CHATBOT_URL"
},
"sessionStore": {
"type": "$PORTAL_SESSIONSTORE_TYPE",
"host": "$PORTAL_SESSIONSTORE_HOST",
"port": "6739",
"password": ""
},
"db": {
"staticConfig": "$PORTAL_API_STATIC_CONFIG",
"dynamicConfig": "$PORTAL_API_DYNAMIC_CONFIG"
Expand Down
1 change: 1 addition & 0 deletions package.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"bootstrap": "3.3.7",
"chai": "3.5.0",
"connect-flash": "0.1.1",
"connect-redis": "3.3.0",
"cookie-parser": "1.4.3",
"cors": "2.7.1",
"csurf": "1.9.0",
Expand Down

0 comments on commit ffaeb3a

Please sign in to comment.