1
0
Fork 0

chore: env-Doku und docker-compose fuer WhatsApp-Benachrichtigung, rebuild-master-stack-Hinweis

This commit is contained in:
Jonny 2026-09-04 00:08:05 +02:00
parent a233cbb1b0
commit 26f7a70b54
3 changed files with 42 additions and 0 deletions

View File

@ -48,4 +48,18 @@ The user granted standing permission (2026-08-19) to run this proactively after
docker exec -i aushilfsfahrer-db-1 psql -U postgres -d postgres -c "insert into supabase_migrations.schema_migrations (version) values ('<version>') on conflict (version) do nothing;" docker exec -i aushilfsfahrer-db-1 psql -U postgres -d postgres -c "insert into supabase_migrations.schema_migrations (version) values ('<version>') on conflict (version) do nothing;"
``` ```
Enthielten die neuen Migrationen einen `pg_cron`-Job, der die App aufruft
(z.B. `notification-dispatch`), zusätzlich die beiden DB-Settings setzen, die
die Migration bewusst nicht enthält:
```bash
docker exec -i aushilfsfahrer-db-1 psql -U postgres -d postgres -c \
"alter database postgres set app.notification_dispatch_url = 'http://web:3000/api/notifications/dispatch';"
docker exec -i aushilfsfahrer-db-1 psql -U postgres -d postgres -c \
"alter database postgres set app.notification_dispatch_secret = '<Wert von NOTIFICATION_DISPATCH_SECRET aus der Root-.env>';"
```
Danach greifen neue Verbindungen die Settings auf; der Cron-Job ruft ab der
nächsten Minute `POST /api/notifications/dispatch` auf.
Report the admin login URL/credentials back to the user once verified (`admin@aushilfsfahrer.local` / `Admin123!`, or the current password — see the `supabase-local-dev` skill if it's been reset). Report the admin login URL/credentials back to the user once verified (`admin@aushilfsfahrer.local` / `Admin123!`, or the current password — see the `supabase-local-dev` skill if it's been reset).

View File

@ -181,3 +181,13 @@ services:
# denselben Wert, den kong/auth/rest bereits als SERVICE_KEY bekommen # denselben Wert, den kong/auth/rest bereits als SERVICE_KEY bekommen
# (siehe SERVICE_ROLE_KEY in der Root-.env). # (siehe SERVICE_ROLE_KEY in der Root-.env).
SUPABASE_SERVICE_ROLE_KEY: ${SERVICE_ROLE_KEY} SUPABASE_SERVICE_ROLE_KEY: ${SERVICE_ROLE_KEY}
# WhatsApp-Benachrichtigung -- Werte aus der Root-.env. Fehlt eine der
# fuenf WHATSAPP_*-Pflichtvariablen, ueberspringt der Dispatcher sauber.
WHATSAPP_ACCESS_TOKEN: ${WHATSAPP_ACCESS_TOKEN}
WHATSAPP_PHONE_NUMBER_ID: ${WHATSAPP_PHONE_NUMBER_ID}
WHATSAPP_RECIPIENT: ${WHATSAPP_RECIPIENT}
WHATSAPP_TEMPLATE_NAME: ${WHATSAPP_TEMPLATE_NAME}
WHATSAPP_TEMPLATE_LANG: ${WHATSAPP_TEMPLATE_LANG}
WHATSAPP_GRAPH_VERSION: ${WHATSAPP_GRAPH_VERSION}
# Muss mit dem DB-Setting app.notification_dispatch_secret uebereinstimmen.
NOTIFICATION_DISPATCH_SECRET: ${NOTIFICATION_DISPATCH_SECRET}

View File

@ -10,3 +10,21 @@ SUPABASE_INTERNAL_URL=http://localhost:8000
# `npx supabase status` (Repo-Root) auslesen ("service_role key"). Fuer den # `npx supabase status` (Repo-Root) auslesen ("service_role key"). Fuer den
# Docker-Compose-Master-Stack ist es SERVICE_ROLE_KEY aus der Root-.env. # Docker-Compose-Master-Stack ist es SERVICE_ROLE_KEY aus der Root-.env.
SUPABASE_SERVICE_ROLE_KEY= SUPABASE_SERVICE_ROLE_KEY=
# --- WhatsApp-Benachrichtigung (Meta WhatsApp Cloud API) ---
# Fehlt eine der folgenden fuenf Pflichtvariablen, ist das Feature "aus":
# die Dispatch-Route antwortet dann 200 { uebersprungen: true } und verschickt
# nichts. Werte stammen aus dem Meta Business Manager (WhatsApp > API-Setup).
WHATSAPP_ACCESS_TOKEN=
WHATSAPP_PHONE_NUMBER_ID=
# Feste Empfaenger-Sammelnummer, E.164 ohne fuehrendes "+" (z.B. 4915112345678).
WHATSAPP_RECIPIENT=
# Name + Sprache des genehmigten Message-Templates.
WHATSAPP_TEMPLATE_NAME=neuer_auftrag
WHATSAPP_TEMPLATE_LANG=de
# Optional, Default v21.0.
WHATSAPP_GRAPH_VERSION=
# Shared Secret fuer den Aufruf des pg_cron-Jobs an POST
# /api/notifications/dispatch. MUSS mit dem DB-Setting
# app.notification_dispatch_secret uebereinstimmen (siehe unten).
NOTIFICATION_DISPATCH_SECRET=