vagrant-proxyconf 1.3.0 → 1.3.1

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: 535eb21da37db3d2eebc8a1f785ae2df92159587
4
- data.tar.gz: 09ed302efc15a97f3cee9f2eb89e657d055d40ad
3
+ metadata.gz: fab817ae04277d81b46ac3d3a524347a75d5ec7b
4
+ data.tar.gz: 8600468a7b7f912dca91810e2bddab0fc026fbc0
5
5
  SHA512:
6
- metadata.gz: b050cb3414bf569dc1938b0cdf631beb2285d00c560621cc93a2a8515240ca2c047e44e74103c1524bfba5e138159cb19a269c4a2f4f63fdea4b4869165152e4
7
- data.tar.gz: aea65b32cade44afe71f626c81e8efa7aa165bd2a3a534d47b62b23576fdc52e34b8bf33fc106a8a9996758c06bd9a9126a82ac66a3351d17f88f3174ad53db3
6
+ metadata.gz: d3c28090c36f9e0510d75a8b5200b85603d99831d99362ddb11dcd78eea73ba8ee916691641453c1cda2cd207d1cc96be36b29b1de21126c08640f1d179418d8
7
+ data.tar.gz: e7a8e0903824e9c43015287de451c0b451051f553825a4b3056a9d5a61ba5f9043394f95e85e5b96be4661b316b3211e8827826309d2ef0c66e658994e134854
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 1.3.1 / 2014-05-09
2
+
3
+ Improvements:
4
+
5
+ - Write environment variable configuration also to /etc/environment on Linux ([GH-58][], [GH-67][])
6
+ * Fixes compatibility with vagrant-omnibus and non-login shells
7
+
1
8
  # 1.3.0 / 2014-05-02
2
9
 
3
10
  Features:
@@ -151,7 +158,9 @@ Bug fixes:
151
158
  [GH-50]: https://github.com/tmatilai/vagrant-proxyconf/issues/50 "Issue 50"
152
159
  [GH-51]: https://github.com/tmatilai/vagrant-proxyconf/issues/51 "Issue 51"
153
160
  [GH-57]: https://github.com/tmatilai/vagrant-proxyconf/issues/57 "Issue 57"
161
+ [GH-58]: https://github.com/tmatilai/vagrant-proxyconf/issues/58 "Issue 58"
154
162
  [GH-59]: https://github.com/tmatilai/vagrant-proxyconf/issues/59 "Issue 59"
155
163
  [GH-60]: https://github.com/tmatilai/vagrant-proxyconf/issues/60 "Issue 60"
156
164
  [GH-62]: https://github.com/tmatilai/vagrant-proxyconf/issues/62 "Issue 62"
157
165
  [GH-63]: https://github.com/tmatilai/vagrant-proxyconf/issues/63 "Issue 63"
166
+ [GH-67]: https://github.com/tmatilai/vagrant-proxyconf/issues/67 "Issue 67"
data/Gemfile CHANGED
@@ -1,10 +1,8 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gemspec
4
-
5
3
  gem 'vagrant',
6
4
  git: 'https://github.com/mitchellh/vagrant.git',
7
- ref: ENV.fetch('VAGRANT_VERSION', 'v1.4.3')
5
+ ref: ENV.fetch('VAGRANT_VERSION', 'v1.5.4')
8
6
 
9
7
  gem 'cane', '~> 2.6'
10
8
  gem 'coveralls', require: false
@@ -17,3 +15,7 @@ group :development do
17
15
  gem 'redcarpet'
18
16
  gem 'yard', '~> 0.8'
19
17
  end
18
+
19
+ group :plugins do
20
+ gem 'vagrant-proxyconf', path: '.'
21
+ end
data/README.md CHANGED
@@ -75,7 +75,7 @@ It is a good practise to wrap plugin specific configuration with `Vagrant.has_pl
75
75
 
76
76
  It's a common case that you want all possible connections to pass through the same proxy. This will set the default values for all other proxy configuration keys. It also sets default proxy configuration for all Chef Solo and Chef Client provisioners.
77
77
 
78
- Many programs (wget, curl, yum, etc.) can be configured to use proxies with `http_proxy` or `HTTP_PROXY` etc. environment variables. This configuration will be written to _/etc/profile.d/proxy.sh_ on the guest.
78
+ Many programs (wget, curl, yum, etc.) can be configured to use proxies with `http_proxy` or `HTTP_PROXY` etc. environment variables. This configuration will be written to _/etc/profile.d/proxy.sh_ and _/etc/environment_ on the guest.
79
79
 
80
80
  Also sudo will be configured to preserve the variables. This requires that sudo in the VM is configured to support "sudoers.d", i.e. _/etc/sudoers_ contains line `#includedir /etc/sudoers.d`.
