fix: Allow S3 usage without token
This commit is contained in:
parent
b137d680e2
commit
8ad3ab2328
2 changed files with 11 additions and 5 deletions
|
|
@ -155,6 +155,16 @@ LITELLM_LOG="ERROR"
|
||||||
# DEFAULT_USER_EMAIL=""
|
# DEFAULT_USER_EMAIL=""
|
||||||
# DEFAULT_USER_PASSWORD=""
|
# DEFAULT_USER_PASSWORD=""
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# 📂 AWS Settings
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
#AWS_REGION=""
|
||||||
|
#AWS_ENDPOINT_URL=""
|
||||||
|
#AWS_ACCESS_KEY_ID=""
|
||||||
|
#AWS_SECRET_ACCESS_KEY=""
|
||||||
|
#AWS_SESSION_TOKEN=""
|
||||||
|
|
||||||
------------------------------- END OF POSSIBLE SETTINGS -------------------------------
|
------------------------------- END OF POSSIBLE SETTINGS -------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,7 @@ class S3FileStorage(Storage):
|
||||||
def __init__(self, storage_path: str):
|
def __init__(self, storage_path: str):
|
||||||
self.storage_path = storage_path
|
self.storage_path = storage_path
|
||||||
s3_config = get_s3_config()
|
s3_config = get_s3_config()
|
||||||
if (
|
if s3_config.aws_access_key_id is not None and s3_config.aws_secret_access_key is not None:
|
||||||
s3_config.aws_access_key_id is not None
|
|
||||||
and s3_config.aws_secret_access_key is not None
|
|
||||||
and s3_config.aws_session_token is not None
|
|
||||||
):
|
|
||||||
self.s3 = s3fs.S3FileSystem(
|
self.s3 = s3fs.S3FileSystem(
|
||||||
key=s3_config.aws_access_key_id,
|
key=s3_config.aws_access_key_id,
|
||||||
secret=s3_config.aws_secret_access_key,
|
secret=s3_config.aws_secret_access_key,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue