560 Commits

Author SHA1 Message Date
Chris Roberts
c8fc8b3ad2 Include newline on end of comment within private key 2023-10-02 15:38:02 -07:00
Chris Roberts
51adb12547 Add architecture support for boxes
Introduce support for handling box architecture. Adds a new
`box_architecture` setting that defaults to `:auto` which will perform
automatic detection of the host system, but can be overridden with a
custom value. Can also be set to `nil` which will result in it fetching
the box flagged with the default architecture within the metadata.

Box collection has been modified to allow existing boxes already
downloaded and unpacked to still function as expected when architecture
information is not available.
2023-09-14 16:15:03 -07:00
Chris Roberts
e958c6183a Adds initial HCP config support
Adds initial basic support for HCP based configuration in vagrant-go.
The initalization process has been updated to remove Vagrantfile parsing
from the client, moving it to the runner using init jobs for the basis
and the project (if there is one). Detection is done on the file based
on extension for Ruby based parsing or HCP based parsing.

Current HCP parsing is extremely simple and currently just a base to
build off. Config components will be able to implement an `Init`
function to handle receiving configuration data from a non-native source
file. This will be extended to include a default approach for injecting
defined data in the future.

Some cleanup was done in the state around validations. Some logging
adjustments were applied on the Ruby side for better behavior
consistency.

VirtualBox provider now caches locale detection to prevent multiple
checks every time the driver is initialized.
2023-09-07 17:26:10 -07:00
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
Chris Roberts
67562588c9 Add ed25519 keypair support
Introduce keypair support for ed25519. Default keypair type when
generating without specifying type is rsa to maintain existing behavior.
2023-06-26 15:06:36 -07:00
Chris Roberts
d83bfc0d40 Perform best effort ssl revocation check on Windows
When performing a request via curl on Windows using schannel, ssl
certificate revocation checks does not handle verification failures
gracefully when an error is encountered that is unrelated to the actual
revocation of a certificate.

A new option is available to perform best effort revocation checks on
curl, so this is enabled by default on the Windows platform. A new
config option (`box_download_disable_ssl_revoke_best_effort`) has also
been added which can be optionally enabled to restore previous behavior
which results in a hard error if any error is encountered.
2023-06-20 16:37:00 -07:00
Chris Roberts
0a20379b1a Enable deprecated key type and host key algorithm
Recent versions of OpenSSH remove support of ssh-rsa key types and host
key algorithms from the default conection configuration. Set options to
enable them and provide a configuration option which can disable them if
required.
2023-05-22 17:09:47 -07:00
Chris Roberts
1f26256680 Release file lock before file deletion
When unlocking the file mutex utility always unlock the file prior to
deletion to ensure the file can be properly deleted.
2023-05-17 11:13:10 -07:00
Sophia Castellarin
72dab76707
Merge pull request #13057 from soapy1/box-race-condition
Add a file mutex when downloading box files.
2023-02-22 15:02:13 -08:00
sophia
4551b8b2ad Use file locks to avoid file existance checking race conditions 2023-02-22 14:28:00 -08:00
lyderX05
a7d87498ed Requested Changes Updated on Fixes
Fixes the issue of Vagrant is unable to execute Get-WindowsOptionalFeature Command changes 2

Fixes #11932
2023-02-16 14:28:21 -08:00
lyderX05
88c5e17c5c Fixes the issue of Vagrant is unable to execute Get-WindowsOptionalFeature Command changes 2
Fixes #11932
2023-02-16 14:28:21 -08:00
lyderX05
b0a4109845 Fixes the issue of Vagrant is unable to execute Get-WindowsOptionalFeature Command.
Fixes #11932
2023-02-16 14:28:21 -08:00
sophia
f153996b2d Add tests for mutex util module 2023-01-13 14:08:27 -08:00
sophia
b91a5d5576 Add file mutex util module 2023-01-13 12:00:46 -08:00
Chris Roberts
c75e05d4b1
Merge pull request #12913 from nist/File.exists
Replace deprecated File.exists? with File.exist?.
2022-11-08 15:07:21 -08:00
Mateus Pereira
3bdb204bf7 Renames PERPEND_STRING to PREPEND_STRING 2022-10-19 20:02:36 -03:00
Chris Roberts
c7ef689d86 Prevent trailing space character on user agent 2022-09-28 13:51:54 -07:00
Nicolas St-Laurent
6f9f88e055 Replace deprecated File.exists? with File.exist?. 2022-09-22 08:54:46 -04:00
Paul Hinze
63cefbb8ed
Fix ssh-config and winrm-config by remote-ifying safe_puts
This also removes the "Running (command)..." output since users will
expect to be able to redirect the ssh-config output to a file without
that noise.

