Commit graph

4531 commits

Author SHA1 Message Date
Chris Roberts
a7135c000b Apply license adjustments and fixes
Add configuration file for automated license modifications, remove
automated licese modifications from specific locations, and update the
license set in the gem specification.
2023-08-10 17:05:19 -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
e0dbbcc04c Use all insecure private key paths
When constructing the ssh information, use all available insecure key
paths for authentication.
2023-06-26 15:46:15 -07:00
Chris Roberts
380afe5fac Define directory and paths for insecure private keys
Within the environment, add a new directory value which points to the
directory containing the valid insecure private keys. A new default
private key paths value contains an array of all the insecure private
keys which are available for initial authentication.
2023-06-26 15:43:25 -07: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
f42269c584 Generated proto updates 2023-06-05 14:18:06 -07:00
Chris Roberts
627a5193ef
Merge pull request #13179 from chrisroberts/ssh-deprecated-types
Enable deprecated key type and host key algorithm
2023-06-02 17:09:52 -07:00
Chris Roberts
415b006ebd Add helper for loading OpenSSL providers
On OpenSSL 3, engines have been deprecated being replaced by providers.
The Ruby openssl library supported loading specific engines, but there
is no replacement currently using providers. The winrm communicator
specifically relies on a MD4 which OpenSSL has marked as legacy and no
longer loads by default.

