1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-08-05 10:39:07 +00:00

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
This commit is contained in:
BlackDex 2023-12-06 23:21:37 +01:00
commit 46fb588f37
No known key found for this signature in database
GPG key ID: 58C80A2AA6C765E1

View file

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