acme_nsupdate 0.4.3 → 0.4.5

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
  SHA256:
3
- metadata.gz: 2c2c9a4882555e5998835255c9d0a0a1433b1369e7b3cb5c16a3e17074d092b3
4
- data.tar.gz: e6df0ac6c9d93f478b25165aff982f0db4e686e6f1c3415d921b28c129270aa8
3
+ metadata.gz: fcf1ae51c7808408407ff607d7415766088e1060ce3cb63e0f9f362b652a538c
4
+ data.tar.gz: 6719543b5ec0b4cbf197b227f36286f817b947915e09ff3eb0695e0f3660581d
5
5
  SHA512:
6
- metadata.gz: dae4322617100f7644bfa625a8a17a16f2d569721815a4282a16fc36cdb7632377f058da20437ccd54f09fb0446af0b658f270fa377ee3cae94e4f2b76b32f16
7
- data.tar.gz: 0e8e737733fd2bbc95a4568777280d4e62bf2dcecd2cf31a26f0ad57a24dabb8b21a7c168389199c9d6b9c7d2b2c7ebef2ec478761160ef760c78462ea961343
6
+ metadata.gz: a6620b1037693afc4447d7be07db180e81fd4441b9431e6481f80174242c1385d22f467f4e02457816e59bff8038e0748c85b186c6a0fe085998f5cc7fdf9a47
7
+ data.tar.gz: 6479e09299fcd217a384d7c50e44917f643e1ee18def38322f89aa3ad950b57967bf41462eb643fa606f8575766dd6adfa1404ee00b3de540f7cfe8c24937084
@@ -83,14 +83,20 @@ module AcmeNsupdate
83
83
  begin
84
84
  sender = requester.sender(message, name, primary, 53)
85
85
  reply, _ = requester.request(sender, 10)
86
- authority = !reply.authority.empty? ? reply.authority.first.first.to_s : reply.answer.first[2].to_s
86
+ authority = !reply.authority.empty? ? reply.authority.first.first.to_s : reply.answer.first.first.to_s
87
87
  ensure
88
88
  requester.close
89
89
  end
90
90
  end
91
91
 
92
- return [] unless authority
93
- query(primary, authority, :NS).map {|record| record.name.to_s }.uniq
92
+ unless authority
93
+ @client.logger.warn "Could not determine authority for #{name}, returning empty list of nameservers"
94
+ return []
95
+ end
96
+
97
+ query(primary, authority, :NS).map {|record| record.name.to_s }.uniq.tap do |nameservers|
98
+ @client.logger.debug "List of nameservers to check: #{nameservers.join(', ')}"
99
+ end
94
100
  end
95
101
 
96
102
  def query(nameserver, name, qtype)
@@ -48,8 +48,25 @@ module AcmeNsupdate
48
48
  def wait_for_verification challenges
49
49
  @client.logger.debug("Requesting verification")
50
50
  challenges.each_value(&:request_validation)
51
- @client.logger.debug("Waiting for verification")
52
- challenges.map {|_, challenge| Thread.new { sleep(5) while challenge.status == "pending" } }.each(&:join)
51
+
52
+ @client.logger.debug("Waiting 120 seconds for verification")
53
+ waited = 0
54
+ challenges.each do |domain, challenge|
55
+ challenge.reload
56
+
57
+ next unless challenge.status == "pending"
58
+
59
+ if waited >= 120
60
+ @client.logger.error "Timeout while waiting for validation of challenge for #{domain}"
61
+ break
62
+ end
63
+
64
+ @client.logger.debug "Challenge for #{domain} is pending, waiting 5 seconds"
65
+ sleep(5)
66
+ waited += 5
67
+ redo
68
+ end
69
+
53
70
  challenges.each do |domain, challenge|
54
71
  raise "Verification of #{domain} failed: #{challenge.error}" unless challenge.status == "valid"
55
72
  end
@@ -1,3 +1,3 @@
1
1
  module AcmeNsupdate
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acme_nsupdate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonne Haß
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-11 00:00:00.000000000 Z
11
+ date: 2023-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slop
@@ -105,7 +105,7 @@ homepage: https://github.com/jhass/acme_nsupdate
105
105
  licenses:
106
106
  - MIT
107
107
  metadata: {}
108
- post_install_message:
108
+ post_install_message:
109
109
  rdoc_options: []
110
110
  require_paths:
111
111
  - lib
@@ -120,8 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubygems_version: 3.1.2
124
- signing_key:
123
+ rubygems_version: 3.4.13
124
+ signing_key:
125
125
  specification_version: 4
126
126
  summary: ACME (Let's Encrypt) client with nsupdate (DDNS) integration.
127
127
  test_files: []