Using Fog with Ruby

Christopher Meiklejohn cmeiklejohn at basho.com
Mon Apr 8 19:59:54 EDT 2013


On Monday, April 8, 2013 at 7:32 PM, Christopher Meiklejohn wrote:
> On Monday, April 8, 2013 at 7:08 PM, Hector Castro wrote:
> > Hi Michael,
> > 
> > I believe that you are seeing this error because the `cs_root_host`
> > Riak CS configuration option and `:host` (in the script's
> > configuration map) are not the same. Once you update `cs_root_host`,
> > make sure that you restart Riak CS for the changes to take effect.
> 
> 
> 
> Hi Michael,
> 
> Another alternative is to configure proxy_port and proxy_host in your Fog connection setup to point to your Riak CS instance, and use the default host of RiakCS which is s3.amazonaws.com (http://s3.amazonaws.com).
> 
> The reason this is failing is because the host is used to generate the HMAC which authenticates each request.
> 
> Please let me know if you have any other questions
Eek, I confused s3 client and fog.  

Here's a correct example of how to use the proxy in Fog.

@client = Fog::RiakCS::Provisioning.new(
  :riakcs_access_key_id => KEY
  :riakcs_secret_access_key => SECRET
  :host => 's3.amazonaws.com',
  :port => 80,
  :connection_options => {
    :proxy => 'http://localhost:8080',
  }
)



- Chris

 --
Christopher Meiklejohn
Software Engineer
Basho Technologies, Inc.






More information about the riak-users mailing list