You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi All,
Openmetadata has a lot of environment variables in its docker compose file. Using Docker Swarm it would come really handy, if the sensible ones (passwords, etc.) may be read from file. Postgres Docker Image has a very nice builtin function (see below) which checks whether the name of the Environment variable ends with '_FILE', and if so then it reads the value from the file (for example: DB_PASSWORD_FILE: /run/secrets/db_password). I would appreciate a similar solution in Openmetadata entrypoint scripts.
The official entrypoint script of Postgres reads:
# usage: file_env VAR [DEFAULT]# ie: file_env 'XYZ_DB_PASSWORD' 'example'# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)file_env() {
<------>local var="$1"<------>local fileVar="${var}_FILE"<------>local def="${2:-}"<------>if [ "${!var:-}" ] && [ "${!fileVar:-}" ];then<------><------>printf >&2'error: both %s and %s are set (but are exclusive)\n'"$var""$fileVar"<------><------>exit 1
<------>fi
<------>local val="$def"<------>if [ "${!var:-}" ];then<------><------>val="${!var}"<------>elif [ "${!fileVar:-}" ];then<------><------>val="$(<"${!fileVar}")"<------>fi
<------>export "$var"="$val"<------>unset "$fileVar"
}
(Actual workaround /ie. hacking the entrypoint script/ we use is not a nice solution)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All,
Openmetadata has a lot of environment variables in its docker compose file. Using Docker Swarm it would come really handy, if the sensible ones (passwords, etc.) may be read from file. Postgres Docker Image has a very nice builtin function (see below) which checks whether the name of the Environment variable ends with '_FILE', and if so then it reads the value from the file (for example: DB_PASSWORD_FILE: /run/secrets/db_password). I would appreciate a similar solution in Openmetadata entrypoint scripts.
The official entrypoint script of Postgres reads:
(Actual workaround /ie. hacking the entrypoint script/ we use is not a nice solution)
Beta Was this translation helpful? Give feedback.
All reactions