Federated install: SMTP relay for the notification email channel on core
release gate / check (push) Failing after 6m54s
release gate / check (push) Failing after 6m54s
The tier switch removed core's SMTP config when password reset became dead in oidc mode, but the notification engine's email channel needs the same relay. Reinstate the house pattern in config_superbrain (fcore submission on mail.$DOMAIN:587, credential read from authelia's secret or superpanel's .env, NETGUARD_TRUSTED_HOSTS pin for split-horizon DNS) and correct STRATEGY.md, including the stale 'app sends no outbound mail' claim in the suite-service notes. Deployed to core: migration 013 applied, SMTP+pin env verified in the app container, /api/notifications/* routes live behind auth (401 anonymous), clean app/web logs. The live /federated/lib/superbrain.sh was synced from this repo copy (backup kept as superbrain.sh.bak-20261026).
This commit is contained in:
@@ -57,6 +57,20 @@ config_superbrain() {
|
||||
SUPERBRAIN_AUTH_SECRET=$(create_password)
|
||||
SUPERBRAIN_ENCRYPTION_KEY=$(create_password)
|
||||
|
||||
# Shared house SMTP sender credential (fcore) for the notification
|
||||
# engine's email channel. Reuse the secret other apps already hold; never
|
||||
# generate a new one — the mail server is LDAP-provisioned and
|
||||
# `setup email add` does not exist there (ACCOUNT_PROVISIONER is not
|
||||
# FILE). Verified end-to-end 2026-10-26: net/smtp STARTTLS + AUTH PLAIN
|
||||
# to mail.$DOMAIN:587 from the core network delivers with a per-app From
|
||||
# address (sender != login user is allowed; authelia does the same).
|
||||
if [ -f /federated/apps/authelia/data/secrets/NOTIFIER_SMTP_PASSWORD ]; then
|
||||
SUPERBRAIN_SMTP_PASSWORD=$(cat /federated/apps/authelia/data/secrets/NOTIFIER_SMTP_PASSWORD)
|
||||
else
|
||||
SUPERBRAIN_SMTP_PASSWORD=$(sed -n 's/^EMAIL_HOST_PASSWORD=//p' /federated/apps/superpanel/.env | tail -1)
|
||||
fi
|
||||
[ -n "$SUPERBRAIN_SMTP_PASSWORD" ] || failcheck "could not find the fcore SMTP password (authelia secret or superpanel .env)"
|
||||
|
||||
# app is deliberately the FIRST service with an image: key — upgrade_app()
|
||||
# reads the first image: line and compares it to CONTAINER in the service file.
|
||||
cat > /federated/apps/superbrain/docker-compose.yml <<EOF
|
||||
@@ -186,6 +200,20 @@ ADMIN_EMAILS=admin@$DOMAIN
|
||||
TIER=core
|
||||
COOKIE_SECURE=1
|
||||
# TRUSTED_PROXY deliberately unset — traefik does not send X-Real-IP.
|
||||
|
||||
# --- Transactional mail (notification engine email channel) ---
|
||||
# House pattern: authenticated submission via mail.$DOMAIN:587 as the
|
||||
# shared sender account fcore with a per-app From address (authelia and
|
||||
# superpanel do the same). Password reset stays refused on this tier
|
||||
# (oidc mode); this relay exists for notification deliveries.
|
||||
# Split-horizon DNS: mail.$DOMAIN resolves to the private container IP
|
||||
# inside the core network, hence the netguard pin (verified 2026-10-26).
|
||||
SMTP_HOST=mail.$DOMAIN
|
||||
SMTP_PORT=587
|
||||
SMTP_USERNAME=fcore
|
||||
SMTP_PASSWORD=$SUPERBRAIN_SMTP_PASSWORD
|
||||
SMTP_FROM=superbrain@$DOMAIN
|
||||
NETGUARD_TRUSTED_HOSTS=mail.$DOMAIN
|
||||
EOF
|
||||
chmod 600 /federated/apps/superbrain/.env
|
||||
|
||||
|
||||
Reference in New Issue
Block a user