feat(mail): add MailSender port and explicit provider selection
This commit is contained in:
1 parent
e7d0d92ef9
commit
6153887eb5
26 files changed
+1253
-29
No files matched your search
@@ -187,6 +187,16 @@ services:
|
||||
SEAWEEDFS_REGION: us-east-1
|
||||
SEAWEEDFS_TIMEOUT: 10s
|
||||
KAFKA_BROKERS: kafka:9092
|
||||
EMAIL_PROVIDER: ${EMAIL_PROVIDER:?Set EMAIL_PROVIDER to resend, smtp, or disabled in the root .env file}
|
||||
EMAIL_FROM: ${EMAIL_FROM:?Set EMAIL_FROM in the root .env file}
|
||||
EMAIL_TIMEOUT: ${EMAIL_TIMEOUT:-10s}
|
||||
APP_PUBLIC_URL: ${APP_PUBLIC_URL:?Set APP_PUBLIC_URL in the root .env file}
|
||||
RESEND_API_KEY: ${RESEND_API_KEY:-}
|
||||
SMTP_HOST: ${SMTP_HOST:-}
|
||||
SMTP_PORT: ${SMTP_PORT:-}
|
||||
SMTP_USERNAME: ${SMTP_USERNAME:-}
|
||||
SMTP_PASSWORD: ${SMTP_PASSWORD:-}
|
||||
SMTP_TLS_MODE: ${SMTP_TLS_MODE:-}
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
|
||||
+10
-2
@@ -10,8 +10,11 @@ port=18080
|
||||
network="${project}_default"
|
||||
started=0
|
||||
|
||||
# The smoke stack sends no mail: it uses EMAIL_PROVIDER=disabled from
|
||||
# .env.example and points mail links at its own loopback port.
|
||||
compose() {
|
||||
APP_PROJECT="$project" APP_NETWORK="$app_network" APP_HTTP_PORT="$port" docker compose \
|
||||
APP_PROJECT="$project" APP_NETWORK="$app_network" APP_HTTP_PORT="$port" \
|
||||
APP_PUBLIC_URL="http://localhost:$port" docker compose \
|
||||
--env-file "$env_file" \
|
||||
-p "$project" \
|
||||
-f "$compose_file" \
|
||||
@@ -84,6 +87,11 @@ wait_for_readiness() {
|
||||
|
||||
wait_for "http://127.0.0.1:$port/healthz"
|
||||
wait_for "http://127.0.0.1:$port/api/v1/healthz"
|
||||
backend_logs=$(compose logs --no-color backend)
|
||||
if [[ "$backend_logs" != *'mail transport selected'*'disabled'* ]]; then
|
||||
printf '%s\n' 'Backend did not report EMAIL_PROVIDER=disabled at startup.' >&2
|
||||
exit 1
|
||||
fi
|
||||
wait_for_readiness
|
||||
status=$(curl --silent --show-error --output /dev/null --write-out '%{http_code}' \
|
||||
"http://127.0.0.1:$port/api/v1/missing")
|
||||
@@ -122,4 +130,4 @@ fi
|
||||
curl --fail --silent --show-error "http://127.0.0.1:$port/api/v1/healthz" >/dev/null
|
||||
compose up -d --wait --wait-timeout 90 seaweedfs
|
||||
wait_for_readiness
|
||||
printf '%s\n' 'Technical smoke passed: frontend, API routing, PostgreSQL, Redis, SeaweedFS, dependency recovery, and storage authentication.'
|
||||
printf '%s\n' 'Technical smoke passed: frontend, API routing, PostgreSQL, Redis, SeaweedFS, dependency recovery, storage authentication, and the disabled mail transport.'
|
||||
Reference in new issue
Block a user