dns_one 0.5.20 → 0.5.21

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: caafacad6e7e7d9590f2184fd8e01b7c4c7c580c
4
- data.tar.gz: 1abbf736872e12bff9de5aed832be97d42eac55b
3
+ metadata.gz: 6b5bf92c0bc4710f4e54db5721a0c586935e1835
4
+ data.tar.gz: 300f3e270ddab9889fdea647596a19a53189f3f5
5
5
  SHA512:
6
- metadata.gz: d77b938f760923f91771689ce597c29a7ea544b91ac6051a4b9a64f732a5d22e71946c80a7ecbfdf25c36542c0f22d002a374ce8a9b39e257c3f798f236e31a7
7
- data.tar.gz: 4d3d20d7936ba8e5788f850d38d14f467daa5852fceccb000ae273a84c166484084637db2a8243020aed67dea7d2e3f7d329a2fa20082aa48984ea2aa5775513
6
+ metadata.gz: 132013f5c4eb8889695674b6180ab5f6380727ca4d71da16af4c752c7b89cabd5002b4da39bf04408a0b83e47f435b0b7bb20d64192a41fedba9e2eec17070d0
7
+ data.tar.gz: 162dfddae488f15de7d105109e958fd65da3c6048fb48194b904f31ab9005b9b849485be85a75cbedf99efdeb2cd42c3775c6ba6b0a988866e7b0fdc0eb00c7c
@@ -47,7 +47,7 @@ module DnsOne; module Backend; class HTTPBell < Base
47
47
 
48
48
  url = @conf[:http_bell_url].sub '$id', last_id.to_s
49
49
 
50
- recs = `curl #{url}`
50
+ recs = `curl #{curl_opts} '#{url}'`
51
51
  .split(/\n+/)
52
52
  .map{ |r|
53
53
  id, domain = r.strip.split /\s+/
@@ -62,6 +62,12 @@ module DnsOne; module Backend; class HTTPBell < Base
62
62
  recs
63
63
  end
64
64
 
65
+ def curl_opts
66
+ if Global.conf.http_bell_insecure
67
+ '--insecure'
68
+ end
69
+ end
70
+
65
71
  def log_update point, recs = nil
66
72
  case point
67
73
  when :start
data/lib/dns_one/util.rb CHANGED
@@ -58,8 +58,11 @@ module DnsOne; class Util
58
58
  def init_logger logdev, level = Logger::WARN, shift_age = 10, shift_size = 2**20
59
59
  if logdev.is_a? String
60
60
  begin
61
- FileUtils.mkdir_p File.dirname(logdev)
62
- File.write logdev, ''
61
+ if File.exists? logdev
62
+ File.writable? logdev
63
+ else
64
+ FileUtils.mkdir_p File.dirname(logdev)
65
+ end
63
66
  rescue => e
64
67
  $stderr.puts "#{e.desc}\nCannot open log file #{logdev}. Will use STDOUT."
65
68
  logdev = $stdout
@@ -1,3 +1,3 @@
1
1
  module DnsOne
2
- VERSION = "0.5.20"
2
+ VERSION = "0.5.21"
3
3
  end
data/util/sample_conf.yml CHANGED
@@ -34,6 +34,7 @@ backend:
34
34
  http_bell_url: https://dnsapi.mysite.com/dns/fetch_since?id=$id
35
35
  http_bell_record_set: my_set_1
36
36
  http_bell_port: 27861
37
+ http_bell_insecure: false
37
38
  http_bell_allow_ips:
38
39
  - 1.2.3.4
39
40
  - 2.3.4.5
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dns_one
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.20
4
+ version: 0.5.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Lobato