Skip to content

Commit

Permalink
[WEB - 1482] fix: uploads when using block storages other than s3 and…
Browse files Browse the repository at this point in the history
… minio (#4647)

* fix: minio storage and redirection

* dev: disconnect web url and app base url configuration.
  • Loading branch information
pablohashescobar authored and sriramveeraghanta committed Jun 10, 2024
1 parent 94a34c5 commit 453984c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apiserver/plane/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"

# Storage Settings
# Use Minio settings
USE_MINIO = int(os.environ.get("USE_MINIO", 0)) == 1

STORAGES = {
"staticfiles": {
"BACKEND": "whitenoise.storage.CompressedManifestStaticFilesStorage",
Expand All @@ -243,7 +246,7 @@
AWS_S3_ENDPOINT_URL = os.environ.get(
"AWS_S3_ENDPOINT_URL", None
) or os.environ.get("MINIO_ENDPOINT_URL", None)
if AWS_S3_ENDPOINT_URL:
if AWS_S3_ENDPOINT_URL and USE_MINIO:
parsed_url = urlparse(os.environ.get("WEB_URL", "http://localhost"))
AWS_S3_CUSTOM_DOMAIN = f"{parsed_url.netloc}/{AWS_STORAGE_BUCKET_NAME}"
AWS_S3_URL_PROTOCOL = f"{parsed_url.scheme}:"
Expand Down Expand Up @@ -307,8 +310,6 @@
ANALYTICS_SECRET_KEY = os.environ.get("ANALYTICS_SECRET_KEY", False)
ANALYTICS_BASE_API = os.environ.get("ANALYTICS_BASE_API", False)

# Use Minio settings
USE_MINIO = int(os.environ.get("USE_MINIO", 0)) == 1

# Posthog settings
POSTHOG_API_KEY = os.environ.get("POSTHOG_API_KEY", False)
Expand Down Expand Up @@ -350,4 +351,4 @@
# Base URLs
ADMIN_BASE_URL = os.environ.get("ADMIN_BASE_URL", None)
SPACE_BASE_URL = os.environ.get("SPACE_BASE_URL", None)
APP_BASE_URL = os.environ.get("APP_BASE_URL") or os.environ.get("WEB_URL")
APP_BASE_URL = os.environ.get("APP_BASE_URL")

0 comments on commit 453984c

Please sign in to comment.