title: sitemap_generator and Carrierwave - Change S3 permission, but only temporarily
body: <p>I am using Rails 3.2 with <code>carrierwave</code> and <code>sitemap_generator</code>. </p>
  
  <p>The file is correctly uploaded, but the permissions are not public on S3.</p>
  
  <ul>
  <li>How can I set the permission for this "sitemap.xml.gz" file only?</li>
  </ul>
  
  <p>My S3 Bucket is normally only open for tokens:</p>
  
  <pre><code>CarrierWave.configure do |config|
  
    config.storage = :fog
  
    config.fog_credentials = {
        :provider =&gt; 'AWS', # required
        :aws_access_key_id =&gt; ENV['S3_KEY'],
        :aws_secret_access_key =&gt; ENV['S3_SECRET']
    }
    config.fog_directory = ENV['S3_BUCKET_NAME']
  
    # -&gt; THIS is what sitemap_generator likes: 
    # -&gt; config.permissions = "0666"
    # here I set my permissions:
    config.fog_public = false
    config.fog_attributes = {'Cache-Control' =&gt; 'max-age=315576000'}
  end
  </code></pre>
  
  <p>and my sitemap_generator gem initalizer is:</p>
  
  <pre><code># 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/'
  </code></pre>
  
  <p>Thank you!</p>