mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
A few fixes for lets encrypt error handling
This commit is contained in:
parent
bfa13e5325
commit
6132875b6b
1 changed files with 12 additions and 4 deletions
|
@ -78,18 +78,26 @@ class LetsEncryptWorker
|
||||||
begin
|
begin
|
||||||
auth = letsencrypt.authorize domain: domain
|
auth = letsencrypt.authorize domain: domain
|
||||||
challenge = auth.http01
|
challenge = auth.http01
|
||||||
rescue Acme::Client::Error => e
|
rescue => e
|
||||||
if e =~ /Internationalized domain names.+not yet supported/
|
if e.message =~ /Internationalized domain names.+not yet supported/
|
||||||
@international_domain = true
|
@international_domain = true
|
||||||
puts "This is an internationalized domain, and so is not yet supported."
|
puts "This is an internationalized domain, and so is not yet supported. Skipping to next"
|
||||||
|
next
|
||||||
|
else
|
||||||
|
raise e
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if challenge.nil?
|
||||||
|
puts "challenge object is nil, going to next domain"
|
||||||
|
next
|
||||||
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
FileUtils.mkdir_p File.join(site.base_files_path, File.dirname(challenge.filename))
|
FileUtils.mkdir_p File.join(site.base_files_path, File.dirname(challenge.filename))
|
||||||
File.write File.join(site.base_files_path, challenge.filename), challenge.file_content
|
File.write File.join(site.base_files_path, challenge.filename), challenge.file_content
|
||||||
rescue => e
|
rescue => e
|
||||||
put "FAILED TO WRITE CHALLENGE: #{site.domain} #{challenge.filename}"
|
puts "FAILED TO WRITE CHALLENGE: #{site.domain} #{challenge.filename}"
|
||||||
# A verification needs to be attempted anyways, otherwise 300 of them will jam up the system for a week
|
# A verification needs to be attempted anyways, otherwise 300 of them will jam up the system for a week
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue