mirror of
git://f0xx.org/ac/ac-deploy
synced 2026-07-29 05:59:05 +03:00
cluster0: fix secrets MAIL_FROM parsing; normalize RFC5322 From in compose
load_secrets_lab quotes values safely; compose reads MAIL_FROM via read_secret. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -118,7 +118,8 @@ AUTH_KEY="${AUTH_ENCRYPTION_KEY:-lab-cluster-dev-32-char-min-secret!!}"
|
||||
_MSMTP_PASS="$(read_secret MSMTP_APP_PASSWORD 2>/dev/null || true)"
|
||||
[ -n "$_MSMTP_PASS" ] || _MSMTP_PASS="${MSMTP_APP_PASSWORD:-}"
|
||||
MAIL_TRANSPORT="${MAIL_TRANSPORT:-sendmail}"
|
||||
MAIL_FROM="${MAIL_FROM:-Android Cast Lab <bestcastr@gmail.com>}"
|
||||
_mail_from_secret="$(read_secret MAIL_FROM 2>/dev/null || true)"
|
||||
[ -n "$_mail_from_secret" ] || _mail_from_secret="${MAIL_FROM:-}"
|
||||
MAIL_REPLY="${MAIL_REPLY_TO:-bestcastr@gmail.com}"
|
||||
SMTP_HOST="${SMTP_HOST:-127.0.0.1}"
|
||||
SMTP_PORT="${SMTP_PORT:-587}"
|
||||
@@ -130,9 +131,11 @@ if [ -n "$_MSMTP_PASS" ]; then
|
||||
SMTP_HOST=smtp.gmail.com
|
||||
SMTP_USER="${MSMTP_USER:-bestcastr@gmail.com}"
|
||||
SMTP_PASS="$_MSMTP_PASS"
|
||||
MAIL_FROM="${MAIL_FROM:-Android Cast <bestcastr@gmail.com>}"
|
||||
fi
|
||||
unset _MSMTP_PASS
|
||||
MAIL_FROM="$(normalize_mail_from "$_mail_from_secret" "$SMTP_USER")"
|
||||
[ -n "$MAIL_FROM" ] || MAIL_FROM="Android Cast Lab <${SMTP_USER:-bestcastr@gmail.com}>"
|
||||
unset _MSMTP_PASS _mail_from_secret
|
||||
MAIL_FROM_PHP="$(printf '%s' "$MAIL_FROM" | sed "s/'/\\\\'/g")"
|
||||
AUTH_BEARER_ID="$(read_secret URL_SHORTENER_AUTH_BEARER_ID 2>/dev/null || true)"
|
||||
[ -n "$AUTH_BEARER_ID" ] || AUTH_BEARER_ID="${URL_SHORTENER_AUTH_BEARER_ID:-0}"
|
||||
mkdir -p "${COMPOSED}/config"
|
||||
@@ -174,7 +177,7 @@ return [
|
||||
],
|
||||
'mail' => [
|
||||
'transport' => '${MAIL_TRANSPORT}',
|
||||
'from' => '${MAIL_FROM}',
|
||||
'from' => '${MAIL_FROM_PHP}',
|
||||
'reply_to' => '${MAIL_REPLY}',
|
||||
'smtp' => [
|
||||
'host' => '${SMTP_HOST}',
|
||||
|
||||
Reference in New Issue
Block a user