From fb5c863ddacd48ca8aa48c42e44b03da8ad6f899 Mon Sep 17 00:00:00 2001 From: Lilou Date: Sun, 4 Aug 2024 14:11:07 +0000 Subject: [PATCH] Clearer explanation AWS_CUSTOM_DOMAIN + protocol --- api/config/settings/common.py | 15 ++++++++++++++- changes/changelog.d/aws-custom-domain.doc | 1 + .../administrator/configuration/object-storage.md | 4 ++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 changes/changelog.d/aws-custom-domain.doc diff --git a/api/config/settings/common.py b/api/config/settings/common.py index b2fa0d715..3faf9f3ef 100644 --- a/api/config/settings/common.py +++ b/api/config/settings/common.py @@ -609,7 +609,20 @@ if AWS_ACCESS_KEY_ID: """ AWS_S3_CUSTOM_DOMAIN = env("AWS_S3_CUSTOM_DOMAIN", default=None) """ - Custom domain to use for your S3 storage. + Custom domain for serving your S3 files. + + Useful if your provider offers a CDN-like service for your bucket. + + .. important:: + + The URL must not contain a scheme (:attr:`AWS_S3_URL_PROTOCOL` is + automatically prepended) nor a trailing slash. + """ + AWS_S3_URL_PROTOCOL = env("AWS_S3_URL_PROTOCOL", default="https:") + """ + Protocol to use when constructing the custom domain (see :attr:`AWS_S3_CUSTOM_DOMAIN`) + .. important:: + It must end with a `:`, remove `//`. """ AWS_S3_ENDPOINT_URL = env("AWS_S3_ENDPOINT_URL", default=None) """ diff --git a/changes/changelog.d/aws-custom-domain.doc b/changes/changelog.d/aws-custom-domain.doc new file mode 100644 index 000000000..a5f8f5571 --- /dev/null +++ b/changes/changelog.d/aws-custom-domain.doc @@ -0,0 +1 @@ +Added explanation of AWS_CUSTOM_DOMAIN and AWS_S3_URL_PROTOCOL. diff --git a/docs/administrator/configuration/object-storage.md b/docs/administrator/configuration/object-storage.md index 3c39136a5..3964065ba 100644 --- a/docs/administrator/configuration/object-storage.md +++ b/docs/administrator/configuration/object-storage.md @@ -48,6 +48,8 @@ To set up S3-compatible storage, fill out the relevant details in the `.env` fil :::{dropdown} Environment variables +Internally, Funkwhale uses the `django-storages` library. See [the documentation](https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html) for more details about environment variables. + ```{eval-rst} .. autodata:: config.settings.common.AWS_QUERYSTRING_AUTH @@ -62,6 +64,8 @@ To set up S3-compatible storage, fill out the relevant details in the `.env` fil :noindex: .. autodata:: config.settings.common.AWS_S3_CUSTOM_DOMAIN :noindex: +.. autodata:: config.settings.common.AWS_S3_URL_PROTOCOL + :noindex: .. autodata:: config.settings.common.AWS_S3_ENDPOINT_URL :noindex: :annotation: = https://minio.mydomain.com