From 6608bf60aad4d13df3b22e66326c1adbf9a51f3d Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Mon, 5 Nov 2018 14:04:05 -0500 Subject: The ingress username is constant --- lib/tasks/ingress.rake | 10 ++++++---- 1 file 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) -- cgit v1.2.3