New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Archive download link does not respect S3_ALIAS_HOST setting #24380
Comments
same problem here |
We are experiencing this issue on our instance with version v4.1.2 |
I poked around a little bit in the code to see if I could understand what was going on here and it looks like it may be something related to the Paperclip gem and how it's being called or configured. I don't know enough about the particulars of the implementation here to know what the problem is, though. Maybe something different between the web and mailer environments when rendering the link? 🤷♂️ |
It doesn't only affect the download link in the email but also the download link in import/export settings. I managed to work around this with nginx since both links actually point to the mastodon server, which then redirects wrongly. If using the recommended nginx config, replace Line 144 in f877aa9
with proxy_redirect http://192.0.2.69/my-bucket/ https://media.example.net/; where |
@codl thanks! That solution seems to work. I did need to be sure to use Perhaps the best solution for this would be for the maintainers to include this setting in the documentation, if it's not already. |
This is an underlying issue in Paperclip (thoughtbot/paperclip#2196), but I am not sure how it is supposed to be addressed. I am unfortunately not knowledgeable enough in S3. |
The workaround of adding |
@davetroy unfortunately doesn't work for me (on queer.party) as i'm not using Nginx as a front-end loadbalancer |
Steps to reproduce the problem
Expected behaviour
User should have received link based on S3_ALIAS_HOST
Actual behaviour
User received link based on S3_ENDPOINT
Detailed description
Requesting a download of one's account archive produces a user-facing link to S3_ENDPOINT instead of S3_ALIAS_HOST. In our setup, this will not work, because S3_ENDPOINT is a private VLAN-accessible endpoint that we do not want to expose to end users. S3_ALIAS_HOST should be used instead, as it is for the distribution of other user-uploaded files.
Specifications
Mastodon 4.1.1
Ruby 3.0.4p208
PostgreSQL 15.1
Redis 5.0.7
The text was updated successfully, but these errors were encountered: