discourse/discourse — pull request #956 by ZogStriP (2013-06-04 22:54:51+00:00)
Title: fix image uploads on s3/imgur

Meta: [Storing images in the cloud](http://meta.discourse.org/t/storing-images-in-the-cloud/6779/)

Most of the work was done on `S3` uploads. They will now work properly when using (or not) a region and will *automagically* create the bucket if it doesn't already exists.

`Imgur` mostly got a lifting and a few bug fixes (all props goes to @benbeltran).

- Changed a few site settings
- [x] removed unused `imgur_client_secret`
- [x] updated `imgur_endpoint` to use https
- [x] removed default for `s3_region` as it is no longer needed (and was wrong)
- Refactored `upload.rb` model and extracted all the methods into their own class
- [x] `s3` for handling uploads to s3 buckets
- [x] `local_store` for handling uploads to a local directory
- The idea is that these classes handles uploads and returns the url of the uploaded file.
- Created a new `SiteSettingMissing` exception that is used to provide better error log whenever a site setting is missing (only used in `s3.rb` and `imgur.rb` for now)
- Updated the tests accordingly to the changes