Skip to content

Commit

Permalink
Fix healthcheck when using an ENV file
Browse files Browse the repository at this point in the history
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
  • Loading branch information
BlackDex committed Dec 6, 2023
1 parent 15d6520 commit 46fb588
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docker/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 46fb588

Please sign in to comment.