Differential/meteor-blog — pull request #141 by coopermaruyama (2014-12-23 20:02:26+00:00)
Title: Store images on Amazon S3 (CollectionFS)

**Adds the ability to use CollectionFS + S3 to store your post images.**

- Medium-insert, drag-and-drop, and progress bar will use S3 if enabled
- Uses `Meteor.settings` instead of `Blog.config` for options because
the code that sets up S3 loads before `Blog.config`.

**To setup S3 for file storage, add the following in `lib/settings.json`:**

```json
{
"public": {
"blog": {
"useS3": true
}
},
"private": {
"blog": {
"s3Config": {
"bucket": "you-bucket-name",
"ACL": "public-read",
"MaxTries": 2,
"accessKeyId": "XXXXXXXXXXXXX",
"secretAccessKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
}
```
**Then, Run meteor with `meteor --settings=/lib/settings.json`**

**Note:** At this point we have configs in 3 different places (server, client, settings.json). Instead, we should probably use just `Meteor.settings` for all the config since it's guaranteed to be available by the time your app loads, and it would be secure.