mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
Fixes for letsencrypt - please no more acme changes :(
This commit is contained in:
parent
4dfacac83a
commit
10018c5124
1 changed files with 7 additions and 6 deletions
|
@ -112,7 +112,7 @@ class LetsEncryptWorker
|
|||
|
||||
finalized_domains = []
|
||||
|
||||
order = client.new_order identifiers: verified_domains
|
||||
order = letsencrypt.new_order identifiers: verified_domains
|
||||
order.authorizations.each do |authorization|
|
||||
challenge = authorization.http
|
||||
|
||||
|
@ -129,17 +129,17 @@ class LetsEncryptWorker
|
|||
# A verification needs to be attempted anyways, otherwise 300 of them will jam up the system for a week
|
||||
end
|
||||
|
||||
challenge.request_verification
|
||||
challenge.request_validation
|
||||
|
||||
sleep 1
|
||||
attempts = 0
|
||||
|
||||
while true
|
||||
result = challenge.status
|
||||
puts "#{domain} : #{result}"
|
||||
puts "#{authorization.domain} : #{result}"
|
||||
|
||||
if result == 'valid'
|
||||
puts "VALIDATED: #{domain}"
|
||||
puts "VALIDATED: #{authorization.domain}"
|
||||
clean_wellknown_turds site
|
||||
finalized_domains.push authorization.domain
|
||||
break
|
||||
|
@ -148,12 +148,13 @@ class LetsEncryptWorker
|
|||
raise VerificationTimeoutError if attempts == 60
|
||||
|
||||
if result == 'invalid'
|
||||
puts "returned invalid, walking away"
|
||||
puts "returned invalid (#{authorization.domain}, walking away"
|
||||
clean_wellknown_turds site
|
||||
break
|
||||
end
|
||||
|
||||
attempts += 1
|
||||
challenge.reload
|
||||
sleep 2
|
||||
end
|
||||
end
|
||||
|
@ -171,7 +172,7 @@ class LetsEncryptWorker
|
|||
end
|
||||
|
||||
site.ssl_key = csr.private_key.to_pem
|
||||
site.ssl_cert = order.certificate.fullchain_to_pem
|
||||
site.ssl_cert = order.certificate
|
||||
site.cert_updated_at = Time.now
|
||||
site.domain_fail_count = 0
|
||||
site.save_changes validate: false
|
||||
|
|
Loading…
Add table
Reference in a new issue