Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support configuration via environment variables #3572

Merged
merged 7 commits into from
Mar 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ cp ../settings.json.template settings.json
[ further edit your settings.json as needed]
```

**Each configuration parameter can also be set via an environment variable**, using the syntax `"${ENV_VAR_NAME}"`. For details, refer to `settings.json.template`.

Build the version you prefer:
```bash
# builds latest development version
Expand Down
37 changes: 35 additions & 2 deletions settings.json.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,41 @@
*
* Please edit settings.json, not settings.json.template
*
* Please note that since Etherpad 1.6.0 you can store DB credentials in a
* separate file (credentials.json).
* Please note that starting from Etherpad 1.6.0 you can store DB credentials in
* a separate file (credentials.json).
*
*
* ENVIRONMENT VARIABLE SUBSTITUTION
* =================================
*
* All the configuration values can be read from environment variables using the
* syntax "${ENV_VAR_NAME}".
* This is useful, for example, when running in a Docker container.
*
* EXAMPLE:
* "port": "${PORT}"
* "minify": "${MINIFY}"
* "skinName": "${SKIN_NAME}"
*
* Would read the configuration values for those items from the environment
* variables PORT, MINIFY and SKIN_NAME.
*
* REMARKS:
* Please note that a variable substitution always needs to be quoted.
* "port": 9001, <-- Literal values. When not using substitution,
* "minify": false only strings must be quoted: booleans and
* "skin": "colibris" numbers must not.
*
* "port": ${PORT} <-- ERROR: this is not valid json
* "minify": ${MINIFY}
* "skin": ${SKIN_NAME}
*
* "port": "${PORT}" <-- CORRECT: if you want to use a variable
* "minify": "${MINIFY}" substitution, put quotes around its name,
* "skin": "${SKIN_NAME}" even if the required value is a number or a
* boolean.
* Etherpad will take care of rewriting it to
* the proper type if necessary.
*/
{
/*
Expand Down
Loading