141 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
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
66524426d0
Update ruby remote box metadata for proto changes 2022-04-25 12:26:53 -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
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
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
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
5003bb6e15 Updates to address all Ruby deprecations and warnings
This includes updates for resolving all warnings provided by Ruby
for deprecations and/or removed methods. It also enables support
for Ruby 2.7 in the specification constraint as all 2.7 related
warnings are resolved with this changeset.
2020-08-10 13:05:41 -07:00
sophia
646de433a9 Validate conversion of map to cmd options 2020-04-29 15:10:48 -04:00
sophia
7e125969dd Add option box_download_options
Allow users to specify a map of extra options to pass to the downloader.
These options will be passed to curl, with a `--` appended to the key
2020-04-29 15:10:44 -04:00
Brian Cain
efd3a62ffe
Fixes #11207: Do not validate checksums if options are empty string
Prior to this commit, if Vagrant received checksum options from Vagrant
Cloud that were simply empty strings, it would try to validate its
checksum with those options. This commit fixes that by ignoring empty
string values.
2019-11-21 09:56:58 -08:00
Chris Roberts
13654dcc37 Update box checksum logic to use that supplied from FileChecksum 2019-10-08 11:23:48 -07:00
Chris Roberts
da1b5765c7 Prevent URI parse errors when checking box name
Fixes #8758
2017-07-07 11:43:16 -07:00
Brian Cain
f1d08aa629 (#7118) Handle box names that are URLs
Prior to this commit, if a user set a URL for the name of a box, vagrant
would not warn the user about using box_url instead. This would lead to
some difficult user experiences around the various box commands due to
the box name being a full URL. This commit introduces a warning to the
user and lets them know to instead use box_url.
2017-05-31 15:25:05 -07:00
Chris Roberts
7d1c77f523 Unescape url to provide actual local path when adding box
Fixes #6825
2017-04-20 15:37:08 -07:00
Chris Roberts
a055978d74 Scrub credentials from box URLs 2017-01-12 13:24:46 -08:00
Seth Vargo
7ed6bb5bef Merge pull request #7569 from rossi-fi/fix/master/7568
Use RFC- and cURL-friendly file:/// URI. Fixes #7568.
2016-07-18 22:20:03 -04:00
Markus Rossi
4730602ceb Strip leading slash left in front of drive letter by uri.path (see GH-7570). 2016-07-12 15:20:04 +03:00
Markus Rossi
8768d7921d Fix for #7568 Windows drive letter in config.vm.box_url is ignored 2016-07-12 12:01:23 +03:00
Seth Vargo
2a02ceb870
Bump box resume delay to 24h
This commit bumps the box resume delay time to 24h and makes it a
constant because I had a bugger of a time actually finding this in the
code :frowny:.

Fixes GH-7272
2016-05-27 15:18:50 -04:00
Seth Vargo
42a8ed658e Authenticate metadata box urls 2016-03-19 17:05:43 -04:00
Seth Vargo
4e21dd78e4 Ignore case when comparing checksums
Fixes GH-6648
2015-12-07 10:30:46 -05:00
Mitchell Hashimoto
21cacb6eb8 core: file:/// for windows paths [GH-5288] 2015-11-23 09:53:28 -08:00
Mitchell Hashimoto
4e1ba3a027 core: fix file URLs from cygwin on Windows [GH-5747] 2015-11-23 09:30:27 -08:00
Mitchell Hashimoto
079ee6ea95 Merge pull request #6540 from mitchellh/b-non-http-head
core: don't do HEAD request for box on non-HTTP [GH-5477]
2015-11-18 18:09:31 -08:00
Mitchell Hashimoto
7c9fd58786 core: log if not checking box metadata 2015-11-18 18:09:18 -08:00
Mitchell Hashimoto
7c49fd1418 core: fix crash on invalid checksum type [GH-6327] 2015-11-18 17:36:52 -08:00
Mitchell Hashimoto
891c47c742 core: don't do HEAD request for box on non-HTTP [GH-5477] 2015-11-18 16:52:40 -08:00
Mitchell Hashimoto
28bea401c0 core: if interrupted, don't open metadata file 2015-07-07 12:38:45 -06:00
Mitchell Hashimoto
ab27413954 core: make note that the box is being added directly [GH-5311] 2015-07-06 12:17:49 -06:00
Dmitry Moskalchuk
26e3994319 Add option to enable trusted HTTP redirects 2015-05-31 09:34:02 -07:00
Seth Vargo
a0b86a8474 Style fixes 2015-05-30 12:34:05 -07:00
Tim Rensen
6c2cc31926 Fixed inaccurate downloading status message
Importing a base box from the local file system currently outputs 'Downloading: file://...' which is more accurate now by presenting it as: 'Unpacking necessary files from: file://...'.
Fixes #5386.
2015-02-25 20:37:54 +01:00
Mitchell Hashimoto
a0be121f4f Revert "Merge pull request #5274 from mitchellh/sethvargo/atlas_api"
This reverts commit 7f19284ef4e8a67ffbcac98aa30db89ccd370d99, reversing
changes made to f0284d000be2480ae7a9d343bd54b6ef0d4d9e0a.
2015-02-03 06:39:28 +01:00
Seth Vargo
bec0f28f40 Use the new Atlas APIs for downloading boxes 2015-02-02 18:14:21 -05:00
Seth Vargo
d2874064f4 Use .key? instead of .has_key? 2015-01-05 18:29:01 -05:00
Seth Vargo
2e4f854725 Vagrant Cloud -> Atlas 2014-12-08 17:42:29 -08:00
Mitchell Hashimoto
4827469dee core: recognize more complex content types for json [GH-4525] 2014-10-23 11:26:56 -07:00
Anduin Withers
855bda8c26 Fix typo that prevents "vagrant box add --cert certfile -name foo URL" from working. 2014-10-22 23:19:15 -04:00