From ce941db3be05107b1a341d4d57513ccf29ded0c3 Mon Sep 17 00:00:00 2001 From: dmaes Date: Wed, 20 Jul 2022 08:54:34 +0200 Subject: [PATCH 1/2] add S3_CUSTOM_DOMAIN setting --- recipes/settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/settings.py b/recipes/settings.py index 120a1386..9c1df670 100644 --- a/recipes/settings.py +++ b/recipes/settings.py @@ -408,6 +408,8 @@ if os.getenv('S3_ACCESS_KEY', ''): if os.getenv('S3_ENDPOINT_URL', ''): AWS_S3_ENDPOINT_URL = os.getenv('S3_ENDPOINT_URL', '') + if os.getenv('S3_CUSTOM_DOMAIN', ''): + AWS_S3_CUSTOM_DOMAIN = os.getenv('S3_CUSTOM_DOMAIN', '') MEDIA_URL = os.getenv('MEDIA_URL', '/media/') MEDIA_ROOT = os.path.join(BASE_DIR, "mediafiles") From 24aeae6de956cc2afb35ded7fe3c87a16160338e Mon Sep 17 00:00:00 2001 From: dmaes Date: Wed, 20 Jul 2022 10:45:52 +0200 Subject: [PATCH 2/2] update .env.template --- .env.template | 1 + 1 file changed, 1 insertion(+) diff --git a/.env.template b/.env.template index 9b09e8a3..c76e7c8d 100644 --- a/.env.template +++ b/.env.template @@ -77,6 +77,7 @@ GUNICORN_MEDIA=0 # S3_QUERYSTRING_AUTH=1 # default true, set to 0 to serve media from a public bucket without signed urls # S3_QUERYSTRING_EXPIRE=3600 # number of seconds querystring are valid for # S3_ENDPOINT_URL= # when using a custom endpoint like minio +# S3_CUSTOM_DOMAIN= # when using a CDN/proxy to S3 (see https://github.com/TandoorRecipes/recipes/issues/1943) # Email Settings, see https://docs.djangoproject.com/en/3.2/ref/settings/#email-host # Required for email confirmation and password reset (automatically activates if host is set)