v0.88.0: app-email SMTP relay (in-process shim + per-app injection)

In-process go-smtp shim (Shape 1): apps → shim → hub → Resend, Resend key stays
hub-side. From-header allowlist (reject 5xx pre-hub), single-shot raw-MIME forward,
status→SMTP mapping. Global + per-app toggles gate compose-time env injection from
.felhom.yml smtp_mapping. Hungarian UI on settings + app config pages.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-29 08:45:04 +02:00
parent 7cddb885e0
commit 0e20eb19c1
22 changed files with 1619 additions and 64 deletions
@@ -93,6 +93,31 @@ func (s *Server) tier2ConfigSaveHandler(w http.ResponseWriter, r *http.Request,
s.redirectTier2(w, r, name, "A 2. mentés beállítása elmentve.", "")
}
// appEmailToggleHandler flips the per-app email toggle (only for apps with an smtp_mapping)
// and recreates the stack so the SMTP env injection takes effect. Redirects back to the
// app's config page with a flash.
func (s *Server) appEmailToggleHandler(w http.ResponseWriter, r *http.Request, name string) {
if _, ok := s.stackMgr.GetStack(name); !ok {
http.NotFound(w, r)
return
}
_ = r.ParseForm()
enabled := r.FormValue("app_email_enabled") == "on" || r.FormValue("app_email_enabled") == "true"
dest := "/stacks/" + url.PathEscape(name) + "/deploy"
if err := s.stackMgr.SetAppEmailEnabled(name, enabled); err != nil {
s.logger.Printf("[ERROR] [web] app-email toggle for %s: %v", name, err)
http.Redirect(w, r, dest+"?flash_error="+url.QueryEscape(err.Error()), http.StatusSeeOther)
return
}
s.logger.Printf("[INFO] [web] App-email for %s set to %v", name, enabled)
msg := "Email-küldés kikapcsolva ennél az alkalmazásnál."
if enabled {
msg = "Email-küldés bekapcsolva ennél az alkalmazásnál."
}
http.Redirect(w, r, dest+"?flash="+url.QueryEscape(msg), http.StatusSeeOther)
}
// redirectTier2 sends the customer back to the panel with a flash message.
func (s *Server) redirectTier2(w http.ResponseWriter, r *http.Request, name, flash, flashErr string) {
dest := "/stacks/" + url.PathEscape(name) + "/backup"