diff --git a/config.js b/config.js index 8987f1114..99600508a 100644 --- a/config.js +++ b/config.js @@ -30,7 +30,7 @@ const CONFIG = { ENABLE_TRACING: Boolean(process.env.APOLLO_ENGINE_KEY), // EMAIL_SUBJECT_PREFIX is the string before emails in the subject. - EMAIL_SUBJECT_PREFIX: process.env.TALK_EMAIL_SUBJECT_PREFIX || '[Talk]', + EMAIL_SUBJECT_PREFIX: process.env.TALK_EMAIL_SUBJECT_PREFIX, // DEFAULT_LANG is the default language used for server sent emails and // rendered text. @@ -271,6 +271,10 @@ const CONFIG = { // CONFIG VALIDATION //============================================================================== +if (typeof CONFIG.EMAIL_SUBJECT_PREFIX === 'undefined') { + CONFIG.EMAIL_SUBJECT_PREFIX = '[Talk]'; +} + if (process.env.NODE_ENV === 'test') { if (!CONFIG.ROOT_URL) { CONFIG.ROOT_URL = `http://${localAddress}:3001`; diff --git a/docs/source/02-02-advanced-configuration.md b/docs/source/02-02-advanced-configuration.md index 083b4bcdb..49769be0b 100644 --- a/docs/source/02-02-advanced-configuration.md +++ b/docs/source/02-02-advanced-configuration.md @@ -246,6 +246,21 @@ Refer to the documentation for [TALK_JWT_ALG](#talk-jwt-alg) for other signing methods and other forms of the `TALK_JWT_SECRET`. If you are interested in using multiple keys, then refer to [TALK_JWT_SECRETS](#talk-jwt-secrets). +You can also encode your secret as a base64 string (if you are using a symmetric +algorithm) as long as you prefix it with `base64:`. For example: + +```plain +TALK_JWT_SECRET={"secret": "base64:dGVzdA=="} +``` + +Would be the same as: + +```plain +TALK_JWT_SECRET={"secret": "test"} +``` + +As `dGVzdA==` is just `test` encoded using base64. + ## TALK_JWT_SECRETS Used when specifying multiple secrets used for key rotations. This is a JSON @@ -271,7 +286,6 @@ Note that the secret is stored in a JSON object, keyed by `secret`. This is only needed when specifying in the multiple secrets for `TALK_JWT_SECRETS`, but may be used to specify the single [TALK_JWT_SECRET](#talk-jwt-secret). - When the value of [TALK_JWT_ALG](#talk-jwt-alg) is **not** a `HS*` value, then the value of the `TALK_JWT_SECRETS` should take the form: @@ -282,7 +296,6 @@ TALK_JWT_SECRETS=[{"kid": "1", "private": "", "public": "