From 9d075343c509c1dba70b5a65eecc0ea3ed669352 Mon Sep 17 00:00:00 2001 From: Ronni Baslund Date: Mon, 8 Jun 2026 21:02:17 +0200 Subject: [PATCH] feat(infra): migrate Stalwart to the v0.16 config model (config.json) v0.16 dropped TOML config. The host service now boots from a tiny config.json that describes only the datastore (RocksDB); all other settings live in the DB (web UI / stalwart-cli / platform-api JMAP). - add stalwart/config.json (RocksDb datastore at /opt/stalwart/data) - install.sh: install config.json instead of config.toml - stalwart-mail.service: --config points at config.json - README: document the v0.16 model + remaining DB-side config + DNS/PTR Verified: Stalwart 0.16.8 runs on node1 with default mail listeners + the :8080 management server. config.toml retained as a reference for the DB settings. --- infrastructure/production/host/README.md | 18 ++++++++++++++++++ .../production/host/stalwart/config.json | 4 ++++ .../production/host/stalwart/install.sh | 13 +++++++++---- .../host/stalwart/stalwart-mail.service | 2 +- 4 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 infrastructure/production/host/stalwart/config.json diff --git a/infrastructure/production/host/README.md b/infrastructure/production/host/README.md index 86e82cf..570f8ee 100644 --- a/infrastructure/production/host/README.md +++ b/infrastructure/production/host/README.md @@ -225,3 +225,21 @@ cert-manager + `ClusterIssuer`, ingress, the data tier (Postgres/Mongo/Redis), Authentik, OCIS + Collabora, and portal + platform-api — plus the `mail/mail-tls` cert and the DB-dump CronJobs this layer's `cert-sync` and backups depend on. + +## Stalwart v0.16 — config model change (IMPORTANT) + +v0.16 **removed TOML configuration**. The host service now boots from +`stalwart/config.json` — a tiny file describing ONLY the datastore (RocksDB at +`/opt/stalwart/data`). Every other setting (listeners, authentication, TLS, +domains, DKIM, spam, webhooks) is stored in the DB and managed via the web admin +UI, `stalwart-cli`, or platform-api over JMAP. `stalwart/config.toml` is kept as +a reference for the settings to recreate in the DB; it is NOT loaded by v0.16. + +**Status (node1):** Stalwart 0.16.8 installed + running with default listeners +(25/465/587/143/993/4190 + management on `:8080`). Still to configure (DB-side): +- Fallback admin password (so platform-api can authenticate) + the audit webhook. +- TLS for `mail.dezky.eu` — Stalwart's own ACME, or rework `cert-sync.sh` to feed + the cert-manager cert into the v0.16 DB cert model. +- Domains / DKIM — provisioned by platform-api over JMAP. + +Then publish DNS (MX, SPF, DKIM, DMARC) and set the **PTR/rDNS** → `mail.dezky.eu`. diff --git a/infrastructure/production/host/stalwart/config.json b/infrastructure/production/host/stalwart/config.json new file mode 100644 index 0000000..e4324f1 --- /dev/null +++ b/infrastructure/production/host/stalwart/config.json @@ -0,0 +1,4 @@ +{ + "@type": "RocksDb", + "path": "/opt/stalwart/data" +} diff --git a/infrastructure/production/host/stalwart/install.sh b/infrastructure/production/host/stalwart/install.sh index 416958a..9f88b2d 100755 --- a/infrastructure/production/host/stalwart/install.sh +++ b/infrastructure/production/host/stalwart/install.sh @@ -89,12 +89,17 @@ systemctl stop stalwart-mail 2>/dev/null || true install -o stalwart -g stalwart -m 0755 "$bin" "$PREFIX/bin/stalwart" ok "Installed $("$PREFIX/bin/stalwart" --version 2>/dev/null || echo 'stalwart binary')." -# ── Step 3: config + secrets EnvironmentFile ─────────────────────────────── -info "Step 3: config.toml + secrets env..." -install -o stalwart -g stalwart -m 0640 "$SCRIPT_DIR/config.toml" "$PREFIX/etc/config.toml" +# ── Step 3: config.json (v0.16 datastore) + secrets EnvironmentFile ──────── +# v0.16 dropped TOML: config.json describes ONLY the datastore; every other +# setting (listeners, auth, TLS, domains, DKIM, spam, webhooks) lives in the DB +# and is managed via the web UI / stalwart-cli / platform-api (JMAP). +info "Step 3: config.json (v0.16 datastore-only) + secrets env..." +install -o stalwart -g stalwart -m 0640 "$SCRIPT_DIR/config.json" "$PREFIX/etc/config.json" umask 077 cat > "$PREFIX/etc/stalwart.env" <