This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RAINCATCH-1262 - server side config improvements (#122)
* RAINCATCH-1262 - server side config improvements * Externalize port
- Loading branch information
Showing
12 changed files
with
187 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
|
||
|
||
// Server side application configuration | ||
var config = { | ||
// Application port number | ||
"port": process.env.PORT || process.env.FH_PORT || 8001, | ||
"morganOptions": "dev", | ||
"logStackTraces": true, | ||
// Use this parameter to disable inserting demo data into mongodb | ||
"seedDemoData": true, | ||
// General security configuration | ||
"security": { | ||
"adminRole": "admin", | ||
"userRole": "user", | ||
// Passport.js security configuration | ||
"passportjs": { | ||
// Passport.js secret for JWT tokens. Provide custom value even for development needs | ||
"jwtSecret": "D837131FD17F62CB85FBD5919563086369691F4D42379C3596F811839A8992CBA1FBA88DF243BF2481940F112D339C33283BDFEF29A13612550EDAAAB7B5E061", | ||
// Allows to provide custom login page messages | ||
"portalLoginPage": { | ||
"title": "RainCatcher Portal", | ||
"invalidMessage": "Invalid Credentials" | ||
}, | ||
}, | ||
// Keycloak configuration. Uncomment to enable keycloak integration | ||
// "keycloak": { | ||
// "realm": "", | ||
// "bearer-only": true, | ||
// "auth-server-url": "", | ||
// "ssl-required": "", | ||
// "resource": "", | ||
// "use-resource-role-mappings": true | ||
// } | ||
}, | ||
"sync": { | ||
// Required to handle UI. | ||
"customDataHandlers": true | ||
}, | ||
// See bunyan.d.ts/LoggerOptions | ||
"bunyanConfig": { | ||
"name": "Demo application", | ||
"level": "debug" | ||
}, | ||
// Database configuration | ||
"mongodb": { | ||
"url": getMongoUrl(), | ||
"options": {} | ||
}, | ||
// Cache layer configuration | ||
"redis": { | ||
"url": getRedisUrl() | ||
}, | ||
} | ||
|
||
function getMongoUrl() { | ||
if (process.env.MONGO_CONNECTION_URL) { | ||
return process.env.MONGO_CONNECTION_URL | ||
} | ||
if (process.env.FH_MONGODB_CONN_URL) { | ||
// Legacy env variable only to support in house systems | ||
return process.env.FH_MONGODB_CONN_URL; | ||
} | ||
return "mongodb://127.0.0.1:27017/raincatcher"; | ||
} | ||
|
||
function getRedisUrl() { | ||
if (process.env.REDIS_CONNECTION_URL) { | ||
return process.env.REDIS_CONNECTION_URL | ||
} | ||
// Legacy env variable only to support in house systems | ||
if (process.env.FH_REDIS_HOST) { | ||
return 'redis://' + process.env.FH_REDIS_HOST + ':' + process.env.FH_REDIS_PORT | ||
} | ||
return "redis://127.0.0.1:6379"; | ||
} | ||
|
||
module.exports = config; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
|
||
|
||
// Server side application configuration | ||
var config = { | ||
// Application port number | ||
"port": process.env.PORT || process.env.FH_PORT || 8001, | ||
"morganOptions": null, | ||
"logStackTraces": false, | ||
// Use this parameter to disable inserting demo data into mongodb | ||
"seedDemoData": false, | ||
// General security configuration | ||
"security": { | ||
"adminRole": "admin", | ||
"userRole": "user", | ||
// Passport.js security configuration | ||
"passportjs": { | ||
// Passport.js secret for JWT tokens. Provide custom value even for development needs | ||
"jwtSecret": "D837131FD17F62CB85FBD5919563086369691F4D42379C3596F811839A8992CBA1FBA88DF243BF2481940F112D339C33283BDFEF29A13612550EDAAAB7B5E061", | ||
// Allows to provide custom login page messages | ||
"portalLoginPage": { | ||
"title": "RainCatcher Portal", | ||
"invalidMessage": "Invalid Credentials" | ||
}, | ||
}, | ||
// Keycloak configuration. Uncomment to enable keycloak integration | ||
// "keycloak": { | ||
// "realm": "", | ||
// "bearer-only": true, | ||
// "auth-server-url": "", | ||
// "ssl-required": "", | ||
// "resource": "", | ||
// "use-resource-role-mappings": true | ||
// } | ||
}, | ||
"sync": { | ||
// Required to handle UI. | ||
"customDataHandlers": true | ||
}, | ||
// See bunyan.d.ts/LoggerOptions | ||
"bunyanConfig": { | ||
"name": "Demo application", | ||
"level": "debug" | ||
}, | ||
// Database configuration | ||
"mongodb": { | ||
"url": getMongoUrl(), | ||
"options": {} | ||
}, | ||
// Cache layer configuration | ||
"redis": { | ||
"url": getRedisUrl() | ||
}, | ||
} | ||
|
||
function getMongoUrl() { | ||
if (process.env.MONGO_CONNECTION_URL) { | ||
return process.env.MONGO_CONNECTION_URL | ||
} | ||
if (process.env.FH_MONGODB_CONN_URL) { | ||
// Legacy env variable only to support in house systems | ||
return process.env.FH_MONGODB_CONN_URL; | ||
} | ||
return "mongodb://127.0.0.1:27017/raincatcher"; | ||
} | ||
|
||
function getRedisUrl() { | ||
if (process.env.REDIS_CONNECTION_URL) { | ||
return process.env.REDIS_CONNECTION_URL | ||
} | ||
// Legacy env variable only to support in house systems | ||
if (process.env.FH_REDIS_HOST) { | ||
return 'redis://' + process.env.FH_REDIS_HOST + ':' + process.env.FH_REDIS_PORT | ||
} | ||
return "redis://127.0.0.1:6379"; | ||
} | ||
|
||
module.exports = config; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.