-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Paperclip with Fog / Ceph #1577
Comments
Reading fog.rb, it looks like there are hardcoded assumptions that only AWS S3 is going to be used by the :fog datastore - at least, I think that's what is happening: 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 If that's the case, would it be preferable to patch fog.rb or to write a new storage module for paperclip? I'll potentially need to do one or the other (or use an alternative, like Dragonfly) |
That is actually the case, unfortunately. I would say we should change the Fog module, as others would want this as well. |
Since the fog gem itself can cope with a non-AWS host, it seems like we just need to pass it on through, but maintain the logic going on in |
Actually... if you pass in the |
Ok, it is all working now. Here's the deal: you need to pass in :host in the :fog_credentials and things work as one would expect. The problems I was having stemmed from us not having some important configuration bits on our Ceph cluster, but the good news for anyone who finds this thread is that Paperclip works out of the box if your cluster is properly configured. |
Paperclip support for Fog does not appear to allow for use of non-Amazon servers. For example, I can use the following Ruby + Fog gem code to successfully write to my Ceph FS:
This works just fine. I can't figure out how to do this in Paperclip, but if I use the following code, I can tell from tcpdump and the resulting error that my app is talking to Amazon, not the host I have specified:
Is there a way to cause Paperclip to use something other than AWS S3?
The text was updated successfully, but these errors were encountered: