Skip to content

Commit

Permalink
added new env vars to example file
Browse files Browse the repository at this point in the history
when in dev env don't validate aws vars existence
  • Loading branch information
omerzam committed Nov 4, 2020
1 parent 3d18210 commit 7a11558
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .env.example
Expand Up @@ -72,3 +72,10 @@ TORUS_VERIFICATION_RETRY_DELAY=
# Allow log errors to the bug tracking systems (e.g. sentry)
# Boolean. Optional. Default: true
REMOTE_LOGGING_ALLOWED=

# AWS ses vars
AWS_SES_ACCESS_KEY=
AWS_SES_SECRET_ACCESS_KEY=
AWS_SES_REGION='eu-west-1'
AWS_SES_SOURCE_VERIFICATION_EMAIL='GoodDollar <support@gooddollar.org>'
AWS_SES_TEMPLATE_NAME=VerificationEmail
7 changes: 5 additions & 2 deletions src/server/aws-ses/aws-ses.js
Expand Up @@ -8,8 +8,11 @@ const region = conf.awsSesRegion
const sourceVerificationEmail = conf.awsSesSourceVerificationEmail
const templateName = conf.awsSesTemplateName

if (!accessKeyId || !secretAccessKey || !region || !sourceVerificationEmail || !templateName) {
throw new Error('Missing AWS configuration')
let runInEnv = ['production', 'staging', 'test'].includes(conf.env)
if (runInEnv) {
if (!accessKeyId || !secretAccessKey || !region || !sourceVerificationEmail || !templateName) {
throw new Error('Missing AWS configuration')
}
}

const SES_CONFIG = {
Expand Down

0 comments on commit 7a11558

Please sign in to comment.