From 46fb588f37d9576ee0e398411547a431a14168e6 Mon Sep 17 00:00:00 2001 From: BlackDex Date: Wed, 6 Dec 2023 23:21:37 +0100 Subject: [PATCH] Fix healthcheck when using an ENV file If someone is using a `.env` file or configured the `ENV_FILE` variable to use that as it's configuration, this was missed by the healthcheck. So, `DOMAIN` and `ROCKET_TLS` were not seen, and not used in these cases. This commit fixes this by checking for this file and if it exists, then it will load those variables first. Fixes #4112 --- docker/healthcheck.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docker/healthcheck.sh b/docker/healthcheck.sh index 5021b187dc..9d518c1a14 100755 --- a/docker/healthcheck.sh +++ b/docker/healthcheck.sh @@ -7,6 +7,16 @@ CONFIG_FILE="${DATA_FOLDER}"/config.json +# Check if there is a .env file configured +# If that is the case, load it into the environment before running any check +if [ -z "${ENV_FILE}" ]; then + ENV_FILE=".env" +fi +if [ -r "${ENV_FILE}" ]; then + # shellcheck disable=SC1090 + . "${ENV_FILE}" +fi + # Given a config key, return the corresponding config value from the # config file. If the key doesn't exist, return an empty string. get_config_val() {