Commit graph

179 commits

Author SHA1 Message Date
hashicorp-copywrite[bot]
36a312ee26
add missing license headers and update copyright file headers to BUS-1.1 2023-08-10 21:53:25 +01:00
sophia
0939af9a76 Process rsync exclude regex less
This change will prepend "^" and append "/" if a start anchor is
detected in the regex string. This allows users to specify
relative paths to exclude.

It also removes replacing occurences of "*" with "[^/]*". "*"
already expresses itself accurately.
2023-01-19 16:38:28 -08:00
Chris Roberts
45f5043508 Check for extra arguments in ssh info before appending 2022-11-08 16:48:57 -08:00
Benoît Peccatte
139893603f Fix sync_folder type rsync ignores ssh extra_args 2022-11-08 16:35:35 -08:00
sophia
1e39161a7b Ensure candidate ips are available when determining mount name 2022-09-02 10:42:27 -05:00
Paul Hinze
7c1d2e5368
Use optional fields on Synced Folder instead of empty string checks
Addresses concerns raised in discussion here
https://github.com/hashicorp/vagrant-ruby/pull/219#discussion_r816966056
and makes it so we don't have to change any plugin code to make things
work.

Depends on https://github.com/hashicorp/vagrant-plugin-sdk/pull/133
2022-04-25 12:26:44 -05:00
Paul Hinze
0fc068822a
Fix rsync ownership settings in synced folders
When the opts are being pass through the go side, we get back empty
string values instead of nil values, so the `||=` assignment was not
working to populate the default owner and group. This was causing the
rsync_post hook to fail on linux guests.
2022-04-25 12:26:43 -05:00
sophia
b30a87ce6c Extract os friendly mount name for vbox shared folders 2021-02-10 15:25:56 -06:00
sophia
00e4810197 Add mount_name synced folder capability to get name of mount 2020-09-22 16:57:43 -05:00
sophia
11aeafea5c Add tests for smb mount options driven through synced folder capabilities 2020-09-22 16:56:11 -05:00
sophia
583b3f5332 Persist smb mounts 2020-09-22 16:53:10 -05:00
sophia
bc898e385d Update tests for synced folder typed hash 2020-08-19 15:00:40 -05:00
sophia
faad9f2717 Add tests 2020-08-19 15:00:40 -05:00
sophia
de28cec95f Add mount options cap for smb 2020-08-19 15:00:40 -05:00
sophia
cde39e26ba Make mount options a synced_folder capability 2020-08-19 15:00:40 -05:00
sophia
afd2a28f60 Add synced_folder_capability 2020-08-19 15:00:40 -05:00
Lachlan Arthur
c2df34298f Fix SMB credential validation on Windows hosts 2020-07-30 17:10:18 +10:00
sophia
1dc761a6c4 Refactor out persisting a mount to it's own guest cap 2020-05-29 15:26:48 -04:00
sophia
4ded8f098f Clarify SMB username format 2020-04-13 14:21:21 -04:00
Brian Cain
1c620852b6
Fixes #10966: Ensure all subdirectory files are watched
Prior to this commit, due to a fix that ignored `.vagrant` with rsync
helper, it broke the ability to watch for changes in subdirectories when
running the rsync-auto command. This commit puts back some of the helper
methods that were there previously for a given watcher path to ensure
that all files and subdirectories are properly watched and synced.
2019-09-26 08:29:37 -07:00
Brian Cain
75d42fed9d
Merge pull request #10902 from briancain/fixup-rsync-listener
Fixes #10895: Use relative paths to machines folder path for Listener
2019-06-17 08:20:37 -07:00
Brian Cain
1b0148bc78
Fixes #10895: Use relative paths to machines folder path for Listener
Prior to this commit, the rsync helper expanded all exclude paths that
should be ignored to be full qualified and regexp escaped. However the
Listen gem expects these ignore paths to be relative to the path passed
into the listener, not a full path. This commit fixes that by using the
path given by the user for the `rsync__exclude` option
2019-06-11 14:58:42 -07:00
Brian Cain
bf55e43460
Fixes #10869: Remove excludes if array is empty
Prior to this commit, if a user specified that their `rsync__excludes`
option was an empty array, Vagrant would treat that as if it included
options inside the array rather than ignoring it. This commit fixes that
by only adding the excludes option when it exists and is not empty.
2019-06-10 13:44:39 -07:00
Chris Roberts
b493503e09 Scrub SMB credential information from folder configuration
This prevents credential information from being persisted into the
local data directory which is used during subsequent runs to determine
folder definition changes.
2019-04-25 10:07:48 -07:00
Brian Cain
3b540e502f
Force removal of rsync tmp dir
Force delete entry to prevent any potentail failures when trying to
clean up the tmp dir from rsync
2019-02-26 09:08:56 -08:00
Andrew Eikum
7517faa9ee
Remove tmpdir after rsync completes 2019-02-22 12:24:13 -08:00
Chris Roberts
cb3b8bd732 Add support for using the --chown flag with rsync when available.
Adds a new `rsync__rsync_ownership` option to rsync based synced folders
which will allow rsync to use the `--chown` flag if it is available. The
`rsync` and `rsync-auto` commands have a new `--rsync-chown` flag which
can be used to force the option on folders when running the commands.

