Changing my HostName in S3 without breaking the links
-
Hello forum members,
I'm encountering an issue with my Mastodon instance, and I could use some assistance in resolving it. I recently configured my Mastodon instance to use a custom asset host for media URLs. The goal was to change the format of media URLs from the default "s3-us-west-2.amazonaws.com" to "Media.Persiansmastodon.com."
I made the necessary changes in my Mastodon configuration, including setting the S3_HOSTNAME variable to "Media.Persiansmastodon.com." However, despite these changes, new media uploads are not using the correct format ("Media.Persiansmastodon.com").
also the old media files continue to use the original "s3-us-west-2.amazonaws.com" format. This has resulted in broken links for the old media.I've also restarted my Mastodon instance to apply the changes, but it hasn't resolved the issue.
I would appreciate any insights or guidance on how I can make Mastodon load old media from the "s3-us-west-2.amazonaws.com" link while using the new format for newly uploaded media. If there are any specific configuration changes or steps I should follow, please let me know.
Thank you for your help!
-
@ehson_mokhtary This is probably best asked in the upstream forum. I think https://github.com/mastodon/mastodon/discussions . Atleast in the docs, I found no mention of the behavior wrt old links. Looks like it will always use the new S3 configuration.
-
@ehson_mokhtary you may also find some clues e.g. in these posts:
https://github.com/cybrespace/cybrespace-meta/blob/master/s3.md
(see e.g. this section https://github.com/cybrespace/cybrespace-meta/blob/master/s3.md#follow-up although I've no idea how you'd do that on Cloudron)
https://chrishubbs.com/2022/11/19/hosting-a-mastodon-instance-moving-asset-storage-to-s3/