56 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
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
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
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
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
Gavin Williams
0500f2b9b3 Add support for SSH config file to Rsync helper 2018-12-11 07:51:47 -08: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
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
139a65e555 Format host address for rsync when IPv6 2017-07-31 15:44:37 -07:00
Chris Roberts
9e26e31a6b Add generated private key options to rsync command 2016-08-11 13:00:37 -07:00
Chris Roberts
7ba4f2087b Include LogLevel option within ssh command setup 2016-08-11 12:12:45 -07:00
Zack Train
cb70749bd8 redux of pr 7398 for ssh-agent key fix 2016-08-11 11:48:10 -07:00
Seth Vargo
571747be5e
Ensure space after last arg 2016-07-18 23:39:08 -04:00
Seth Vargo
8a5cf3b81a Merge pull request #7012 from penguincoder/rsync-command-quoting
translate windows path
2016-07-18 22:05:39 -04:00
Seth Vargo
7f1947fec2
folders/rsync: Shellescape guest paths
This allows users to have spaces or other special characters in
destination paths on the guest.
2016-07-18 21:13:00 -04:00
Seth Vargo
43538f68a4
Simpler 2016-06-06 19:47:25 -04:00
Andrew Coleman
95ab29b3db only use controlmaster for non-windows platforms, resolves #6702 2016-02-10 22:44:54 -05:00
Andreas Reischuck
5647de8ba4 Add shell quotes to the reported rsync command line to make it readable. 2016-01-09 22:27:54 +01:00
Mitchell Hashimoto
45a8a5907f synced_folders/rsync: SSH control for faster rsync 2015-11-20 10:48:59 -08:00
Lonnie VanZandt
b897fd7365 Scrub Guest Paths for Windows Rsync leaving Dirty Paths for Winrm Mkdir
Windows offers no out-of-the-box rsync utility. By far, the most
commonly used external utilities for Windows rsync are built with the
GNU Cygwin libraries. The cost for this convenience is that rsync on
Windows has to be provided paths that begin “/cygdrive/c” rather than
“c:/“ like other Windows-API utilities. Compounding the situation,
rsync doesn’t create paths/to/sub/targets and so the vagrant plugin
code, when performing an rsync, is responsible for creating
intermediate directories in guest paths if there are any. Furthermore,
the mkdir utility in Windows is not another Cygwin utility like rsync
but the routine mkdir of Windows command.com. Therefore, while rsync
needs the /cygwin paths, mkdir uses the Windows paths. Later, the
chef_solo.rp provisioner running within the guest will expect to find
Windows-style paths in its solo.rb configuration file. Due to all this,
vagrant has to keep track of both the original, possibly dirty Windows
guest path and the cygwin-scrubbed guest path.
2015-08-18 10:56:13 -06:00
Mitchell Hashimoto
31448d126b synced_folders/rsync: can set rsync_path [GH-3966] 2015-07-09 10:02:38 -06:00
Seth Vargo
f9816d89d9 Merge pull request #4867 from malonecm/GH4201-ShowRSyncOutput
GH-4201: Added rsync__showoutput to display rsync output to console
2015-05-30 21:21:26 -07:00
Hubert
7e5391c0f5 synced/folders/rsync Add 'IdentitiesOnly=yes'
Added IdentiesOnly=yes to avoid "Too Many Authentication Failures" error
2015-01-12 15:19:43 +01:00
Chad Maloney
d2e1500c74 Review comments applied. Removed changelog. Changed showoutput to verbose. 2015-01-05 14:36:00 -06:00
Chad Maloney
1ed31afeba GH-4201: Cleaned up some leftover junk I missed removing 2014-11-25 14:39:56 -06:00
Chad Maloney
cf784d5d3c GH-4201: Split process output by line so prefix shows on each line. Also fixed localization reference. 2014-11-25 14:37:59 -06:00
Chad Maloney
5de3f30bb0 GH-4201: Added rsync__showoutput to display rsync output to console 2014-11-25 12:38:41 -06:00
Mitchell Hashimoto
3c4e129fb8 synced_folders/rsync: dup arg list [GH-3864] 2014-05-20 19:24:06 -07:00
Mitchell Hashimoto
2a973df440 synced_folders/rsync: copy symlinks as real files [GH-3734] 2014-05-09 09:31:31 -07:00
Mitchell Hashimoto
ac040102f9 Merge pull request #3544 from benesch/rsync-conservative-chown
synced_folders/rsync: only chown when necessary
2014-04-27 15:59:40 -07:00
Mitchell Hashimoto
df86b18263 Update CHANGELOG, fix tests 2014-04-27 15:53:31 -07:00
Brian.Clark
fb509ac8b7 Add ssh ProxyCommand functionality to rsync 2014-04-26 13:52:39 -04:00
Nikhil Benesch
2df36892dd synced_folders/rsync: only chown when necessary [GH-3525]
Run remote rsync as root to guarantee that rsync can write to guestpath.
This obviates the need to chown the guestpath to the SSH user prior to
sync.

This brings a substantial speedup (2x on a moderately-sized shared
folder) and properly triggers filesystem notifications on only the files
changed by a given sync.
2014-04-25 15:00:12 -04:00
Mitchell Hashimoto
a47b85c8c4 synced_folders/rsync: add UserKnownHostsFile to /dev/null [GH-3511] 2014-04-21 20:39:48 -07:00
Mitchell Hashimoto
bb967265df synced_folders/rsync: style 2014-04-05 09:05:39 -07:00
Steffen Müller
32f25b6a0d synced_folders/rsync: enable override of default chmod flag
fixed new file creation to follow guest's umask on Windows by default
2014-04-05 11:11:55 +02:00
Mitchell Hashimoto
2e0142168e synced_folders/rsync: set chmod flag by default on Windows [GH-3256] 2014-04-02 09:07:00 -07:00
Mitchell Hashimoto
56dd0e8531 synced_folders/rsync: don't watch excluded paths [GH-3159] 2014-03-12 19:40:18 -07:00
Mitchell Hashimoto
a6eafd6a12 synced_folders/rsync: execute rsync_post cap if it exists [GH-3163] 2014-03-12 18:43:59 -07:00
Mitchell Hashimoto
04a19e05ca synced_folders/rsync: convert to proper unix-style path [GH-3086] 2014-03-09 18:22:00 -07:00
Mitchell Hashimoto
d4511131b4 synced_folders/rsync: allow custom args [GH-3070] 2014-03-06 11:27:58 -08:00