vagrant-dns 2.2.2 → 2.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db8e26c490508c47ab65d7a9065e491cac6d97a00a5c6134198acd258445b72c
4
- data.tar.gz: 61651738cc69c6d9992e13e61ee8d21c6f2c2a5018ab32adbc338e6bc2d3e10d
3
+ metadata.gz: 79dfdc20901e6817d9acb8d2833a1be00655cd974b2d9d6afbffc5ddea2d3ff2
4
+ data.tar.gz: 6c4fa0e10842aee72a453b368bb535a0d450f64b2c0eb88e1479d1a4d83f2984
5
5
  SHA512:
6
- metadata.gz: 7e2d081d253222942c755e9c8a65798d9225e2a6220a6317a092b37526cc354617e956c3255d0af078173fd458e1eb5826ac3769b1dfc20f2c77179b05359e53
7
- data.tar.gz: 7b804c925ad00243d5643a6b9fe531dac654ded33456fb873bf6644f9e119faf99560838fb54a0285e7fe7e95e189688c2f67a0a3d5dff23f1101885464b0739
6
+ metadata.gz: 7b55bfad4178e4dfb15fff551de3fde4ab324520ce4d4e1e2cab3acc13b67b3e9d194be2af2e0281922b9f03061540472decda0f5ca94173f1600add4fbdd9ae
7
+ data.tar.gz: 0cbd95cb993d9cc857838629ad7eaeb6c5708c53b337b246c685468783a3e0864bc7f1ff6e9b8afe675add2b173ef09e4e9def27d038915e503be59440d794b4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 2.2.3
2
+
3
+ ### Fixes:
4
+
5
+ * Workaround for a Vargant-on-Ventura issue, crashing the DNS process. [GH-72]
6
+
1
7
  ## 2.2.2
2
8
 
3
9
  ### Fixes:
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
- ruby(ENV['TEST_RUBY_VERSION'] || '~> 2.4.4')
2
+ ruby(ENV['TEST_RUBY_VERSION'] || '~> 2.7.3')
3
3
 
4
- ENV['TEST_VAGRANT_VERSION'] ||= 'v2.1.4'
4
+ ENV['TEST_VAGRANT_VERSION'] ||= 'v2.3.4'
5
5
 
6
6
  # Using the :plugins group causes Vagrant to automagially load auto_network
7
7
  # during acceptance tests.
@@ -23,6 +23,6 @@ group :test do
23
23
  gem 'rake'
24
24
  end
25
25
 
26
- if File.exists? "#{__FILE__}.local"
26
+ if File.exist? "#{__FILE__}.local"
27
27
  eval(File.read("#{__FILE__}.local"), binding)
28
28
  end
@@ -120,11 +120,9 @@ module VagrantDNS
120
120
  end
121
121
 
122
122
  def resolver_file(port)
123
- contents = <<-FILE
124
- # this file is generated by vagrant-dns
125
- nameserver 127.0.0.1
126
- port #{port}
127
- FILE
123
+ "# this file is generated by vagrant-dns\n" \
124
+ "nameserver 127.0.0.1\n" \
125
+ "port #{port}\n"
128
126
  end
129
127
 
130
128
  def resolver_folder
@@ -9,49 +9,58 @@ module VagrantDNS
9
9
  end
10
10
 
11
11
  def start!(opts = {})
12
- run_options = {
13
- :ARGV => ["start"],
14
- :ontop => opts[:ontop]
15
- }.merge!(runopts)
16
- run!(run_options)
12
+ run!("start", { ontop: opts[:ontop] })
17
13
  end
18
14
 
19
15
  def stop!
20
- run_options = {:ARGV => ["stop"]}.merge(runopts)
21
- run!(run_options)
16
+ run!("stop")
22
17
  end
23
18
 
24
19
  def status!
25
- run_options = {:ARGV => ["status"]}.merge(runopts)
26
- run!(run_options)
20
+ run!("status")
27
21
  end
