mikp / wn-s3browser-plugin
S3 browser plugin for Winter CMS
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Type:winter-plugin
Requires
- ankitpokhrel/tus-php: ^1.3
- composer/installers: ~1.0
- greenlion/php-sql-parser: ^4.4
- league/flysystem: ^1.1
- league/flysystem-aws-s3-v3: ^1.0
- league/flysystem-cached-adapter: ^1.1
- league/flysystem-webdav: ^1.0
- predis/predis: ^1.0
- superbalist/flysystem-google-storage: ^7.2
This package is auto-updated.
Last update: 2024-11-30 02:16:26 UTC
README
S3 object browser plugin containing components for front end views to interact with an s3 bucket like a file browser. This is a plugin for WinterCMS.
Cool Features
- supports many of the backends that are used in flysystem
- uses cache to list files
- the API implements the TUS resumable upload protocol using tus-php, and there is a component to match.
- middleware can be added to create custom access control
Why?
There is already a media manager and remote filesystem support in WinterCMS.
Although the CMS supports these features, there are not many good examples of components that show files to users. Here are some.
This plugin allows an additional location and method of storing files. It can support unofficial
S3 implementations as well as HTTP only S3 services. This can be very useful if you want store files in S3 in a self hosted or non-public configuration. It is intended to allow front-end users to interact with stored files. It provides an API that can be modified with middleware creating application specific access control on files.
For example:
Say that your website hosts a bunch of CAD files that your users can download, but you only want some users to be able to access them. The problem further complicating the issue is that all your CAD files are on your business's NAS - which is not public and the sys-admin didn't bother to set up SSL, add valid certificates, or create root-CAs and maybe there isn't any DNS records either.
By adding a middleware to the s3browser routes only allowed files will display on the downloads page and the insecure s3 storage server is not publicly exposed.
Issues
Admittedly I started this plugin without really understanding the laravel filesystem so I aim to migrate this implementation to use the built in remote storage provided by WinterCMS.
Usage
Just add the various components to views.
API
- {GET}
/api/v1/s3browser/list/{bucket}
- {POST/GET}
/api/v1/s3browser/object
- {GET}
/api/v1/s3browser/download
- {POST}
/api/v1/s3browser/upload
- {GET}
/api/v1/s3browser/zip
- {GET}
/api/v1/s3browser/select
- {ANY}
/api/v1/s3browser/tus
components
- s3browser - browse a given bucket
- s3uploader - upload to a given bucket
- s3query - Select style queries on tabular files (WIP)
Licence
This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.