lecli 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04e436ff4e1fecde9e281bac7fa04ffa91825315
4
- data.tar.gz: 9c7268a5cb0f20529a68fbf306bd5762801f8fa1
3
+ metadata.gz: 86ea7e2f098905bdd1cfcc4602af73f7192929b3
4
+ data.tar.gz: 0f26ed9f43b3b75e3677b63b501832839ea225cd
5
5
  SHA512:
6
- metadata.gz: e6893a2d1a8c07004822ba197302a2fcf0b93b7e6458fe9c6c3cc6b3bd6f187f7aed37e700cf04ad3f1fd3bcb15810507d93484eae88bfab708cd769df23a1f2
7
- data.tar.gz: e981541b881cebd02094c44b51b738ee35540eea01c8b7630aa4006e5d7b30f793b73c269db876863d91792e0328c1d220492db631e2ba4f22658c1f218e21f3
6
+ metadata.gz: 72886355955c95b8e7662b3e1928ebb3e036825fdabf6bd7aa9f0cb167b7fd9f467c0e87ea9445ec968511cd0a03fa54534c87fa772a13441c34e40228a76497
7
+ data.tar.gz: eb08e0a68424775221c67f748ad4dd1588bafc372764ebcb75f419613089e124dbd39ffa50c3d558e583eb0536998058345d3de8d46cdae8bfdb46adf0d8ef44
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lecli (0.2.8)
4
+ lecli (0.2.9)
5
5
  acme-client (~> 2.0.0)
6
6
  thor (~> 0.20.0)
7
7
 
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
- success = system(".#{script_path}")
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
- request_challenges(options: options)
54
- sleep(3) # We are unaware of challenge hosting, better give them some time
55
-
56
- request_challenge_validation
57
- request_key = finalize_order(
58
- domains: options['domains'],
59
- title: options['common_name']
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
- write_certificate(
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
@@ -1,3 +1,3 @@
1
1
  module LECLI
2
- VERSION = '0.2.8'.freeze
2
+ VERSION = '0.2.9'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lecli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Valverde Arredondo