S3 Europe Domain Names

4 views
Skip to first unread message

Jonty

unread,
Jun 22, 2010, 4:55:51 PM6/22/10
to carrierwave
I have been trying to get my app working with carrierwave but my s3
store is Europe based.

Finally I have uploads working - thanks to carrierwave!

However when I come to look at the images I have uploaded the url
comes out as bucket/path. The usual standard domain name for buckets
in Europe is bucket.s3.amazonaws.com/path.

So the url method in right_s3.rb, which is still the same in the s3.rb
file currently, is thus:

def url
if @uploader.s3_cnamed
["http://#{@uploader.s3_bucket}", @path].compact.join('/')
else
["http://#{@uploader.s3_bucket}.s3.amazonaws.com",
@path].compact.join('/')
end
end

I patched it to:


def url
if @uploader.s3_cnamed
["http://", @uploader.s3_bucket, ".s3.amazonaws.com","/",
@path].compact.join
else
["http://s3.amazonaws.com/", @uploader.s3_bucket, "/",
@path].compact.join
end
end

It now works for me.

I am not sure what the original is meant for but I would be grateful
if my patch could be considered for my case.

Samuel Lown

unread,
Jun 22, 2010, 6:16:22 PM6/22/10
to carri...@googlegroups.com
Hi Jonty,

This is a regression with the current (0.4.5) carrierwave gem. Your fix will work, but you have a couple of choices. You can either pull down the latest source from git and create your own gem which uses the aws driver, or downgrade to an older gem which doesn't have the same problem (I think its okay in 0.4.3).

You can also use my gem which has this issue fixed and uses aws (instead of aws-s3 and right_aws): samlown-carrierwave.

Its rather confusing, I know, but hopefully Jonas will have time to make a new release soon.

Cheers,
sam



--
You received this message because you are subscribed to the Google Groups "carrierwave" group.
To post to this group, send email to carri...@googlegroups.com.
To unsubscribe from this group, send email to carrierwave...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/carrierwave?hl=en.




--
www.samlown.com
www.autofiscal.com
www.planetaki.com/sam

Jonty

unread,
Jun 25, 2010, 9:43:59 AM6/25/10
to carrierwave
Thanks Sam - I will put up with my patched version included with my
app for now and wait for the next gem release!

However I have another issue - see my next topic!

On Jun 22, 11:16 pm, Samuel Lown <sam.l...@gmail.com> wrote:
> Hi Jonty,
>
> This is a regression with the current (0.4.5) carrierwave gem. Your fix will
> work, but you have a couple of choices. You can either pull down the latest
> source from git and create your own gem which uses the aws driver, or
> downgrade to an older gem which doesn't have the same problem (I think its
> okay in 0.4.3).
>
> You can also use my gem which has this issue fixed and uses aws (instead of
> aws-s3 and right_aws): samlown-carrierwave.
>
> Its rather confusing, I know, but hopefully Jonas will have time to make a
> new release soon.
>
> Cheers,
> sam
>
> On 22 June 2010 22:55, Jonty <jontyj...@btinternet.com> wrote:
>
>
>
> > I have been trying to get my app working with carrierwave but my s3
> > store is Europe based.
>
> > Finally I have uploads working - thanks to carrierwave!
>
> > However when I come to look at the images I have uploaded the url
> > comes out as bucket/path. The usual standard domain name for buckets
> > in Europe is bucket.s3.amazonaws.com/path.
>
> > So the url method in right_s3.rb, which is still the same in the s3.rb
> > file currently, is thus:
>
> > def url
> >          if @uploader.s3_cnamed
> >            ["http:/...@uploader.s3_bucket}", @path].compact.join('/')
> >          else
> >            ["http:/...@uploader.s3_bucket}.s3.amazonaws.com",
> > @path].compact.join('/')
> >          end
> >        end
>
> > I patched it to:
>
> > def url
> >          if @uploader.s3_cnamed
> >            ["http://", @uploader.s3_bucket, ".s3.amazonaws.com","/",
> > @path].compact.join
> >          else
> >            ["http://s3.amazonaws.com/", @uploader.s3_bucket, "/",
> > @path].compact.join
> >          end
> >        end
>
> > It now works for me.
>
> > I am not sure what the original is meant for but I would be grateful
> > if my patch could be considered for my case.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "carrierwave" group.
> > To post to this group, send email to carri...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > carrierwave...@googlegroups.com<carrierwave%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages