lecli 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/exe/lecli +2 -3
- data/lib/lecli/certificate_builder.rb +24 -14
- data/lib/lecli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86ea7e2f098905bdd1cfcc4602af73f7192929b3
|
4
|
+
data.tar.gz: 0f26ed9f43b3b75e3677b63b501832839ea225cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72886355955c95b8e7662b3e1928ebb3e036825fdabf6bd7aa9f0cb167b7fd9f467c0e87ea9445ec968511cd0a03fa54534c87fa772a13441c34e40228a76497
|
7
|
+
data.tar.gz: eb08e0a68424775221c67f748ad4dd1588bafc372764ebcb75f419613089e124dbd39ffa50c3d558e583eb0536998058345d3de8d46cdae8bfdb46adf0d8ef44
|
data/Gemfile.lock
CHANGED
data/exe/lecli
CHANGED
@@ -42,14 +42,13 @@ class LECLIRunner < Thor
|
|
42
42
|
builder = LECLI::CertificateBuilder.new do |b|
|
43
43
|
b.production = options[:production]
|
44
44
|
end
|
45
|
-
builder.generate_certs(opts)
|
45
|
+
return unless builder.generate_certs(opts)
|
46
46
|
puts 'Certificates generated successfully!'
|
47
47
|
|
48
48
|
script_path = File.expand_path(opts['success_callback_script'])
|
49
49
|
return if File.file?(script_path)
|
50
50
|
puts "Executing now success callback script `#{script_path}`..."
|
51
|
-
|
52
|
-
puts "Let's Encrypt certificates generated successfully" if success
|
51
|
+
exec(".#{script_path}")
|
53
52
|
end
|
54
53
|
end
|
55
54
|
|
@@ -50,21 +50,30 @@ module LECLI
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def generate_certs(options)
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
53
|
+
success = true
|
54
|
+
|
55
|
+
begin
|
56
|
+
request_challenges(options: options)
|
57
|
+
sleep(3) # We are unaware of challenge hosting, better give extra time
|
58
|
+
|
59
|
+
request_challenge_validation
|
60
|
+
request_key = finalize_order(
|
61
|
+
domains: options['domains'],
|
62
|
+
title: options['common_name']
|
63
|
+
)
|
64
|
+
|
65
|
+
write_certificate(
|
66
|
+
cert: @order.certificate, relative_path: options['certificate_key']
|
67
|
+
)
|
68
|
+
write_certificate(
|
69
|
+
cert: request_key, relative_path: options['request_key']
|
70
|
+
)
|
71
|
+
rescue Acme::Client::Error::RateLimited => e
|
72
|
+
puts e.message
|
73
|
+
success = false
|
74
|
+
end
|
61
75
|
|
62
|
-
|
63
|
-
cert: @order.certificate, relative_path: options['certificate_key']
|
64
|
-
)
|
65
|
-
write_certificate(
|
66
|
-
cert: request_key, relative_path: options['request_key']
|
67
|
-
)
|
76
|
+
success
|
68
77
|
end
|
69
78
|
|
70
79
|
private
|
@@ -109,6 +118,7 @@ module LECLI
|
|
109
118
|
end
|
110
119
|
|
111
120
|
def request_challenge_validation
|
121
|
+
puts 'Requesting challenge validation and polling for confirmation...'
|
112
122
|
wait_time = 5
|
113
123
|
pending = true
|
114
124
|
while pending
|
data/lib/lecli/version.rb
CHANGED