mirror of
https://github.com/bitwarden/server.git
synced 2025-04-22 05:25:10 -05:00
Support reading a file for the SA_PASSWORD for swarm security. (#477)
This commit is contained in:
parent
d6a451d41f
commit
03bcce1e73
@ -27,6 +27,17 @@ useradd -o -u $LUID -g $GROUPNAME -s /bin/false $USERNAME >/dev/null 2>&1 ||
|
|||||||
usermod -o -u $LUID -g $GROUPNAME -s /bin/false $USERNAME >/dev/null 2>&1
|
usermod -o -u $LUID -g $GROUPNAME -s /bin/false $USERNAME >/dev/null 2>&1
|
||||||
mkhomedir_helper $USERNAME
|
mkhomedir_helper $USERNAME
|
||||||
|
|
||||||
|
# Read the SA_PASSWORD value from a file for swarm environments.
|
||||||
|
# See https://github.com/Microsoft/mssql-docker/issues/326
|
||||||
|
if [ ! -z "$SA_PASSWORD" ] && [ ! -z "$SA_PASSWORD_FILE" ]; then
|
||||||
|
echo "Provided both SA_PASSWORD and SA_PASSWORD_FILE environment variables. Please only use one."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -z "$SA_PASSWORD_FILE" ]; then
|
||||||
|
# It should be exported, so it is available to the env command below.
|
||||||
|
export SA_PASSWORD=$(cat $SA_PASSWORD_FILE)
|
||||||
|
fi
|
||||||
|
|
||||||
# The rest...
|
# The rest...
|
||||||
|
|
||||||
# ref: https://stackoverflow.com/a/38850273
|
# ref: https://stackoverflow.com/a/38850273
|
||||||
|
Loading…
x
Reference in New Issue
Block a user