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

Add support for storing letters and attachments on AWS s3 #129

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pdabrowski6
Copy link

@pdabrowski6 pdabrowski6 commented Jan 25, 2024

Hello @fgrehm 👋 I added support to store letters and attachments on S3 bucket. Thanks to this solution it is possible to use the gem on Heroku when there are multiple workers. It will also help on containerized applications. This PR solves the issue reported in #35

I attached to the README details how to setup the bucket on s3 and the content of the policy required to safely manage the bucket and delete files.

@pdabrowski6 pdabrowski6 marked this pull request as ready for review January 26, 2024 17:48
@ismaelbks
Copy link

Hello, is there any chance this PR would be merged ?
This would be very useful because we use LetterOpener for all of our platforms (~50) and we are switching to dockerized about so without this we would need to use something else than LetterOpener 🥲

@qdegraeve
Copy link

Nice feature , maybe it would be better for s3 management to add an option to specify a prefix to store the files inside the bucket so it would be easy and safe to create a lifecylcle policy for automatic cleanup.

@fgrehm
Copy link
Owner

fgrehm commented May 14, 2024

@stevenharman any thoughts on this?

@stevenharman
Copy link
Collaborator

stevenharman commented May 15, 2024

I certainly understand the desire for this feature. However, I worry about adding aws-sdk-s3 as a dependency for everyone. I think we could get around this with some use of Ruby autoload and explicit instructions for adding that dependency.

Or, perhaps more work but a better overall approach, would be to make the "backend" pluggable. The default backend, which ships with this Gem, is local disk storage, like today. But an extension (e.g., letter_opener_web-s3) could provide an alternate backend for storing, receiving messages and attachments.

That would require some effort to formalize the API/contract of "backend," but I don't think that'd be a too bad. Thoughts?

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.

5 participants