vagrant-proxyconf 2.0.2 → 2.0.7

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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +7 -3
  3. data/CHANGELOG.md +137 -1
  4. data/Gemfile +1 -1
  5. data/Jenkinsfile +60 -0
  6. data/README.md +21 -0
  7. data/jenkins/helper_functions +206 -0
  8. data/lib/vagrant-proxyconf/action.rb +5 -8
  9. data/lib/vagrant-proxyconf/action/base.rb +9 -5
  10. data/lib/vagrant-proxyconf/action/configure_docker_proxy.rb +9 -6
  11. data/lib/vagrant-proxyconf/config/apt_proxy.rb +21 -2
  12. data/lib/vagrant-proxyconf/version.rb +1 -1
  13. data/spec/unit/support/shared/apt_proxy_config.rb +12 -0
  14. data/spec/unit/vagrant-proxyconf/action/configure_docker_proxy_spec.rb +5 -3
  15. data/spec/unit/vagrant-proxyconf/action/configure_svn_proxy_spec.rb +1 -0
  16. data/test/issues/172/README.md +2 -2
  17. data/test/issues/172/Vagrantfile +3 -2
  18. data/test/issues/180/spec/docker_host/redhat_spec.rb +2 -2
  19. data/test/issues/192/.rspec +2 -0
  20. data/test/issues/192/Dockerfile +47 -0
  21. data/test/issues/192/Dockerfile.bionic +40 -0
  22. data/test/issues/192/README.md +29 -0
  23. data/test/issues/192/Rakefile +27 -0
  24. data/test/issues/192/Vagrantfile +64 -0
  25. data/test/issues/192/entrypoint.sh +50 -0
  26. data/test/issues/192/spec/default/redhat_spec.rb +15 -0
  27. data/test/issues/192/spec/docker_host/ubuntu_spec.rb +3 -0
  28. data/test/issues/192/spec/spec_helper.rb +52 -0
  29. data/test/issues/192/tinyproxy.conf +333 -0
  30. data/test/issues/199/.rspec +2 -0
  31. data/test/issues/199/Dockerfile +47 -0
  32. data/test/issues/199/README.md +31 -0
  33. data/test/issues/199/Rakefile +27 -0
  34. data/test/issues/199/Vagrantfile +74 -0
  35. data/test/issues/199/entrypoint.sh +50 -0
  36. data/test/issues/199/spec/apt_host/ubuntu_spec.rb +135 -0
  37. data/test/issues/199/spec/default/redhat_spec.rb +15 -0
  38. data/test/issues/199/spec/spec_helper.rb +52 -0
  39. data/test/issues/199/tinyproxy.conf +333 -0
  40. metadata +47 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f389b148d8815b5a0f81a851900dbea47114c3f6b60597107d7815eb6ab0fa9
4
- data.tar.gz: b3f551cedfd75ebb27d06d495b4bffee2e5832a1b45dec1065933b999939ef13
3
+ metadata.gz: '09ccd0a2a51d1de18dc63c8355c6f6d4217faf1d31b470a0de6348c514a5c621'
4
+ data.tar.gz: 6384262695d6fffd759de258efb6c70ddd52a434fb1ead968ea0f0f8aa225ba3
5
5
  SHA512:
6
- metadata.gz: d8a521ab63ab244683f2027ae6dc5902f9f8ff9b08514f3099ff0fcfd9e3f1105a1518fdd924f2fcb57ca53a131a5510cb877eeaefd28b3bef47eab00fe265e6
7
- data.tar.gz: 4cd46b6a73344a8d1ee2fe045d2c398c172298d6fa0c2fbda69785e76999d1748072bbf3cc832433494921b9d27dc19644125414198746cf0e236713f3ac06af
6
+ metadata.gz: df0979eae22816e8a23ebddaf8e0874d0e6b5b8a9ae79e66499cb4bc418e47c300483dd1dc889e6324c7169636d4c4b2cffcfbc67c17e21170b3b178654211ce
7
+ data.tar.gz: ad5f86225dd89c3ce59c2fb50f72b10375e53f1b630de6e28ae53b3f4677507f26114ee991e467408b3c0cc612297cd87284400b2e7cdf50fdcc6007baf21658
data/.travis.yml CHANGED
@@ -1,15 +1,21 @@
1
+ ---
2
+
1
3
  language: ruby
