From 2a104ea62240eab7b888a8b425be0436bffe0c15 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 7 Oct 2010 14:26:59 -0700 Subject: [PATCH 1/3] Revert "moved the SMTP setting into app_config.yml" This reverts commit 2451ac49575c58391cbafcc14b5fabb2e48a4266. --- config/environments/development.rb | 16 ++++++++-------- config/environments/production.rb | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index d848ad4e9..15d1fc2bb 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -24,15 +24,15 @@ Diaspora::Application.configure do config.active_support.deprecation = :log config.middleware.use MongoMapper::ClearDevMemory #config.threadsafe! - config.action_mailer.delivery_method = :smtp - config.action_mailer.default_url_options = {:host => APP_CONFIG[:terse_pod_url]} + config.action_mailer.delivery_method = :smtp + config.action_mailer.default_url_options = {:host => 'localhost:3000'} config.action_mailer.smtp_settings = { - :address => APP_CONFIG[:smtp_address], - :port => APP_CONFIG[:smtp_port], - :domain => APP_CONFIG[:smtp_domain], - :authentication => APP_CONFIG[:smtp_authentication], - :user_name => APP_CONFIG[:smtp_username], - :password => APP_CONFIG[:smtp_password], + :address => 'smtp.gmail.com', + :port => 587, + :domain => 'mail.joindiaspora.com', + :authentication => 'plain', + :user_name => 'diaspora-pivots@joindiaspora.com', + :password => "xy289|]G+R*-kA", :enable_starttls_auto => true } end diff --git a/config/environments/production.rb b/config/environments/production.rb index 6b081b164..cb13c1d1c 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -49,14 +49,14 @@ Diaspora::Application.configure do config.threadsafe! config.action_mailer.delivery_method = :smtp - config.action_mailer.default_url_options = {:host => APP_CONFIG[:terse_pod_url]} + config.action_mailer.default_url_options = {:host => 'pivots.joindiaspora.com'} config.action_mailer.smtp_settings = { - :address => APP_CONFIG[:smtp_address], - :port => APP_CONFIG[:smtp_port], - :domain => APP_CONFIG[:smtp_domain], - :authentication => APP_CONFIG[:smtp_authentication], - :user_name => APP_CONFIG[:smtp_username], - :password => APP_CONFIG[:smtp_password], + :address => 'smtp.gmail.com', + :port => 587, + :domain => 'mail.joindiaspora.com', + :authentication => 'plain', + :user_name => 'diaspora-pivots@joindiaspora.com', + :password => "xy289|]G+R*-kA", :enable_starttls_auto => true } end From 0f5a09783d912e953612ee7776ddfbb71574e850 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 7 Oct 2010 14:32:45 -0700 Subject: [PATCH 2/3] positioning --- lib/diaspora/exporter.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/diaspora/exporter.rb b/lib/diaspora/exporter.rb index 106c94bb0..f23ed7681 100644 --- a/lib/diaspora/exporter.rb +++ b/lib/diaspora/exporter.rb @@ -16,9 +16,9 @@ module Diaspora builder = Nokogiri::XML::Builder.new do |xml| xml.user { xml.username user.username - xml.serialized_private_key user.serialized_private_key xml.parent << user.person.to_xml - + xml.serialized_private_key user.serialized_private_key + xml.aspects { user.aspects.each do |aspect| xml.aspect { From 7aa49b277cd9a6ad2c0e8322773c29f20c487e46 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 7 Oct 2010 14:36:08 -0700 Subject: [PATCH 3/3] moved the smtp setting to intializers --- config/app_config.yml.example | 7 +++++++ config/environments/development.rb | 11 ----------- config/environments/production.rb | 11 ----------- config/initializers/mailer_config.rb | 17 +++++++++++++++++ 4 files changed, 24 insertions(+), 22 deletions(-) create mode 100644 config/initializers/mailer_config.rb diff --git a/config/app_config.yml.example b/config/app_config.yml.example index 069823a05..deb69220e 100644 --- a/config/app_config.yml.example +++ b/config/app_config.yml.example @@ -12,6 +12,13 @@ default: pubsub_server: 'https://pubsubhubbub.appspot.com/' mongo_host: 'localhost' mongo_port: 27017 + smtp_address: 'smtp.example.com' + smtp_port: '587' + smtp_domain: 'mail.example.com' + smtp_authentication: 'plain' + smtp_username: 'no-reply@example.com' + smtp_password: 'secret' + development: diff --git a/config/environments/development.rb b/config/environments/development.rb index 15d1fc2bb..063adbd1b 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -24,15 +24,4 @@ Diaspora::Application.configure do config.active_support.deprecation = :log config.middleware.use MongoMapper::ClearDevMemory #config.threadsafe! - config.action_mailer.delivery_method = :smtp - config.action_mailer.default_url_options = {:host => 'localhost:3000'} - config.action_mailer.smtp_settings = { - :address => 'smtp.gmail.com', - :port => 587, - :domain => 'mail.joindiaspora.com', - :authentication => 'plain', - :user_name => 'diaspora-pivots@joindiaspora.com', - :password => "xy289|]G+R*-kA", - :enable_starttls_auto => true - } end diff --git a/config/environments/production.rb b/config/environments/production.rb index cb13c1d1c..bdeeea249 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -48,15 +48,4 @@ Diaspora::Application.configure do config.i18n.fallbacks = true config.threadsafe! - config.action_mailer.delivery_method = :smtp - config.action_mailer.default_url_options = {:host => 'pivots.joindiaspora.com'} - config.action_mailer.smtp_settings = { - :address => 'smtp.gmail.com', - :port => 587, - :domain => 'mail.joindiaspora.com', - :authentication => 'plain', - :user_name => 'diaspora-pivots@joindiaspora.com', - :password => "xy289|]G+R*-kA", - :enable_starttls_auto => true - } end diff --git a/config/initializers/mailer_config.rb b/config/initializers/mailer_config.rb new file mode 100644 index 000000000..823a369fe --- /dev/null +++ b/config/initializers/mailer_config.rb @@ -0,0 +1,17 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +Diaspora::Application.configure do + config.action_mailer.delivery_method = :smtp + config.action_mailer.default_url_options = {:host => APP_CONFIG[:terse_pod_url]} + config.action_mailer.smtp_settings = { + :address => APP_CONFIG[:smtp_address], + :port => APP_CONFIG[:smtp_port], + :domain => APP_CONFIG[:smtp_domain], + :authentication => APP_CONFIG[:smtp_authentication], + :user_name => APP_CONFIG[:smtp_username], + :password => APP_CONFIG[:smtp_password], + :enable_starttls_auto => true + } +end