dns_one 0.4.55 → 0.4.56
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/lib/dns_one/backend/http_bell.rb +11 -3
- data/lib/dns_one/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: d7cfa42d5e5a79c82bacde06905ef3c377f7d526
|
4
|
+
data.tar.gz: 935dd60e6651e5feb036d76b532f4f8a7b986aa1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8cd4635cf05862d3bc966b656002127653442f1ae30abe832fa6f2a48b33037aa6027a4a0ee3ecc87d85bed77d915721309556caeee715e4bfc3c55383be6a7
|
7
|
+
data.tar.gz: 379aae2b224c76303fac3b85b2d04ec08ab065c0e255eb76bfa65205fb9c059a81afce1878fa29b6253e8a90854dadd8b90b60cfe2a385b59c8b752ffe8f1a59
|
@@ -65,13 +65,16 @@ module DnsOne; module Backend; class HTTPBell < Base
|
|
65
65
|
when :start
|
66
66
|
@log_update_t0 = Time.now
|
67
67
|
Log.i "update`ing..."
|
68
|
+
system "echo 'update`ing...' >> /tmp/ddf"
|
68
69
|
when :end
|
69
70
|
show_num = 10
|
70
71
|
dots = '...' if recs.size > show_num
|
71
72
|
zones = recs[0, show_num].map(&:last).join(', ')
|
72
73
|
dt = '%.2f' % (Time.now - @log_update_t0)
|
74
|
+
system "echo '#{recs.size} zone(s) added in #{dt}s: #{zones}#{dots}' >> /tmp/ddf"
|
73
75
|
Log.i "#{recs.size} zone(s) added in #{dt}s: #{zones}#{dots}"
|
74
76
|
else
|
77
|
+
system "echo 'Wrong param #{point} for log_update' >> /tmp/ddf"
|
75
78
|
Log.e "Wrong param #{point} for log_update"
|
76
79
|
end
|
77
80
|
end
|
@@ -83,15 +86,20 @@ module DnsOne; module Backend; class HTTPBell < Base
|
|
83
86
|
require "socket"
|
84
87
|
dts = TCPServer.new '0.0.0.0', @conf[:http_bell_port]
|
85
88
|
allow_ips = @conf[:http_bell_allow_ips]
|
89
|
+
Log.i 'Starting bell listener...'
|
86
90
|
Thread.new do
|
87
91
|
loop do
|
88
92
|
Thread.start(dts.accept) do |client|
|
89
|
-
|
90
|
-
|
93
|
+
Log.i 'accepted'
|
94
|
+
numeric_address = client.peeraddr[3]
|
95
|
+
if !allow_ips || allow_ips.include?(numeric_address)
|
96
|
+
Log.i 'will update'
|
91
97
|
update
|
92
98
|
else
|
93
|
-
Log.w "Ignoring bell ring from #{
|
99
|
+
Log.w "Ignoring bell ring from #{numeric_address}."
|
94
100
|
end
|
101
|
+
Log.i 'closing connection'
|
102
|
+
client.close
|
95
103
|
end
|
96
104
|
end
|
97
105
|
end
|
data/lib/dns_one/version.rb
CHANGED