Skip to content
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

Use pre-signed URLs for media storage when using S3 #9

Merged
merged 5 commits into from
Feb 9, 2022

Conversation

jesseplusplus
Copy link
Owner

The default way mastodon uses S3 for object storage is insecure:

  • It requires buckets to be open to public access
  • Anyone with the URL of a file can access it

This PR overrides all urls to be expiring urls when using S3 to fix these issues.

I did this with a monkey patch of the url method instead of changing all uses of url to expiring_url to minimize conflicts with upstream. I also had to manually gsub the output to use the local S3 alias due to thoughtbot/paperclip#2196.

@jesseplusplus jesseplusplus merged this pull request into freq-main Feb 9, 2022
jesseplusplus added a commit that referenced this pull request Feb 8, 2023
originally introduced in #9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant