vagrant-dns 2.2.2 → 2.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile +3 -3
- data/lib/vagrant-dns/configurator.rb +3 -5
- data/lib/vagrant-dns/service.rb +42 -29
- data/lib/vagrant-dns/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79dfdc20901e6817d9acb8d2833a1be00655cd974b2d9d6afbffc5ddea2d3ff2
|
4
|
+
data.tar.gz: 6c4fa0e10842aee72a453b368bb535a0d450f64b2c0eb88e1479d1a4d83f2984
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b55bfad4178e4dfb15fff551de3fde4ab324520ce4d4e1e2cab3acc13b67b3e9d194be2af2e0281922b9f03061540472decda0f5ca94173f1600add4fbdd9ae
|
7
|
+
data.tar.gz: 0cbd95cb993d9cc857838629ad7eaeb6c5708c53b337b246c685468783a3e0864bc7f1ff6e9b8afe675add2b173ef09e4e9def27d038915e503be59440d794b4
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
|
-
ruby(ENV['TEST_RUBY_VERSION'] || '~> 2.
|
2
|
+
ruby(ENV['TEST_RUBY_VERSION'] || '~> 2.7.3')
|
3
3
|
|
4
|
-
ENV['TEST_VAGRANT_VERSION'] ||= 'v2.
|
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.
|
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
|
-
|
124
|
-
|
125
|
-
|
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
|
data/lib/vagrant-dns/service.rb
CHANGED
@@ -9,49 +9,58 @@ module VagrantDNS
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def start!(opts = {})
|
12
|
-
|
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
|
-
|
21
|
-
run!(run_options)
|
16
|
+
run!("stop")
|
22
17
|
end
|
23
18
|
|
24
19
|
def status!
|
25
|
-
|
26
|
-
run!(run_options)
|
20
|
+
run!("status")
|
27
21
|
end
|
28
22
|
|
29
|
-
|
30
|
-
|
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
|
-
|
35
|
-
|
36
|
-
|
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
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
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
|
-
|
81
|
+
private
|
82
|
+
|
83
|
+
def run_options(cmd, extra = {})
|
73
84
|
daemon_dir = File.join(tmp_path, "daemon")
|
74
85
|
{
|
75
|
-
:
|
76
|
-
:
|
77
|
-
:
|
78
|
-
:
|
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
|
data/lib/vagrant-dns/version.rb
CHANGED
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.
|
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:
|
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.
|
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
|