From 4f246ccc1deee60f8508953617e92a14794b1eeb Mon Sep 17 00:00:00 2001 From: Gabriel Radureau Date: Sat, 9 May 2026 14:39:14 +0200 Subject: [PATCH] docs(DEPLOY): add Phase 2b activation steps --- DEPLOY.md | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/DEPLOY.md b/DEPLOY.md index cc88eb1..114fb64 100644 --- a/DEPLOY.md +++ b/DEPLOY.md @@ -106,12 +106,31 @@ Pour le test `/echo coucou` répond `coucou`. | `setWebhook` → `Wrong response from the webhook: 401` | `BOT_FACTORY_SECRET` côté Secret ≠ celui passé à setWebhook. Régénérer + recréer le Secret avec `kubectl delete && create`. | | Webhook accepté mais pas de réponse Telegram | `kubectl logs` côté gateway → erreur sendMessage. Token bot invalide (révoqué via @BotFather ?) ou rate-limit Telegram. | +## Phase 2b — activer la queue Postgres async (optionnel) + +Phase 2a (handler `http` sync) est livrée et active dès qu'un bot a `handler: http`. + +Phase 2b (queue + worker) est désactivée tant que `DATABASE_URL` n'est pas dans le Secret. Pour activer : + +1. Provisionner un user / une DB Postgres avec droits `CREATE TABLE` (le pod auto-applique la migration idempotente `gateway_jobs` au boot). +2. Ajouter le DSN au Secret existant : + + ```bash + DSN='postgres://gateway:CHANGEME@pgbouncer.tools.svc.cluster.local:6432/gateway?sslmode=disable' + kubectl -n telegram-gateway patch secret telegram-gateway-bots --type=json -p="[ + {\"op\":\"add\",\"path\":\"/data/DATABASE_URL\",\"value\":\"$(echo -n "$DSN" | base64)\"} + ]" + kubectl -n telegram-gateway rollout restart deploy/telegram-gateway + ``` + +3. Vérifier dans les logs : `queue + schema ready (db=postgres://gateway@…)` puis `worker started`. +4. Configurer un bot avec `async: true` dans `chart/values.yaml` pour valider le pipeline. + ## Pour aller plus loin -- Phase 2 : handler `http` (forward vers svc interne) + queue Postgres durable. -- Phase 3 : handlers `shell` / `script` / `ollama` async, retry quand le +- Phase 3 (pas livré) : handlers `shell` / `script` / `ollama` async, retry quand le Macbook Ollama est endormi. -- Phase 4 : passage à Vault (toggle `vault.enabled: true` + provisionner +- Phase 4 (pas livré) : passage à Vault (toggle `vault.enabled: true` + provisionner `kvv2/telegram-gateway/config`), Wake-on-LAN, multi-provider. Plan complet : `~/.claude/plans/pour-les-notifications-on-inherited-seal.md`.