mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 09:42:36 +02:00
A few bugfixes for letsencrypt worker
This commit is contained in:
parent
96642dc27a
commit
2598474596
1 changed files with 5 additions and 2 deletions
|
@ -30,7 +30,7 @@ class LetsEncryptWorker
|
||||||
domains = [site.domain, "www.#{site.domain}"]
|
domains = [site.domain, "www.#{site.domain}"]
|
||||||
|
|
||||||
domains.each_with_index do |domain, index|
|
domains.each_with_index do |domain, index|
|
||||||
auth = letsencrypt.authorize domain: site.domain
|
auth = letsencrypt.authorize domain: domain
|
||||||
challenge = auth.http01
|
challenge = auth.http01
|
||||||
|
|
||||||
FileUtils.mkdir_p File.join(site.base_files_path, File.dirname(challenge.filename)) if index == 0
|
FileUtils.mkdir_p File.join(site.base_files_path, File.dirname(challenge.filename)) if index == 0
|
||||||
|
@ -42,13 +42,16 @@ class LetsEncryptWorker
|
||||||
attempts = 0
|
attempts = 0
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
puts "WAITING FOR #{domain} VALIDATION"
|
||||||
raise VerificationTimeoutError if attempts == 30
|
raise VerificationTimeoutError if attempts == 30
|
||||||
raise NotAuthorizedYetError if challenge.verify_status != 'valid'
|
raise NotAuthorizedYetError if challenge.verify_status != 'valid'
|
||||||
rescue NotAuthorizedYet
|
rescue NotAuthorizedYetError
|
||||||
sleep 5
|
sleep 5
|
||||||
attempts += 1
|
attempts += 1
|
||||||
retry
|
retry
|
||||||
end
|
end
|
||||||
|
|
||||||
|
puts "DONE!"
|
||||||
end
|
end
|
||||||
|
|
||||||
csr = Acme::Client::CertificateRequest.new names: domains
|
csr = Acme::Client::CertificateRequest.new names: domains
|
||||||
|
|
Loading…
Add table
Reference in a new issue