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}" />
|
<property name="port" value="${SMTP_PORT}" />
|
||||||
EOF
|
EOF
|
||||||
if [ "$SMTP_AUTH" != "false" ]; then
|
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
|
cat >>data-source.xml <<EOF
|
||||||
<property name="username" value="${SMTP_USER}" />
|
<property name="username" value="${SMTP_USER}" />
|
||||||
<property name="password" value="${SMTP_PASSWORD}" />
|
<property name="password" value="${password}" />
|
||||||
EOF
|
EOF
|
||||||
fi
|
fi
|
||||||
cat >>data-source.xml <<EOF
|
cat >>data-source.xml <<EOF
|
||||||
|
|
|
@ -38,9 +38,10 @@ services:
|
||||||
SMTP_PORT: ${SMTP_PORT}
|
SMTP_PORT: ${SMTP_PORT}
|
||||||
SMTP_AUTH: ${SMTP_AUTH}
|
SMTP_AUTH: ${SMTP_AUTH}
|
||||||
SMTP_USER: ${SMTP_USER}
|
SMTP_USER: ${SMTP_USER}
|
||||||
SMTP_PASSWORD: ${SMTP_PASSWORD}
|
SMTP_PASSWORD_FILE: /run/secrets/smtp_password
|
||||||
secrets:
|
secrets:
|
||||||
- lw_db_password
|
- lw_db_password
|
||||||
|
- smtp_password
|
||||||
|
|
||||||
web-main:
|
web-main:
|
||||||
build:
|
build:
|
||||||
|
@ -73,3 +74,5 @@ secrets:
|
||||||
environment: DB_PASSWORD
|
environment: DB_PASSWORD
|
||||||
lw_db_password:
|
lw_db_password:
|
||||||
environment: LW_DB_PASSWORD
|
environment: LW_DB_PASSWORD
|
||||||
|
smtp_password:
|
||||||
|
environment: SMTP_PASSWORD
|
||||||
|
|
Loading…
Reference in a new issue