Feat: extend S3 storage compatibility and add knowledge base ID prefix (#6355)

### What problem does this PR solve?

- Added support for S3-compatible protocols.
- Enabled the use of knowledge base ID as a file prefix when storing
files in S3.
- Updated docker/README.md to include detailed S3 and OSS configuration
instructions.

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
RedBookOfMemory
2025-03-31 16:09:43 +08:00
committed by GitHub
parent 46b5e32cd7
commit e2b66628f4
4 changed files with 81 additions and 12 deletions

View File

@ -136,6 +136,24 @@ The [.env](./.env) file contains important environment variables for Docker.
- `password`: The password for MinIO.
- `host`: The MinIO serving IP *and* port inside the Docker container. Defaults to `minio:9000`.
- `oss`
- `access_key`: The access key ID used to authenticate requests to the OSS service.
- `secret_key`: The secret access key used to authenticate requests to the OSS service.
- `endpoint_url`: The URL of the OSS service endpoint.
- `region`: The OSS region where the bucket is located.
- `bucket`: The name of the OSS bucket where files will be stored. When you want to store all files in a specified bucket, you need this configuration item.
- `prefix_path`: Optional. A prefix path to prepend to file names in the OSS bucket, which can help organize files within the bucket.
- `s3`:
- `access_key`: The access key ID used to authenticate requests to the S3 service.
- `secret_key`: The secret access key used to authenticate requests to the S3 service.
- `endpoint_url`: The URL of the S3-compatible service endpoint. This is necessary when using an S3-compatible protocol instead of the default AWS S3 endpoint.
- `bucket`: The name of the S3 bucket where files will be stored. When you want to store all files in a specified bucket, you need this configuration item.
- `region`: The AWS region where the S3 bucket is located. This is important for directing requests to the correct data center.
- `signature_version`: Optional. The version of the signature to use for authenticating requests. Common versions include `v4`.
- `addressing_style`: Optional. The style of addressing to use for the S3 endpoint. This can be `path` or `virtual`.
- `prefix_path`: Optional. A prefix path to prepend to file names in the S3 bucket, which can help organize files within the bucket.
- `oauth`
The OAuth configuration for signing up or signing in to RAGFlow using a third-party account. It is disabled by default. To enable this feature, uncomment the corresponding lines in **service_conf.yaml.template**.
- `github`: The GitHub authentication settings for your application. Visit the [Github Developer Settings page](https://github.com/settings/developers) to obtain your client_id and secret_key.
@ -152,4 +170,4 @@ The [.env](./.env) file contains important environment variables for Docker.
- `api_key`: The API key for the specified LLM. You will need to apply for your model API key online.
> [!TIP]
> If you do not set the default LLM here, configure the default LLM on the **Settings** page in the RAGFlow UI.
> If you do not set the default LLM here, configure the default LLM on the **Settings** page in the RAGFlow UI.

View File

@ -1,6 +1,7 @@
include:
- ./docker-compose-base.yml
# To ensure that the container processes the locally modified `service_conf.yaml.template` instead of the one included in its image, you need to mount the local `service_conf.yaml.template` to the container.
services:
ragflow:
depends_on:
@ -20,6 +21,7 @@ services:
- ./nginx/proxy.conf:/etc/nginx/proxy.conf
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ../history_data_agent:/ragflow/history_data_agent
- ./service_conf.yaml.template:/ragflow/conf/service_conf.yaml.template
env_file: .env
environment:

View File

@ -37,6 +37,11 @@ redis:
# access_key: 'access_key'
# secret_key: 'secret_key'
# region: 'region'
# endpoint_url: 'endpoint_url'
# bucket: 'bucket'
# prefix_path: 'prefix_path'
# signature_version: 'v4'
# addressing_style: 'path'
# oss:
# access_key: '${ACCESS_KEY}'
# secret_key: '${SECRET_KEY}'