Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
added option to configure aws key and secret via ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
Hampei committed Mar 7, 2012
1 parent d408bdd commit 280c6ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.textile
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions lib/s3_swf_upload/s3_config.rb
Expand Up @@ -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'
Expand Down

0 comments on commit 280c6ff

Please sign in to comment.