2
4
  cache: bundler
3
5
  sudo: false
4
6
 
5
7
  before_install: ./travis/before_install
8
+ install: bundle install --path .bundle/gems
9
+ script: bundle exec rspec
6
10
  bundler_args: --without=development
7
11
 
8
12
  env:
9
13
  global:
10
14
  - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
11
15
 
12
- rvm: 2.4.4
16
+ rvm:
17
+ - 2.4.4
18
+
13
19
  matrix:
14
20
  include:
15
21
  - env: VAGRANT_VERSION=v2.2.4
@@ -17,8 +23,6 @@ matrix:
17
23
  - env: VAGRANT_VERSION=v2.2.2
18
24
  - env: VAGRANT_VERSION=v2.1.5
19
25
  - env: VAGRANT_VERSION=v2.0.4
20
- - env: VAGRANT_VERSION=v1.9.8
21
- rvm: 2.3.4
22
26
  - env: VAGRANT_VERSION=master
23
27
  allow_failures:
24
28
  - env: VAGRANT_VERSION=master
data/CHANGELOG.md CHANGED
@@ -1,4 +1,140 @@
1
- # 2.0.2 / _Not released yet_
1
+ # 2.0.7 / 2019-11-14
2
+
3
+ This is a bug fix release.
4
+
5
+ - Addresses issues with docker proxy configuration and permissions.
6
+
7
+ #### Closed Issues
8
+
9
+ - https://github.com/tmatilai/vagrant-proxyconf/milestone/3
10
+
11
+
12
+ #### Credits
13
+
14
+ Thank you to these folks how identified the bugs and provided
15
+ workarounds.
16
+
17
+ - @antoinetran
18
+ - @tkang007
19
+
20
+
21
+ # 2.0.6 / 2019-08-09
22
+
23
+ This is a bug fix release addressing a permissions problem with the docker proxy client config.
24
+ The fixes the permissions problem setting /etc/docker/config.json from 0600 to 0644 permissions.
25
+
26
+ #### Credits
27
+
28
+ - Credit to this release goes to @takuto-h.
29
+
30
+ # 2.0.5 / 2019-07-27
31
+
32
+ #### Deprecations:
33
+
34
+ - Dropped support for vagrant 1.9.8 due to our tests failinging and it's more than 2 years old.
35
+
36
+ #### Credits
37
+
38
+ - Credit to this release goes to @greut. Thank you for your detailed information and for reporting a solution.
39
+
40
+ This is a feature enhancement for the APT proxy configuration when using
41
+ a proxy that is terminating SSL. By default, these settings are left
42
+ as-is and only enabled when a user wants to configure these settings.
43
+ This feature supports enabling/disabling the follwoing settings
44
+
45
+ #### file `/etc/apt/apt.conf.d/01proxy`
46
+
47
+ ```
48
+ Acquire::https::Verify-Host
49
+ Acquire::https::Verify-Peer
50
+ ```
51
+
52
+ #### Configuration settings for `Acquire::https::Verify-Host` and `Acquire::https::Verify-Peer`
53
+
54
+ * The value for these settings must be a string.
55
+ * When `"true"` enable the setting
56
+ * When `"false"` disable the setting
57
+ * When `""` this setting is removed.
58
+
59
+ #### Example Inside the Vagrantfile
60
+
61
+ ```
62
+ Vagrant.configure("2") do |config|
63
+
64
+ config.vm.define 'apt_host' do |c|
65
+ c.vm.box = "bento/ubuntu-18.04"
66
+
67
+ if Vagrant.has_plugin?('vagrant-proxyconf')
68
+ c.proxy.http = ENV['HTTP_PROXY']
69
+ c.proxy.https = ENV['HTTPS_PROXY']
70
+ c.proxy.no_proxy = ENV['NO_PROXY']
71
+ c.apt_proxy.verify_host = "false"
72
+ c.apt_proxy.verify_peer = "false"
73
+
74
+ c.proxy.enabled = {
75
+ :apt => {
76
+ :enabled => true,
77
+ :skip => false,
78
+ },
79
+ :env => {
80
+ :enabled => true,
81
+ :skip => false,
82
+ },
83
+ :git => {
84
+ :enabled => true,
85
+ :skip => false,
86
+ }
87
+ }
88
+ end
89
+ end
90
+
91
+ end
92
+ ```
93
+
94
+ #### Example setting the environment variables
95
+
96
+ ```
97
+ export VAGRANT_APT_VERIFY_HOST="false"
98
+ export VAGRANT_APT_VERIFY_PEER="false"
99
+ vagrant up
100
+ vagrant provision
101
+ ```
102
+
103
+ **NOTE** If you change a setting in your `Vagrantfile` and the box is
104
+ running, you can run `vagrant provision` or `vagrant reload` to adjust
105
+ the settings.
106
+
107
+ Supporting Issues:
108
+ - https://github.com/tmatilai/vagrant-proxyconf/issues/199
109
+
110
+ Supporting Integration Tests:
111
+ - Look at the examples in directory [199](test/issues/199/)
112
+
113
+
114
+ # 2.0.4 / 2019-07-24
115
+
116
+ This is a bug fix release to address a logic issue for supporting docker
117
+ versions when attempting to configure a docker proxy.
118
+
119
+
120
+ Bug Fixes:
121
+ - https://github.com/tmatilai/vagrant-proxyconf/issues/197
122
+
123
+ # 2.0.3 / 2019-07-23
124
+
125
+ This is a bug fix release to address systemd and docker issues.
126
+
127
+ Bug Fixes:
128
+ - https://github.com/tmatilai/vagrant-proxyconf/issues/172
129
+
130
+ # 2.0.2 / 2019-07-19
131
+
132
+ This is a bug fix release, please see the issues below for furthe
133
+ details. This fix should address some Docker proxy problems when using
134
+ systemd.
135
+
136
+ Bug Fixes:
137
+ - https://github.com/tmatilai/vagrant-proxyconf/issues/172
2
138
 