The extension included loads the legacy provider as well as the default
provider. The legacy provider includes MD4, thus allowing winrm to
function again.
2023-05-25 15:36:55 -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
Chris Roberts
b77fb6ab4c
Merge pull request #13031 from chrisroberts/redux-eol-macos
Isolate protobuf message loading to server mode
2023-03-15 15:05:44 -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
sophia
817fbdd2d1 Add information about lock file path 2023-01-12 16:34:45 -08:00
sophia
bc03f21758 Add a file mutex when downloading box files.
Box's are global to Vagrant. Multiple Vagrant process can all
access the box directory for both downloading and extracting boxes.
A file mutex will ensure that mulitple Vagrant process will not
trample eachother if they are trying to download the same box.
2023-01-12 15:30:06 -08:00
sophia
7661eba89a Environment home dir is also not accessible if EROFS error occurs 2023-01-03 16:01:20 -08:00
Chris Roberts
672a408dbc Isolate protobuf message loading to server mode
Prevent protobuf loading when not in server mode. This allows proper
loading on platforms which don't have support for the protobuf
libraries.
2022-12-16 16:21:06 -08:00
Chris Roberts
e2165917e5 Always load protos regardless of server mode 2022-12-08 11:42:51 -08:00
Chris Roberts
1cd6ac3b31 Isolate loading dependencies for serve command
Only load the dependencies needed for the serve command if the serve
command is being run. This allows Vagrant to properly load on platforms
where some of the dependency libraries may not be available due to
incompatibilities or being EOL.
2022-12-07 15:35:00 -08:00
Chris Roberts
cbddfbd028 Handle missing machine folder value
If the value of the machine folder can not be found in the
system properties, report a user friendly error message and
include relevant information in the logs for debugging.
2022-11-14 10:45:10 -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
Chris Roberts
40a90fd9b4 Remove net-ssh patches 2022-11-08 13:59:32 -08:00
Mateus Pereira
3bdb204bf7 Renames PERPEND_STRING to PREPEND_STRING 2022-10-19 20:02:36 -03:00
Chris Roberts
e7e1badbdc Add support for VirtualBox 7.0 2022-10-14 15:58:00 -07:00
Chris Roberts
8694a400d6
Merge pull request #12925 from chrisroberts/fix-user-agent
Fix downloader user agent
2022-09-28 14:34:09 -07:00
Chris Roberts
c7ef689d86 Prevent trailing space character on user agent 2022-09-28 13:51:54 -07:00
sophia
d958b15352 go generate to pick up input color changes 2022-09-23 16:22:29 -04:00
Nicolas St-Laurent
6f9f88e055 Replace deprecated File.exists? with File.exist?. 2022-09-22 08:54:46 -04:00
Chris Roberts
c13c0feabf
Merge pull request #12885 from wbclark/12884_keys_only_fix
(#12884) Use default ssh.private_key_path when ssh.keys_only = false
2022-09-21 13:21:27 -07:00
Chris Roberts
7d7ad89ac5 Provide helpful error message on invalid version
When a box version (or constraint) is provided with an invalid
format, rescue the error and return a customized error with
information for the user explaining the problem.
2022-09-21 11:21:24 -07:00
sophia
ccb89c0143 Don't check for errors when checking if a provider is usable
If a provider is unusable then Usable() will throw an error. When
checking for a default provider, Vagrant should not raise an error
if there is an issue with executing Usable().
2022-09-19 15:14:42 -04:00
sophia
571daea639 Validate provider by default when collecting machine config 2022-09-19 15:14:42 -04:00
Sophia Castellarin
d0d81d6bb0
Merge pull request #12888 from soapy1/terminal-coloring
Terminal coloring
2022-09-19 15:11:26 -04:00
sophia
ccc232914d Raise error if required metadata.json box fields are not present 2022-09-14 13:01:31 -04:00
sophia
f7cd08b208 Pass terminal output color option from Ruby to terminal plugin 2022-09-14 11:42:52 -04:00
sophia
e96738bf43 Add protos for supporting colored terminal line events 2022-09-14 11:41:30 -04:00
sophia
55e89ed372 Colorize ui output 2022-09-14 11:41:30 -04:00
William Bradford Clark
15df2c69b4 (#12884) Use default ssh.private_key_path when ssh.keys_only = false 2022-09-10 02:16:51 -04:00
sophia
8bdb5e797d Pass in echo/secret ui input setting 2022-08-30 15:18:21 -05:00
Chris Roberts
d31f9a59a5 Only patch fake_ftp when running tests
The fake_ftp patches should only be applied when running tests. Since
the library is a development dependency only, it will not be available
for loading from a release.
2022-08-02 10:44:07 -07:00
Sophia Castellarin
14e825b8d0
Merge pull request #12753 from dcermak/bump-fake_ftp
Bump fake_ftp to ~> 0.3.0 & adjust tests
2022-08-01 13:23:00 -05:00
Paul Hinze
1b93691b8a
Merge pull request #12567 from electrofelix/improve-gem-resolving
Improve Gem spec selection when resolving
2022-08-01 12:49:16 -05:00
sophia
df94a36568 Patch fake_ftp for determining the size of files 2022-08-01 11:30:29 -05:00
Chris Roberts
da1b89b820
Merge pull request #12584 from chrisroberts/algo-patch
Set algorithms in kex
2022-07-28 16:51:42 -07:00
Paul Hinze
7c56c74bb6
Support and honor the "primary" option for Command plugins 2022-07-27 11:36:04 -05:00
Chris Roberts
dca389eda0 Generated proto updates 2022-07-25 15:00:49 -07:00
sophia
4f0082adfa Fix provider options typo 2022-07-18 10:03:01 -07:00
Paul Hinze
313905dde5
Merge pull request #317 from hashicorp/fix-help-subcommand
Band-aid to prevent help subcommand from erroring
2022-07-15 16:42:13 -05:00
Paul Hinze
957d0d3779
Bring plugin options back to Ruby for providers and synced folders
This removes the need for the validation workaround for Docker, because
box_updated is once again available in that context.

We don't technically need the SyncedFolder priorities back on the Ruby
side, but wiring them through for symmetry.

Depends on https://github.com/hashicorp/vagrant-plugin-sdk/pull/183
2022-07-15 12:14:47 -05:00
Paul Hinze
f3dbc24a22
Band-aid to prevent help subcommand from erroring
The code running in the help subcommand relies on Command plugins being
returned from the manager with their options hash. Stubbing in a blank
hash prevents the command from crashing

What we really need is for CommandOptions to be modeled and passed
through from Go to Ruby so :primary subcommands can be displayed, but
that can be a follow-on task from this quick fix.
2022-07-15 11:25:50 -05:00
Chris Roberts
a7d3652920 Generated proto update 2022-07-11 15:10:03 -07:00
Chris Roberts
d2ad38a607 Do not load provider during initialization 2022-07-08 16:38:03 -07:00
Chris Roberts
4dd69a07a3 Generated proto updates for vagrantfile 2022-07-08 16:38:02 -07:00
Chris Roberts
3c88c9ca7d Support individual value fetching from vagrantfile 2022-07-08 16:38:02 -07:00
Paul Hinze
27d08534cf
Merge pull request #309 from hashicorp/fix-docker-by-supporting-machine-with-no-box
Make Docker provider work again post config refactor
2022-07-08 15:07:00 -05:00
sophia
a6caa47f8e Environment#active_machines should return a list of tuple
The tuple should be compsed of the machine name (as a string)
and provider name (as a symbol)
2022-07-08 11:41:18 -05:00
Paul Hinze
ee8883153c
Make Docker provider work again post config refactor
- Allow machine.box to be empty without sadness (depends on
   https://github.com/hashicorp/vagrant-plugin-sdk/pull/182)
 - Get synced folder type from plugin name instead of defaulting to
   :virtualbox
2022-07-08 11:36:27 -05:00
Sophia Castellarin
66a22e5254
Merge pull request #303 from hashicorp/synced_folder_has_override_opts
Synced folder has override opts
2022-07-07 16:28:14 -05:00
Chris Roberts
f5d778d51a Revert "Merge pull request #300 from hashicorp/optimize-ruby-command-list"
This reverts commit 1c26a4abb0, reversing
changes made to 186824a568.

The changes broke plugin loading when using subcommands so these
changes will be reverted until the underlying issue can be
investigated and resolved.
2022-07-07 14:03:56 -07:00
sophia
9043ab4c45 go generate 2022-07-07 12:30:24 -05:00
sophia
e70a25e24f Use the scoped hash override to get overriden synced folder config 2022-07-07 12:30:24 -05:00
sophia
b17c36c7c7 Fix typo 2022-07-07 12:30:24 -05:00
sophia
e8c0587c85 go generate 2022-07-07 12:30:24 -05:00
Sophia Castellarin
0b53e06687
Merge pull request #297 from hashicorp/port-command-fix
Use remote provider
2022-07-07 12:21:48 -05:00
sophia
73801703e7 Pass machine to provider capabilities 2022-07-07 11:49:57 -05:00
Chris Roberts
1c26a4abb0
Merge pull request #300 from hashicorp/optimize-ruby-command-list
Optimize command list generation
2022-07-07 09:29:15 -07:00
Paul Hinze
fb2a102c71
Fix init and other commands that run without a project
The Basis needs to be able to respond to Vagrantfile() and
DefaultProvider() to make it through Vagrant::Environment
initialization.

Depends on https://github.com/hashicorp/vagrant-plugin-sdk/pull/178
2022-07-01 11:56:08 -05:00
sophia
52d37217ac Use cache from CommandServe module 2022-06-30 16:57:41 -05:00
sophia
20ec85b021 Use remote provider 2022-06-30 16:57:41 -05:00
Chris Roberts
e1d7962ee8 Generated proto updates for get commands 2022-06-29 16:14:01 -07:00
sophia
adadf26c9c Check if communicator is available before detecting guests 2022-06-29 17:23:43 -05:00
sophia
e0a30f9ba7 Raise error if communicator is not ready when getting guest from machine 2022-06-29 17:23:43 -05:00
Paul Hinze
430377fdce
Merge pull request #291 from hashicorp/fix-ssh-config
Fix ssh-config and winrm-config by remote-ifying safe_puts
2022-06-28 11:50:08 -05:00
Chris Roberts
f1695b6c1f Generated proto updates for config wrappers 2022-06-24 18:28:10 -07: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
Chris Roberts
4b61b0be49 Fix state loading for machine 2022-06-21 14:42:14 -07:00
Chris Roberts
83467013e9 Handle Set and Logger types 2022-06-20 16:56:30 -07:00
Chris Roberts
e0d8fa6689 Generated proto updates 2022-06-20 13:13:06 -07:00
Chris Roberts
8e69548c76 Memoize some values fetched from the machine client 2022-06-20 13:10:38 -07:00
Chris Roberts
3f557e26f1 Log what wasn't handled by wrapper 2022-06-20 13:06:14 -07:00
Chris Roberts
4d403ef02a Only raise error if version load is nil 2022-06-15 11:15:08 -07:00
Chris Roberts
2274efa568 Add helper method for performing partial loads 2022-06-15 11:06:33 -07:00
Chris Roberts
2af4ee0859 Always store values even when not registered 2022-06-15 11:06:33 -07:00
Chris Roberts
dfc2a6d6f4 Make dummy config a proper config instance and remove to_proto 2022-06-15 11:06:33 -07:00
Chris Roberts
09e6ff7ba2 Use client to get vagrantfile for environment 2022-06-15 11:06:33 -07:00
Chris Roberts
0d2627014c Update remote machine to use client for values 2022-06-15 11:06:28 -07:00
Chris Roberts
972ba095e9 Add remote vagrantfile implementation 2022-06-15 11:02:29 -07:00
Chris Roberts
e47da98810 Update unset value constant 2022-06-15 11:02:29 -07:00
Chris Roberts
4128441aac Remove to_proto from config and update unset value constant 2022-06-15 11:02:29 -07:00
sophia
ec2e2a6e89 go generate 2022-06-08 10:30:46 -05:00
sophia
90825f7086 go generate 2022-06-08 10:30:46 -05:00
Paul Hinze
8b08b3117c
Use plugin options for Synced Folder priorities
Now that plugin options are available, we can use them to interpret
synced folder priorities and remove the shim we had in place.
2022-06-06 17:39:09 -05:00
Paul Hinze
8dbe72a5a0
Use Component Options to implement ProviderOptions
* Populates ComponentOptions into plugin structs
* Maps options for legacy Provider Plugins into PluginOptions
* Demos use of PluginOptions in a stub provider
* Honors plugin priority and defaultable settings
2022-06-03 16:37:05 -05:00
Sophia Castellarin
fa1f45732b
Merge pull request #276 from hashicorp/machine-readable-flag
Machine readable flag
2022-06-03 12:11:15 -05:00