mirror of
https://github.com/lobehub/lobehub.git
synced 2026-09-20 04:56:13 +08:00
c5ec20abab
* ✨ 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>
105 lines
3.2 KiB
Plaintext
105 lines
3.2 KiB
Plaintext
---
|
|
title: Configuring S3 Storage Service
|
|
description: >-
|
|
Learn how to configure S3 storage service to support multimodal AI sessions
|
|
and image uploads.
|
|
tags:
|
|
- S3 Storage
|
|
- Multimodal AI
|
|
- Image Upload
|
|
- File Storage
|
|
---
|
|
|
|
# Configuring S3 Storage Service
|
|
|
|
LobeHub supports multimodal AI sessions, including the ability to upload unstructured data such as images and files to large language models. To optimize storage and performance, we use S3-compatible file storage services to store image files and support file upload/knowledge base functionality.
|
|
|
|
## Core Environment Variables
|
|
|
|
### `S3_ACCESS_KEY_ID`
|
|
|
|
- Type: Required
|
|
- Description: Access key ID for S3 storage service
|
|
- Default: -
|
|
- Example: `AKIAIOSFODNN7EXAMPLE`
|
|
|
|
### `S3_SECRET_ACCESS_KEY`
|
|
|
|
- Type: Required
|
|
- Description: Secret access key for S3 storage service
|
|
- Default: -
|
|
- Example: `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`
|
|
|
|
### `S3_ENDPOINT`
|
|
|
|
- Type: Required
|
|
- Description: Request endpoint for the bucket; for `virtual-host` mode, should not include the bucket name prefix
|
|
- Default: -
|
|
- Example: `https://cos.ap-chengdu.myqcloud.com`
|
|
|
|
### `S3_INTERNAL_ENDPOINT`
|
|
|
|
- Type: Optional
|
|
- Description: Endpoint the LobeHub server uses for its own S3 requests (uploads, metadata checks, reads, bucket creation) when `S3_ENDPOINT` is only reachable from browsers, for example the Docker Compose service name. Presigned URLs keep using `S3_ENDPOINT`.
|
|
- Default: `-` (uses `S3_ENDPOINT`)
|
|
- Example: `http://rustfs:9000`
|
|
|
|
### `S3_BUCKET`
|
|
|
|
- Type: Required
|
|
- Description: Name of the storage bucket
|
|
- Default: -
|
|
- Example: `my-bucket`
|
|
|
|
### `S3_REGION`
|
|
|
|
- Type: Optional
|
|
- Description: Region of the storage bucket
|
|
- Default: -
|
|
- Example: `ap-chengdu`
|
|
|
|
### `S3_SET_ACL`
|
|
|
|
- Type: Optional
|
|
- Description: Whether to set ACL to `public-read` when uploading files
|
|
- Default: `-` (disabled; the ACL is only set when explicitly configured to `1`)
|
|
- Example: `1`
|
|
|
|
### `S3_ENABLE_PATH_STYLE`
|
|
|
|
- Type: Optional
|
|
- Description: Whether to enable S3 `path-style` access mode
|
|
- Default: `0`
|
|
- Example: `1`
|
|
|
|
<Callout type={'info'}>
|
|
`path-style` and `virtual-host` are different methods of accessing buckets and objects in S3, with differences in URL structure and domain name resolution.
|
|
|
|
Assuming the S3 service provider's domain is s3.example.net, the bucket is mybucket, and the object is config.env, the specific differences are:
|
|
|
|
- path-style: `s3.example.net/mybucket/config.env`
|
|
- virtual-host: `mybucket.s3.example.net/config.env`
|
|
</Callout>
|
|
|
|
### `LLM_VISION_IMAGE_USE_BASE64`
|
|
|
|
- Type: Optional
|
|
- Description: Set to `1` to use base64 encoding for image upload.
|
|
- Default: undefined
|
|
- Example: `1`
|
|
|
|
When set to `1`, LobeHub will convert images to base64 encoding before uploading them to the LLM model. When encountering the following error, please consider configuring this environment variable to `1`:
|
|
|
|
```log
|
|
Route: [xai] ProviderBizError: Fetching images over plain http:// is not supported.
|
|
```
|
|
|
|
### `LLM_VISION_VIDEO_USE_BASE64`
|
|
|
|
- Type: Optional
|
|
- Description: Set to `1` to use base64 encoding for video upload.
|
|
- Default: undefined
|
|
- Example: `1`
|
|
|
|
When set to `1`, LobeHub will convert videos to base64 encoding before uploading them to the LLM model.
|