webmail, console and routes (K-C3) #18

Merged
jcoffey-dev merged 1 commits from feat/webmail-console into main 2026-11-18 21:59:30 +00:00
Owner

K-C3 (tracker #14).

What's new

  • webmail, console: each off by default. Each is a Deployment, a Service, an optional HPA and a PDB, with a read-only root filesystem, all capabilities dropped and a non-root user. The image tag is required, because the webmail and console are versioned apart from the server.
  • The webmail:
    • SESSION_BACKEND=cookie, so any replica serves any request.
    • OAuth sign-in through the server's page.
    • MAIL_SERVER_URL is the in-cluster HTTP Service.
    • SECURE_COOKIES follows the public URL's scheme.
    • Its app-secret and oauth-client-secret come from a Secret the chart generates once and keeps across upgrades (via lookup), or from webmail.existingSecret. app-secret-previous is optional, for rotation.
  • The console: API_BASE_URL = server.publicUrl. emptyDirs for /tmp and nginx's cache.
  • The server: every pod gets INBUXA_WEBMAIL_URL, INBUXA_WEBMAIL_CLIENT_SECRET and INBUXA_ADMIN_URL, so it registers both clients and allows the console's origin.
  • routes: the server's, the webmail's and the console's addresses by host name, as Gateway API HTTPRoutes (parentRefs required) or one Ingress. Not both at once, and two front ends on one host are refused.

Needs: inbuxa/inbuxa-webmail#113, without which a sign-in fails about half the time with two replicas. The webmail tag comment says 27.1-rc.7 or later.

CI:

  • kubeconform now also checks HTTPRoute against the CRDs catalog's schema.
  • New ci/ingress-values.yaml; everything-values turns on both front ends, both autoscalers and the Gateway.
  • kube-linter:
    • hpa-minimum-three-replicas excluded, with the reason.
    • read-secret-from-env-var ignored on the webmail and server Deployments, marked TODO(K-W4)/TODO(K-S2) until they read *_FILE.
  • 51/51 unit tests (14 new).

Tested on kind (inbuxa-k8s-lab lab/chart/frontends-test.sh, lab PR below), with the webmail from inbuxa/inbuxa-webmail#113:

A: sends the browser to https://mail.lab.test/login as ihasmail-inbuxa, state cookie 407 bytes
server: signed [email protected] in, code issued for https://webmail.lab.test/api/auth/callback
B: finished the sign-in A started, session cookie 650 bytes
B: session and JMAP work (6 mailboxes)
A: session and JMAP work (6 mailboxes)
console: served, api-base-url and connect-src name https://mail.lab.test
server: signed [email protected] in for inbuxa-admin, back to https://admin.lab.test/oauth/callback
server: exchanged the code for a token
server: allows https://admin.lab.test; the token opens [email protected]'s session
K-C3 (tracker #14). **What's new** - **`webmail`, `console`:** each off by default. Each is a Deployment, a Service, an optional HPA and a PDB, with a read-only root filesystem, all capabilities dropped and a non-root user. The image tag is required, because the webmail and console are versioned apart from the server. - **The webmail:** - `SESSION_BACKEND=cookie`, so any replica serves any request. - OAuth sign-in through the server's page. - `MAIL_SERVER_URL` is the in-cluster HTTP Service. - `SECURE_COOKIES` follows the public URL's scheme. - Its `app-secret` and `oauth-client-secret` come from a Secret the chart generates once and keeps across upgrades (via `lookup`), or from `webmail.existingSecret`. `app-secret-previous` is optional, for rotation. - **The console:** `API_BASE_URL` = `server.publicUrl`. emptyDirs for `/tmp` and nginx's cache. - **The server:** every pod gets `INBUXA_WEBMAIL_URL`, `INBUXA_WEBMAIL_CLIENT_SECRET` and `INBUXA_ADMIN_URL`, so it registers both clients and allows the console's origin. - **`routes`:** the server's, the webmail's and the console's addresses by host name, as Gateway API HTTPRoutes (`parentRefs` required) or one Ingress. Not both at once, and two front ends on one host are refused. **Needs:** inbuxa/inbuxa-webmail#113, without which a sign-in fails about half the time with two replicas. The webmail tag comment says 27.1-rc.7 or later. **CI:** - kubeconform now also checks HTTPRoute against the CRDs catalog's schema. - New `ci/ingress-values.yaml`; `everything-values` turns on both front ends, both autoscalers and the Gateway. - kube-linter: - `hpa-minimum-three-replicas` excluded, with the reason. - `read-secret-from-env-var` ignored on the webmail and server Deployments, marked TODO(K-W4)/TODO(K-S2) until they read `*_FILE`. - 51/51 unit tests (14 new). **Tested on kind** (inbuxa-k8s-lab `lab/chart/frontends-test.sh`, lab PR below), with the webmail from inbuxa/inbuxa-webmail#113: ``` A: sends the browser to https://mail.lab.test/login as ihasmail-inbuxa, state cookie 407 bytes server: signed [email protected] in, code issued for https://webmail.lab.test/api/auth/callback B: finished the sign-in A started, session cookie 650 bytes B: session and JMAP work (6 mailboxes) A: session and JMAP work (6 mailboxes) console: served, api-base-url and connect-src name https://mail.lab.test server: signed [email protected] in for inbuxa-admin, back to https://admin.lab.test/oauth/callback server: exchanged the code for a token server: allows https://admin.lab.test; the token opens [email protected]'s session ```
jcoffey-dev added 1 commit 2026-11-18 21:53:01 +00:00
webmail, console and routes (K-C3)
ci / chart (pull_request) Successful in 52s
a427c7b179
The webmail and the console, each off by default: a Deployment, a
Service, an optional autoscaler and a PodDisruptionBudget, a read-only
root filesystem, all capabilities dropped.

The webmail runs with sealed-cookie sessions, so any replica serves any
request, signs in through the server's page, and talks to the server
inside the cluster. Its app and OAuth client secrets are a Secret the
chart makes once and keeps across upgrades, or webmail.existingSecret.
Every server pod gets INBUXA_WEBMAIL_URL, the client secret and
INBUXA_ADMIN_URL, so it registers both as OAuth clients and lets the
console's origin call the API.

routes: the server's, the webmail's and the console's addresses, by host
name, as Gateway API HTTPRoutes or one Ingress. kubeconform checks
HTTPRoute against the CRDs catalog's schema.
jcoffey-dev merged commit 40eefa966a into main 2026-11-18 21:59:30 +00:00
jcoffey-dev deleted branch feat/webmail-console 2026-11-18 21:59:30 +00:00
Sign in to join this conversation.