Fixes #7329 #7332
2018-12-20 17:16:36 -08:00
Chris Roberts
818d1d97ae Update rsync auto post command error handling to be more generic
Rescue and re-wrap any errors encountered when running the post
rsync capability. Rescue this exception type and notify of error
when encountered by rsync auto. Include test coverage.
2018-12-18 09:50:21 -08:00
hieptranquoc
480e992ea1 @ #10460 | vagrant rsync should restart when rsync find chown command error 2018-12-18 09:49:44 -08:00
hieptranquoc
aa6908cc00 @ #10460 | fix vagrant rsync-auto is crashed 2018-12-18 09:49:21 -08:00
Gavin Williams
0500f2b9b3 Add support for SSH config file to Rsync helper 2018-12-11 07:51:47 -08:00
Brian Cain
65651178cd
Fixes #9591: Allow for 'default' smb_username if set
Prior to this commit, Vagrant would prompt for smb username and password
every time, even if only smb_username was defined. This commit changes
that by allowing a "default" username from the Vagrantfile, with the
option of overriding it.
2018-10-19 13:26:18 -07:00
Brian Cain
cc14b43a96
Ensure tmpdir is loaded for rsync helper class 2018-10-11 09:57:20 -07:00
Brian Cain
cb0bd89ae1
Fixes #10289: Create proper tmp dir for ControlPath
Prior to this commit, when creating the ControlPath tmp dir for
socket path, Vagrant would simply rely on `rand(1000)` for making unique
dirs for rsyncing files which could result in collisions. This commit
updates that be properly using `Dir.mktmpdir` with a `vagrant-rsync-`
prefix.
2018-10-11 09:51:03 -07:00
Chris Roberts
d48b95ffaf Check :verify_host_key value for :never or if falsey 2018-08-24 14:11:30 -07:00
Chris Roberts
2667de163b Enable rsync synced folders for non-DrvFs file systems within WSL 2018-07-06 16:58:12 -07:00
Chris Roberts
52bae21933 Remove unused PowerShell scripts 2018-05-24 15:33:36 -07:00
Chris Roberts
a1529d5fbe
Merge pull request #8828 from mkhon/nfsv4-default-tcp
nfs_udp is false by default if using NFS v4
2018-02-23 09:50:49 -08:00
Chris Roberts
5444271268 Move SMB credentials validation into host capability 2018-01-12 16:55:35 -08:00
Lachlan Arthur
01bc2627be Check SMB credentials before using them 2018-01-12 15:46:31 -08:00
Chris Roberts
b0fc6a06a1
Merge pull request #9294 from chrisroberts/e-smb
SMB synced folders enhancements
2018-01-12 15:02:08 -08:00
Brian Cain
c9e5a22bff (#9062) Deprecate :paranoid in favor of :verify_host_key
As of `net-ssh` version 4.2.0, the key :paranoid has been deprecated in
favor of using :verify_host_key. This commit updates Vagrants ssh config
to use the new key, and deprecates the use of :paranoid.
2018-01-05 10:02:45 -08:00
Chris Roberts
6e4139acd3 Include configuration for smb synced folders 2018-01-03 09:40:52 -08:00
Chris Roberts
5b7714f542 Include macOS as valid host platform 2018-01-03 09:30:44 -08:00
Chris Roberts
3eeff59329 Use custom types and messages for errors 2018-01-02 14:36:28 -08:00
Chris Roberts
98ec1af30e Add smb_start capability for darwin 2018-01-02 11:21:50 -08:00
Chris Roberts
5a607d9248 Clean up SMB related errors 2017-12-21 09:55:19 -08:00
Chris Roberts
00fa50c296 SMB enhancements 2017-12-21 09:55:19 -08:00
Chris Roberts
139a65e555 Format host address for rsync when IPv6 2017-07-31 15:44:37 -07:00
Max Khon
d87dd018b0 nfs_udp is false by default if using NFS v4. 2017-07-27 14:00:53 +06:00