81
81
 
@@ -19,6 +19,7 @@ module VagrantPlugins
19
19
  logger.info('Writing the proxy configuration to files')
20
20
  super
21
21
  write_config(sudo_config, path: '/etc/sudoers.d/proxy', mode: '0440')
22
+ write_environment_config
22
23
  end
23
24
  end
24
25
 
@@ -29,13 +30,6 @@ module VagrantPlugins
29
30
  set_windows_proxy('no_proxy', config.no_proxy)
30
31
  end
31
32
 
32
- def sudo_config
33
- <<-CONFIG.gsub(/^\s+/, '')
34
- Defaults env_keep += "HTTP_PROXY HTTPS_PROXY FTP_PROXY NO_PROXY"
35
- Defaults env_keep += "http_proxy https_proxy ftp_proxy no_proxy"
36
- CONFIG
37
- end
38
-
39
33
  def set_windows_proxy(key, value)
40
34
  if value
41
35
  command = "cmd.exe /c SETX #{key} #{value.inspect} /M"
@@ -50,6 +44,58 @@ module VagrantPlugins
50
44
  @machine.config.vm.guest.eql?(:windows)
51
45
  end
52
46
 
47
+ def sudo_config
48
+ <<-CONFIG.gsub(/^\s+/, '')
49
+ Defaults env_keep += "HTTP_PROXY HTTPS_PROXY FTP_PROXY NO_PROXY"
50
+ Defaults env_keep += "http_proxy https_proxy ftp_proxy no_proxy"
51
+ CONFIG
52
+ end
53
+
54
+ def write_environment_config
55
+ tmp = "/tmp/vagrant-proxyconf"
56
+ path = "/etc/environment"
57
+
58
+ sed_script = environment_sed_script
59
+ local_tmp = tempfile(environment_config)
60
+
61
+ @machine.communicate.tap do |comm|
62
+ comm.sudo("rm #{tmp}", error_check: false)
63
+ comm.upload(local_tmp.path, tmp)
64
+ comm.sudo("touch #{path}")
65
+ comm.sudo("sed -e '#{sed_script}' #{path} > #{path}.new")
66
+ comm.sudo("cat #{tmp} >> #{path}.new")
67
+ comm.sudo("chmod 0644 #{path}.new")
68
+ comm.sudo("chown root:root #{path}.new")
69
+ comm.sudo("mv #{path}.new #{path}")
70
+ comm.sudo("rm #{tmp}")
71
+ end
72
+ end
73
+
74
+ def environment_sed_script
75
+ <<-SED.gsub(/^\s+/, '')
76
+ /^HTTP_PROXY=/ d
77
+ /^HTTPS_PROXY=/ d
78
+ /^FTP_PROXY=/ d
79
+ /^NO_PROXY=/ d
80
+ /^http_proxy=/ d
81
+ /^https_proxy=/ d
82
+ /^ftp_proxy=/ d
83
+ /^no_proxy=/ d
84
+ SED
85
+ end
86
+
87
+ def environment_config
88
+ <<-CONFIG.gsub(/^\s+/, '')
89
+ HTTP_PROXY=#{config.http}
90
+ HTTPS_PROXY=#{config.https}
91
+ FTP_PROXY=#{config.ftp}
92
+ NO_PROXY=#{config.no_proxy}
93
+ http_proxy=#{config.http}
94
+ https_proxy=#{config.https}
95
+ ftp_proxy=#{config.ftp}
96
+ no_proxy=#{config.no_proxy}
97
+ CONFIG
98
+ end
53
99
  end
54
100
  end
55
101
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module ProxyConf
3
- VERSION = '1.3.0'
3
+ VERSION = '1.3.1'
4
4
  end
5
5
  end
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: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Teemu Matilainen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-02 00:00:00.000000000 Z
11
+ date: 2014-05-09 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: