This repository has been archived by the owner on Jul 13, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted to AWS::S3, all tests passing.
- Loading branch information
Jon Yurek
committed
Jul 30, 2009
1 parent
80d699c
commit ac86bb9
Showing
5 changed files
with
93 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the reason for switching from RightAWS to AWS::S3?
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be interested in the reason for switching from RightAWS to AWS::S3, too, especially as AWS::S3 doesn't support European S3 buckets a far as I know.
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's interesting to me too. I think that RightAWS has good support and good implementation. Moreover in our project we are using European S3 buckets too and it'll be a problem if it's not supported.
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The switch from RightAWS was discussed here: http://groups.google.com/group/paperclip-plugin/browse_thread/thread/d4dc166a9a5f0df4#
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chad, thanks for the link to the discussion.
Jonathan, Thanks for this change. I agree that RightAWS's slowness and complexity was more trouble than it was worth. Great job!
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is bad news. We were just updating our app and migrating from attachment_fu / AWS::S3 to paperclip because we were getting sick and tired of the problems with european buckets :(
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've managed to get around the European problem by monkey patching using these changes and by patching the Paperclip S3 storage module to pass
:server => "#{@bucket}.s3.amazonaws.com"
when it establishes a connection. It's not pretty but it'll do till I get chance to work on a nicer solution :)ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my case we use lot of buckets located in EU, so this could be a problem.
Anyhow, I believe this can be easily solve as pointed by Rob from TheWebFellas. The exact same issue we have with s3sync and such, we need to use subdomains instead of subfolders.
Putting that change in place would sort out these issues.
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well this commit (http://github.com/vladr/aws-s3/commit/a13504ba581496eab253583f38d26aa475949b53) actually fixes the problem with S3 buckets, but it hasn't been rolled into the main branch (yet) as it has no associated tests....
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify my last post, we have been using this patched version of aws-s3 along with attachment_fu in our production system (vladr is actually our local guru) and it's been working flawlessly. We never got around to actually writing test cases to it, which is why the original author of aws-s3 refused to merge it in the main branch (with reason).
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's the same commit as posted to earlier..
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this ever going to get fixed? Not working with european buckets is kinda killing paperclip for us..
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still no fix, I tried the patch suggested above but I get the same endpoint error.
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are actually also having some issues with European buckets when working on OSX, even tho it's working fine on Ubuntu 8.04. Looking into it.. Sure would help if the official aws:s3 gem would get updated once in a while, especially now that it's pretty much the only lib that can be used...
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We made a fork of Marcel's aws-s3 and we have it on production. It's available here. http://github.com/fesplugas/aws-s3
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick reply! unfortunately, it doesn't work 100%. We specify our buckets in the server field (xxx.yyy.zzz.s3.amazonaws.com) and while we can indeed connect, download and upload files that way, some commands don't seem to work. At least Bucket.list doesn't seem to work as I get an error:
AWS::S3::SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.
from /Users/khelal/Sites/monaqasat.com/1.7/vendor/plugins/aws-s3/lib/aws/s3/error.rb:38:in
raise' from /Users/khelal/Sites/monaqasat.com/1.7/vendor/plugins/aws-s3/lib/aws/s3/base.rb:75:in
request'from /Users/khelal/Sites/monaqasat.com/1.7/vendor/plugins/aws-s3/lib/aws/s3/base.rb:101:in
get' from /Users/khelal/Sites/monaqasat.com/1.7/vendor/plugins/aws-s3/lib/aws/s3/service.rb:21:in
unmemoized_buckets_1258454875'from /Users/khelal/Sites/monaqasat.com/1.7/vendor/plugins/aws-s3/lib/aws/s3/extensions.rb:177:in
send' from /Users/khelal/Sites/monaqasat.com/1.7/vendor/plugins/aws-s3/lib/aws/s3/extensions.rb:177:in
buckets'from /Users/khelal/Sites/monaqasat.com/1.7/vendor/plugins/aws-s3/lib/aws/s3/extensions.rb:146:in
expirable_memoize' from /Users/khelal/Sites/monaqasat.com/1.7/vendor/plugins/aws-s3/lib/aws/s3/extensions.rb:176:in
buckets'from /Users/khelal/Sites/monaqasat.com/1.7/vendor/plugins/aws-s3/lib/aws/s3/bucket.rb:196:in `list'
from (irb):11
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about http://github.com/appoxy/aws/
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWS is based on right_aws, which is not supported anymore by paperclip. This is thus not a viable solution. Can't believe this is still ongoing months after the original announcement by thoughbot :)
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! This problem prevents all European folks from usage of paperclip... I am sad about it :-(
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still no fix for this?
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend you using the S3 gem from qoobaa. It provides an S3 backend for paperclip and works perfect for all bucket regions.
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seconded on the S3 gem, very simple to get up and running and works great in production on both European and American buckets
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a patch with updated tests to make the change to the s3 gem, i'll upload it later so you can give it a try.
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've created a new issue with patch here for your enjoyment :)
ac86bb9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's how I solved this:
require "aws/s3"
AWS::S3::DEFAULT_HOST = "s3-us-west-1.amazonaws.com"