From 7755f9b381c007ce98e0858473a9f29f1cd25311 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Mon, 5 Nov 2018 09:11:01 -0500 Subject: Read ingress passwords/API keys from encrypted credentials Fall back to ENV for people who prefer that approach. --- lib/action_mailbox/engine.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/action_mailbox/engine.rb') diff --git a/lib/action_mailbox/engine.rb b/lib/action_mailbox/engine.rb index b4758aacb5..6a0312c65f 100644 --- a/lib/action_mailbox/engine.rb +++ b/lib/action_mailbox/engine.rb @@ -10,6 +10,7 @@ module ActionMailbox initializer "action_mailbox.config" do config.after_initialize do |app| + ActionMailbox.ingress = app.config.action_mailbox.ingress ActionMailbox.logger = app.config.action_mailbox.logger || Rails.logger ActionMailbox.incinerate_after = app.config.action_mailbox.incinerate_after || 30.days end -- cgit v1.2.3 From b859eebff8545eea972d479137e14b917e6519dc Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Mon, 5 Nov 2018 12:39:37 -0500 Subject: Only load the AWS SDK when the Amazon ingress is configured --- lib/action_mailbox/engine.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib/action_mailbox/engine.rb') diff --git a/lib/action_mailbox/engine.rb b/lib/action_mailbox/engine.rb index 6a0312c65f..cf438d8f24 100644 --- a/lib/action_mailbox/engine.rb +++ b/lib/action_mailbox/engine.rb @@ -10,10 +10,21 @@ module ActionMailbox initializer "action_mailbox.config" do config.after_initialize do |app| - ActionMailbox.ingress = app.config.action_mailbox.ingress ActionMailbox.logger = app.config.action_mailbox.logger || Rails.logger ActionMailbox.incinerate_after = app.config.action_mailbox.incinerate_after || 30.days end end + + initializer "action_mailbox.ingress" do + config.after_initialize do |app| + if ActionMailbox.ingress = app.config.action_mailbox.ingress.presence + config.to_prepare do + if ingress_controller_class = "ActionMailbox::Ingresses::#{ActionMailbox.ingress.to_s.classify}::InboundEmailsController".safe_constantize + ingress_controller_class.prepare + end + end + end + end + end end end -- cgit v1.2.3