Skip to content

Commit

Permalink
Allow changing ACME_DIRECTORY_URL from env var (#24)
Browse files Browse the repository at this point in the history
* Allow changing ACME_DIRECTORY_URL from env var

* Use const instead of let, good catch
  • Loading branch information
GabLeRoux authored and larryboymi committed Jul 30, 2018
1 parent c204b0e commit be6989a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config.js
Expand Up @@ -3,6 +3,9 @@ const defaultCertInfo = {
'cert-name2': ['<third-domain-needing-certificate>', '<fourth-domain-needing-certificate>']
}

const productionDirectoryUrl = process.env.ACME_DIRECTORY_URL || 'https://acme-v01.api.letsencrypt.org'
const stagingDirectoryUrl = process.env.ACME_DIRECTORY_URL || 'https://acme-staging.api.letsencrypt.org'

module.exports = {
's3-account-bucket': process.env.S3_ACCOUNT_BUCKET || '<your-s3-account-config-bucket>',
's3-cert-bucket': process.env.S3_CERT_BUCKET || '<your-s3-ssl-cert-bucket>',
Expand All @@ -13,6 +16,6 @@ module.exports = {
'acme-account-file': process.env.ACME_ACCOUNT_FILE || '<where-to-save-generated-account-registration>',
'acme-account-email': process.env.ACME_ACCOUNT_EMAIL || '<email-of-responsible-person>',
'acme-account-key-bits': 2048,
'acme-directory-url': process.env.USE_PRODUCTION ? 'https://acme-v01.api.letsencrypt.org' : 'https://acme-staging.api.letsencrypt.org',
'acme-directory-url': process.env.USE_PRODUCTION ? productionDirectoryUrl : stagingDirectoryUrl,
'region': process.env.AWS_REGION || 'us-east-1'
}

0 comments on commit be6989a

Please sign in to comment.