fog / fog-google

Fog for Google Cloud Platform
MIT License
99 stars 146 forks source link

Uploads to Google Cloud are "not public" after Ruby upgrade #554

Closed ReinierKorth closed 2 years ago

ReinierKorth commented 2 years ago

Hi,

I have upgraded Ruby to 2.7.4 and now all my uploads to Google Cloud are "not public" where they were always "Public to internet" before the upgrade.

Is there a way to fix this?

Thnx

Temikus commented 2 years ago

@ReinierKorth what's your use-case? You may have also changed to JSON API from XML (which uses public ACL by default).

If so, it's trivial to just add the ACL where it's needed: DIR.files.create( :key => new_filename, :predefined_acl => "publicRead" )

ReinierKorth commented 2 years ago

I have not changed anything. Just the versions of Ruby, Rails and the fog-google gem.

I have the following carrierwave initializer:

CarrierWave.configure do |config| config.fog_provider = 'fog/google' config.fog_credentials = { provider: 'Google', google_storage_access_key_id: ENV['GOOGLE_STORAGE_ACCESS_KEY'], google_storage_secret_access_key: ENV['GOOGLE_STORAGE_SECRET'] } config.storage = :fog config.fog_public = true config.fog_directory = ENV['GOOGLE_STORAGE_FOLDER'] end

ReinierKorth commented 2 years ago

I changed it to (see below) and it now seems to work.

CarrierWave.configure do |config| config.fog_provider = 'fog/google' config.storage = :fog config.fog_credentials = { provider: 'Google', google_project: ENV['GOOGLE_STORAGE_PROJECT'], google_json_key_string: ENV['GOOGLE_STORAGE_JSON'], } config.fog_directory = ENV['GOOGLE_STORAGE_FOLDER'] end

github-actions[bot] commented 2 years ago

This issue has been marked inactive and will be closed if no further activity occurs.