959 Commits

Author SHA1 Message Date
Chris Roberts
74b4a2b1f5 Adjust installation for unknown default architecture
When the reported architecture is unknown and the provider is listed as
the default architecture, add the box without architecture information
so it is installed without architecture information on the path within
the collection.
2023-09-26 16:20:37 -07:00
Chris Roberts
c8a7989b88 Adjust internal layout to allow downgrading
With the initial layout of `provider/architecture`, after installing a
box with architecture support downgrading Vagrant would result in it
being unable to process the box collection. Swapping the layout to be
`architecture/provider` allows downgrades to still properly process the
box collection.
2023-09-25 15:09:29 -07:00
Chris Roberts
9ef5c49598 Use api endpoint for expanded urls
When expanding the box url, prefer the API endpoint which is updated to
include provider architecture information. Test the API endpoint and the
legacy endpoint and use which ever is valid, with the API taking
precedence. This allows Vagrant to continue with non Vagrant Cloud
servers that do not implement the API endpoint.
2023-09-15 17:30:32 -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
513be177d3 Remove experimental checks
Removes experimental checks on existing experimental features.
2023-09-08 14:15:34 -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
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
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
b17c36c7c7 Fix typo 2022-07-07 12:30:24 -05:00
Paul Hinze
2707d09181
Fix prepend/append action hooks firing multiple times
This addresses the surprising behavior that the StoreBoxMetadata hook
was running many times during a machine up, including during failed
operations where a destroy_on_error deleted the machine. This was
resulting in an error that looked like:

> No such file or directory @ rb_sysopen [...] /[...]/box_meta

Plugin action hooks using prepend/append were attaching every time a
Builder was run, including sub-Builders that show up for things like
Call actions.

To fix this, we tell Builders if they are "primary" and only run
prepend/append on those. See inline comments for more explanation.
2022-04-25 12:26:55 -05:00
sophia
66524426d0
Update ruby remote box metadata for proto changes 2022-04-25 12:26:53 -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
fda2bcf0cd
Refactor SSHRun action to make room for remote overrides 2022-04-25 12:26:48 -05:00
sophia
1db38e65f8
Setup remote plugin manager when in server mode 2022-04-25 12:26:14 -05:00
sophia
94a203efc9
Inject dummy client into remote synced folders 2022-04-25 12:26:14 -05:00
sophia
90033b9b68
Only prepend remote mixin synced folders when running in remote mode 2022-04-25 12:26:13 -05:00
sophia
083fe5ea82
Setup remote mixin synced folder module 2022-04-25 12:26:07 -05:00
grahamhub
bfa73b06c6 cli: implement --info flag for package #12191 2021-04-15 00:28:41 -05:00
sophia
b480790a8d Add box directly with authed urls 2021-04-05 16:39:01 -05:00
Connor Martin
e92fe5d720 Merge branch 'main' of github.com:hashicorp/vagrant into remove-space 2021-03-11 17:20:57 -06:00
Sophia Castellarin
181b4ea890
Merge pull request #12177 from soapy1/apply-download-opts-to-metadata
Apply download options to metadata requests
2021-02-23 13:26:53 -06:00
sophia
4b67216d71 Raise error if downloading box metadata fails 2021-02-12 17:07:04 -06:00
Connor Martin
3f70d44266 assign to a new var 2021-02-12 09:31:32 -06:00
sophia
44f527ff8e Apply download options to metadata requests 2021-02-09 18:33:20 -06:00
Connor Martin
9a26940114 use strip instead 2021-02-04 14:29:54 -06:00
Connor Martin
1022e5b991 remove all space from checksums 2021-02-01 21:54:10 -06:00
Chris Roberts
157db39938 Remove action name tracking for applying
The raw action name tracking should be sufficient for preventing
multi-insertions where only a single modification should occur.
With action name, hooks _should_ be able to be applied in multiple
builder stacks as they are expanding.

Fixes #12035
2020-11-11 09:56:03 -08:00
Chris Roberts
30f8e7944d Track raw actions as they are applied to prevent multiple insertions
The raw actions are used for applying the original trigger behavior
which can insert before and/or after the entire set of actions. When
processing the stack items, mark when the raw action has been applied
to prevent it from being applied again. Triggers around the raw actions
should only ever be applied _once_.

Fixes #12034
2020-11-11 09:39:07 -08:00
Chris Roberts
db24f26daa Track application of action name hooks / triggers
When expanding stack track the origin action name and only apply
it once the stack has completed its expansion. The local env data
is marked with origin action to prevent it from being applied in
nested builders as they are expanded. The value of the stored action
name is checked and invalidated if another action is applied to the
same env in the future so hooks / triggers for that action are
applied as expected.
2020-11-02 10:39:15 -08:00
Chris Roberts
cba5bca7de Use variable when sending info to logger 2020-11-02 10:31:28 -08:00
sophia
4cdf60cb0a Create MIME type data 2020-10-28 15:57:45 -05:00
sophia
e2f71dd55d Update mime gem 2020-10-28 15:57:45 -05:00
Rui Lopes
fcdc63ff89 let the user configure the cloud_init mime part content-disposition filename 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
f9b1d52ec6 Catch error for when guest is not available 2020-09-10 16:28:38 -05:00
Sophia Castellarin
3835da3839
Merge pull request #11797 from soapy1/synced-folder-caps
Synced folder caps for mount options and default fstab modification behaviour
2020-08-21 11:44:15 -05:00
sophia
e96d60c029 Add tests for persisting shared folders 2020-08-20 18:24:09 -05:00
sophia
bb5d0e9c28 Remove credentials scrubbing from caching synced folders
Passwords are (and should) never stored be as part of folder data.
I think there is also a case to be made about desensitizes
information here can lead to leaking of credentials. For example if
an exported folder is named "vagrant" and the users password is
"vagrant", the synced_folder cache will show "****" in place of the
folder name, indicating that it is also password.
2020-08-19 17:43:22 -05:00
sophia
56fa014af8 Don't persist shared folders if mount options capability not provided 2020-08-19 15:47:21 -05:00
Chris Roberts
cd2d84fda7 Adjust synced folder collection class 2020-08-19 15:00:40 -05:00
sophia
7577c11eb6 Persist synced folders in action 2020-08-19 15:00:40 -05:00
sophia
1a3136b9fe Allow types to be specified when instantiating a typed hash 2020-08-19 15:00:40 -05:00
sophia
bc898e385d Update tests for synced folder typed hash 2020-08-19 15:00:40 -05:00
sophia
2239ee8582 Create Hash with type attribute 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
0d1635303f Sperate hook for authenticating url and adding headers for authentication 2020-08-18 17:42:59 -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