impress/config/initializers/aws_s3.rb

14 lines
411 B
Ruby
Raw Normal View History

access_key_id = ENV.fetch('AWS_ACCESS_KEY_ID')
secret_access_key = ENV.fetch('AWS_SECRET_ACCESS_KEY')
2011-05-20 16:19:14 -07:00
def set(params, params_key, env_key)
params[params_key] = ENV[env_key] if ENV.has_key?(env_key)
end
2011-05-20 16:19:14 -07:00
params = {}
set params, :server, 'AWS_SERVER_HOST'
set params, :port, 'AWS_SERVER_PORT'
set params, :protocol, 'AWS_SERVER_PROTOCOL'
2011-05-20 16:19:14 -07:00
IMPRESS_S3 = RightAws::S3.new access_key_id, secret_access_key, params