Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Store assets on S3 as well as NFS and optionally serve from S3 on public URLs #74
This is the first step in changing the Asset Manager to store its assets in and serve its assets from AWS S3, i.e. to avoid using NFS.
This PR means that whenever an asset is successfully virus scanned a new asynchronous job is kicked off to upload the asset to S3. The fact that it's a separate job should mean that the current external behaviour is unaffected; the assets are still stored on NFS as before.
Serving assets through the Rails app and not using
The new behaviour requires the following standard environment variables to be set:
And this application specific environment variable:
I think we should remove the
This looks good to me. I checked out this branch to my local development environment to test it. Testing file upload without setting any environment variables gave the following output from
Testing file upload with the env variables set as per the explanation above gave
I was able to view the uploaded asset at
The only thing I could think to change here would be to not run the delayed job at all if the environment variable wasn't set, rather than run a job which suceeds but does not have the expected side effect - this might make it a little easier to see at a glance what's going on if we have misconfigured something. Or perhaps we could log something informative instead? I think we'll be able to work it out either way though so