diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c50a3f63..5959858fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,9 @@ `"${UNSET_VAR:undefined}"`), the setting is now removed instead of set to the string "undefined". It is no longer possible to produce the string "undefined" via environment variable substitution. + * Support for unset variables without a default value is now deprecated. + Please change all instances of `"${FOO}"` in your `settings.json` to + `${FOO:null}` to keep the current behavior. ### Notable enhancements diff --git a/settings.json.docker b/settings.json.docker index 80becd3be..426a58953 100644 --- a/settings.json.docker +++ b/settings.json.docker @@ -45,7 +45,9 @@ * - "${UNSET_VAR:undefined}" causes the setting to be removed (or be set * to null, if used as a member of an array). * - If the environment variable is unset and no default value is provided, - * the value becomes null. + * the value becomes null. THIS BEHAVIOR MAY CHANGE IN A FUTURE VERSION OF + * ETHERPAD; if you want the default value to be null, you should explicitly + * specify "null" as the default value. * * EXAMPLE: * "port": "${PORT:9001}" diff --git a/settings.json.template b/settings.json.template index 3469cc7a4..2d7f119a2 100644 --- a/settings.json.template +++ b/settings.json.template @@ -36,7 +36,9 @@ * - "${UNSET_VAR:undefined}" causes the setting to be removed (or be set * to null, if used as a member of an array). * - If the environment variable is unset and no default value is provided, - * the value becomes null. + * the value becomes null. THIS BEHAVIOR MAY CHANGE IN A FUTURE VERSION OF + * ETHERPAD; if you want the default value to be null, you should explicitly + * specify "null" as the default value. * * EXAMPLE: * "port": "${PORT:9001}" diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js index 27630a046..482abd730 100644 --- a/src/node/utils/Settings.js +++ b/src/node/utils/Settings.js @@ -599,7 +599,9 @@ const lookupEnvironmentVariables = (obj) => { if ((envVarValue === undefined) && (defaultValue === undefined)) { console.warn(`Environment variable "${envVarName}" does not contain any value for ` + - `configuration key "${key}", and no default was given. Returning null.`); + `configuration key "${key}", and no default was given. Using null. ` + + 'THIS BEHAVIOR MAY CHANGE IN A FUTURE VERSION OF ETHERPAD; you should ' + + 'explicitly use "null" as the default if you want to continue to use null.'); /* * We have to return null, because if we just returned undefined, the