From 2fc0681ea7b3c49ed52bef699dd5e5a12e51a182 Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Sun, 15 Nov 2026 22:10:43 +0100 Subject: [PATCH] feat(business-site): give the portal the site's SES sender for its emails The portal must send order confirmations and withdrawal receipts by email itself (Consumer Contracts Act, sections 13 and 20 a; business-site#21), using the site's existing send-only SES sender (#5400, #6311): From no-reply@devantler.tech only. - business-site-runtime carries smtp-username and smtp-password from OpenBao apps/business-site/smtp, read through the ClusterSecretStore the way ZITADEL's zitadel-smtp reads it. - The portal egress policy allows email-smtp.eu-central-1.amazonaws.com on 587/TCP (STARTTLS). Nothing reads the new items until a business-site release projects them, and the portal sends nothing while its flags are off. This must deploy before that release, because a projected key that is missing keeps new pods from starting. Co-Authored-By: Claude Opus 5.5 --- .../cilium-network-policy-portal-egress.yaml | 9 ++++++- .../external-secret-runtime.yaml | 27 +++++++++++++++++-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/k8s/providers/hetzner/apps/business-site/cilium-network-policy-portal-egress.yaml b/k8s/providers/hetzner/apps/business-site/cilium-network-policy-portal-egress.yaml index 38c80f577..1177461e6 100644 --- a/k8s/providers/hetzner/apps/business-site/cilium-network-policy-portal-egress.yaml +++ b/k8s/providers/hetzner/apps/business-site/cilium-network-policy-portal-egress.yaml @@ -1,6 +1,7 @@ # Platform-applied, additive to the tenant's own policies. The portal's web pods # and migration job: their database, and for the web -# pods the customer Dex's public name (discovery, token exchange). +# pods the customer Dex's public name (discovery, token exchange) and the mail +# sender's SES SMTP endpoint (STARTTLS on 587) for the portal's emails. apiVersion: cilium.io/v2 kind: CiliumNetworkPolicy metadata: @@ -26,6 +27,12 @@ spec: - ports: - port: "443" protocol: TCP + - toFQDNs: + - matchName: email-smtp.eu-central-1.amazonaws.com + toPorts: + - ports: + - port: "587" + protocol: TCP - toEndpoints: - matchLabels: k8s:io.kubernetes.pod.namespace: kube-system diff --git a/k8s/providers/hetzner/apps/business-site/external-secret-runtime.yaml b/k8s/providers/hetzner/apps/business-site/external-secret-runtime.yaml index 211d10cd0..896543c30 100644 --- a/k8s/providers/hetzner/apps/business-site/external-secret-runtime.yaml +++ b/k8s/providers/hetzner/apps/business-site/external-secret-runtime.yaml @@ -1,8 +1,11 @@ # The business-site WebApp's one projected Secret, assembled on the platform # side because the WebApp has no environment variables and projects a single # Secret (/run/webapp-inputs). It carries the public company disclosure and, -# for the portal, its settings file, its Dex client secret and its database -# CA. The package selects it in its WebApp; until then nothing reads it. +# for the portal, its settings file, its Dex client secret, its database CA +# and the send-only SES credential of the site's mail sender (platform#5400), +# which the portal uses for order confirmations and withdrawal receipts +# (business-site#21). The package selects it in its WebApp; until then nothing +# reads it, and the portal sends nothing while its flags are off. # # portal-settings is the portal's on/off switch. While sign-in is off it holds # no settings, so the public site never depends on the portal database or the @@ -26,6 +29,8 @@ spec: # Portal sign-in is off (business-site#302). portal-client-secret: "{{ .portal_client_secret }}" portal-database-ca: "{{ .portal_database_ca }}" + smtp-username: "{{ .smtp_username }}" + smtp-password: "{{ .smtp_password }}" data: # The tenant's own owner-maintained disclosure, read through its own # namespaced store exactly as the package's disclosure ExternalSecret does. @@ -53,3 +58,21 @@ spec: remoteRef: key: apps/business-site/portal-db-ca property: ca + # The mail sender's SES SMTP credential, read the same way as ZITADEL's + # zitadel-smtp: From no-reply@devantler.tech only. + - secretKey: smtp_username + sourceRef: + storeRef: + name: openbao + kind: ClusterSecretStore + remoteRef: + key: apps/business-site/smtp + property: username + - secretKey: smtp_password + sourceRef: + storeRef: + name: openbao + kind: ClusterSecretStore + remoteRef: + key: apps/business-site/smtp + property: password