Skip to content

Commit

Permalink
Use settings value as region
Browse files Browse the repository at this point in the history
Some managed minio providers require the region to be exact when accessing private files
  • Loading branch information
devanao committed Nov 14, 2022
1 parent b308d3f commit faf2433
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion django_minio_backend/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def __init__(self,
self.__MINIO_ACCESS_KEY: str = get_setting("MINIO_ACCESS_KEY")
self.__MINIO_SECRET_KEY: str = get_setting("MINIO_SECRET_KEY")
self.__MINIO_USE_HTTPS: bool = get_setting("MINIO_USE_HTTPS")
self.__MINIO_REGION: str = get_setting("MINIO_REGION", None)
self.__MINIO_EXTERNAL_ENDPOINT_USE_HTTPS: bool = get_setting("MINIO_EXTERNAL_ENDPOINT_USE_HTTPS", self.__MINIO_USE_HTTPS)
self.__MINIO_BUCKET_CHECK_ON_SAVE: bool = get_setting("MINIO_BUCKET_CHECK_ON_SAVE", False)

Expand Down Expand Up @@ -373,7 +374,7 @@ def _create_new_client(self, fake: bool = False) -> minio.Minio:
secret_key=self.__MINIO_SECRET_KEY,
secure=self.__MINIO_EXTERNAL_ENDPOINT_USE_HTTPS if fake else self.__MINIO_USE_HTTPS,
http_client=self.HTTP_CLIENT,
region='us-east-1' if fake else None,
region=self.__MINIO_REGION,
)
if fake:
self.__CLIENT_FAKE = mc
Expand Down

0 comments on commit faf2433

Please sign in to comment.