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

[RFC] Flysystem #1929

Open
LewisHobden opened this issue Oct 1, 2020 · 3 comments · May be fixed by #3454
Open

[RFC] Flysystem #1929

LewisHobden opened this issue Oct 1, 2020 · 3 comments · May be fixed by #3454
Labels

Comments

@LewisHobden
Copy link

User Story

As a developer, I want to store my assets on an object store like AWS S3, GCP or DigitalOcean Spaces so that I can benefit from their tools and help my server to be stateless.

Context

As discussed in issue #1681, Bolt could benefit from support for external object stores using PHPLeague's Flysystem V2 (Currently in beta). This would help servers with scaling options like load balancing containers or Kubernetes as all container instances could refer to the same external filesystem. It makes unit testing easier and faster, as mock/memory adapters can be used to replace local operations.

What is Required

Classes which talk to the local filesystem using methods such as file_get_contents or Symphony's Filesystem component would need to be swapped out in favour of Filesystem objects. This would only need to be done for media files that the user uploads. Operations like image processing or video compressing can still be done using the local filesystem, as long as they are uploaded to the remote storage at the end.

The chosen Filesystem should be configured using the project config, like the .env file and default to local operations as it does currently.

How can you help?

I'm happy to create a PR for this work, I've worked with PHP on our own framework for nearly 4 years. I've had plenty of experience with Flysystem and I've been looking to contribute to open source.. This is my first RFC so let me know if I've missed anything.

@bobdenotter
Copy link
Member

Hi, @LewisHobden

Sounds good. Would love this as an improvement for Bolt. Some initial thoughts:

Flysystem V2

Yes, let's go straight for v2! Knowing Frank, what he labels "beta" is already of a higher quality than most mature libraries.

This would only need to be done for media files that the user uploads.

Agreed! In Bolt 3 we also had FlySystem support for app/config and the like, which made things like 'check if this config file is readable/writable' very clumsy. In turn this was confusing for end-users, who we couldn't give proper feedback in backend UI in these cases.

The chosen Filesystem should be configured using the project config, like the .env file and default to local operations as it does currently.

That would be ideal, from the perspective of the end-user! We can then ship Bolt working 'out of the box', and people who want/need this functionality can enable it!

tenor

@maetthu
Copy link

maetthu commented Oct 20, 2023

Are there any plans for merging this PR or a way to help with this? A FS abstraction would certainly help running Bolt in a containerized cloud environment.

@przyb
Copy link

przyb commented Jan 5, 2024

@bobdenotter could you share with us any timeline for merging and releasing this feature? I took a peek at @praswicaksono's PR and it looks pretty solid! One of our clients recently requested migrating all of the media to S3, so we're looking forward to this feature's release 🤞 Thanks for your hard work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants