From 1df9b675222b67ec6521cdda7f14522cce9ab022 Mon Sep 17 00:00:00 2001 From: Dmytro Lazariev Date: Thu, 20 Apr 2023 12:40:32 +0300 Subject: [PATCH] [IMP] pass DB user from secret The password stored in Docker Secret could be passed using the `PASSWORD_FILE` environment variable. This PR allows to pass the user. --- 14.0/entrypoint.sh | 4 ++++ 15.0/entrypoint.sh | 4 ++++ 16.0/entrypoint.sh | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/14.0/entrypoint.sh b/14.0/entrypoint.sh index f802bcb25..29913df1c 100755 --- a/14.0/entrypoint.sh +++ b/14.0/entrypoint.sh @@ -2,6 +2,10 @@ set -e +if [ -v USER_FILE ]; then + USER="$(< $USER_FILE)" +fi + if [ -v PASSWORD_FILE ]; then PASSWORD="$(< $PASSWORD_FILE)" fi diff --git a/15.0/entrypoint.sh b/15.0/entrypoint.sh index f802bcb25..29913df1c 100755 --- a/15.0/entrypoint.sh +++ b/15.0/entrypoint.sh @@ -2,6 +2,10 @@ set -e +if [ -v USER_FILE ]; then + USER="$(< $USER_FILE)" +fi + if [ -v PASSWORD_FILE ]; then PASSWORD="$(< $PASSWORD_FILE)" fi diff --git a/16.0/entrypoint.sh b/16.0/entrypoint.sh index f802bcb25..29913df1c 100755 --- a/16.0/entrypoint.sh +++ b/16.0/entrypoint.sh @@ -2,6 +2,10 @@ set -e +if [ -v USER_FILE ]; then + USER="$(< $USER_FILE)" +fi + if [ -v PASSWORD_FILE ]; then PASSWORD="$(< $PASSWORD_FILE)" fi