From c0d08b0880dcce7337d9bdf046c93b318a84c2dc Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Sun, 20 Sep 2026 15:58:10 +0200 Subject: deploy: pass BOKFD_SECRET_KEY through compose; document waves 1-2 --- compose.yaml | 1 + docs/DEPLOY.md | 6 ++++++ docs/STATE.md | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/compose.yaml b/compose.yaml index 41d1562..25cb1eb 100644 --- a/compose.yaml +++ b/compose.yaml @@ -17,6 +17,7 @@ services: BOKFD_BACKUP_DIR: /var/lib/bokfd/backup BOKFD_EXPORT_DIR: /var/lib/bokfd/export BOKFD_LOG_LEVEL: info + BOKFD_SECRET_KEY: ${BOKFD_SECRET_KEY:-} BOKFD_TLS: 0.0.0.0:8788 BOKFD_TLS_CERT: /var/lib/bokfd/certs/certificates/${LEGO_DOMAIN:-bokf.makandra.eu}.crt BOKFD_TLS_KEY: /var/lib/bokfd/certs/certificates/${LEGO_DOMAIN:-bokf.makandra.eu}.key diff --git a/docs/DEPLOY.md b/docs/DEPLOY.md index ed105f8..7385a8f 100644 --- a/docs/DEPLOY.md +++ b/docs/DEPLOY.md @@ -184,8 +184,14 @@ LEGO_DOMAIN=bokf.makandra.eu LEGO_EMAIL=anders@makandra.eu INWX_USERNAME=... INWX_PASSWORD=... +BOKFD_SECRET_KEY=... # openssl rand -hex 32 ``` +`BOKFD_SECRET_KEY` encrypts secrets that live in the database (the SMTP +password) with AES-256-GCM; without it, setting or sending with a mail +password fails. Keep it out of the repository and out of backups of the +database — losing it only means re-entering the SMTP password. + Forward port 8788 on the router to the host. The `certs` sidecar obtains and renews the certificate into `var/db/certs/certificates/`; `bokfd` reloads it in place. On the very first `up`, `bokfd` may restart a few times until the diff --git a/docs/STATE.md b/docs/STATE.md index 981aace..8b33b52 100644 --- a/docs/STATE.md +++ b/docs/STATE.md @@ -158,6 +158,11 @@ check. Settings `invoice_receivable_account`, `invoice_revenue_account`, `invoice_bankgiro`. **Swish QR: decided 2026-09-20 — not supported** (invoice 1's QR is dropped; the generator has no image support). + **Wave 2 done 2026-09-20**: settings secrets are AES-256-GCM encrypted + with `BOKFD_SECRET_KEY` (`smtp_password`; `settings.get` never returns + it), SMTP over TLS/STARTTLS/plain (`src/smtp.c`) and `invoice.send` + (subject `Faktura `, PDF attached, `last_sent_*`, audited, + `SMTP_NOT_CONFIGURED`/`SMTP_FAILED`). Wave 3 (TUI Fakturering) pending. ## Pending decisions -- cgit v1.3