diff --git a/README.md b/README.md index 3b209c3..c41feaf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# TeamVis — Self-Hosting-Bundle (v0.31.0) +# TeamVis — Self-Hosting-Bundle (v0.32.0) Dieses Bundle enthält alles zum **Betreiben** von TeamVis auf eigener Infrastruktur — **keinen** App-Quellcode. Die App selbst kommt als fertiges @@ -25,4 +25,4 @@ Vollständige Schritt-für-Schritt-Anleitung (von der nackten VM bis live): | `supabase/migrations/` | Datenbank-Schema (DDL) | | `docs/` | Anleitungen | -Stand: TeamVis 0.31.0. +Stand: TeamVis 0.32.0. diff --git a/package.json b/package.json index a712e11..b06cc99 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "teamvis-selfhost", - "version": "0.31.0", + "version": "0.32.0", "private": true, "description": "Self-Hosting-Bundle für TeamVis (Installer + Migrationen, ohne App-Quellcode).", "type": "module", diff --git a/supabase/migrations/0055_smtp_settings.sql b/supabase/migrations/0055_smtp_settings.sql new file mode 100644 index 0000000..eb0d5d7 --- /dev/null +++ b/supabase/migrations/0055_smtp_settings.sql @@ -0,0 +1,48 @@ +-- ==================================================================== +-- 0055_smtp_settings — SMTP-Konfiguration über die Admin-UI +-- ==================================================================== +-- Bisher kam SMTP ausschließlich aus ENV-Variablen (lib/email.ts → +-- process.env.SMTP_*). Self-Host-Kunden mussten dafür die .env editieren + +-- Container neu starten. Jetzt pro Mandant in site_settings (Admin → Mail) +-- pflegbar — mit ENV-Fallback (bestehende ENV-Setups laufen unverändert). +-- +-- Vorrang in lib/email.ts: ist smtp_host in der DB gesetzt → DB-Konfig, +-- sonst ENV. smtp_pass/-user sind Geheimnisse → NICHT für anon lesbar. + +alter table public.site_settings + add column if not exists smtp_host text, + add column if not exists smtp_port integer, + add column if not exists smtp_secure boolean, + add column if not exists smtp_user text, + add column if not exists smtp_pass text, + add column if not exists smtp_from_email text, + add column if not exists smtp_from_name text; + +-- anon-Spalten-Grant neu setzen (Muster aus 0043): anon Vollzugriff entziehen, +-- dann ALLE Spalten AUSSER der Geheimnis-/SMTP-Block-Liste freigeben. +-- WICHTIG: Block-Liste = die Original-Geheimnisse aus 0043 + alle smtp_*, +-- sonst würden die in 0043 geschützten Keys wieder anon-lesbar. +revoke all on public.site_settings from anon; + +do $$ +declare + v_cols text; +begin + select string_agg(quote_ident(column_name), ', ') + into v_cols + from information_schema.columns + where table_schema = 'public' + and table_name = 'site_settings' + and column_name not in ( + -- Geheimnis-Spalten aus 0043 (weiter geschützt): + 'ai_anthropic_key', 'ai_openai_key', 'ai_openrouter_key', + 'apple_pass_cert_p12', 'apple_pass_passphrase', 'apple_pass_type_id', + 'google_wallet_service_account_json', + 'phone_api_token', 'phone_lookup_token', 'phone_webhook_secret', + 'license_key', + -- neu: SMTP-Konfiguration (Zugangsdaten + Infrastruktur, kein anon-Bedarf): + 'smtp_host', 'smtp_port', 'smtp_secure', 'smtp_user', 'smtp_pass', + 'smtp_from_email', 'smtp_from_name' + ); + execute 'grant select (' || v_cols || ') on public.site_settings to anon'; +end $$;