-
Notifications
You must be signed in to change notification settings - Fork 456
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 other file storage drivers (Flysystem) #11120
Comments
In a decoupled scenario with Flysystem writing to S3 instead of a local host, the web server delivering the assets can be a different one. This needs to be taken into account for the load-balancing strategy of a given service. Additionally it is considered good security practice to serve user-generated content from a separate domain-name, in order to benefit from the additional XSS and CSRF protection. Stored objects receive a full URL and need to be addressed through it. Relative file-system paths or constructed URLs based on an instance domain will not continue to work. Ideally the transport is encrypted. Signing of URLs allows for the client to generate links that can be opened, while a bucket can remain private. E.g. with Minio:
Flysystem seems to be prepared for that: In the documentation it says the
In a perfect world, that of containers, the application does not store state in the file system and all side-effects are handed over to separate, decoupled (web) services. This would in turn allow for horizontal scaling of pkp-lib processes. |
Not concrete. But we have a few related wishes/changes that are related:
Those are both very aggressive changes, though, and not yet scheduled. So whatever happens with |
OJS currently supports file interactions with a mixture of Flysystem's local adapter and legacy PHP functions (wrapped with homebrew FileManager classes).
There are two separate file storage areas involved:
files_dir
inconfig.inc.php
). This is a private storage area that should never be accessed through any other mechanism than PHP scripts.public
directory. This exists inside the web root; OJS/OMP/OPS uses it for storing CSS, images, and other content that can be accessed directly through the web server.Eventually it would be beneficial to convert both of these over to consistently using Flysystem and eliminate the old
FileManager
classes as much as possible. This would potentially allow the use of other Flysystem adapters, which could be configured viaconfig.inc.php
.I'm ambivalent about the
public
files directory; having PHP scripts write to web-accessible areas is an opportunity for security hazards. I would support a move to homogenize the two file storage areas and serve everything there via PHP.Related issues:
The text was updated successfully, but these errors were encountered: