Question

We are using Carrierwave in a Rails 3.2.7 project. Currently we are migrating to our own Openstack Swift installation and would like to continue using Carrierwave.

By looking at the Carrierwave docs I can see that it can be used with Rackspace using the Fog gem. Nevertheless, I can not find any documentation how to set it up with an Openstack Swift installation.

Is there a way to use Carrierwave and Fog with my own Openstack Swift installation?

Was it helpful?

Solution

Here is how we solved this problem:

There was no native support from the Fog Gem for handling storage with a Swift installation. I hope there will be someday.

BUT you can use "HP" as a provider for Carrierwave. The HP-Storage is, like Rackspace, based on Openstack Swift and support the handling of Storage with the Fog Gem. It is not perfect, but it worked:

CarrierWave.configure do |config|
  config.storage = :fog

  config.fog_credentials = {
    :provider => 'HP',
    :hp_secret_key => "swift_password",
    :hp_account_id => "swift_container",
    :hp_tenant_id => "swift_tenant_id'",
    :hp_auth_uri => "swift_url"
    :hp_use_upass_auth_style => true
  }
  config.fog_directory = "swift_container"
end
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top