vagrant-dns 2.2.3 → 2.4.0
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/.editorconfig +16 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +17 -5
- data/DEVELOPMENT.md +18 -2
- data/Gemfile +4 -1
- data/PLATFORM_SUPPORT.md +20 -9
- data/README.md +76 -15
- data/lib/vagrant-dns/command.rb +19 -15
- data/lib/vagrant-dns/config.rb +15 -10
- data/lib/vagrant-dns/configurator.rb +151 -80
- data/lib/vagrant-dns/installers/linux.rb +73 -0
- data/lib/vagrant-dns/installers/mac.rb +16 -2
- data/lib/vagrant-dns/installers.rb +16 -0
- data/lib/vagrant-dns/registry.rb +7 -48
- data/lib/vagrant-dns/server.rb +82 -0
- data/lib/vagrant-dns/service.rb +31 -36
- data/lib/vagrant-dns/store.rb +59 -0
- data/lib/vagrant-dns/tld_registry.rb +19 -0
- data/lib/vagrant-dns/version.rb +1 -1
- data/lib/vagrant-dns.rb +3 -1
- data/tasks/acceptance.rake +3 -1
- data/vagrant-dns.gemspec +9 -2
- data/vagrant-spec.config.rb +1 -3
- metadata +26 -9
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'yaml/store'
|
2
|
+
require 'forwardable'
|
3
|
+
|
4
|
+
module VagrantDNS
|
5
|
+
module Store
|
6
|
+
module InstanceMethods
|
7
|
+
# This method is only valid in a #transaction and it cannot be read-only. It will raise PStore::Error if called at any other time.
|
8
|
+
def [](name)
|
9
|
+
name = name.source if name.respond_to? :source
|
10
|
+
@store[name]
|
11
|
+
end
|
12
|
+
|
13
|
+
# This method is only valid in a #transaction and it cannot be read-only. It will raise PStore::Error if called at any other time.
|
14
|
+
def []=(name, value)
|
15
|
+
name = name.source if name.respond_to? :source
|
16
|
+
@store[name] = value
|
17
|
+
end
|
18
|
+
|
19
|
+
def delete(name)
|
20
|
+
name = name.source if name.respond_to? :source
|
21
|
+
@store.delete(name)
|
22
|
+
end
|
23
|
+
|
24
|
+
# This method is only valid in a #transaction and it cannot be read-only. It will raise PStore::Error if called at any other time.
|
25
|
+
def root?(name)
|
26
|
+
name = name.source if name.respond_to? :source
|
27
|
+
@store.root?(name)
|
28
|
+
end
|
29
|
+
alias_method :key?, :root?
|
30
|
+
|
31
|
+
# This method is only valid in a #transaction and it cannot be read-only. It will raise PStore::Error if called at any other time.
|
32
|
+
def roots
|
33
|
+
@store.roots.map { |name| Regexp.new(name) }
|
34
|
+
end
|
35
|
+
alias_method :keys, :roots
|
36
|
+
|
37
|
+
# This method is only valid in a #transaction and it cannot be read-only. It will raise PStore::Error if called at any other time.
|
38
|
+
def any?
|
39
|
+
@store.roots.any?
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_hash
|
43
|
+
@store.transaction(true) do
|
44
|
+
@store.roots.each_with_object({}) do |name, a|
|
45
|
+
a[Regexp.new(name)] = @store[name]
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.included(receiver)
|
52
|
+
receiver.class_eval do
|
53
|
+
extend Forwardable
|
54
|
+
def_delegators :@store, :transaction, :abort, :commit
|
55
|
+
include InstanceMethods
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module VagrantDNS
|
2
|
+
# This is the dns pattern registry (aka "config")
|
3
|
+
# It basically delegates everything to a YAML::Store but handles the conversion
|
4
|
+
# of Regexp dns-patterns into YAML string keys and reverse.
|
5
|
+
class TldRegistry
|
6
|
+
include VagrantDNS::Store
|
7
|
+
|
8
|
+
NAME = "ltds"
|
9
|
+
|
10
|
+
def initialize(tmp_path)
|
11
|
+
@store = YAML::Store.new(File.join(tmp_path, NAME), true)
|
12
|
+
end
|
13
|
+
|
14
|
+
# @return [VagrantDNS::Registry,nil] Eitehr an instance or +nil+ if cofig file does not exist.
|
15
|
+
def self.open(tmp_path)
|
16
|
+
new(tmp_path) if File.exist?(File.join(tmp_path, NAME))
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/vagrant-dns/version.rb
CHANGED
data/lib/vagrant-dns.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
require "vagrant-dns/version"
|
2
2
|
require "vagrant-dns/config"
|
3
3
|
|
4
|
+
require "vagrant-dns/store"
|
4
5
|
require "vagrant-dns/registry"
|
6
|
+
require "vagrant-dns/tld_registry"
|
5
7
|
require "vagrant-dns/service"
|
6
|
-
require "vagrant-dns/installers
|
8
|
+
require "vagrant-dns/installers"
|
7
9
|
require "vagrant-dns/configurator"
|
8
10
|
require "vagrant-dns/middlewares/config_up"
|
9
11
|
require "vagrant-dns/middlewares/config_down"
|
data/tasks/acceptance.rake
CHANGED
@@ -11,7 +11,9 @@ namespace :acceptance do
|
|
11
11
|
# Ubuntu 16.04 https://app.vagrantup.com/ubuntu/boxes/xenial64.json
|
12
12
|
# :virtualbox => "https://vagrantcloud.com/ubuntu/boxes/xenial64/versions/20180511.0.0/providers/virtualbox.box"
|
13
13
|
# Ubuntu 18.04 https://app.vagrantup.com/ubuntu/boxes/bionic64.json
|
14
|
-
:
|
14
|
+
virtualbox: "https://vagrantcloud.com/ubuntu/boxes/bionic64/versions/20180709.0.0/providers/virtualbox.box",
|
15
|
+
# Ubuntu 22.10 https://app.vagrantup.com/bento/boxes/ubuntu-22.10
|
16
|
+
vmware_desktop: "https://app.vagrantup.com/bento/boxes/ubuntu-22.10/versions/202303.13.0/providers/vmware_desktop.box"
|
15
17
|
}
|
16
18
|
|
17
19
|
TEST_BOXES.each do |provider, box_url|
|
data/vagrant-dns.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.email = ["florian.gilcher@asquera.de", "robert@dotless.de"]
|
7
7
|
gem.description = %q{vagrant-dns is a vagrant plugin that manages DNS records associated with local machines.}
|
8
8
|
gem.summary = %q{vagrant-dns manages DNS records of vagrant machines}
|
9
|
-
gem.homepage = ""
|
9
|
+
gem.homepage = "https://github.com/BerlinVagrant/vagrant-dns"
|
10
10
|
gem.license = "MIT"
|
11
11
|
|
12
12
|
gem.files = `git ls-files`.split($\).reject { |f| f.match(%r{^(test|testdrive)/}) }
|
@@ -16,6 +16,13 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.require_paths = ["lib"]
|
17
17
|
gem.version = VagrantDNS::VERSION
|
18
18
|
|
19
|
+
gem.metadata = {
|
20
|
+
"bug_tracker_uri" => "https://github.com/BerlinVagrant/vagrant-dns/issues",
|
21
|
+
"changelog_uri" => "https://github.com/BerlinVagrant/vagrant-dns/blob/master/CHANGELOG.md",
|
22
|
+
"source_code_uri" => "https://github.com/BerlinVagrant/vagrant-dns",
|
23
|
+
"wiki_uri" => "https://github.com/BerlinVagrant/vagrant-dns/wiki"
|
24
|
+
}
|
25
|
+
|
19
26
|
gem.required_ruby_version = '>= 2.2.6'
|
20
27
|
|
21
28
|
gem.add_dependency "daemons"
|
@@ -25,7 +32,7 @@ Gem::Specification.new do |gem|
|
|
25
32
|
# Pinning async gem to work around an issue in vagrant, where it does not
|
26
33
|
# honor "required_ruby_version" while resolving sub-dependencies.
|
27
34
|
# see: https://github.com/hashicorp/vagrant/issues/12640
|
28
|
-
gem.add_dependency 'async', '
|
35
|
+
gem.add_dependency 'async', '~> 1.30', '>= 1.30.3'
|
29
36
|
|
30
37
|
gem.add_development_dependency 'rspec'
|
31
38
|
end
|
data/vagrant-spec.config.rb
CHANGED
@@ -7,9 +7,7 @@ Vagrant::Spec::Acceptance.configure do |c|
|
|
7
7
|
c.component_paths = [acceptance_dir.to_s]
|
8
8
|
c.skeleton_paths = [(acceptance_dir + 'skeletons').to_s]
|
9
9
|
|
10
|
-
c.provider ENV['VS_PROVIDER'],
|
11
|
-
box: ENV['VS_BOX_PATH'],
|
12
|
-
skeleton_path: c.skeleton_paths
|
10
|
+
c.provider ENV['VS_PROVIDER'], box: ENV['VS_BOX_PATH'], skeleton_path: c.skeleton_paths
|
13
11
|
|
14
12
|
# there seems no other way to set additional environment variables
|
15
13
|
# see: https://github.com/mitchellh/vagrant-spec/pull/17
|
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.
|
4
|
+
version: 2.4.0
|
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: 2023-
|
12
|
+
date: 2023-04-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: daemons
|
@@ -57,16 +57,22 @@ dependencies:
|
|
57
57
|
name: async
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- - "
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '1.30'
|
63
|
+
- - ">="
|
61
64
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
65
|
+
version: 1.30.3
|
63
66
|
type: :runtime
|
64
67
|
prerelease: false
|
65
68
|
version_requirements: !ruby/object:Gem::Requirement
|
66
69
|
requirements:
|
67
|
-
- - "
|
70
|
+
- - "~>"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '1.30'
|
73
|
+
- - ">="
|
68
74
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
75
|
+
version: 1.30.3
|
70
76
|
- !ruby/object:Gem::Dependency
|
71
77
|
name: rspec
|
72
78
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,7 +96,9 @@ executables: []
|
|
90
96
|
extensions: []
|
91
97
|
extra_rdoc_files: []
|
92
98
|
files:
|
99
|
+
- ".editorconfig"
|
93
100
|
- ".gitignore"
|
101
|
+
- ".ruby-version"
|
94
102
|
- CHANGELOG.md
|
95
103
|
- DEVELOPMENT.md
|
96
104
|
- Gemfile
|
@@ -102,20 +110,29 @@ files:
|
|
102
110
|
- lib/vagrant-dns/command.rb
|
103
111
|
- lib/vagrant-dns/config.rb
|
104
112
|
- lib/vagrant-dns/configurator.rb
|
113
|
+
- lib/vagrant-dns/installers.rb
|
114
|
+
- lib/vagrant-dns/installers/linux.rb
|
105
115
|
- lib/vagrant-dns/installers/mac.rb
|
106
116
|
- lib/vagrant-dns/middlewares/config_down.rb
|
107
117
|
- lib/vagrant-dns/middlewares/config_up.rb
|
108
118
|
- lib/vagrant-dns/middlewares/restart.rb
|
109
119
|
- lib/vagrant-dns/registry.rb
|
120
|
+
- lib/vagrant-dns/server.rb
|
110
121
|
- lib/vagrant-dns/service.rb
|
122
|
+
- lib/vagrant-dns/store.rb
|
123
|
+
- lib/vagrant-dns/tld_registry.rb
|
111
124
|
- lib/vagrant-dns/version.rb
|
112
125
|
- tasks/acceptance.rake
|
113
126
|
- vagrant-dns.gemspec
|
114
127
|
- vagrant-spec.config.rb
|
115
|
-
homepage:
|
128
|
+
homepage: https://github.com/BerlinVagrant/vagrant-dns
|
116
129
|
licenses:
|
117
130
|
- MIT
|
118
|
-
metadata:
|
131
|
+
metadata:
|
132
|
+
bug_tracker_uri: https://github.com/BerlinVagrant/vagrant-dns/issues
|
133
|
+
changelog_uri: https://github.com/BerlinVagrant/vagrant-dns/blob/master/CHANGELOG.md
|
134
|
+
source_code_uri: https://github.com/BerlinVagrant/vagrant-dns
|
135
|
+
wiki_uri: https://github.com/BerlinVagrant/vagrant-dns/wiki
|
119
136
|
post_install_message:
|
120
137
|
rdoc_options: []
|
121
138
|
require_paths:
|
@@ -131,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
148
|
- !ruby/object:Gem::Version
|
132
149
|
version: '0'
|
133
150
|
requirements: []
|
134
|
-
rubygems_version: 3.
|
151
|
+
rubygems_version: 3.1.6
|
135
152
|
signing_key:
|
136
153
|
specification_version: 4
|
137
154
|
summary: vagrant-dns manages DNS records of vagrant machines
|