From 2aae88703395c5a770c66354f19ffa4a8db77d7a Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 23 Apr 2026 07:31:03 +0000 Subject: [PATCH] docs(env): document SM_MULTI_TENANT and SM_TENANT_HEADER opt-in Last piece of the DX hardening plan (2026-04-14). The implementation, tests and conventions doc all reference these vars but .env.example never advertised them, so new deployments had no signpost for the opt-in tenancy flag. --- .env.example | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.env.example b/.env.example index 3e2b52ed..20d8f3dc 100644 --- a/.env.example +++ b/.env.example @@ -13,6 +13,14 @@ SM_SECRET_KEY=change-me-in-production # Dev-only: Vite asset URL (ignored in production builds) SM_VITE_DEV_URL=http://localhost:5050 +# Multi-tenancy (opt-in). When false (default), TenantMiddleware is not +# installed and queries on MultiTenantMixin models ignore tenant filtering. +# Production tenant deployments should set SM_MULTI_TENANT=true and carry +# tenant_id in the auth token — SM_TENANT_HEADER is only a convenience for +# internal/test clients; leave empty to disable header-based resolution. +# SM_MULTI_TENANT=false +# SM_TENANT_HEADER=X-Tenant-ID + # First-boot admin seed (optional). Only applied when the users table is empty. # Leave unset and use `uv run sm-users create-admin` instead if you prefer. # SM_USERS_BOOTSTRAP_EMAIL=admin@example.com