ruby on rails - Using Paperclip, Fog, and Ceph -
ruby on rails - Using Paperclip, Fog, and Ceph -
i'm writing rails 3 app uses paperclip transcode video file attachment bunch of other formats, , store resulting files. works fine local storage, trying create work using paperclip's fog back upwards store files in bucket on our own ceph cluster. however, can't seem find right configuration options create fog talk ceph server.
here snippet rails class:
has_attached_file :videofile, :storage => :fog, :fog_credentials => { :aws_access_key_id => 'xxx', :aws_secret_access_key => 'xxx', :provider => 'aws'}, :fog_public => true, :url => ":id/:filename", :fog_directory => 'replay', :fog_host => 'my-hostname',
writes using setup fail because paperclip attempts save amazon s3 rather host i've provided. have non-rails / non-paperclip toy script working fine:
conn = fog::storage.new({ :aws_access_key_id => 'xxx', :aws_secret_access_key => 'xxx', :host => 'my-hostname', :path_style => true, :provider => "aws", })
this correctly connects local ceph server. suspect there i'm not configuring in paperclip - what?
here's relevant hunk fog.rb think causing connection go aws:
def host_name_for_directory if @options[:fog_directory].to_s =~ fog::aws_bucket_subdomain_restricton_regex "#{@options[:fog_directory]}.s3.amazonaws.com" else "s3.amazonaws.com/#{@options[:fog_directory]}" end end
the error improperly configured ceph cluster. finds thread, long you:
have wildcard dns set ceph frontend; ceph configured recognize such pass in:host
in :fog_credentials
, fqdn of ceph frontend :fog_host, apparently needs url bucket, e.g. https://bucket.ceph-server.foobar.com.
paperclip work out of box. don't think documented anywhere can utilize :host
works.
ruby-on-rails ruby-on-rails-3 paperclip fog ceph
Comments
Post a Comment