From e0a1b3366fa6418d97d2a6cbf4ad6f30a763735e Mon Sep 17 00:00:00 2001 From: Shlee Date: Tue, 8 Apr 2025 07:27:11 +0000 Subject: [PATCH] EXTRA_DATA_HOSTS (#1612) * Update object-storage.md * Update config.md * Update object-storage-proxy.md * Update object-storage.md * Update config.md * Update object-storage-proxy.md * Update object-storage.md * Update config.md * Update content/en/admin/config.md Co-authored-by: Claire --------- Co-authored-by: Claire --- content/en/admin/config.md | 4 ++++ content/en/admin/optional/object-storage-proxy.md | 6 ++++++ content/en/admin/optional/object-storage.md | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/content/en/admin/config.md b/content/en/admin/config.md index 9ae2ccec..0842d5e4 100644 --- a/content/en/admin/config.md +++ b/content/en/admin/config.md @@ -862,6 +862,10 @@ The bucket must support access control lists (ACLs). For AWS S3, this means sett #### `S3_ALIAS_HOST` +#### `EXTRA_MEDIA_HOSTS` + +**Version history:**\ +4.4.0 - added #### `S3_OPEN_TIMEOUT` diff --git a/content/en/admin/optional/object-storage-proxy.md b/content/en/admin/optional/object-storage-proxy.md index 66ad68b6..748ad0d7 100644 --- a/content/en/admin/optional/object-storage-proxy.md +++ b/content/en/admin/optional/object-storage-proxy.md @@ -115,6 +115,12 @@ At last, you'll want to make sure Mastodon is using your new proxy to generate f S3_ALIAS_HOST=files.example.com ``` +(Optional) If your S3_ALIAS_HOST is using a 301 redirection or similar. Add the final location to the EXTRA_MEDIA_HOSTS + +```bash +EXTRA_MEDIA_HOSTS=https://data.example1.com,https://data.example2.com +``` + And restart Mastodon: ```bash diff --git a/content/en/admin/optional/object-storage.md b/content/en/admin/optional/object-storage.md index 7879873b..e27b6f42 100644 --- a/content/en/admin/optional/object-storage.md +++ b/content/en/admin/optional/object-storage.md @@ -101,6 +101,12 @@ provider, reducing egress bandwidth costs from the storage provider. This can be done in your own reverse proxy, or by using a CDN. +`EXTRA_MEDIA_HOSTS` offers appending an additional list of hosts that +are allowed to serve media for your instance. This is useful if you +include external media in your custom CSS or about page, or if your +data storage provider makes use of redirects to other domains. +`EXTRA_MEDIA_HOSTS=https://data.example1.com,https://data.example2.com` + {{< page-ref page="admin/optional/object-storage-proxy.md" >}} {{< hint style="info" >}}