Browse Source

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
pull/4143/head
BlackDex 2 years ago
parent
commit
46fb588f37
No known key found for this signature in database GPG Key ID: 58C80A2AA6C765E1
  1. 10
      docker/healthcheck.sh

10
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() {

Loading…
Cancel
Save