vagrant-bindfs 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +16 -14
- data/Vagrantfile +6 -6
- data/lib/vagrant-bindfs/bindfs.rb +1 -1
- data/lib/vagrant-bindfs/vagrant/actions/concerns/machine.rb +5 -5
- data/lib/vagrant-bindfs/vagrant/actions/installer.rb +1 -1
- data/lib/vagrant-bindfs/vagrant/actions/mounter.rb +2 -2
- data/lib/vagrant-bindfs/vagrant/config.rb +7 -7
- data/lib/vagrant-bindfs/version.rb +1 -1
- data/locales/en.yml +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0c2eea3a0e7cf3a24836af90d8b9c1f85b6b172dfdc39bb94e748060ce51bb26
|
4
|
+
data.tar.gz: 6193954f74c1128a7d6e5fbcc94f58abf5ab2506620c9caa32a3ee44dedfe79f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0fbc3b99ed572bfe89bef90b713521eaba93e41a5ffa2f97cfc22d8f11f8e8d76318487a7860c1fdaf062ad3c47925db55697cd7606e867f1ae5f74527fabaf
|
7
|
+
data.tar.gz: 3d050014188a339be0994a8117591c6cd96490c9d6ab2af34cc61ebffc030b657c12a1e3141ca41a472251556a8cbaa27c10b442993a937eb1a76103a56e8589
|
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# vagrant-bindfs
|
2
2
|
|
3
|
-
A Vagrant plugin to automate [bindfs](http://bindfs.org/)
|
3
|
+
A Vagrant plugin to automate [bindfs](http://bindfs.org/) mounts in the VM. This allow you to change owner, group and permissions on files and, for example, work around NFS share permissions issues.
|
4
4
|
|
5
5
|
|
6
6
|
## Some Background: Why `vagrant-bindfs`
|
7
7
|
|
8
8
|
The default vagrant provider is [virtualbox](https://www.virtualbox.org/).
|
9
|
-
It's free
|
9
|
+
It's free and works well but has some [performance problems](http://snippets.aktagon.com/snippets/609-Slow-IO-performance-with-Vagrant-and-VirtualBox-).
|
10
10
|
|
11
11
|
People often recommend switching to [vagrant's VMWare-fusion provider](http://www.vagrantup.com/vmware).
|
12
12
|
This reportedly has better performance, but shares with symlinks [won't work](http://communities.vmware.com/thread/428199?start=0&tstart=0).
|
@@ -38,15 +38,15 @@ vagrant plugin install vagrant-bindfs
|
|
38
38
|
|
39
39
|
## Usage
|
40
40
|
|
41
|
-
In your `Vagrantfile`, use `config.bindfs.bind_folder` to configure folders that will be
|
41
|
+
In your `Vagrantfile`, use `config.bindfs.bind_folder` to configure folders that will be bound on VM startup.
|
42
42
|
The format is:
|
43
43
|
|
44
44
|
```ruby
|
45
45
|
config.bindfs.bind_folder "/path/to/source", "/path/to/destination", options
|
46
46
|
```
|
47
47
|
|
48
|
-
By default, all folders are
|
49
|
-
You can pass a special `:after` option to the bind_folder method to choose when a folder should be
|
48
|
+
By default, all folders are bound after folders syncing between host and guest machines.
|
49
|
+
You can pass a special `:after` option to the bind_folder method to choose when a folder should be bound.
|
50
50
|
Supported values are :
|
51
51
|
|
52
52
|
* `:synced_folders` (default)
|
@@ -92,27 +92,27 @@ Remember that Vagrant use `/vagrant` on guest side to automatically share your p
|
|
92
92
|
### bindfs support
|
93
93
|
|
94
94
|
The `bind_folder` config accept any option you can pass to bindfs.
|
95
|
-
vagrant-bindfs is compatible with bindfs from version 1.9 to 1.
|
96
|
-
Check [lib/vagrant-bindfs/
|
95
|
+
vagrant-bindfs is compatible with bindfs from version 1.9 to 1.14.2.
|
96
|
+
Check [lib/vagrant-bindfs/bindfs/option_definitions.json](https://github.com/gael-ian/vagrant-bindfs/blob/master/lib/vagrant-bindfs/bindfs/option_definitions.json) for a complete list of supported options and default values and read the [bindfs man page](http://bindfs.org/docs/bindfs.1.html) for full documentation.
|
97
97
|
|
98
98
|
Both long arguments and shorthand are supported.
|
99
99
|
If you set both, shorthand will prevail.
|
100
|
-
Long arguments can be written indifferently with underscore ('force_user') or dash ('force-user') and as strings (
|
100
|
+
Long arguments can be written indifferently with underscore ('force_user') or dash ('force-user') and as strings ('force-user') or symbols (:force_user or :'force-user').
|
101
101
|
|
102
102
|
Option arguments values can be anything that can be casted to a string _via_ `to_s`.
|
103
103
|
The plugin will try to detect flag arguments values as true or false from common notations.
|
104
104
|
|
105
|
-
vagrant-bindfs detects installed version of bindfs,
|
105
|
+
vagrant-bindfs detects installed version of bindfs, translates option names when needed and ignores an option if it is not supported.
|
106
106
|
As we may have missed something, it will warn you when a binding command fail.
|
107
107
|
|
108
|
-
On Debian (
|
108
|
+
On Debian (and Ubuntu), SUSE, Fedora, CentOS, Gentoo and OS X guest systems, vagrant-bindfs will try to install bindfs automatically if it is not installed.
|
109
109
|
On other system, you'll get warned.
|
110
110
|
|
111
111
|
OS X guests may need some specific options. See [bindfs README](https://github.com/mpartel/bindfs#os-x-note) for details.
|
112
112
|
|
113
113
|
## Configuration
|
114
114
|
|
115
|
-
This plugin supports the following configuration options
|
115
|
+
This plugin supports the following configuration options:
|
116
116
|
|
117
117
|
### `debug`
|
118
118
|
|
@@ -137,10 +137,10 @@ end
|
|
137
137
|
|
138
138
|
### `skip_validations`
|
139
139
|
|
140
|
-
By default, `vagrant-bindfs` will check if the user and the group set for a
|
140
|
+
By default, `vagrant-bindfs` will check if the user and the group set for a bound folder exists on the virtual machine.
|
141
141
|
If either one, the other or both of them are missing, it will warn you and not execute any bindfs command for this folder.
|
142
142
|
|
143
|
-
To skip these validations, you can add `:user`and/or `:group` to the `config.bindfs.skip_validations` array.
|
143
|
+
To skip these validations, you can add `:user` and/or `:group` to the `config.bindfs.skip_validations` array.
|
144
144
|
|
145
145
|
|
146
146
|
```ruby
|
@@ -212,7 +212,7 @@ We could also use some more specs…
|
|
212
212
|
|
213
213
|
### How to Test Changes
|
214
214
|
|
215
|
-
If you've made changes to this plugin, you can easily test it locally in
|
215
|
+
If you've made changes to this plugin, you can easily test it locally in Vagrant.
|
216
216
|
|
217
217
|
Edit `Vagrantfile` and uncomment one or more of the selected test boxes.
|
218
218
|
Then, from the root of the repo, do:
|
@@ -222,3 +222,5 @@ Then, from the root of the repo, do:
|
|
222
222
|
|
223
223
|
This will spin up one or more VM and try to bindfs-mount some shares in it.
|
224
224
|
Feel free to modify the included `Vagrantfile` or test helpers (in `test/test_helpers.rb`) to add additional boxes and test cases.
|
225
|
+
If you add a new test machine, please ensure that it will stay available and regularly updated for future tests.
|
226
|
+
We recommend to use [officialy supported boxes](https://goo.gl/LbkPVF).
|
data/Vagrantfile
CHANGED
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
# Uncomment machines you want to test
|
7
7
|
test_machines = {
|
8
|
-
# debian: { box: "bento/debian-
|
9
|
-
# ubuntu: { box: "bento/ubuntu-18.
|
10
|
-
# fedora: { box: "bento/fedora-
|
11
|
-
# redhat: { box: "bento/centos-
|
12
|
-
# gentoo: { box: "generic/gentoo"
|
8
|
+
# debian: { box: "bento/debian-10" },
|
9
|
+
# ubuntu: { box: "bento/ubuntu-18.04" },
|
10
|
+
# fedora: { box: "bento/fedora-latest" },
|
11
|
+
# redhat: { box: "bento/centos-8" },
|
12
|
+
# gentoo: { box: "generic/gentoo" },
|
13
13
|
|
14
14
|
# The `vagrant` user group does not exist in this box.
|
15
|
-
# suse: { box: "bento/opensuse-leap-
|
15
|
+
# suse: { box: "bento/opensuse-leap-15", args: { group: 'users' } },
|
16
16
|
|
17
17
|
# **This box require the Oracle VM VirtualBox Extension Pack for Virtualbox.**
|
18
18
|
# The `vagrant` user group does not exist in this box.
|
@@ -13,11 +13,11 @@ module VagrantBindfs
|
|
13
13
|
machine.config.bindfs
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
17
|
-
@
|
18
|
-
config.
|
19
|
-
|
20
|
-
|
16
|
+
def bound_folders(hook = nil)
|
17
|
+
@bound_folders ||= begin
|
18
|
+
config.bound_folders.each_with_object({}) do |(id, folder), bound|
|
19
|
+
bound[id] = folder if hook.nil? || folder.hook == hook
|
20
|
+
bound
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -19,7 +19,7 @@ module VagrantBindfs
|
|
19
19
|
|
20
20
|
def call(env)
|
21
21
|
app.call(env)
|
22
|
-
return if
|
22
|
+
return if bound_folders(hook).empty?
|
23
23
|
|
24
24
|
bind_folders!
|
25
25
|
end
|
@@ -28,7 +28,7 @@ module VagrantBindfs
|
|
28
28
|
|
29
29
|
def bind_folders!
|
30
30
|
info I18n.t('vagrant-bindfs.actions.mounter.start', hook: hook)
|
31
|
-
|
31
|
+
bound_folders(hook).each_value do |folder|
|
32
32
|
bind_folder!(folder)
|
33
33
|
end
|
34
34
|
end
|
@@ -9,7 +9,7 @@ module VagrantBindfs
|
|
9
9
|
attr_reader :install_bindfs_from_source
|
10
10
|
|
11
11
|
attr_reader :default_options
|
12
|
-
attr_accessor :
|
12
|
+
attr_accessor :bound_folders
|
13
13
|
|
14
14
|
attr_accessor :skip_validations
|
15
15
|
attr_reader :force_empty_mountpoints
|
@@ -20,7 +20,7 @@ module VagrantBindfs
|
|
20
20
|
@bindfs_version = UNSET_VALUE
|
21
21
|
@install_bindfs_from_source = false
|
22
22
|
|
23
|
-
@
|
23
|
+
@bound_folders = {}
|
24
24
|
@default_options = Bindfs::OptionSet.new(nil,
|
25
25
|
'force-user' => 'vagrant',
|
26
26
|
'force-group' => 'vagrant',
|
@@ -50,14 +50,14 @@ module VagrantBindfs
|
|
50
50
|
@force_empty_mountpoints = (value == true)
|
51
51
|
end
|
52
52
|
|
53
|
-
def
|
54
|
-
raise VagrantBindfs::Vagrant::ConfigError, :
|
53
|
+
def bound_folder=(*_any_variant)
|
54
|
+
raise VagrantBindfs::Vagrant::ConfigError, :bound_folders
|
55
55
|
end
|
56
56
|
|
57
57
|
def bind_folder(source, destination, options = {})
|
58
58
|
hook = options.delete(:after) || :synced_folders
|
59
59
|
folder = Bindfs::Folder.new(hook, source, destination, options)
|
60
|
-
@
|
60
|
+
@bound_folders[folder.id] = folder
|
61
61
|
end
|
62
62
|
|
63
63
|
def merge(other) # rubocop:disable Metrics/AbcSize
|
@@ -69,7 +69,7 @@ module VagrantBindfs
|
|
69
69
|
result.install_bindfs_from_source = (install_bindfs_from_source || other.install_bindfs_from_source)
|
70
70
|
|
71
71
|
result.default_options = default_options.merge(other.default_options)
|
72
|
-
result.
|
72
|
+
result.bound_folders = bound_folders.merge(other.bound_folders)
|
73
73
|
|
74
74
|
result.skip_validations = (skip_validations + other.skip_validations).uniq
|
75
75
|
result.force_empty_mountpoints = (force_empty_mountpoints || other.force_empty_mountpoints)
|
@@ -83,7 +83,7 @@ module VagrantBindfs
|
|
83
83
|
def validate(_machine)
|
84
84
|
errors = _detected_errors
|
85
85
|
|
86
|
-
|
86
|
+
bound_folders.each_value do |folder|
|
87
87
|
validator = Bindfs::Validators::Config.new(folder)
|
88
88
|
errors << validator.errors unless validator.valid?
|
89
89
|
end
|
data/locales/en.yml
CHANGED
@@ -42,7 +42,7 @@ en:
|
|
42
42
|
errors:
|
43
43
|
package_manager_missing: "No package manager found on the virtual machine. You may use an unsupported flavour of Linux."
|
44
44
|
config:
|
45
|
-
|
45
|
+
bound_folders: "config.bindfs.bound_folders= must no be called. Use config.bindfs.bind_folders instead."
|
46
46
|
conflicting_options: "Another option has already been set for the canonical name '%{name}'"
|
47
47
|
|
48
48
|
bindfs:
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-bindfs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gaël-Ian Havard
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-
|
13
|
+
date: 2019-12-23 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: " A Vagrant plugin to automate bindfs mount in the VM. This allow you
|
16
16
|
to change owner, group and permissions on files and, for example, work around NFS
|
@@ -104,8 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
104
|
- !ruby/object:Gem::Version
|
105
105
|
version: 1.3.6
|
106
106
|
requirements: []
|
107
|
-
|
108
|
-
rubygems_version: 2.5.1
|
107
|
+
rubygems_version: 3.0.3
|
109
108
|
signing_key:
|
110
109
|
specification_version: 4
|
111
110
|
summary: A Vagrant plugin to automate bindfs mount in the VM
|