FriendsOfFlarum / upload

The file upload extension with insane intelligence for your Flarum forum.
https://discuss.flarum.org/d/4154
MIT License
177 stars 96 forks source link

S3 Uploading Issue for US-EAST-1 region users #22

Closed krispii closed 7 years ago

krispii commented 7 years ago

Cross-posted from the Flarum discussion: https://discuss.flarum.org/d/4154-flagrow-file-upload-the-intelligent-file-attachment-extension/36

I've discovered a (possible) issue with S3 uploading and I'm not sure if it's related to this extension or the S3 library it depends on.

For example, when setting up S3, I need to specify an Access ID, Secret Key and Region endpoint (all par for the course with AWS).

However, because I use use the US East 1 region, it cannot be used in the style of s3.region.amazonaws.com/bucketname and must use s3.amazonaws.com/bucketname as per amazon's documentation: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro

Unfortunately, because I need to specify the region in the settings for the upload to actually work, the same region is appended to the URL which shouldn't happen in the case of their "default" region.

As far as I can tell, ideally, us-east-1 region users should be able to leave the region blank, in lieu of having to write a workaround for that specific region.

At the moment, I can edit the URL on the post to remove the region and everything works - however, other users won't know what's going on.

Either way thanks for the awesome extension and if this issue is better reported elsewhere let me know. :)

luceos commented 7 years ago

@krispii thanks for reporting, I'm not an expert user on AWS, so I simply missed that. Will fix asap.

krispii commented 7 years ago

Hey there - it's still broken for me at 0.3.x. (0.3.1 as of this post)

Here's a thread I've used it for: https://community.krispii.com/d/42-google-drive-docs-apps-etc-integration-goes-live

Uploading works (provided I attached via the file-browser), but it's still appending us-east-1 to the URLs. If I remove the region from settings it still fails with a InvalidArgumentException: Missing required client configuration options:...

When I manually change the URL, post-upload, it all works. So the above post everything worked except that I had to change the URL after upload, but before posting.

luceos commented 7 years ago

Right, let me fix this asap.

luceos commented 7 years ago

Please try 0.3.3

krispii commented 7 years ago

Working :)