Switches storage driver to s3. This uses fakes3 on dev and AWS S3 bucket on prod. (Tested with personal S3 bucket. Not tested on materia server yet)
Things to note:
I didn't see the purpose of setting AWS keys in the docker compose file since these are set in .env.local and converted to $_ENV vars in bootstrap.php during local development, and production also doesn't appear to need them. If this is a mistake, lmk
This updates the AWS SDK for PHP package, so you might have to do a fresh install (re-run run_first.sh)
The fakes3 container was restarted after running run_tests.sh, essentially deleting all uploaded assets. My initial fix for this is just create a whole new fakes3 container for testing, and drop it after tests are complete.
How to test:
run_first.sh should run without errors, meaning all widget assets were uploaded. Check s3mnt/ folder in local fakes3 container
Do all thumbnails and uploaded assets load properly in different views?
Does the media uploader work?
Does running run_tests.sh remove any assets? (Do assets in widget demos still load?)
Any other way you can think to break it!
If you want to test your own S3 bucket, you'll need to set these variables in your .env.local file in the root folder. Here's the guide I used for setting up AWS locally
FAKES3_DISABLED = true
# ASSET_STORAGE_S3_BUCKET=<MUST_SET>
# ASSET_STORAGE_S3_ENDPOINT=<MUST_SET>
# AWS_ACCESS_KEY_ID=<MUST_SET>
# AWS_SECRET_ACCESS_KEY=<MUST_SET>
# AWS_SESSION_TOKEN=<MUST_SET> // STS token for s3 development
To Do:
[x] Add S3 Object Locking in lock_for_processing and unlock_for_processing for when assets are resized
[x] Disable Object Locking when using fakes3
[x] May need a re-check / error handling refactor after dev/10.2.0 is pushed
[x] Test deleting assets
To see the specific tasks where the Asana app for GitHub is being used, see below:
Switches storage driver to s3. This uses fakes3 on dev and AWS S3 bucket on prod. (Tested with personal S3 bucket. Not tested on materia server yet)
Things to note:
$_ENV
vars inbootstrap.php
during local development, and production also doesn't appear to need them. If this is a mistake, lmkrun_first.sh
)run_tests.sh
, essentially deleting all uploaded assets. My initial fix for this is just create a whole new fakes3 container for testing, and drop it after tests are complete.How to test:
run_first.sh
should run without errors, meaning all widget assets were uploaded. Checks3mnt/
folder in local fakes3 containerrun_tests.sh
remove any assets? (Do assets in widget demos still load?)If you want to test your own S3 bucket, you'll need to set these variables in your
.env.local
file in the root folder. Here's the guide I used for setting up AWS locallyTo Do:
lock_for_processing
andunlock_for_processing
for when assets are resized