Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ACME_DOMAIN variable instead of Heroku domains list #34

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 2 additions & 5 deletions lib/tasks/letsencrypt.rake
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,22 @@ namespace :letsencrypt do

# Wait for app to come up
print "Testing filename works (to bring up app)..."

# Get the domain name from Heroku
hostname = heroku.domain.list(heroku_app).first['hostname']

# Wait at least a little bit, otherwise the first request will almost always fail.
sleep(2)

start_time = Time.now

begin
open("http://#{hostname}/#{challenge.filename}").read
open("http://#{domain}/#{challenge.filename}").read
rescue OpenURI::HTTPError, RuntimeError => e
raise e if e.is_a?(RuntimeError) && !e.message.include?("redirection forbidden")
if Time.now - start_time <= 60
puts "Error fetching challenge, retrying... #{e.message}"
sleep(5)
retry
else
failure_message = "Error waiting for response from http://#{hostname}/#{challenge.filename}, Error: #{e.message}"
failure_message = "Error waiting for response from http://#{domain}/#{challenge.filename}, Error: #{e.message}"
raise Letsencrypt::Error::ChallengeUrlError, failure_message
end
end
Expand Down