From eb615c3e7eedcbd00919fb4d7c27b0d7c1860618 Mon Sep 17 00:00:00 2001 From: cyberkov Date: Wed, 18 May 2011 15:57:02 +0200 Subject: [PATCH] Added region config to carrierwave to select other regions than US --- config/app_config.yml.example | 1 + config/initializers/carrierwave.rb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/app_config.yml.example b/config/app_config.yml.example index 393b6e53d..93b162ab9 100644 --- a/config/app_config.yml.example +++ b/config/app_config.yml.example @@ -91,6 +91,7 @@ default: #s3_key: 'key' #s3_secret: 'secret' #s3_bucket: 'my_photos' + #s3_region: 'us-east-1' # If you want normal Rails logs, set this to false in the appropriate environment. # It is false by default in development and test. diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index c350a1a2f..41c59c186 100644 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -3,11 +3,12 @@ # the COPYRIGHT file. CarrierWave.configure do |config| - if AppConfig[:s3_key] && AppConfig[:s3_secret] && AppConfig[:s3_bucket] + if AppConfig[:s3_key] && AppConfig[:s3_secret] && AppConfig[:s3_bucket] && AppConfig[:s3_region] config.storage = :s3 config.s3_access_key_id = AppConfig[:s3_key] config.s3_secret_access_key = AppConfig[:s3_secret] config.s3_bucket = AppConfig[:s3_bucket] + config.s3_region = AppConfig[:s3_region] config.s3_use_ssl = true config.cache_dir = "#{Rails.root}/tmp/uploads" else