28
22
 
29
- def run!(run_options)
30
- Daemons.run_proc("vagrant-dns", run_options) do
23
+ SERVER = Proc.new do |tmp_path, skip_require_dependencies|
24
+ unless skip_require_dependencies
31
25
  require 'rubydns'
32
26
  require 'async/dns/system'
27
+ end
33
28
 
34
- registry = Registry.new(tmp_path).to_hash
35
- std_resolver = RubyDNS::Resolver.new(Async::DNS::System.nameservers)
36
- ttl = VagrantDNS::Config.ttl
29
+ registry = Registry.new(tmp_path).to_hash
30
+ std_resolver = RubyDNS::Resolver.new(Async::DNS::System.nameservers)
31
+ ttl = VagrantDNS::Config.ttl
37
32
 
38
- RubyDNS::run_server(VagrantDNS::Config.listen) do
39
- registry.each do |pattern, ip|
40
- match(pattern, Resolv::DNS::Resource::IN::A) do |transaction, match_data|
41
- transaction.respond!(ip, ttl: ttl)
42
- end
33
+ RubyDNS::run_server(VagrantDNS::Config.listen) do
34
+ registry.each do |pattern, ip|
35
+ match(pattern, Resolv::DNS::Resource::IN::A) do |transaction, match_data|
36
+ transaction.respond!(ip, ttl: ttl)
43
37
  end
38
+ end
44
39
 
45
- otherwise do |transaction|
46
- transaction.passthrough!(std_resolver) do |reply, reply_name|
47
- puts reply
48
- puts reply_name
49
- end
40
+ otherwise do |transaction|
41
+ transaction.passthrough!(std_resolver) do |reply, reply_name|
42
+ puts reply
43
+ puts reply_name
50
44
  end
51
45
  end
52
46
  end
53
47
  end
54
48
 
49
+ def run!(cmd, opts = {})
50
+ # On darwin, when the running Ruby is not compiled for the running OS
51
+ # @see: https://github.com/BerlinVagrant/vagrant-dns/issues/72
52
+ use_issue_72_workround = RUBY_PLATFORM.match?(/darwin/) && !RUBY_PLATFORM.end_with?(`uname -r`[0, 2])
53
+
54
+ if cmd == "start" && use_issue_72_workround
55
+ require 'rubydns'
56
+ require 'async/dns/system'
57
+ end
58
+
59
+ Daemons.run_proc("vagrant-dns", run_options(cmd, opts)) do
60
+ SERVER.call(tmp_path, use_issue_72_workround)
61
+ end
62
+ end
63
+
55
64
  def restart!(start_opts = {})
56
65
  stop!
57
66
  start!(start_opts)
@@ -69,13 +78,17 @@ module VagrantDNS
69
78
  end
70
79
  end
71
80
 
72
- def runopts
81
+ private
82
+
83
+ def run_options(cmd, extra = {})
73
84
  daemon_dir = File.join(tmp_path, "daemon")
74
85
  {
75
- :dir_mode => :normal,
76
- :dir => daemon_dir,
77
- :log_output => true,
78
- :log_dir => daemon_dir
86
+ ARGV: [cmd],
87
+ dir_mode: :normal,
88
+ dir: daemon_dir,
89
+ log_output: true,
90
+ log_dir: daemon_dir,
91
+ **extra
79
92
  }
80
93
  end
81
94
  end
@@ -1,3 +1,3 @@
1
1
  module VagrantDNS
2
- VERSION = "2.2.2"
2
+ VERSION = "2.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-dns
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Gilcher
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-01-06 00:00:00.000000000 Z
12
+ date: 2023-01-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: daemons
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0'
133
133
  requirements: []
134
- rubygems_version: 3.1.6
134
+ rubygems_version: 3.3.26
135
135
  signing_key:
136
136
  specification_version: 4
137
137
  summary: vagrant-dns manages DNS records of vagrant machines