Added very minimalist support for an S3 backend... #86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
making use of a a publicly readable S3 bucket.
Terraform project included at src/static/terraform to describe the S3 bucket and attached policies necessary to make it publicly readable. Also configures an object lifecycle policy to handle our auto-deletion and obviate the need for a cron job when using S3 storage.
Relies on a local AWS CLI Profile existing on the server with read/write permissions to the configured bucket.
Adds 4 new related config.json variables, for AWS Profile, Region and Bucket and a boolean to enable S3 storage, otherwise defaulting to the existing local files backend.
Adds no new error handling, but configured correctly, it works great on my end and simply returns the uploaded file's S3 URL, fully offloading downloads to AWS S3.
I too am a sysops guy, but with pretty limited experience writing PHP. If you reject my PR (and feel free to, it won't hurt my feelings) hopefully this can be of benefit to someone. I just built it quick and dirty for myself because the instance I'm running this on only has a single volume and I didn't want to risk an attack that would let someone fill up my local disk and affect other services. Now the worst they can can do is max out out my AWS bill, but at least S3 is still way cheaper than block storage.