3
139
  # 2.0.1 / 2019-03-31
4
140
 
data/Gemfile CHANGED
@@ -19,7 +19,7 @@ end
19
19
 
20
20
  gem 'vagrant',
21
21
  git: 'https://github.com/hashicorp/vagrant.git',
22
- ref: ENV.fetch('VAGRANT_VERSION', 'v2.2.4')
22
+ tag: ENV.fetch('VAGRANT_VERSION', 'v2.2.4')
23
23
 
24
24
  gem 'rake'
25
25
  gem 'rspec', '~> 3.1'
data/Jenkinsfile ADDED
@@ -0,0 +1,60 @@
1
+ pipeline {
2
+
3
+ agent { label 'virtualbox' }
4
+
5
+ options {
6
+ disableConcurrentBuilds()
7
+ }
8
+
9
+ parameters {
10
+
11
+ string(
12
+ name: 'VAGRANT_TEST_ISSUE',
13
+ defaultValue: '180',
14
+ description: 'The test/issues/# where "#" refers to the test environment to invoke'
15
+ )
16
+
17
+ string(
18
+ name: 'DEFAULT_RVM_RUBY',
19
+ defaultValue: '2.4.4',
20
+ description: 'The default ruby to use for RVM'
21
+ )
22
+
23
+ }
24
+
25
+ stages {
26
+
27
+ stage('test') {
28
+
29
+ environment {
30
+ VAGRANT_TEST_ISSUE = "${params.VAGRANT_TEST_ISSUE}"
31
+ DEFAULT_RVM_RUBY = "${params.DEFAULT_RVM_RUBY}"
32
+ }
33
+
34
+ steps {
35
+ timestamps {
36
+ ansiColor('xterm') {
37
+
38
+ dir("${WORKSPACE}") {
39
+
40
+ sh '''#!/usr/bin/env bash -l
41
+
42
+ set +x
43
+ tty
44
+ . jenkins/helper_functions
45
+
46
+ setup_test_env
47
+
48
+ set -e
49
+ run_all_tests
50
+
51
+ '''
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+
58
+ } // stages
59
+
60
+ }
data/README.md CHANGED
@@ -237,6 +237,8 @@ VAGRANT_APT_HTTP_PROXY="http://proxy.example.com:8080" vagrant up
237
237
  | apt | `VAGRANT_APT_HTTP_PROXY` | Configures APT http proxy | Highest |
238
238
  | | `VAGRANT_APT_HTTPS_PROXY` | Configures APT https proxy | Highest |
239
239
  | | `VAGRANT_APT_FTP_PROXY` | Configures APT ftp proxy | Highest |
240
+ | | `VAGRANT_APT_VERIFY_PEER` | Configures APT Verify-Peer | Highest |
241
+ | | `VAGRANT_APT_VERIFY_HOST` | Configures APT Verify-Host | Highest |
240
242
  | chef | `VAGRANT_CHEF_HTTP_PROXY` | Configures CHEF http proxy | Highest |
241
243
  | | `VAGRANT_CHEF_HTTPS_PROXY` | Configures CHEF https proxy | Highest |
242
244
  | | `VAGRANT_CHEF_NO_PROXY` | Configures CHEF no proxy | Highest |
@@ -330,3 +332,22 @@ unless ENV.key?('VAGRANT_INSTALLER_EMBEDDED_DIR')
330
332
  end
331
333
  end
332
334
  ```
335
+
336
+ # Contributors
337
+
338
+ * @tmatilai
339
+ * @otahi
340
+ * @jperville
341
+ * @johnbellone
342
+ * @SaschaGuenther
343
+ * @mrsheepuk
344
+ * @vboerchers
345
+ * @rlaveycal
346
+ * @pomeh
347
+ * @mynamewastaken
348
+ * @lawsonj2019
349
+ * @jonekdahl
350
+ * @hexmode
351
+ * @craigmunro
352
+ * @greut
353
+ * @codylane
@@ -0,0 +1,206 @@
1
+ #!/usr/bin/env bash
2
+
3
+ DEFAULT_RVM_RUBY="${DEFAULT_RVM_RUBY:-2.4.4}"
4
+
5
+ RVM_HOME_DIR="${RVM_HOME_DIR:-${HOME}/.rvm/scripts/rvm}"
6
+
7
+ VAGRANT_TEST_ISSUE="${VAGRANT_TEST_ISSUE:-180}"
8
+
9
+ err() {
10
+
11
+ echo "ERR: $* exiting" >&2
12
+
13
+ reset_docker_perms || true
14
+
15
+ exit 1
16
+
17
+ }
18
+
19
+
20
+ bundle_exec() {
21
+
22
+ local run_dir="test/issues/${VAGRANT_TEST_ISSUE}"
23
+
24
+ pushd "${run_dir}" || err "The directory: '${run_dir}' does not exist" && true
25
+
26
+ bundle exec $@
27
+
28
+ popd >>/dev/null 2>&1
29
+
30
+ }
31
+
32
+
33
+ enable_rvm_ruby() {
34
+
35
+ local ruby_version="${1:-${DEFAULT_RVM_RUBY}}"
36
+
37
+ shift
38
+ local persist="${1:-persist}"
39
+
40
+
41
+ [ -f "${RVM_HOME_DIR}" ] && . "${RVM_HOME_DIR}" >> /dev/null || true
42
+
43
+ rvm use "ruby-${ruby_version}" || err "Unable to switch to ruby ${ruby_version}"
44
+
45
+ [ -z "${persist}" ] || echo "${DEFAULT_RVM_RUBY}" > .ruby-version
46
+
47
+ }
48
+
49
+
50
+ enable_rbenv_ruby() {
51
+
52
+ local ruby_version="${1:-${DEFAULT_RVM_RUBY}}"
53
+
54
+ shift
55
+ local persist="${1:-persist}"
56
+
57
+ eval "$(rbenv init -)"
58
+
59
+ rbenv_install "${DEFAULT_RVM_RUBY}"
60
+
61
+ if [ -n "${persist}" ]; then
62
+
63
+ echo "${DEFAULT_RVM_RUBY}" > .ruby-version
64
+
65
+ rbenv shell "${DEFAULT_RVM_RUBY}"
66
+
67
+ fi
68
+
69
+ rbenv versions
70
+
71
+ }
72
+
73
+ rbenv_install() {
74
+
75
+ rbenv versions | grep -q "${1}" || rbenv install "${1}"
76
+
77
+ }
78
+
79
+ vagrant_cmd() {
80
+
81
+ bundle_exec vagrant $@
82
+
83
+ }
84
+
85
+
86
+ install_gems() {
87
+
88
+ command -v bundle >>/dev/null 2>&1 || gem install bundler --no-doc
89
+ command -v rake >>/dev/null 2>&1 || gem install rake --no-doc
90
+
91
+ gem update --system --no-doc || err "Updating system gems"
92
+
93
+ rm -f Gemfile.lock
94
+ bundle install --path .bundle/gems
95
+
96
+ }
97
+
98
+
99
+ install_from_gemfile() {
100
+
101
+ [ -d ".bundle/gems" ] || install_gems
102
+
103
+ }
104
+
105
+
106
+ run_all_tests() {
107
+
108
+ set -e
109
+
110
+ vagrant_cmd status
111
+ bundle_exec rake spec
112
+
113
+ set +e
114
+
115
+ }
116
+
117
+
118
+ setup_test_env() {
119
+
120
+ set -e
121
+
122
+ whoami
123
+ env
124
+
125
+ ruby -v
126
+ gem list
127
+
128
+ install_from_gemfile
129
+
130
+ bundle show
131
+
132
+ update_docker_perms
133
+
134
+ vagrant_cmd plugin repair || true
135
+ vagrant_cmd status
136
+ vagrant_cmd up || err "Starting the virtual machine"
137
+ vagrant_cmd provision || err "Attempting to provision the virtual machine"
138
+
139
+ reset_docker_perms
140
+
141
+ set +e
142
+
143
+ }
144
+
145
+
146
+ reset_docker_perms() {
147
+
148
+ [ -L /var/run/docker.sock ] && sudo chmod 0770 "$(readlink /var/run/docker.sock)" || true
149
+
150
+ }
151
+
152
+ update_docker_perms() {
153
+
154
+ [ -L /var/run/docker.sock ] && sudo chmod 6770 "$(readlink /var/run/docker.sock)" || true
155
+
156
+ }
157
+
158
+
159
+ is_container_running() {
160
+
161
+ CONTAINER_ID=$(docker ps -a | grep ':8888' | awk '{print $1}')
162
+
163
+ [ -z "${CONTAINER_ID}" ] && return 0
164
+
165
+ echo "${CONTAINER_ID}"
166
+ return 1
167
+
168
+ }
169
+
170
+
171
+ initialize() {
172
+ reset_docker_perms
173
+
174
+ OS_TYPE="$(uname -s 2>>/dev/null)"
175
+
176
+ case "${OS_TYPE}" in
177
+
178
+ Darwin)
179
+ HOME_DIR_PREFIX="/Users"
180
+ ;;
181
+
182
+ *)
183
+ HOME_DIR_PREFIX="/home"
184
+ ;;
185
+
186
+ esac
187
+
188
+ [ -f ${HOME_DIR_PREFIX}/jenkins/.bash_profile ] && . ${HOME_DIR_PREFIX}/jenkins/.bash_profile || true
189
+ [ -f ${HOME_DIR_PREFIX}/jenkins/.bashrc ] && . ${HOME_DIR_PREFIX}/jenkins/.bashrc || true
190
+
191
+ command -v rvm >>/dev/null 2>&1 && enable_rvm_ruby "${DEFAULT_RVM_RUBY}" "persist" || true
192
+ command -v rbenv >>/dev/null 2>&1 && enable_rbenv_ruby "${DEFAULT_RVM_RUBY}" "persist" || true
193
+
194
+ command -v docker || err "Docker must be installed on this host."
195
+ command -v bsdtar || err "Please install bsdtar"
196
+
197
+ id
198
+ groups
199
+
200
+ CONTAINER_ID=$(is_container_running)
201
+ [ $? -ne 0 ] && docker rm -vf "${CONTAINER_ID}"
202
+
203
+ reset_docker_perms
204
+ }
205
+
206
+ initialize