ruby on rails - sitemap_generator and Carrierwave - Change S3 permission, but only temporarily -
i using rails 3.2 carrierwave
, sitemap_generator
.
the file correctly uploaded, permissions not public on s3.
- how can set permission "sitemap.xml.gz" file only?
my s3 bucket open tokens:
carrierwave.configure |config| config.storage = :fog config.fog_credentials = { :provider => 'aws', # required :aws_access_key_id => env['s3_key'], :aws_secret_access_key => env['s3_secret'] } config.fog_directory = env['s3_bucket_name'] # -> sitemap_generator likes: # -> config.permissions = "0666" # here set permissions: config.fog_public = false config.fog_attributes = {'cache-control' => 'max-age=315576000'} end
and sitemap_generator gem initalizer is:
# waveadapter: carrierwave sitemapgenerator::sitemap.adapter = sitemapgenerator::waveadapter.new sitemapgenerator::sitemap.sitemaps_host = "http://s3.amazonaws.com/#{env['s3_bucket_name']}/" sitemapgenerator::sitemap.public_path = 'tmp/' sitemapgenerator::sitemap.sitemaps_path = 'sitemaps/'
thank you!
it looks config.fog_public set false; should set true enable public viewing on s3.
Comments
Post a Comment