vagrant-proxyconf 2.0.7 → 2.0.8

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
  SHA256:
3
- metadata.gz: '09ccd0a2a51d1de18dc63c8355c6f6d4217faf1d31b470a0de6348c514a5c621'
4
- data.tar.gz: 6384262695d6fffd759de258efb6c70ddd52a434fb1ead968ea0f0f8aa225ba3
3
+ metadata.gz: 4d721ed3ca409df6422674ace6fe21eb4d061f2803ab1e3d3297f2a6443ca06b
4
+ data.tar.gz: ba5327b55dbda01b797803002c990b96a9905897ec9fa933f38dac8c9fd00341
5
5
  SHA512:
6
- metadata.gz: df0979eae22816e8a23ebddaf8e0874d0e6b5b8a9ae79e66499cb4bc418e47c300483dd1dc889e6324c7169636d4c4b2cffcfbc67c17e21170b3b178654211ce
7
- data.tar.gz: ad5f86225dd89c3ce59c2fb50f72b10375e53f1b630de6e28ae53b3f4677507f26114ee991e467408b3c0cc612297cd87284400b2e7cdf50fdcc6007baf21658
6
+ metadata.gz: d4be0de47b43ad064279e9820e22de28a3ac55436635eb655dea3e407df08c71900569a565df930d090e4ebe8a887542feeeb4f1018881aae6e0166179882bb1
7
+ data.tar.gz: e259b6a96d86aca4fdebca70a029c918c574801569aee4acee0299908d7f2f34633627561e4b35d13f5b4af16e3d45c34025683523808dedcc09988bd827d881
@@ -5,7 +5,7 @@ cache: bundler
5
5
  sudo: false
6
6
 
7
7
  before_install: ./travis/before_install
8
- install: bundle install --path .bundle/gems
8
+ install: make
9
9
  script: bundle exec rspec
10
10
  bundler_args: --without=development
11
11
 
@@ -14,15 +14,16 @@ env:
14
14
  - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
15
15
 
16
16
  rvm:
17
- - 2.4.4
17
+ - 2.6.6
18
18
 
19
19
  matrix:
20
20
  include:
21
+ - env: VAGRANT_VERSION=v2.2.9
22
+ - env: VAGRANT_VERSION=v2.2.8
23
+ - env: VAGRANT_VERSION=v2.2.7
24
+ - env: VAGRANT_VERSION=v2.2.6
25
+ - env: VAGRANT_VERSION=v2.2.5
21
26
  - env: VAGRANT_VERSION=v2.2.4
22
- - env: VAGRANT_VERSION=v2.2.3
23
- - env: VAGRANT_VERSION=v2.2.2
24
- - env: VAGRANT_VERSION=v2.1.5
25
- - env: VAGRANT_VERSION=v2.0.4
26
27
  - env: VAGRANT_VERSION=master
27
28
  allow_failures:
28
29
  - env: VAGRANT_VERSION=master
