mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-08-25 20:23:21 +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:
parent
15d652088e
commit
46fb588f37
1 changed files with 10 additions and 0 deletions
|
@ -7,6 +7,16 @@
|
||||||
|
|
||||||
CONFIG_FILE="${DATA_FOLDER}"/config.json
|
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
|
# Given a config key, return the corresponding config value from the
|
||||||
# config file. If the key doesn't exist, return an empty string.
|
# config file. If the key doesn't exist, return an empty string.
|
||||||
get_config_val() {
|
get_config_val() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue