markevans / dragonfly-s3_data_store

S3 data store for the Dragonfly ruby gem
MIT License
62 stars 58 forks source link

Add path_style to avoid fog Excon::Errors::SocketError hostname does not match ssl error #4

Closed darrenterhune closed 10 years ago

darrenterhune commented 10 years ago

I have a AWS s3 bucket with dot '.' in the bucket name. This causes issues with ssl. If I would have written this app I wouldn't have created a bucket with a dot in it. Unfortunately the app is large and migrating could be a pain. Fog has a config that gets around this called path_style. You can set it to path_style: true to solve the issue.

See https://github.com/fog/fog/issues/2381#issuecomment-28088524

I've forked and added path_style to the gem and it seems to solve my problem:

https://github.com/darrenterhune/dragonfly-s3_data_store/commit/f932c686b

Thoughts?

markevans commented 10 years ago

I think I'll have a look at the way config is done generally re. fog as there are probably other config options that would be useful, so that rather than creating a new option/accessor for each, it simply has a fog_storage_options hash or something that blindly gets passed through

darrenterhune commented 10 years ago

Yeah cool, that would be ideal :thumbsup:

sebastian-julius commented 10 years ago

I'm having the same SSL issue. So it'd be great if you could add such a feature to your great gem.

darrenterhune commented 10 years ago

@sebastian-julius gem install the branch from my fork as a temporary hack.

twetzel commented 10 years ago

+1 Same here, was on the way to do the same fix :) what also worked, put that line initializer/dragonfly:

Fog.credentials = Fog.credentials.merge({ :path_style => true })
twetzel commented 10 years ago

@darrenterhune why no Pull-Request ?

darrenterhune commented 10 years ago

Lol no spare time right now, I'm working a full time job while doing 2 large side projects :-(

Also I believe setting up test env requires setting up aws, which I don't have at the moment.

markevans commented 10 years ago

I've just added "storage_options" for adding generic options through to Fog::Storage.new https://github.com/markevans/dragonfly-s3_data_store/commit/ed4a397bc50b94d262e7e5d71decd8c663c8ad66 - does this solve the problem?

darrenterhune commented 10 years ago

Yeah that should work Mark :-)

darrenterhune commented 10 years ago

Confirmed storage_options: { path_style: true } works, now so closing :+1:

markevans commented 10 years ago

cool thanks - it's in version 1.0.4 now, and actually I've renamed it to fog_storage_options, to save confusion with the model accessor storage_options method

darrenterhune commented 10 years ago

Awesome :-)