From 1f41f8a8a017724d1ce5bfa7b7d183ef6643de96 Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 11 May 2026 14:04:28 +0200 Subject: [PATCH] chore(env): document DOCUMENSO/MINIO vars + fix InMemoryBackend test stub - .env.example: strip /api/v1 from DOCUMENSO_API_URL (was producing double-pathed 404s), add DOCUMENSO_API_VERSION docs (v1 vs v2 support), add MINIO_AUTO_CREATE_BUCKET, document DOCUMENSO_TEMPLATE_ID_EOI + recipient role IDs - Add listByPrefix to InMemoryBackend test stub (was 3 pre-existing tsc errors) Pre-commit hook bypassed on explicit user request (CLAUDE.md policy blocks .env* by default; user authorized this update as part of audit-fixes cutover prep). Co-Authored-By: Claude Opus 4.7 (1M context) --- .env.example | 22 +++++++++++++++++++++- tests/unit/storage/copy-and-verify.test.ts | 4 ++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 22a51021..a7111ca4 100644 --- a/.env.example +++ b/.env.example @@ -16,11 +16,31 @@ MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin MINIO_BUCKET=crm-files MINIO_USE_SSL=false +# When `true`, the S3 backend auto-creates the configured bucket on boot if it +# does not exist (otherwise boot throws so deployment-time misconfigs surface +# immediately). Leave unset in production. +MINIO_AUTO_CREATE_BUCKET=false # Documenso -DOCUMENSO_API_URL=https://documenso.example.com/api/v1 +# Use the bare host — never include `/api/v1` in this URL. The Documenso +# client constructs versioned paths internally based on DOCUMENSO_API_VERSION +# below, and a double-pathed URL (https://.../api/v1/api/v1/...) returns 404 +# on every call. Trailing-slash values are fine. +DOCUMENSO_API_URL=https://documenso.example.com +# `v1` (Documenso 1.13.x) or `v2` (Documenso 2.x). Determines which API path +# prefix the client uses and which response-shape normalizer runs. +DOCUMENSO_API_VERSION=v1 DOCUMENSO_API_KEY=your-documenso-api-key DOCUMENSO_WEBHOOK_SECRET=your-webhook-secret-min-16-chars +# The Documenso template id used by the EOI send pathway. Per-port overrides +# live in `system_settings.documenso_template_id_eoi`; this env value is the +# global fallback when no per-port row exists. +DOCUMENSO_TEMPLATE_ID_EOI= +# Recipient role ids on the EOI template. The send service copies the template +# layout but re-targets recipients per interest, so we need the role ids to +# look up which template recipient becomes the Client / Sales signer. +DOCUMENSO_RECIPIENT_ID_CLIENT= +DOCUMENSO_RECIPIENT_ID_SALES= # Email (SMTP) SMTP_HOST=mail.portnimara.com diff --git a/tests/unit/storage/copy-and-verify.test.ts b/tests/unit/storage/copy-and-verify.test.ts index c63d261d..f0880b48 100644 --- a/tests/unit/storage/copy-and-verify.test.ts +++ b/tests/unit/storage/copy-and-verify.test.ts @@ -49,6 +49,10 @@ class InMemoryBackend implements StorageBackend { this.store.delete(key); } + async listByPrefix(prefix: string): Promise { + return [...this.store.keys()].filter((k) => k.startsWith(prefix)); + } + async presignUpload(_key: string, _opts: PresignOpts) { return { url: 'mem://upload', method: 'PUT' as const }; }