I have both public and private files which I server from Amazon cloudfront, the public files work fine but now I\'d like to secure some of them as private with an authentica
Depends how secure, but you can set file permissions on the particular Uploader Class itself overriding the default permissions like so:
class SomeUploader < CarrierWave::Uploader::Base
def fog_public
false
end
def fog_authenticated_url_expiration
5.minutes # in seconds from now, (default is 10.minutes)
end
.....
That will automatically cause the files from this Uploader to now be prepended with the temporary AWS expiration and accesskeys and future uploads will be set to private, ie not publicly accessible.
https://s3.amazonaws.com/uploads/something/1234/124.pdf?AWSAccessKeyId=AKIAJKOSTQ6UXXLEWIUQ&Signature=4yM%2FF%2F5TV6t4b1IIvjseenRrb%2FY%3D&Expires=1379152321