Skip to content

Instantly share code, notes, and snippets.

@achempion
Forked from kzaitsev/carrierwave.rb
Created November 14, 2018 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save achempion/4fa45d19de23dd091e8fb96189feb9c2 to your computer and use it in GitHub Desktop.
Save achempion/4fa45d19de23dd091e8fb96189feb9c2 to your computer and use it in GitHub Desktop.
Carrierwave + Selectel
CarrierWave.configure do |config|
if Rails.env.development? || Rails.env.test?
config.storage = :file
else
config.storage = :fog
config.fog_credentials = {
:provider => 'OpenStack',
:openstack_auth_url => 'https://auth.selcdn.ru/v1.0',
:openstack_username => Rails.application.secrets.openstack_username,
:openstack_api_key => Rails.application.secrets.openstack_api_key
}
config.fog_directory = Rails.application.secrets.container # required
config.fog_public = true # optional, defaults to true
config.fog_attributes = {'Cache-Control'=>'max-age=315576000'} # optional, defaults to {}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment