From 4e758a9f4a5041186fab60fa12d756aa18fdba27 Mon Sep 17 00:00:00 2001 From: muxator Date: Sat, 19 Oct 2019 00:34:00 +0200 Subject: [PATCH] settings: better explain that no default value is very different from '' If environment variable PASSW is not defined, the following would be very different: "password": "${PASSW}" // would result in password === null "password": "${PASSW:}" // would result in password === '' This characteristic will be used in the next commit, when we will use it to discard a user if his password were null (and in turn use it for docker containerization). No functional changes. --- settings.json.template | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/settings.json.template b/settings.json.template index 9cdf2d3a7..27d605c98 100644 --- a/settings.json.template +++ b/settings.json.template @@ -22,13 +22,15 @@ * * Would read the configuration values for those items from the environment * variables PORT, MINIFY and SKIN_NAME. + * * If PORT and SKIN_NAME variables were not defined, the default values 9001 and - * "colibris" would be used. The configuration value "minify", on the other - * hand, does not have a default indicated. Thus, if the environment variable - * MINIFY were undefined, "minify" would be null (do not do this). + * "colibris" would be used. + * The configuration value "minify", on the other hand, does not have a + * designated default value. Thus, if the environment variable MINIFY were + * undefined, "minify" would be null. * * REMARKS: - * Please note that variable substitution always needs to be quoted. + * 1) please note that variable substitution always needs to be quoted. * * "port": 9001, <-- Literal values. When not using * "minify": false substitution, only strings must be @@ -45,6 +47,12 @@ * "minify": ${MINIFY} around variable names are missing. * "skinName": ${SKIN_NAME} * + * 2) Beware of undefined variables and default values: nulls and empty strings + * are different! + * + * "password": "${PASSW}" // if PASSW is not defined would result in password === null + * "password": "${PASSW:}" // if PASSW is not defined would result in password === '' + * */ { /*