mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-12 21:39:00 +08:00
Use s3 configuration from settings module (#4167)
### What problem does this PR solve? Fix the issue when retrieving AWS credentials from the S3 configuration from the settings module instead of getting from the environment variables. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) Co-authored-by: Kevin Hu <kevinhu.sh@gmail.com>
This commit is contained in:
parent
cb45431412
commit
f13f503952
@ -6,15 +6,17 @@ from botocore.client import Config
|
|||||||
import time
|
import time
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from rag.utils import singleton
|
from rag.utils import singleton
|
||||||
|
from rag import settings
|
||||||
|
|
||||||
@singleton
|
@singleton
|
||||||
class RAGFlowS3(object):
|
class RAGFlowS3(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.conn = None
|
self.conn = None
|
||||||
self.endpoint = os.getenv('ENDPOINT', None)
|
self.s3_config = settings.S3
|
||||||
self.access_key = os.getenv('ACCESS_KEY', None)
|
self.endpoint = self.s3_config.get('endpoint', None)
|
||||||
self.secret_key = os.getenv('SECRET_KEY', None)
|
self.access_key = self.s3_config.get('access_key', None)
|
||||||
self.region = os.getenv('REGION', None)
|
self.secret_key = self.s3_config.get('secret_key', None)
|
||||||
|
self.region = self.s3_config.get('region', None)
|
||||||
self.__open__()
|
self.__open__()
|
||||||
|
|
||||||
def __open__(self):
|
def __open__(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user