Permalink
Browse files

Merge pull request #62 from hampei/env-aws-settings

added option to configure aws key and secret via ENV
  • Loading branch information...
2 parents d408bdd + 280c6ff commit 76f36fa49f60cf5ac33aa0959c4a33cbc3ee0290 @nathancolgate committed Mar 7, 2012
Showing with 3 additions and 2 deletions.
  1. +1 −0 README.textile
  2. +2 −2 lib/s3_swf_upload/s3_config.rb
View
@@ -34,6 +34,7 @@ h2. Usage
If you are using Rails 3.1, you will need to move the generated s3_upload.js from the public/javascripts directory to the app/assets/javascripts directory.
4. Configure your amazon parameters via the generated <code>config/amazon_s3.yml</code> file.
+(key and secret can optionally be removed from that file and configured via <code>ENV['AWS_ACCESS_KEY_ID']</code> and <code>ENV['AWS_SECRET_ACCESS_KEY']</code>)
5. Make the bucket
@@ -18,8 +18,8 @@ def self.load_config
raise "Could not load config options for #{Rails.env} from #{filename}."
end
- @@access_key_id = config['access_key_id']
- @@secret_access_key = config['secret_access_key']
+ @@access_key_id = config['access_key_id'] || ENV['AWS_ACCESS_KEY_ID']
+ @@secret_access_key = config['secret_access_key'] || ENV['AWS_SECRET_ACCESS_KEY']
@@bucket = config['bucket']
@@max_file_size = config['max_file_size']
@@acl = config['acl'] || 'private'

0 comments on commit 76f36fa

Please sign in to comment.