If we really like the "Running" thing we can try and swing around and
get fancy by detecting whether or not we have a terminal or a file as
output and doing conditional stuff, but this seemed like the simplest
way forward for now.
2022-06-24 12:53:57 -05:00
Paul Hinze
a4f426d26e
Modify SSH utils server mode behavior so ssh -c works
Still work left to do on exec and stderr separation but this represents
enough working to let vagrant-spec assertions pass so I think it's worth a
checkpoint!
2022-04-25 12:26:48 -05:00
Paul Hinze
6471a5a310
Refactor Util::SSH to make room for remote overrides
Splitting out methods gives us a place to hook in appropriate behavior
for when we're running in a GRPC server.
2022-04-25 12:26:48 -05:00
Chris Roberts
914530d26a
Use trace log level for noisy log messages 2022-04-25 12:26:19 -05:00
Chris Roberts
8c9b72d56e
Base log message splitting on overall size 2022-04-25 12:26:16 -05:00
Chris Roberts
8b7c5efa52
Use custom output to break long log lines. Force encoding. 2022-04-25 12:26:02 -05:00
Chris Roberts
a85c7cc097
Temp logger fix to prevent encoding based errors 2022-04-25 12:25:59 -05:00
Chris Roberts
819a4d28a4
Reconfigure legacy vagrant to utilize hclog 2022-04-25 12:24:46 -05:00
Chris Roberts
bbd1404c1e
Merge pull request #12437 from chrisroberts/line-buf-shell-util
Line buffer utility and shell provisioner usage
2021-06-29 13:11:19 -07:00
Chris Roberts
35de0d724e Remove stringio usage from line buffer util, add max buffer length 2021-06-29 11:04:14 -07:00
sophia
0a1b20bb07 Get powershell path in %WINDIR%/System32 2021-06-29 10:34:57 -05:00
Rui Lopes
ef18b45786 ensure that the shell provisioner only emits complete output lines to the ui
partial lines are buffered until they are complete (have a line ending)

see https://github.com/hashicorp/vagrant/issues/11047
2021-06-25 15:58:24 -07:00
Chris Roberts
5967a23fa0 Support pwsh executable name for powershell
This updates the powershell detection to look for the `pwsh` executable
    and use it when the powershell executable is not available.
2021-04-28 12:45:48 -07:00
Chris Roberts
fd4da92245 Check file size prior to upload and automatically adjust options
When uploading box file, check if the size is greater than
    5GB. If the size is larger and the direct to storage option
    is enabled, disable the option due to current 5GB restriction
    on direct uploads.
2021-03-23 15:11:32 -07:00
Chris Roberts
d3fffd65d2 Prevent notifications on redirect to default store
This also checks if the redirect notification has been displayed
    before inspecting the source and location to prevent repeat checks
    after the notification has been sent.
2021-03-15 15:21:07 -07:00
sophia
220f346d2b Make shell script for loop shell agnostic 2021-02-22 12:36:54 -06:00
Chris Roberts
203a5f0075 Update filesystem type match for WSL2
Fixes shared folder on WSL2 based on #11705
2020-11-18 10:58:33 -08:00
Chris Roberts
16dc9db76b Handle Errno::EALREADY exceptions on port checks
With WSL port checks can end up resulting in Errno::EALREADY being
raised. When encountered, assume port is unavailable.
2020-10-30 13:09:51 -07:00
Chris Roberts
70d36bc7cd Update uploader options to include --fail so failures are reported properly 2020-10-30 09:26:07 -07:00
Chris Roberts
78d309a09b Update cloud command to use refactored library implementation
This PR is dependent on the 2.1.0 release of the vagrant_cloud
library. It updates the `cloud` command to use the new interface
for interacting with the Vagrant Cloud API. It also adds support
for direct to backend storage uploads, and defaults to this
method.

Also included is a bit of cleanup refactoring, addition of method
documentation, and fixing up some small issues around custom username
usage within the internal client for authentication.
2020-10-30 09:26:07 -07:00
sophia
8a8eff130a Allow entity to support content disposition 2020-10-28 16:21:42 -05:00
sophia
799ebb32ed Add tests for mime util 2020-10-28 15:57:45 -05:00
sophia
4cdf60cb0a Create MIME type data 2020-10-28 15:57:45 -05:00
Sophia Castellarin
70d37e8a9c
Merge pull request #11835 from soapy1/remove-url-token
Download a box by setting auth headers
2020-09-22 15:35:30 -05:00
sophia
d6a88f666f Add some docstrings and logging 2020-09-15 15:01:01 -05:00
Dan Čermák
ce8230ccfb
Switch from unmaintained gem erubis to erubi
Rails switched to erubi as well, as erubis has not seen any new releases since 2011.
2020-09-10 10:52:47 +02:00
sophia
fffc555faf Add tests for new hook 2020-08-21 10:54:43 -05:00
sophia
e2f012ff58 Escape value being scrubbed 2020-08-20 18:03:01 -05:00
sophia
27b37ea838 Scrub credentials as whole words, don't capture matching substrings 2020-08-18 11:38:04 -05:00
sophia
b5f6df9ec0 Download a box by setting auth headers 2020-08-18 10:13:39 -05:00
Chris Roberts
e9ece2ab58
Merge pull request #11814 from chrisroberts/f-dep-warns
Updates to address all Ruby deprecations and warnings
2020-08-12 09:07:10 -07:00