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

Connect to AWS S3 API for static assets #32

Closed
24 tasks done
JSn1nj4 opened this issue Feb 17, 2022 · 2 comments
Closed
24 tasks done

Connect to AWS S3 API for static assets #32

JSn1nj4 opened this issue Feb 17, 2022 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@JSn1nj4
Copy link
Owner

JSn1nj4 commented Feb 17, 2022

Potential good starting point: Getting started with Amazon S3 storage in Laravel

The one I'm probably going with: https://laravel-news.com/uploading-files-laravel

Checklist

Not comprehensive, but should prevent storage issues

  • Set up basic upload mechanism
  • Set up disk environment var - expect local for dev, AWS S3 for prod
  • Upload file to 'public' disk at first
  • Call images folder in S3 'uploads/images' to separate from manual uploads
  • Check if uploaded image already exists (file hash)
  • If new....
    • Queue for permanent storage — run daily
    • Upload asset to permanent storage
    • Update asset URI, disk etc.
    • Remove old locally-stored file
  • If existing...
    • Skip uploading as "new"
    • Attach existing
  • After attachment, remove duplicates
  • Add media management - will need controller
    • Create media library view
    • Look at full-size image
    • Prevent deletion if attached to anything
      • Check if latest attachment of anything only
    • Delete image if not attached
      • Clear all attachments first
    • On delete, queue storage cleanup
  • After first S3 image access, cache for faster loading
    • Tell browser to cache?
    • Download to 'image-cache' directory or similar?
  • Handle statically-linked assets separately
    • Store in separate folder 'assets'
  • Periodically clean 'temp' storage
  • Update IDE helpers
  • Manually update any model fields necessary
  • Update factories and seeders
  • Update existing tests
@JSn1nj4 JSn1nj4 added the enhancement New feature or request label Feb 19, 2022
@JSn1nj4 JSn1nj4 added this to the Release 2.0.0 milestone Feb 19, 2022
@JSn1nj4
Copy link
Owner Author

JSn1nj4 commented Dec 24, 2022

See if this needs a queue too (e.g. from temp disk to permanent in AWS).

@JSn1nj4
Copy link
Owner Author

JSn1nj4 commented Jan 15, 2023

Might need to keep direct S3 uploads (e.g. for CSS and such) stored in public-facing bucket after all.

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

No branches or pull requests

1 participant