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

Added very minimalist support for an S3 backend... #86

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

Conversation

tomamoto
Copy link

@tomamoto tomamoto commented May 9, 2023

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.

…blicly readable S3 bucket.

Terraform project included at src/static/terraform to describe the S3 bucket and attached policies.
…urity check, but want to at least lock down the ACL stuff.
@sonarcloud
Copy link

sonarcloud bot commented May 9, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 5 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@k1shan-k
Copy link

S3 support needed asap

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.

2 participants