🧰 chore: bootstrap fixes, env cleanup, deployment doc, optional pgweb#4
Open
kamikazebr wants to merge 5 commits intoHanake0:mainfrom
Open
🧰 chore: bootstrap fixes, env cleanup, deployment doc, optional pgweb#4kamikazebr wants to merge 5 commits intoHanake0:mainfrom
kamikazebr wants to merge 5 commits intoHanake0:mainfrom
Conversation
- gowa: aldinokemal → aldinokemal2104, pin to v8.3.3 - postgres: switch to pgvector/pgvector:pg17 (vector extension required by migrations) - .env.example: expose POSTGRES_PASSWORD consumed by compose - README: document `claude setup-token` OAuth option and POSTGRES_PASSWORD
- ANTHROPIC_MODEL: claude-sonnet-4-20250514 → claude-sonnet-4-6 - ANTHROPIC_MAX_TOKENS: 4096 → 16000 (prod-aligned) - ANTHROPIC_CONTEXT_BUDGET: 12000 → 300000 (avoid immediate compaction) - Add ANTHROPIC_AUTH_MODE (optional — OAuth is auto-detected by prefix) - Add LIS_GROUP_CONTEXT_MESSAGES, LIS_NEW_SESSION_ON_AGENT_SWITCH (consumed in code) - Add LIS_WEB_SEARCH_ENABLED / LIS_WEB_SEARCH_API_KEY (Brave Search) - Clarify ANTHROPIC_THINKING_EFFORT accepted values
Documents the two-stack topology used in production: services/ (Caddy reverse proxy + GOWA) and lis/ (the agent), sharing a proxy network. Covers TLS, managed Postgres with pgvector, secret matrix, boot order, QR pairing, and backup. Scrubbed of host-specific references.
Enable with: docker compose --profile db-ui up -d Then open http://localhost:8081 Off by default — no impact on standard 'docker compose up -d'. Gives parity with the Neon Database Studio used in production, so dev users can inspect/edit tables (agents, chats, sessions, etc.) without installing a native client.
- Add gowa-data volume mounted at /app/storages so the WhatsApp session survives container restarts. Without it, any 'docker compose restart gowa' (or recreate triggered by backend changes) drops the QR pairing. - .env.example: GOWA_DEVICE_ID was 'default', which GOWA v8.3.3 rejects with '404 DEVICE_NOT_FOUND' because no paired device matches that ID. Ship empty and document that users must fill in the real UUID (from /devices) after pairing.
Hanake0
reviewed
Apr 17, 2026
| WHATSAPP_WEBHOOK_SECRET: "${GOWA_WEBHOOK_SECRET}" | ||
| WHATSAPP_WEBHOOK_EVENTS: "message" | ||
| volumes: | ||
| - gowa-data:/app/storages |
Owner
There was a problem hiding this comment.
If you want to endorse a cannonical setup, i would probably recomend also using pg as the storage backend for gowa.
File Storage is probably fine, but we are alreading setting up pg for the agent, using it for gowa is ok too.
Volume storage is probably recommended to still be kept tho, if you have automatic media download setup on gowa.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Groups everything needed to make a fresh clone of the repo bootable end-to-end from
docker compose up -d, plus documents the production deployment topology (currently undocumented in the repo). Found and fixed several subtle issues that block first-time users.Commits
fix(docker)— gowa/postgres images + bootstrapdocs(env)— stale defaults + missing consumed varsdocs— newdocs/DEPLOYMENT.md(production topology)feat(compose)— optional pgweb profilefix(compose)— persist GOWA session + device_id guidanceBugs the repo had (now fixed)
1. GOWA image name doesn't exist
aldinokemal/go-whatsapp-web-multidevice:latest→ 404 on Docker Hub. Correct namespace isaldinokemal2104/.... Pinned tov8.3.3because upgrades have changed the webhook payload and REST API in the past.2. Postgres missing pgvector
postgres:17-alpinelacks thevectorextension — EF migrations fail immediately withextension "vector" is not available. Swapped topgvector/pgvector:pg17.3. POSTGRES_PASSWORD silently empty
Compose reads
${POSTGRES_PASSWORD}but.env.exampledidn't define it — Postgres booted with a blank password every time. Added.4. GOWA session not persisted
The repo's compose had no volume on
gowa, so/app/storages/{whatsapp,chatstorage}.dblives only inside the container. Anydocker compose restart gowa(or a recreate triggered by backend/service changes) drops the pairing. Addedgowa-data:/app/storages.5.
GOWA_DEVICE_ID=defaultrejected by GOWA v8.3.3After pairing, GOWA requires an
X-Device-Idheader that matches a paired device UUID. The env defaultdefaulttriggers404 DEVICE_NOT_FOUNDon every outbound API call (mark-read, send-reply, group-info). Users see GOWA forward webhooks successfully but Lis can't reply. Shipped empty with a comment explaining the post-pairing flow.6. Env defaults too conservative
ANTHROPIC_MODEL=claude-sonnet-4-20250514— dated API ID instead of the current alias.ANTHROPIC_MAX_TOKENS=4096— cuts off normal replies.ANTHROPIC_CONTEXT_BUDGET=12000— triggers compaction almost immediately, destroys cache hits.7.
.env.examplemissing vars that code consumesLIS_GROUP_CONTEXT_MESSAGES,LIS_NEW_SESSION_ON_AGENT_SWITCH,LIS_WEB_SEARCH_ENABLED,LIS_WEB_SEARCH_API_KEY. AddedANTHROPIC_AUTH_MODEtoo (optional — OAuth tokenssk-ant-oat01-...fromclaude setup-tokenare already auto-detected by prefix inAnthropicProvider.cs:30, but the override exists).8. No deployment doc
Production uses a two-stack topology (Caddy reverse proxy + managed Postgres, Lis and services as separate compose stacks sharing a
proxynetwork) documented only in a private file. Addeddocs/DEPLOYMENT.mdas the canonical version, scrubbed of host-specific references (no domains, no real connection strings).9. No local DB UI
Production uses Neon Database Studio for inspection/edits (the seeder only creates the
defaultagent, so additional agents need runtime creation via/agent newor direct DB work). Added an opt-inpgwebprofile:docker compose --profile db-ui up -d→localhost:8081.Known gaps not fixed here
backend, production useslis. Webhook URLs line up internally in each stack, but the name difference makes copy-pasting between envs error-prone. Left as-is — changingbackend→liswould rename logs/metrics without fixing anything substantive.POST /deviceswith a known ID before pairing (soGOWA_DEVICE_IDstays stable across re-pairings). Dev flow still requires post-pairing lookup. Out of scope for this PR.vector-extension missing, unpaired GOWA, and backend crash loops earlier. Out of scope.oauth_credentialtable observed in the reference production DB is not in any migration and not referenced in code — appears to be a manually created table outside the scope of the repo. Not touched here.LIS_MAX_RECENT_MESSAGES,LIS_SUMMARIZATION_THRESHOLD,LIS_DEBUG_ANTHROPIC) were intentionally not added to.env.example— they're not read anywhere in code, andPlans/resume-and-session-id.mdflags at least one for removal.Test plan
cp .env.example .env→ fill minimums →docker compose up -d→ backend reachesApplication started, gowa serves on:3000docker compose down && up -d(volume works)docker compose --profile db-ui up -dbrings up pgweb at:8081, auto-connected tolisDBdocker compose configvalidates with and without thedb-uiprofileAnthropicProvider.cs:30auto-detectssk-ant-oatprefix and switches to Bearer + required headers/URL rewriteGOWA_DEVICE_ID(in progress by reporter)