Commit Graph

4 Commits

Author SHA1 Message Date
Arvin Xu c5ec20abab ✨ feat(docker): run self-hosted Compose chats in Gateway Mode by default (#19583)
* ✨ feat(docker): run self-hosted Compose chats in Gateway Mode by default

- Add the lobehub-gateway service to docker-compose and wire the lobe service
  to it; AGENT_GATEWAY_INTERNAL_URL keeps server pushes on the Compose network
  while browsers use AGENT_GATEWAY_URL.
- S3_INTERNAL_ENDPOINT routes the server's own S3 requests to rustfs:9000 while
  presigned URLs keep the browser-facing S3_ENDPOINT, which local mode sets to
  localhost and the container cannot reach.
- setup.sh generates a per-deployment JWKS_KEY and gateway token and writes the
  gateway URL for each deploy mode; the .env template drops the public JWKS key.
- Warn loudly at container startup when an upgraded stack lacks the gateway
  settings or still uses the public example JWKS_KEY, and document the upgrade.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* 🔒 fix(docker): pass only the public JWK to the gateway container

The gateway only needs the public half of JWKS_KEY to verify browser
sessions, but it received the full private key set, so anyone able to read
the gateway environment could sign tokens LobeHub trusts. setup.sh now also
writes JWKS_PUBLIC_KEY (the same key without d/p/q/dp/dq/qi), Compose passes
only that to the gateway, and the startup check warns when it is missing,
still contains private fields, or does not match JWKS_KEY.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 00:33:26 +08:00
Arvin Xu 40f8f469cf 🐛 fix(docker): make the one-click Docker Compose install start on the released image (#19590)
- Apply a bucket CORS rule in rustfs-init so browser uploads to RustFS through
  presigned URLs are not blocked by the preflight.
- Preload pg_cron and pg_stat_statements alongside pg_search, matching the
  ParadeDB image default. Its first-start bootstrap creates pg_cron under set -e,
  so preloading only pg_search aborted initialization, restarted the container
  and failed the first docker compose up with an unhealthy database.
- Probe PostgreSQL health over TCP with a start period. During initialization the
  image runs a temporary socket-only server, so the socket probe passed early and
  LobeHub's migrations failed with ECONNREFUSED until it had restarted repeatedly.
- setup.sh downloads templates from lobehub/lobehub main, uses curl with a wget
  fallback, and detects the host IP on macOS where hostname -I is missing.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 21:46:07 +08:00
YuTengjing 13ada65ad9 ✨ feat(fts-search): safe per-entity Elasticsearch mapping migrations (#19186) 2026-09-09 09:03:40 +08:00
YuTengjing 330c12a760 ✨ feat(self-host): add optional Elasticsearch to Docker Compose (#19028) 2026-09-02 17:37:38 +08:00