fix: send the SMTP password as a secret
This commit is contained in:
parent
1238b56935
commit
f2fb65c490
2 changed files with 10 additions and 2 deletions
|
@ -42,9 +42,14 @@ if ! [ -z "$LW_CONFIGURE" ]; then
|
|||
<property name="port" value="${SMTP_PORT}" />
|
||||
EOF
|
||||
if [ "$SMTP_AUTH" != "false" ]; then
|
||||
if [ -z "$SMTP_PASSWORD_FILE" ]; then
|
||||
password="$SMTP_PASSWORD"
|
||||
else
|
||||
password="`cat $SMTP_PASSWORD_FILE`"
|
||||
fi
|
||||
cat >>data-source.xml <<EOF
|
||||
<property name="username" value="${SMTP_USER}" />
|
||||
<property name="password" value="${SMTP_PASSWORD}" />
|
||||
<property name="password" value="${password}" />
|
||||
EOF
|
||||
fi
|
||||
cat >>data-source.xml <<EOF
|
||||
|
|
|
@ -38,9 +38,10 @@ services:
|
|||
SMTP_PORT: ${SMTP_PORT}
|
||||
SMTP_AUTH: ${SMTP_AUTH}
|
||||
SMTP_USER: ${SMTP_USER}
|
||||
SMTP_PASSWORD: ${SMTP_PASSWORD}
|
||||
SMTP_PASSWORD_FILE: /run/secrets/smtp_password
|
||||
secrets:
|
||||
- lw_db_password
|
||||
- smtp_password
|
||||
|
||||
web-main:
|
||||
build:
|
||||
|
@ -73,3 +74,5 @@ secrets:
|
|||
environment: DB_PASSWORD
|
||||
lw_db_password:
|
||||
environment: LW_DB_PASSWORD
|
||||
smtp_password:
|
||||
environment: SMTP_PASSWORD
|
||||
|
|
Loading…
Reference in a new issue