feat: add mail_password #2

Merged
mayel merged 1 commits from smtp-secret into main 2026-03-27 18:49:53 +00:00
4 changed files with 23 additions and 5 deletions

View File

@ -39,8 +39,6 @@ DOMAIN=bonfire.example.com
# enable abra backups
ENABLE_BACKUPS=true
# what service to use for sending out emails (eg. smtp, mailgun, none) NOTE: you should also set the corresponding keys in secrets.env
MAIL_BACKEND=none
# uncomment in order to NOT automatically change the database schema when you upgrade the app
# DISABLE_DB_AUTOMIGRATION=true
@ -64,6 +62,11 @@ LOG_LEVEL=info
# and do not check your env file into any public git repo
# change ALL the values:
# what service to use for sending out emails (eg. smtp, mailgun, none) NOTE: you should also set the corresponding keys in secrets.env
MAIL_BACKEND=none
#COMPOSE_FILE="$COMPOSE_FILE:compose.mail.yml"
#SECRET_MAIL_PASSWORD_VERSION=v1
# signup to an email service and edit with relevant info, see: https://docs.bonfirenetworks.org/Bonfire.Mailer.html
# MAIL_DOMAIN=mgo.example.com
@ -76,7 +79,6 @@ LOG_LEVEL=info
# MAIL_SESSION_TOKEN=
# MAIL_SERVER=
# MAIL_USER=
# MAIL_PASSWORD=
# MAIL_PORT=
# MAIL_SSL=true
# MAIL_TLS=if_available

View File

@ -1,4 +1,4 @@
export APP_ENTRYPOINT_VERSION=v1
export APP_ENTRYPOINT_VERSION=v2
export PG_BACKUP_VERSION=v4
export MEILI_BACKUP_VERSION=v4

11
compose.mail.yml Normal file
View File

@ -0,0 +1,11 @@
version: "3.8"
services:
app:
secrets:
- mail_password
secrets:
mail_password:
external: true
name: ${STACK_NAME}_mail_password_${SECRET_MAIL_PASSWORD_VERSION}

View File

@ -9,7 +9,12 @@ export ENCRYPTION_SALT=$(cat /run/secrets/encryption_salt)
export SEEDS_PW=$(cat /run/secrets/seeds_pw)
export LIVEBOOK_PASSWORD=$(cat /run/secrets/livebook_password)
Outdated
Review

This means that it would override MAIL_PASSWORD for any existing deploys right? Would be good if it can be backwards compatible as mentioned in #1 (not sure how, if you have any ideas)

This means that it would override MAIL_PASSWORD for any existing deploys right? Would be good if it can be backwards compatible as mentioned in #1 (not sure how, if you have any ideas)
Outdated
Review

Ah good point, I made the entrypoint backwards compatible by first checking if MAIL_PASSWORD exists

Ah good point, I made the entrypoint backwards compatible by first checking if MAIL_PASSWORD exists
# Only read the secret when the MAIL_PASSWORD was not set to remain backwards compatible
if [[ -z ${MAIL_PASSWORD} ]]; then
export MAIL_PASSWORD=$(cat /run/secrets/mail_password)
fi
echo "....Secrets have been loaded, now run $@...."
# This will exec the CMD from your Dockerfile
exec "$@"
exec "$@"