jointakahe / takahe

An ActivityPub/Fediverse server
BSD 3-Clause "New" or "Revised" License
1.1k stars 84 forks source link

TAKAHE_MEDIA_URL not fully used for S3 storage #638

Closed virtualmarc closed 11 months ago

virtualmarc commented 11 months ago

I'm currently using Cloudflare R2 as an S3 backend for media storage.

Cloudflare does not allow access to the objects via the S3 storage URL and requires a custom URL.

From the https://github.com/jointakahe/takahe/blob/b003af64ccab6b4462d0e1fe8598c01964e70a44/takahe/settings.py#L438 I've seen that TAKAHE_MEDIA_URL is set as AWS_S3_CUSTOM_DOMAIN so it should be possible to configure an own URL.

This also works fine for the Instance website, where every URL now uses the configured media url, but when I post an image other instances still get the S3 storage URL over Activity Pub.

If I take a look at the post in the Django Admin console it shows the correct media URL in the Activity Pub JSON, but this doesn't seem to be received on the remote Mastodon instance.

I've set the environment variable for both, the web and the stator container instances.

virtualmarc commented 11 months ago

Oops, actually the config change did not apply on the stator instances. (Env was set but environment did not recreate the container).

After rescaling the stator service it works now!