|
@@ -5,6 +5,7 @@ from abc import ABC, abstractmethod
|
|
|
from typing import BinaryIO, Tuple
|
|
|
|
|
|
import boto3
|
|
|
+from botocore.config import Config
|
|
|
from botocore.exceptions import ClientError
|
|
|
from open_webui.config import (
|
|
|
S3_ACCESS_KEY_ID,
|
|
@@ -13,6 +14,8 @@ from open_webui.config import (
|
|
|
S3_KEY_PREFIX,
|
|
|
S3_REGION_NAME,
|
|
|
S3_SECRET_ACCESS_KEY,
|
|
|
+ S3_USE_ACCELERATE_ENDPOINT,
|
|
|
+ S3_ADDRESSING_STYLE,
|
|
|
GCS_BUCKET_NAME,
|
|
|
GOOGLE_APPLICATION_CREDENTIALS_JSON,
|
|
|
AZURE_STORAGE_ENDPOINT,
|
|
@@ -98,6 +101,12 @@ class S3StorageProvider(StorageProvider):
|
|
|
endpoint_url=S3_ENDPOINT_URL,
|
|
|
aws_access_key_id=S3_ACCESS_KEY_ID,
|
|
|
aws_secret_access_key=S3_SECRET_ACCESS_KEY,
|
|
|
+ config=Config(
|
|
|
+ s3={
|
|
|
+ "use_accelerate_endpoint": S3_USE_ACCELERATE_ENDPOINT,
|
|
|
+ "addressing_style": S3_ADDRESSING_STYLE,
|
|
|
+ },
|
|
|
+ ),
|
|
|
)
|
|
|
self.bucket_name = S3_BUCKET_NAME
|
|
|
self.key_prefix = S3_KEY_PREFIX if S3_KEY_PREFIX else ""
|