Use S3 configuration from environment vars instead of s3.yml

This commit is contained in:
Rohan Mitchell
2012-10-19 16:40:18 +11:00
parent 5b025a6cba
commit 4fc7295b97
4 changed files with 12 additions and 10 deletions

1
.gitignore vendored
View File

@@ -27,4 +27,5 @@ public/stylesheets
public/images
public/spree
config/abr.yml
config/heroku_env.rb
NERD_tree*

View File

@@ -28,3 +28,8 @@ Openfoodweb::Application.configure do
# Expands the lines which load the assets
config.assets.debug = true
end
# Load heroku vars from local file
heroku_env = File.join(Rails.root, 'config', 'heroku_env.rb')
load(heroku_env) if File.exists?(heroku_env)

View File

@@ -36,9 +36,13 @@ ComfortableMexicanSofa.configure do |config|
# filesystem see: http://rdoc.info/gems/paperclip/2.3.8/Paperclip/Storage/Filesystem
config.upload_file_options = {
:storage => 's3',
:s3_credentials => Rails.root.join('config', 's3.yml')
:s3_credentials => {
:bucket => ENV['S3_BUCKET'],
:access_key_id => ENV['S3_KEY'],
:secret_access_key => ENV['S3_SECRET']
}
}
# Sofa allows you to setup entire site from files. Database is updated with each
# request (if necessary). Please note that database entries are destroyed if there's
# no corresponding file. Fixtures are disabled by default.

View File

@@ -1,8 +0,0 @@
development:
bucket: openfoodweb_test
access_key_id: AKIAJ3EE2EKGP36D4PUA
secret_access_key: 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
production:
bucket: openfoodweb_production
access_key_id: AKIAJ3EE2EKGP36D4PUA
secret_access_key: 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