vagrant-proxyconf 1.5.2 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.travis.yml +11 -14
- data/CHANGELOG.md +38 -0
- data/Gemfile +28 -7
- data/LICENSE.txt +1 -1
- data/README.md +147 -18
- data/Rakefile +1 -27
- data/development/Dockerfile +45 -0
- data/development/README.md +2 -0
- data/development/Vagrantfile.example +185 -9
- data/development/install-c7.sh +46 -0
- data/development/install-debian.sh +55 -0
- data/development/tinyproxy.conf +333 -0
- data/lib/vagrant-proxyconf/action.rb +15 -7
- data/lib/vagrant-proxyconf/action/base.rb +47 -5
- data/lib/vagrant-proxyconf/action/configure_apt_proxy.rb +17 -0
- data/lib/vagrant-proxyconf/action/configure_chef_proxy.rb +32 -27
- data/lib/vagrant-proxyconf/action/configure_docker_proxy.rb +132 -14
- data/lib/vagrant-proxyconf/action/configure_env_proxy.rb +58 -11
- data/lib/vagrant-proxyconf/action/configure_git_proxy.rb +25 -9
- data/lib/vagrant-proxyconf/action/configure_npm_proxy.rb +14 -6
- data/lib/vagrant-proxyconf/action/configure_pear_proxy.rb +15 -8
- data/lib/vagrant-proxyconf/action/configure_svn_proxy.rb +15 -8
- data/lib/vagrant-proxyconf/action/configure_yum_proxy.rb +16 -0
- data/lib/vagrant-proxyconf/action/is_enabled.rb +18 -1
- data/lib/vagrant-proxyconf/cap/linux/chef_proxy_conf.rb +17 -0
- data/lib/vagrant-proxyconf/cap/linux/docker_proxy_conf.rb +2 -1
- data/lib/vagrant-proxyconf/cap/linux/yum_proxy_conf.rb +19 -0
- data/lib/vagrant-proxyconf/cap/util.rb +4 -5
- data/lib/vagrant-proxyconf/capability.rb +10 -0
- data/lib/vagrant-proxyconf/config.rb +20 -0
- data/lib/vagrant-proxyconf/config/chef_proxy.rb +25 -0
- data/lib/vagrant-proxyconf/config/docker_proxy.rb +25 -0
- data/lib/vagrant-proxyconf/config/git_proxy.rb +3 -0
- data/lib/vagrant-proxyconf/config/npm_proxy.rb +25 -0
- data/lib/vagrant-proxyconf/config/pear_proxy.rb +19 -0
- data/lib/vagrant-proxyconf/version.rb +1 -1
- data/locales/en.yml +38 -0
- data/resources/yum_config.awk +1 -0
- data/spec/spec_helper.rb +27 -9
- data/spec/unit/fixtures/docker_client_config_json_enabled_proxy +9 -0
- data/spec/unit/fixtures/docker_client_config_json_no_proxy +5 -0
- data/spec/unit/fixtures/etc_environment_only_http_proxy.conf +9 -0
- data/spec/unit/fixtures/yum_with_repository_and_proxy_containing_special_chars.conf +10 -0
- data/spec/unit/vagrant-proxyconf/action/base_spec.rb +191 -0
- data/spec/unit/vagrant-proxyconf/action/configure_apt_proxy_spec.rb +162 -0
- data/spec/unit/vagrant-proxyconf/action/configure_chef_proxy_spec.rb +32 -0
- data/spec/unit/vagrant-proxyconf/action/configure_docker_proxy_spec.rb +491 -0
- data/spec/unit/vagrant-proxyconf/action/configure_env_proxy_spec.rb +105 -4
- data/spec/unit/vagrant-proxyconf/action/configure_git_proxy_spec.rb +116 -0
- data/spec/unit/vagrant-proxyconf/action/configure_npm_proxy_spec.rb +67 -0
- data/spec/unit/vagrant-proxyconf/action/configure_pear_proxy_spec.rb +116 -0
- data/spec/unit/vagrant-proxyconf/action/configure_svn_proxy_spec.rb +85 -0
- data/spec/unit/vagrant-proxyconf/action/configure_yum_proxy_spec.rb +100 -0
- data/spec/unit/vagrant-proxyconf/action/is_enabled_spec.rb +162 -12
- data/spec/unit/vagrant-proxyconf/cap/linux/docker_proxy_conf_spec.rb +1 -1
- data/spec/unit/vagrant-proxyconf/cap/util_spec.rb +2 -2
- data/spec/unit/vagrant-proxyconf/config/key_mixin_spec.rb +1 -1
- data/spec/unit/vagrant-proxyconf/resources/yum_config_spec.rb +14 -0
- data/test/issues/180/.rspec +2 -0
- data/test/issues/180/Dockerfile +47 -0
- data/test/issues/180/README.md +31 -0
- data/test/issues/180/Rakefile +27 -0
- data/test/issues/180/Vagrantfile +31 -0
- data/test/issues/180/entrypoint.sh +50 -0
- data/test/issues/180/spec/default/redhat_spec.rb +15 -0
- data/test/issues/180/spec/docker_host/redhat_spec.rb +165 -0
- data/test/issues/180/spec/spec_helper.rb +43 -0
- data/test/issues/180/tinyproxy.conf +333 -0
- data/travis/before_install +26 -0
- metadata +44 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89c3334da0f5ca851a92f23dc388327d47dee03a
|
4
|
+
data.tar.gz: 743404cd2300188be2c8fccf0dda4894b2ba8523
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2298453a51c191d77e4b927ac5be44d4d15aff00fce6a14a4c532dfb85587f7686966ae374f538583fb3ece529724990e902be06af337979f54b0cf3af5c70af
|
7
|
+
data.tar.gz: 375908939f9f242efcd9d4e3b41a610017be5b9e55680d4e09b71620561f55750d0de9508b257c7c8c271881835f28703d3ecfb6113bdbd9922ffd6f14bec728
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -2,24 +2,21 @@ language: ruby
|
|
2
2
|
cache: bundler
|
3
3
|
sudo: false
|
4
4
|
|
5
|
-
before_install:
|
6
|
-
- rvm @global do gem uninstall bundler --all --executables
|
7
|
-
- gem uninstall bundler --all --executables
|
8
|
-
- gem install bundler --version '~> 1.5.2'
|
9
|
-
- bundle --version
|
5
|
+
before_install: ./travis/before_install
|
10
6
|
bundler_args: --without=development
|
11
7
|
|
12
|
-
|
13
|
-
|
8
|
+
env:
|
9
|
+
global:
|
10
|
+
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
11
|
+
|
12
|
+
rvm: 2.4.4
|
14
13
|
matrix:
|
15
14
|
include:
|
16
|
-
- env: VAGRANT_VERSION=
|
17
|
-
- env: VAGRANT_VERSION=
|
18
|
-
- env: VAGRANT_VERSION=
|
19
|
-
- env: VAGRANT_VERSION=v1.
|
20
|
-
rvm:
|
21
|
-
- env: VAGRANT_VERSION=v1.2.7
|
22
|
-
rvm: 1.9.3
|
15
|
+
- env: VAGRANT_VERSION=v2.2.2
|
16
|
+
- env: VAGRANT_VERSION=v2.1.5
|
17
|
+
- env: VAGRANT_VERSION=v2.0.4
|
18
|
+
- env: VAGRANT_VERSION=v1.9.8
|
19
|
+
rvm: 2.3.4
|
23
20
|
- env: VAGRANT_VERSION=master
|
24
21
|
allow_failures:
|
25
22
|
- env: VAGRANT_VERSION=master
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,41 @@
|
|
1
|
+
# 2.0.2 / _Not released yet_
|
2
|
+
|
3
|
+
# 2.0.1 / 2019-03-31
|
4
|
+
|
5
|
+
Improvements:
|
6
|
+
|
7
|
+
- Check for existence of HTTP_PROXY and HTTPS_PROXY environment variables.
|
8
|
+
If neither are set this plugin is automatically disabled.
|
9
|
+
- Correctly uses the Tempfile pattern now via commit. 8ee2a2bb146aeb9fb1b27c80814e9000eff34aa1
|
10
|
+
|
11
|
+
Bug fixes:
|
12
|
+
- Docker proxy conf not set the first time the provisioner is used (trusty64) - #155
|
13
|
+
- Proxy doesn't work for Docker with systemd - #172
|
14
|
+
- Provisioning of docker fails - #180
|
15
|
+
- Docker provider: Guest-specific operations were attempted on a machine that is not ready for guest communication. - #181
|
16
|
+
- Provisioning of docker fails issue 180. - #182
|
17
|
+
- vagrant-proxyconf running on Win10 and provisioning with Docker. - #186
|
18
|
+
- Cannot force to write but without configuration. - #188
|
19
|
+
|
20
|
+
# 2.0.0 / 2019-01-03
|
21
|
+
|
22
|
+
Improvements:
|
23
|
+
|
24
|
+
- Significant refactor to support disabling a proxy. Now when `config.proxy.enabled = false` all supporting proxies will be uncofigured.
|
25
|
+
- Added new tests for new features.
|
26
|
+
- Updated README.md to reflect new behavior.
|
27
|
+
- Cleaned up travis builds to support newere versions of vagrant.
|
28
|
+
|
29
|
+
Features:
|
30
|
+
- Added new configuration parameter for `skipping` configuring a disabled or enabled proxy.
|
31
|
+
|
32
|
+
Bug Fixes:
|
33
|
+
|
34
|
+
- Disable proxy settings in provisioned box ([GH-167][])
|
35
|
+
- unable to disable proxy for chef provisioners ([GH-118][])
|
36
|
+
- Proxy remains enabled after updating config ([GH-87][])
|
37
|
+
|
38
|
+
|
1
39
|
# 1.5.2 / 2015-10-01
|
2
40
|
|
3
41
|
Improvements:
|
data/Gemfile
CHANGED
@@ -1,22 +1,43 @@
|
|
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
|
+
|
3
20
|
gem 'vagrant',
|
4
|
-
|
5
|
-
|
21
|
+
git: 'https://github.com/mitchellh/vagrant.git',
|
22
|
+
ref: ENV.fetch('VAGRANT_VERSION', 'v2.2.2')
|
6
23
|
|
7
|
-
gem 'cane', '~> 2.6'
|
8
|
-
gem 'coveralls', require: false
|
9
24
|
gem 'rake'
|
10
25
|
gem 'rspec', '~> 3.1'
|
11
26
|
gem 'rspec-its', '~> 1.0'
|
12
|
-
gem 'tailor', '~> 1.4'
|
13
27
|
|
14
28
|
group :development do
|
15
29
|
gem 'guard-rspec'
|
30
|
+
gem 'pry'
|
31
|
+
gem 'rb-readline'
|
16
32
|
gem 'redcarpet'
|
17
|
-
gem '
|
33
|
+
gem 'serverspec'
|
34
|
+
gem 'yard', '~> 0.9.11'
|
18
35
|
end
|
19
36
|
|
37
|
+
# when testing our plugin we need to make sure some vagrant plugins are installed
|
38
|
+
# however, the syntax `Vagrant.require_plugin 'vagrant-proxyconf' was deprecated
|
39
|
+
# and this is the future for using testing vagrant behind bundler.
|
40
|
+
# https://stackoverflow.com/questions/19492738/demand-a-vagrant-plugin-within-the-vagrantfile
|
20
41
|
group :plugins do
|
21
|
-
gem 'vagrant-proxyconf', path:
|
42
|
+
gem 'vagrant-proxyconf', path: __dir__
|
22
43
|
end
|
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License
|
2
2
|
|
3
|
-
Copyright (c) 2013-
|
3
|
+
Copyright (c) 2013-2017 Teemu Matilainen <teemu.matilainen@iki.fi>
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -1,18 +1,11 @@
|
|
1
1
|
# Proxy Configuration Plugin for Vagrant
|
2
2
|
|
3
3
|
<span class="badges">
|
4
|
-
[![Gem Version](https://badge.fury.io/rb/vagrant-proxyconf.png)][gem]
|
5
|
-
[![Build Status](https://travis-ci.org/tmatilai/vagrant-proxyconf.png?branch=master)][travis]
|
6
|
-
[![Dependency Status](https://gemnasium.com/tmatilai/vagrant-proxyconf.png)][gemnasium]
|
7
|
-
[![Code Climate](https://codeclimate.com/github/tmatilai/vagrant-proxyconf.png)][codeclimate]
|
8
|
-
[![Coverage Status](https://coveralls.io/repos/tmatilai/vagrant-proxyconf/badge.png)][coveralls]
|
9
|
-
</span>
|
10
4
|
|
11
|
-
[
|
12
|
-
[travis]
|
13
|
-
|
14
|
-
|
15
|
-
[coveralls]: https://coveralls.io/r/tmatilai/vagrant-proxyconf
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/vagrant-proxyconf.png)](https://rubygems.org/gems/vagrant-proxyconf)
|
6
|
+
[![Build Status](https://travis-ci.org/tmatilai/vagrant-proxyconf.svg?branch=master)](https://travis-ci.org/tmatilai/vagrant-proxyconf)
|
7
|
+
|
8
|
+
</span>
|
16
9
|
|
17
10
|
A [Vagrant](http://www.vagrantup.com/) plugin that configures the virtual machine to use specified proxies. This is useful for example in case you are behind a corporate proxy server, or you have a caching proxy (for example [polipo](https://github.com/tmatilai/polipo-box)).
|
18
11
|
|
@@ -125,12 +118,12 @@ VAGRANT_HTTP_PROXY="http://proxy.example.com:8080" vagrant up
|
|
125
118
|
|
126
119
|
### Disabling the plugin
|
127
120
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
121
|
+
New Behavior Warning: Setting the plugin to disabled now unconfigures all or specific proxies.
|
122
|
+
|
123
|
+
The plugin can be disabled by setting `config.proxy.enabled` to `false` or empty string (`""`).
|
124
|
+
This can be also be used to disable a proxy for some provider.
|
125
|
+
Specific applications can be disabled by setting `config.proxy.enabled` to
|
126
|
+
a hash( like `{ svn: false }` or `{ svn: {enabled: false} }`).
|
134
127
|
|
135
128
|
```ruby
|
136
129
|
config.proxy.enabled # => all applications enabled(default)
|
@@ -141,6 +134,53 @@ config.proxy.enabled = "" # => all applications disabled
|
|
141
134
|
config.proxy.enabled = false # => all applications disabled
|
142
135
|
```
|
143
136
|
|
137
|
+
### Skipping the plugin
|
138
|
+
|
139
|
+
The plugin can also be skipped from applying/removing the proxy configuration for a specific provider.
|
140
|
+
|
141
|
+
#### When the plugin is disabled as in the following example:
|
142
|
+
|
143
|
+
```
|
144
|
+
{
|
145
|
+
:apt => {
|
146
|
+
:enabled => false,
|
147
|
+
:skip => true,
|
148
|
+
},
|
149
|
+
:svn => {
|
150
|
+
:enabled => false,
|
151
|
+
:skip => true,
|
152
|
+
},
|
153
|
+
}
|
154
|
+
```
|
155
|
+
|
156
|
+
The plugin is disabled, but `skip = true` means that no proxy configuration will be removed so the system
|
157
|
+
will remain in it's most recent state. This can be useful if you just want to skip over specific provider
|
158
|
+
being configured or unconfigured.
|
159
|
+
|
160
|
+
|
161
|
+
#### When the plugin is enabled as in the following example:
|
162
|
+
|
163
|
+
```
|
164
|
+
{
|
165
|
+
:apt => {
|
166
|
+
:enabled => true,
|
167
|
+
:skip => false,
|
168
|
+
},
|
169
|
+
:svn => {
|
170
|
+
:enabled => true,
|
171
|
+
:skip => true,
|
172
|
+
},
|
173
|
+
}
|
174
|
+
```
|
175
|
+
|
176
|
+
The plugin is enabled, but `skip = true` means that no proxy configuration will be applied so the system
|
177
|
+
will remain in it's most recent state. This can be useful if you just want to skip over specific provider
|
178
|
+
being configured or unconfigured.
|
179
|
+
|
180
|
+
In the example above the `apt` proxy will be enabled and proxy configuration will be applied, but the
|
181
|
+
`svn` proxy even though it's enabled will be skipped.
|
182
|
+
|
183
|
+
|
144
184
|
#### Example Vagrantfile
|
145
185
|
|
146
186
|
```ruby
|
@@ -186,12 +226,36 @@ end
|
|
186
226
|
#### Environment variables
|
187
227
|
These also override the Vagrantfile configuration. To disable or remove the proxy use "DIRECT" or an empty value.
|
188
228
|
|
189
|
-
For example to spin up a VM, run:
|
229
|
+
For example to spin up a VM and set the APT proxy to `http://proxy.example.com:8080, run:
|
190
230
|
|
191
231
|
```sh
|
192
232
|
VAGRANT_APT_HTTP_PROXY="http://proxy.example.com:8080" vagrant up
|
193
233
|
```
|
194
234
|
|
235
|
+
| Provider | Environment Variable | Descrption | Precendence |
|
236
|
+
|-----------|------------------------------|-------------------------------|-------------|
|
237
|
+
| apt | `VAGRANT_APT_HTTP_PROXY` | Configures APT http proxy | Highest |
|
238
|
+
| | `VAGRANT_APT_HTTPS_PROXY` | Configures APT https proxy | Highest |
|
239
|
+
| | `VAGRANT_APT_FTP_PROXY` | Configures APT ftp proxy | Highest |
|
240
|
+
| chef | `VAGRANT_CHEF_HTTP_PROXY` | Configures CHEF http proxy | Highest |
|
241
|
+
| | `VAGRANT_CHEF_HTTPS_PROXY` | Configures CHEF https proxy | Highest |
|
242
|
+
| | `VAGRANT_CHEF_NO_PROXY` | Configures CHEF no proxy | Highest |
|
243
|
+
| docker | `VAGRANT_DOCKER_HTTP_PROXY` | Configuers DOCKER http proxy | Highest |
|
244
|
+
| | `VAGRANT_DOCKER_HTTPS_PROXY` | Configures DOCKER https proxy | Highest |
|
245
|
+
| | `VAGRANT_DOCKER_NO_PROXY` | Configures DOCKER no proxy | Highest |
|
246
|
+
| env | `VAGRANT_ENV_HTTP_PROXY` | Configures ENV http proxy | Highest |
|
247
|
+
| | `VAGRANT_ENV_HTTPS_PROXY` | Configures ENV https proxy | Highest |
|
248
|
+
| | `VAGRANT_ENV_FTP_PROXY` | Configures ENV FTP proxy | Highest |
|
249
|
+
| | `VAGRANT_ENV_NO_PROXY` | Configures ENV no proxy | Highest |
|
250
|
+
| git | `VAGRANT_GIT_HTTP_PROXY` | Configures GIT http proxy | Highest |
|
251
|
+
| | `VAGRANT_GIT_HTTPS_PROXY` | Configures GIT https proxy | Highest |
|
252
|
+
| npm | `VAGRANT_NPM_HTTP_PROXY` | Configures NPM http proxy | Highest |
|
253
|
+
| | `VAGRANT_NPM_HTTPS_PROXY` | Configures NPM https proxy | Highest |
|
254
|
+
| | `VAGRANT_NPM_NO_PROXY` | Configures NPM no proxy | Highest |
|
255
|
+
| pear | `VAGRANT_PEAR_HTTP_PROXY` | Configures PEAR http proxy | Highest |
|
256
|
+
| svn | `VAGRANT_SVN_HTTP_PROXY` | Configures SVN http proxy | Highest |
|
257
|
+
| | `VAGRANT_SVN_NO_PROXY` | Configures SVN no proxy | Highest |
|
258
|
+
| yum | `VAGRANT_YUM_HTTP_PROXY` | Configures YUM http proxy | Highest |
|
195
259
|
|
196
260
|
## Related plugins and projects
|
197
261
|
|
@@ -201,3 +265,68 @@ VAGRANT_APT_HTTP_PROXY="http://proxy.example.com:8080" vagrant up
|
|
201
265
|
a Vagrant setup for [polipo](http://www.pps.univ-paris-diderot.fr/~jch/software/polipo/) caching web proxy.
|
202
266
|
* [vagrant-cachier](https://github.com/fgrehm/vagrant-cachier)<br/>
|
203
267
|
An excellent Vagrant plugin that shares various cache directories among similar VM instances. Should work fine together with vagrant-proxyconf.
|
268
|
+
|
269
|
+
|
270
|
+
## Installing a pre-release version
|
271
|
+
|
272
|
+
* A [released](https://rubygems.org/gems/vagrant-proxyconf) pre-release version:
|
273
|
+
|
274
|
+
```
|
275
|
+
vagrant plugin install --plugin-source https://rubygems.org/ --plugin-prerelease vagrant-proxyconf
|
276
|
+
```
|
277
|
+
|
278
|
+
* Development version from git repository:
|
279
|
+
|
280
|
+
```
|
281
|
+
git clone https://github.com/tmatilai/vagrant-proxyconf.git
|
282
|
+
cd vagrant-proxyconf
|
283
|
+
|
284
|
+
# Optionally check out other than the master branch
|
285
|
+
git checkout <branch>
|
286
|
+
|
287
|
+
# If you don't have Ruby installed, you can use <path/to/vagrant>/embedded/bin/gem>.
|
288
|
+
# If you have Docker you can use the Ruby image:
|
289
|
+
# docker run -it --rm -v ${PWD}:/usr/src/myapp -w /usr/src/myapp ruby:2.6 gem build vagrant-proxyconf.gemspec
|
290
|
+
gem build vagrant-proxyconf.gemspec
|
291
|
+
|
292
|
+
vagrant plugin install vagrant-proxyconf-*.gem
|
293
|
+
```
|
294
|
+
|
295
|
+
Paths to Vagrant's embedded gem:
|
296
|
+
* Linux: `/opt/vagrant/embedded/bin/gem`
|
297
|
+
* OS X: `/Applications/Vagrant/embedded/bin/gem`
|
298
|
+
|
299
|
+
|
300
|
+
## Development Known Issues
|
301
|
+
|
302
|
+
|
303
|
+
### When running `bundle exec vagrant status` I get `Encoded files can't be read outside of the Vagrant installer.`
|
304
|
+
|
305
|
+
```
|
306
|
+
$ bundle exec vagrant status
|
307
|
+
Vagrant failed to initialize at a very early stage:
|
308
|
+
|
309
|
+
The plugins failed to load properly. The error message given is
|
310
|
+
shown below.
|
311
|
+
|
312
|
+
Encoded files can't be read outside of the Vagrant installer.
|
313
|
+
```
|
314
|
+
|
315
|
+
The solution is to add this to the Gemfile
|
316
|
+
|
317
|
+
```
|
318
|
+
embedded_locations = %w(/Applications/Vagrant/embedded /opt/vagrant/embedded)
|
319
|
+
|
320
|
+
embedded_locations.each do |p|
|
321
|
+
ENV['VAGRANT_INSTALLER_EMBEDDED_DIR'] = p if File.directory?(p)
|
322
|
+
end
|
323
|
+
|
324
|
+
unless ENV.key?('VAGRANT_INSTALLER_EMBEDDED_DIR')
|
325
|
+
$stderr.puts "Couldn't find a packaged install of vagrant, and we need this"
|
326
|
+
$stderr.puts 'in order to make use of the RubyEncoder libraries.'
|
327
|
+
$stderr.puts 'I looked in:'
|
328
|
+
embedded_locations.each do |p|
|
329
|
+
$stderr.puts " #{p}"
|
330
|
+
end
|
331
|
+
end
|
332
|
+
```
|
data/Rakefile
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
|
-
require 'cane/rake_task'
|
3
2
|
require 'rspec/core/rake_task'
|
4
|
-
require 'tailor/rake_task'
|
5
3
|
|
6
|
-
task :default =>
|
4
|
+
task :default => :test
|
7
5
|
|
8
6
|
# Remove 'install' task as the gem is installed to Vagrant, not to system
|
9
7
|
Rake::Task[:install].clear
|
@@ -17,30 +15,6 @@ desc "Run all tests"
|
|
17
15
|
task :test => ['test:unit']
|
18
16
|
task :spec => :test
|
19
17
|
|
20
|
-
Tailor::RakeTask.new do |task|
|
21
|
-
task.file_set('lib/**/*.rb', 'code') do |style|
|
22
|
-
style.allow_unnecessary_double_quotes false, level: :off
|
23
|
-
style.max_line_length 100, level: :warn
|
24
|
-
style.max_line_length 140, level: :error
|
25
|
-
end
|
26
|
-
task.file_set('spec/**/*.rb', 'tests') do |style|
|
27
|
-
style.allow_unnecessary_double_quotes false, level: :off
|
28
|
-
style.max_line_length 120, level: :warn
|
29
|
-
# allow vertical alignment of `let(:foo) { block }` blocks
|
30
|
-
style.spaces_before_lbrace 1, level: :off
|
31
|
-
style.indentation_spaces 2, level: :off
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
Cane::RakeTask.new(:cane) do |task|
|
36
|
-
task.abc_max = 16
|
37
|
-
task.style_measure = 140
|
38
|
-
task.options[:color] = true
|
39
|
-
end
|
40
|
-
|
41
|
-
desc 'Run all quality tasks'
|
42
|
-
task :quality => [:cane, :tailor]
|
43
|
-
|
44
18
|
desc "Update gh-pages"
|
45
19
|
task 'gh-pages' do
|
46
20
|
require 'tmpdir'
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# https://gist.github.com/codylane/6ebee3595a02f57d35c325db4e102c55
|
2
|
+
FROM centos:7
|
3
|
+
|
4
|
+
EXPOSE 22
|
5
|
+
|
6
|
+
RUN yum clean all && \
|
7
|
+
yum makecache fast && \
|
8
|
+
yum -y install \
|
9
|
+
curl \
|
10
|
+
device-mapper-persistent-data \
|
11
|
+
git \
|
12
|
+
initscripts \
|
13
|
+
lvm2 \
|
14
|
+
openssh-clients \
|
15
|
+
openssh-server \
|
16
|
+
rsync \
|
17
|
+
sudo \
|
18
|
+
wget \
|
19
|
+
yum-utils \
|
20
|
+
xfsprogs && \
|
21
|
+
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo && \
|
22
|
+
yum clean expire-cache && \
|
23
|
+
yum install -y docker-ce && \
|
24
|
+
/usr/sbin/sshd-keygen && \
|
25
|
+
getent passwd vagrant || useradd -m -d /home/vagrant -s /bin/bash vagrant && \
|
26
|
+
echo "vagrant:vagrant" | chpasswd && \
|
27
|
+
mkdir -p /etc/sudoers.d && \
|
28
|
+
echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant && \
|
29
|
+
echo 'vagrant ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/vagrant && \
|
30
|
+
chmod 0440 /etc/sudoers.d/vagrant && \
|
31
|
+
visudo -cf /etc/sudoers.d/vagrant && \
|
32
|
+
mkdir -p /var/run/sshd && \
|
33
|
+
mkdir -p /home/vagrant/.ssh && \
|
34
|
+
touch /home/vagrant/.ssh/authorized_keys
|
35
|
+
|
36
|
+
VOLUME [ "/sys/fs/cgroup" ]
|
37
|
+
|
38
|
+
RUN grep -q 'OHlnVYCzRdK8jlqm8tehUc9c9WhQ==' /home/vagrant/.ssh/authorized_keys || echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ==" >> /home/vagrant/.ssh/authorized_keys && \
|
39
|
+
chmod 0600 /home/vagrant/.ssh/authorized_keys && \
|
40
|
+
chown vagrant:vagrant /home/vagrant/.ssh/authorized_keys
|
41
|
+
|
42
|
+
# -e write logs to stderr
|
43
|
+
# -D run in foreground
|
44
|
+
# CMD ["/usr/sbin/sshd", "-e", "-D"]
|
45
|
+
CMD ["/usr/sbin/init"]
|