aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-11-05 14:04:05 -0500
committerGeorge Claghorn <george@basecamp.com>2018-11-05 14:04:05 -0500
commit6608bf60aad4d13df3b22e66326c1adbf9a51f3d (patch)
tree23e4f0340160efd31fa9bc84aa8379d3ee15b283
parenta7e8fe4d6e3f18eb3431e9fc95b42542ae2946fb (diff)
downloadrails-6608bf60aad4d13df3b22e66326c1adbf9a51f3d.tar.gz
rails-6608bf60aad4d13df3b22e66326c1adbf9a51f3d.tar.bz2
rails-6608bf60aad4d13df3b22e66326c1adbf9a51f3d.zip
The ingress username is constant
-rw-r--r--lib/tasks/ingress.rake10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/tasks/ingress.rake b/lib/tasks/ingress.rake
index 051d7a6c94..5a944a113d 100644
--- a/lib/tasks/ingress.rake
+++ b/lib/tasks/ingress.rake
@@ -8,14 +8,16 @@ namespace :action_mailbox do
require "active_support/core_ext/object/blank"
require "http"
- url, username, password = ENV.values_at("URL", "INGRESS_USERNAME", "INGRESS_PASSWORD")
+ unless url = ENV["URL"].presence
+ abort "URL is required"
+ end
- if url.blank? || username.blank? || password.blank?
- abort "URL, INGRESS_USERNAME, and INGRESS_PASSWORD are required"
+ unless password = ENV["INGRESS_PASSWORD"].presence
+ abort "INGRESS_PASSWORD is required"
end
begin
- response = HTTP.basic_auth(user: username, pass: password)
+ response = HTTP.basic_auth(user: "actionmailbox", pass: password)
.timeout(connect: 1, write: 10, read: 10)
.post(url, headers: { "Content-Type" => "message/rfc822", "User-Agent" => "Postfix" }, body: STDIN)