Skip to content

Commit

Permalink
cleaning up config
Browse files Browse the repository at this point in the history
  • Loading branch information
teddmason committed Jan 25, 2024
1 parent 4ef11c0 commit 316af24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,4 @@ The default values will be used if the environment variables are missing or comm
| REDIS_PORT | Redis port | yes | 6379 | |
| REDIS_PASSWORD | Redis password | yes | foo | |
| REDIS_TLS | Does redis connect over TLS | no | false | |
| COOKIE_TIMEOUT | Cookie timeout in ms | yes | 7200000 | |
| SUBMIT_INCIDENT | Submit incident flag | yes | false | |
| COOKIE_TIMEOUT | Cookie timeout in ms | yes | 7200000 | | |
14 changes: 2 additions & 12 deletions server/utils/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,7 @@ const schema = Joi.object().keys({
sessionCookiePassword: Joi.string().default('the-password-must-be-at-least-32-characters-long'),
cookieIsSecure: Joi.bool().default(false),
osDataURI: Joi.string().default('https://osdatahub.co.uk'),
osKey: Joi.string(),
submitIncident: Joi.bool().valid(true, false),
fishingConnectionString: Joi.string(),
waterConnectionString: Joi.string(),
fishingQueue: Joi.string(),
waterQueue: Joi.string()
osKey: Joi.string()
})

// Build config
Expand All @@ -54,12 +49,7 @@ const config = {
sessionCookiePassword: process.env.SESSION_COOKIE_PASSWORD,
cookieIsSecure: getBoolean(process.env.COOKIE_IS_SECURE),
osDataURI: process.env.OS_DATA_HUB_URI,
osKey: process.env.OS_KEY,
submitIncident: getBoolean(process.env.SUBMIT_INCIDENT),
fishingConnectionString: process.env.FISHING_CONNECTION_STRING,
waterConnectionString: process.env.WATER_CONNECTION_STRING,
fishingQueue: process.env.FISHING_QUEUE,
waterQueue: process.env.WATER_QUEUE
osKey: process.env.OS_KEY
}

// Validate config
Expand Down

0 comments on commit 316af24

Please sign in to comment.