@@ -1,3 +1,23 @@
1
+ # 2.0.9 / not yet released
2
+
3
+ # 2.0.8 / 2020-06-10
4
+
5
+ This is a bug fix release for windows users which fixes a bug with the
6
+ tempfile creation when uploading and downloading files from the vagrant
7
+ machine.
8
+
9
+ #### Closed Issues
10
+
11
+ - [tempfile implementation on windows doesn't always seem to work
12
+ #220](https://github.com/tmatilai/vagrant-proxyconf/issues/220)
13
+
14
+ #### Credits
15
+
16
+ Big thanks to @chucknelson for debugging and troubleshooting and getting
17
+ to the bottom of this for windows users. Thank you!
18
+
19
+ - @chucknelson
20
+
1
21
  # 2.0.7 / 2019-11-14
2
22
 
3
23
  This is a bug fix release.
data/Gemfile CHANGED
@@ -1,25 +1,8 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- #### Added due to https://groups.google.com/forum/#!topic/vagrant-up/J8J6LmhzBqM/discussion
4
- embedded_locations = %w(/Applications/Vagrant/embedded /opt/vagrant/embedded)
5
-
6
- embedded_locations.each do |p|
7
- ENV['VAGRANT_INSTALLER_EMBEDDED_DIR'] = p if File.directory?(p)
8
- end
9
-
10
- unless ENV.key?('VAGRANT_INSTALLER_EMBEDDED_DIR')
11
- $stderr.puts "Couldn't find a packaged install of vagrant, and we need this"
12
- $stderr.puts 'in order to make use of the RubyEncoder libraries.'
13
- $stderr.puts 'I looked in:'
14
- embedded_locations.each do |p|
15
- $stderr.puts " #{p}"
16
- end
17
- end
18
- #### End Added due to https://groups.google.com/forum/#!topic/vagrant-up/J8J6LmhzBqM/discussion
19
-
20
3
  gem 'vagrant',
21
4
  git: 'https://github.com/hashicorp/vagrant.git',
22
- tag: ENV.fetch('VAGRANT_VERSION', 'v2.2.4')
5
+ tag: ENV.fetch('VAGRANT_VERSION', 'v2.2.9')
23
6
 
24
7
  gem 'rake'
25
8
  gem 'rspec', '~> 3.1'
@@ -0,0 +1,33 @@
1
+ .PHONY: clean
2
+ .PHONY: help
3
+ .PHONY: init
4
+ .PHONY: patch_bundler
5
+
6
+
7
+ all: clean init patch_bundler
8
+
9
+
10
+ clean:
11
+ rm -f Gemfile.lock
12
+ rm -rf .bundle/
13
+
14
+
15
+ help:
16
+ @echo "[Commands]"
17
+ @echo ""
18
+ @echo " all -> The default which runs all tasks"
19
+ @echo " clean -> Deletes Gemfile.lock and .bundle/"
20
+ @echo " init -> Creates the bundle for developing the next release"
21
+ @echo " patch_bundler -> Attemps to patch vagrant bundler with known issues"
22
+ @echo ""
23
+
24
+ init: clean
25
+ bundle config set path '.bundle/gems'
26
+ bundle install
27
+
28
+
29
+ patch_bundler:
30
+ [ "$(VAGRANT_VERSION)" == "v2.2.5" ] && (patch -p0 --batch --backup -d "`bundle info --path vagrant`" < deps/patches/lib/vagrant/bundler.rb.patch) || true
31
+ [ "$(VAGRANT_VERSION)" == "v2.2.6" ] && (patch -p0 --batch --backup -d "`bundle info --path vagrant`" < deps/patches/lib/vagrant/bundler.rb.patch) || true
32
+ [ "$(VAGRANT_VERSION)" == "v2.2.7" ] && (patch -p0 --batch --backup -d "`bundle info --path vagrant`" < deps/patches/lib/vagrant/bundler.rb.patch) || true
33
+ [ "$(VAGRANT_VERSION)" == "v2.2.8" ] && (egrep -q 'cap/redhat' `bundle info --path vagrant`/plugins/provisioners/docker/plugin.rb && sed -i.bak -e 's/redhat/centos/g' `bundle info --path vagrant`/plugins/provisioners/docker/plugin.rb) || true
data/README.md CHANGED
@@ -350,4 +350,5 @@ end
350
350
  * @hexmode
351
351
  * @craigmunro
352
352
  * @greut
353
+ * @chucknelson
353
354
  * @codylane
@@ -0,0 +1,14 @@
1
+ --- lib/vagrant/bundler.rb 2020-04-27 14:19:39.000000000 -0600
2
+ +++ lib/vagrant/bundler.rb 2020-04-27 14:20:01.000000000 -0600
3
+ @@ -421,8 +421,9 @@
4
+ def vagrant_internal_specs
5
+ # activate any dependencies up front so we can always
6
+ # pin them when resolving
7
+ - Gem::Specification.find { |s| s.name == "vagrant" && s.activated? }.
8
+ - runtime_dependencies.each { |d| gem d.name, *d.requirement.as_list }
9
+ + if (vs = Gem::Specification.find { |s| s.name == "vagrant" && s.activated? })
10
+ + vs.runtime_dependencies.each { |d| gem d.name, *d.requirement.as_list }
11
+ + end
12
+ # discover all the gems we have available
13
+ list = {}
14
+ directories = [Gem::Specification.default_specifications_dir]
@@ -108,11 +108,18 @@ module VagrantPlugins
108
108
 
109
109
  # @return [Tempfile] a temporary file with the specified content
110
110
  def tempfile(content)
111
- Tempfile.new("vagrant").tap do |temp|
112
- temp.binmode
113
- temp.write(content)
114
- temp.close
111
+ tempfile = Tempfile.new("vagrant-proxyconf")
112
+
113
+ begin
114
+ tempfile.tap do |tmp|
115
+ tmp.binmode
116
+ tmp.write(content)
117
+ end
118
+ ensure
119
+ tempfile.close
115
120
  end
121
+
122
+ tempfile
116
123
  end
117
124
 
118
125
  def cap_name
@@ -39,28 +39,28 @@ module VagrantPlugins
39
39
  true
40
40
  end
41
41
 
42
- def docker_client_config_path
43
- return @docker_client_config_path if @docker_client_config_path
42
+ def docker_client_config
43
+ return @docker_client_config if @docker_client_config
44
44
  return if !supports_config_json?
45
45
 
46
- @docker_client_config_path = tempfile(Hash.new)
46
+ @docker_client_config = tempfile(Hash.new)
47
47
 
48
48
  @machine.communicate.tap do |comm|
49
49
  if comm.test("[ -f /etc/docker/config.json ]")
50
50
  logger.info('Downloading file /etc/docker/config.json')
51
51
  comm.sudo("chmod 0644 /etc/docker/config.json")
52
- comm.download("/etc/docker/config.json", @docker_client_config_path.path)
53
- logger.info("Downloaded /etc/docker/config.json to #{@docker_client_config_path.path}")
52
+ comm.download("/etc/docker/config.json", @docker_client_config.path)
53
+ logger.info("Downloaded /etc/docker/config.json to #{@docker_client_config.path}")
54
54
  end
55
55
  end
56
56
 
57
- @docker_client_config_path = @docker_client_config_path.path
57
+ @docker_client_config
58
58
  end
59
59
 
60
60
  def update_docker_client_config
61
- return if !supports_config_json? || !docker_client_config_path
61
+ return if !supports_config_json? || !docker_client_config
62
62
 
63
- content = File.read(@docker_client_config_path)
63
+ content = File.read(@docker_client_config)
64
64
  data = JSON.load(content)
65
65
 
66
66
  if disabled?
@@ -92,10 +92,10 @@ module VagrantPlugins
92
92
 
93
93
  config_json = JSON.pretty_generate(data)
94
94
 
95
- @docker_client_config_path = tempfile(config_json)
95
+ @docker_client_config = tempfile(config_json)
96
96
 
97
97
  @machine.communicate.tap do |comm|
98
- comm.upload(@docker_client_config_path.path, "/tmp/vagrant-proxyconf-docker-config.json")
98
+ comm.upload(@docker_client_config.path, "/tmp/vagrant-proxyconf-docker-config.json")
99
99
  comm.sudo("mkdir -p /etc/docker")
100
100
  comm.sudo("chown root:docker /etc/docker")
101
101
  comm.sudo("mv /tmp/vagrant-proxyconf-docker-config.json /etc/docker/config.json")
@@ -104,9 +104,6 @@ module VagrantPlugins
104
104
  comm.sudo("rm -f /tmp/vagrant-proxyconf-docker-config.json")
105
105
 
106
106
  comm.sudo("sed -i.bak -e '/^DOCKER_CONFIG/d' /etc/environment")
107
- if !disabled?
108
- comm.sudo("echo DOCKER_CONFIG=/etc/docker >> /etc/environment")
109
- end
110
107
  end
111
108
 
112
109
  config_json
@@ -136,12 +133,12 @@ module VagrantPlugins
136
133
  end
137
134
 
138
135
  systemd_config = docker_systemd_config
139
- @docker_systemd_config = tempfile(systemd_config).path
136
+ @docker_systemd_config = tempfile(systemd_config)
140
137
 
141
138
  @machine.communicate.tap do |comm|
142
139
 
143
140
  comm.sudo("mkdir -p /etc/systemd/system/docker.service.d")
144
- comm.upload(@docker_systemd_config, "/tmp/vagrant-proxyconf-docker-systemd-config")
141
+ comm.upload(@docker_systemd_config.path, "/tmp/vagrant-proxyconf-docker-systemd-config")
145
142
 
146
143
  if comm.test("diff -Naur /etc/systemd/system/docker.service.d/http-proxy.conf /tmp/vagrant-proxyconf-docker-systemd-config")
147
144
  # system config file is the same as the current config
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module ProxyConf
3
- VERSION = '2.0.7'
3
+ VERSION = '2.0.8'
4
4
  end
5
5
  end
@@ -72,9 +72,9 @@ describe VagrantPlugins::ProxyConf::Action::ConfigureDockerProxy do
72
72
  docker_proxy = described_class.new(app, env)
73
73
  docker_proxy.instance_variable_set(:@machine, machine)
74
74
 
75
- # #docker_client_config_path mock
75
+ # #docker_client_config mock
76
76
  fixture = docker_proxy.send(:tempfile, load_fixture(fixture)).path
77
- docker_proxy.instance_variable_set(:@docker_client_config_path, fixture)
77
+ docker_proxy.instance_variable_set(:@docker_client_config, fixture)
78
78
 
79
79
  # #supported? mock
80
80
  allow(machine).to receive_message_chain(:guest, :capability?).with(:docker_proxy_conf).and_return(true)
@@ -124,9 +124,9 @@ describe VagrantPlugins::ProxyConf::Action::ConfigureDockerProxy do
124
124
  docker_proxy = described_class.new(app, env)
125
125
  docker_proxy.instance_variable_set(:@machine, machine)
126
126
 
127
- # #docker_client_config_path mock
127
+ # #docker_client_config mock
128
128
  fixture = docker_proxy.send(:tempfile, load_fixture(fixture)).path
129
- docker_proxy.instance_variable_set(:@docker_client_config_path, fixture)
129
+ docker_proxy.instance_variable_set(:@docker_client_config, fixture)
130
130
 
131
131
  # #supported? mock
132
132
  allow(machine).to receive_message_chain(:guest, :capability?).with(:docker_proxy_conf).and_return(true)
@@ -183,7 +183,7 @@ describe VagrantPlugins::ProxyConf::Action::ConfigureDockerProxy do
183
183
  end
184
184
  end
185
185
 
186
- describe "#docker_client_config_path" do
186
+ describe "#docker_client_config" do
187
187
  let(:machine) { double('machine') }
188
188
 
189
189
  context "when not supported" do
@@ -197,7 +197,7 @@ describe VagrantPlugins::ProxyConf::Action::ConfigureDockerProxy do
197
197
  allow(machine).to receive_message_chain(:guest, :capability?).with(:docker_proxy_conf).and_return(true)
198
198
  allow(machine).to receive_message_chain(:guest, :capability).with(:docker_proxy_conf).and_return('/etc/default/docker')
199
199
 
200
- docker_proxy.send(:docker_client_config_path)
200
+ docker_proxy.send(:docker_client_config)
201
201
  end
202
202
 
203
203
  it { is_expected.to eq nil }
@@ -208,7 +208,7 @@ describe VagrantPlugins::ProxyConf::Action::ConfigureDockerProxy do
208
208
  subject do
209
209
  docker_proxy = described_class.new(nil, nil)
210
210
  docker_proxy.instance_variable_set(:@machine, machine)
211
- docker_proxy.instance_variable_set(:@docker_client_config_path, nil)
211
+ docker_proxy.instance_variable_set(:@docker_client_config, nil)
212
212
 
213
213
  allow(docker_proxy).to receive(:supports_config_json?).and_return(true)
214
214
 
@@ -216,27 +216,27 @@ describe VagrantPlugins::ProxyConf::Action::ConfigureDockerProxy do
216
216
  allow(machine).to receive_message_chain(:communicate, :sudo).with("chmod 0644 /etc/docker/config.json")
217
217
  allow(machine).to receive_message_chain(:communicate, :download)
218
218
 
219
- docker_proxy.send(:docker_client_config_path)
219
+ docker_proxy.send(:docker_client_config)
220
220
  end
221
221
 
222
- it { expect(File.exists?(subject)).to eq true }
222
+ it { expect(File.exists?(subject.path)).to eq true }
223
223
  end
224
224
 
225
225
  context "when /etc/docker/config.json does not exist" do
226
226
  subject do
227
227
  docker_proxy = described_class.new(nil, nil)
228
228
  docker_proxy.instance_variable_set(:@machine, machine)
229
- docker_proxy.instance_variable_set(:@docker_client_config_path, nil)
229
+ docker_proxy.instance_variable_set(:@docker_client_config, nil)
230
230
 
231
231
  allow(docker_proxy).to receive(:supports_config_json?).and_return(true)
232
232
 
233
233
  allow(machine).to receive_message_chain(:communicate, :test).with("[ -f /etc/docker/config.json ]").and_return(false)
234
234
 
235
- docker_proxy.send(:docker_client_config_path)
235
+ docker_proxy.send(:docker_client_config)
236
236
  end
237
237
 
238
238
  it do
239
- expect(File.exists?(subject)).to eq true
239
+ expect(File.exists?(subject.path)).to eq true
240
240
  expect(File.read(subject)).to eq "{}"
241
241
  end
242
242
  end
@@ -265,14 +265,14 @@ describe VagrantPlugins::ProxyConf::Action::ConfigureDockerProxy do
265
265
 
266
266
  end
267
267
 
268
- context "when #docker_client_config_path returns nil" do
268
+ context "when #docker_client_config returns nil" do
269
269
  it 'return nil' do
270
270
  docker_proxy = described_class.new(app, env)
271
271
  docker_proxy.instance_variable_set(:@machine, machine)
272
272
 
273
273
  # mock a result that looks like no proxy is configured for the config.json
274
274
  allow(docker_proxy).to receive(:supports_config_json?).and_return(true)
275
- allow(docker_proxy).to receive(:docker_client_config_path).and_return(nil)
275
+ allow(docker_proxy).to receive(:docker_client_config).and_return(nil)
276
276
 
277
277
  # #supported? mock
278
278
  allow(machine).to receive_message_chain(:guest, :capability?).with(:docker_proxy_conf).and_return(true)
@@ -294,7 +294,7 @@ describe VagrantPlugins::ProxyConf::Action::ConfigureDockerProxy do
294
294
  fixture_content = load_fixture(fixture)
295
295
  config_path = docker_proxy.send(:tempfile, fixture_content).path
296
296
 
297
- docker_proxy.instance_variable_set(:@docker_client_config_path, config_path)
297
+ docker_proxy.instance_variable_set(:@docker_client_config, config_path)
298
298
 
299
299
  allow(docker_proxy).to receive(:supports_config_json?).and_return(true)
300
300
  allow(docker_proxy).to receive(:disabled?).and_return(true)
@@ -333,7 +333,7 @@ describe VagrantPlugins::ProxyConf::Action::ConfigureDockerProxy do
333
333
  fixture_content = load_fixture(fixture)
334
334
  config_path = docker_proxy.send(:tempfile, fixture_content).path
335
335
 
336
- docker_proxy.instance_variable_set(:@docker_client_config_path, config_path)
336
+ docker_proxy.instance_variable_set(:@docker_client_config, config_path)
337
337
 
338
338
  allow(docker_proxy).to receive(:supports_config_json?).and_return(true)
339
339
  allow(docker_proxy).to receive(:disabled?).and_return(false)
@@ -392,7 +392,7 @@ describe VagrantPlugins::ProxyConf::Action::ConfigureDockerProxy do
392
392
 
393
393
  fixture = fixture_file("docker_client_config_json_enabled_proxy")
394
394
  config_path = docker_proxy.send(:tempfile, load_fixture(fixture)).path
395
- docker_proxy.instance_variable_set(:@docker_client_config_path, config_path)
395
+ docker_proxy.instance_variable_set(:@docker_client_config, config_path)
396
396
 
397
397
  # to isolate this test, we turn of support for systemd
398
398
  allow(docker_proxy).to receive(:supports_systemd?).and_return(false)
@@ -441,7 +441,7 @@ describe VagrantPlugins::ProxyConf::Action::ConfigureDockerProxy do
441
441
 
442
442
  fixture = fixture_file("docker_client_config_json_enabled_proxy")
443
443
  config_path = docker_proxy.send(:tempfile, load_fixture(fixture)).path
444
- docker_proxy.instance_variable_set(:@docker_client_config_path, config_path)
444
+ docker_proxy.instance_variable_set(:@docker_client_config, config_path)
445
445
 
446
446
  allow(machine).to receive_message_chain(:guest, :capability?).with(:docker_proxy_conf).and_return(true)
447
447
  allow(machine).to receive_message_chain(:guest, :capability).with(:docker_proxy_conf).and_return('/etc/default/docker')
@@ -10,9 +10,9 @@ end
10
10
  describe file('/etc/docker/config.json') do
11
11
  it { should be_file }
12
12
  it { should exist }
13
- it { should be_mode 600 }
13
+ it { should be_mode 644 }
14
14
  it { should be_owned_by "root" }
15
- it { should be_grouped_into "root" }
15
+ it { should be_grouped_into "docker" }
16
16
  end
17
17
 
18
18
  context 'when proxy is enabled' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-proxyconf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.7
4
+ version: 2.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Teemu Matilainen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-14 00:00:00.000000000 Z
11
+ date: 2020-06-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A Vagrant plugin that configures the virtual machine to use proxy servers
14
14
  email:
@@ -25,8 +25,10 @@ files:
25
25
  - Guardfile
26
26
  - Jenkinsfile
27
27
  - LICENSE.txt
28
+ - Makefile
28
29
  - README.md
29
30
  - Rakefile
31
+ - deps/patches/lib/vagrant/bundler.rb.patch
30
32
  - development/.gitignore
31
33
  - development/Dockerfile
32
34
  - development/README.md
@@ -202,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
204
  - !ruby/object:Gem::Version
203
205
  version: '0'
204
206
  requirements: []
205
- rubygems_version: 3.0.6
207
+ rubygems_version: 3.0.3
206
208
  signing_key:
207
209
  specification_version: 4
208
210
  summary: A Vagrant plugin that configures the virtual machine to use proxy servers