From ddcad1d815ee92031d9c28247c459ba792cf8fbe Mon Sep 17 00:00:00 2001 From: Nicolae Claudius Date: Fri, 21 Mar 2014 23:28:50 +0200 Subject: [PATCH] ses for production --- Gemfile | 1 + Gemfile.lock | 7 +++++++ config/environments/production.rb | 16 ++++++++++------ config/settings.sample.yml | 9 ++++++--- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index 387d956..db73f92 100644 --- a/Gemfile +++ b/Gemfile @@ -43,6 +43,7 @@ gem 'unicorn', '~> 4.6.3' gem 'dalli', '~> 2.7.0' gem 'json', '~> 1.8.0' gem 'rails_admin', '~> 0.6.1' +gem 'aws-ses', '~> 0.5.0', :require => 'aws/ses' # Assets gem 'uglifier', '~> 2.4.0' diff --git a/Gemfile.lock b/Gemfile.lock index 04d0313..31aaa84 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -61,6 +61,11 @@ GEM addressable (2.3.5) arel (4.0.1) atomic (1.1.14) + aws-ses (0.5.0) + builder + mail (> 2.2.5) + mime-types + xml-simple bcrypt-ruby (3.1.2) better_errors (1.1.0) coderay (>= 1.0.0) @@ -298,6 +303,7 @@ GEM rack (>= 1.0) webshims-rails (1.12.2) rails (> 3.1.0) + xml-simple (1.1.3) xpath (2.0.0) nokogiri (~> 1.3) @@ -308,6 +314,7 @@ DEPENDENCIES active-model-email-validator (~> 1.0.2) active_scaffold (~> 3.4.0.rc)! acts_as_nested_interval (~> 0.1.0) + aws-ses (~> 0.5.0) better_errors (= 1.1.0) binding_of_caller (= 0.7.2) bootstrap-sass (~> 3.1.0.1) diff --git a/config/environments/production.rb b/config/environments/production.rb index 0fabcfb..55cf7f9 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -69,13 +69,17 @@ Entrydns::Application.configure do # Send deprecation notices to registered listeners config.active_support.deprecation = :notify + ActionMailer::Base.add_delivery_method :ses, AWS::SES::Base, + :access_key_id => Settings.ses_access_key_id, + :secret_access_key => Settings.ses_secret_access_key config.action_mailer.default_url_options = {:host => 'entrydns.net'} - config.action_mailer.delivery_method = :smtp - config.action_mailer.smtp_settings = { - :address => "127.0.0.1", - :port => 25, - :domain => 'entrydns.net' - } + # config.action_mailer.delivery_method = :smtp + # config.action_mailer.smtp_settings = { + # :address => "127.0.0.1", + # :port => 25, + # :domain => 'entrydns.net' + # } + config.action_mailer.delivery_method = :ses # Compress JavaScripts and CSS config.assets.js_compressor = :uglifier diff --git a/config/settings.sample.yml b/config/settings.sample.yml index ed869e4..84f47c6 100644 --- a/config/settings.sample.yml +++ b/config/settings.sample.yml @@ -1,7 +1,7 @@ domain: entrydns.net # framework -secret_key_base: 0ce1f02a4b3fc4d1a1c8d22973b21e8589e9314dc338294953f0b985e3f44f12c8af74f2d9ba6f7c7bdb736c4efc5ea3f8135e23b1a036d033cd23331383ac75 +secret_key_base: [PLACEHOLDER] # deployment uses_proxy: true @@ -34,5 +34,8 @@ honeypot: userid support_mail: "support@entrydns.net" news_link: "http://twitter.com/#!/entrydns" -google_key: 105547277286.apps.googleusercontent.com -google_secret: 7cIdW07UrWUmeb8QFYV4L63k +google_key: [PLACEHOLDER] +google_secret: [PLACEHOLDER] + +ses_access_key_id: [PLACEHOLDER] +ses_secret_access_key: [PLACEHOLDER]