51 Commits

Author SHA1 Message Date
Brian Cain
9b385df4ec
Fix comment formatting 2018-10-12 09:07:12 -07:00
Brian Cain
83bd592e30
Introduce curl helper and uploader classes
This commit introduces a new uploader class for uploading files and
splits up some commonly used functionality between it and the downloader
class into a curl helper library.
2018-10-12 09:07:10 -07:00
Chris Roberts
c660643abb Prevent matching on other Location headers
Prevent matching on custom headers that include the Location name
when checking for host redirection.
2018-07-19 09:18:30 -07:00
Chris Roberts
a490a8c587
Merge pull request #9966 from conspicuousClockwork/#9965
Added option to add to User-Agent
2018-07-18 16:43:02 -07:00
Thomas Röggla
2613d620fd checking whether the field location_uri.host is nil 2018-07-12 15:49:26 +02:00
Caleb Martinez
447e58dac3
Added option to add to User-Agent 2018-06-28 13:21:34 -04:00
Brian Cain
67c3f866dd
(#7886) Add tests and simplify code for continuing on 416 2018-04-25 14:03:24 -07:00
Alexey Kamenskiy
f1993dfa19
Fixed minor typo in comment 2018-04-25 09:12:08 -07:00
Alexey Kamenskiy
cd3035e5e9
Issue #7885 Don't raise error if response is 416
416 means there is no more bytes to download (which works only with `--continue-at -` of curl)
2018-04-25 09:12:08 -07:00
Josh Soref
1a5ddea9f4 Spelling fixes
* account
* addresses
* administrator
* afterwards
* because
* bridgeable
* capabilities
* capability
* checksum
* configuration
* configuration for
* configure
* criteria
* delimited
* delivered
* derivatives
* description
* detect
* directory
* display
* downloading
* during
* electric
* enabling
* encountered
* equivalent
* executable
* executed
* hashicorp
* hypervisor
* hyphens
* implementation
* incorporate
* inheritance
* initialize
* instance
* instead
* interactions
* invocable
* machine
* maximum
* message
* mounting
* overridden
* overwrite
* paramiko
* preparing
* provides
* provisioning
* recursively
* requested
* resetting
* retryable
* running
* satisfied
* searching
* sometimes
* specified
* successfully
* synced folders
* unauthorized
* underlying
* userprofile
* vagrant
* vagrantfile
* variable
* various
* version
* virtual
* windows
2018-03-14 14:41:04 +00:00
Chris Roberts
ffa6d2810d Remove end of line matcher from progress regexp 2018-02-22 09:46:24 -08:00
Chris Roberts
04e05088ff Check location first. Grab final progress when multiple entries listed. 2018-02-21 19:46:12 -08:00
Chris Roberts
5e7e56f573 Fix redirect display and chosen location 2018-02-21 17:05:13 -08:00
Chris Roberts
fa2f17c7ae Notify user when download host changes on redirect 2018-02-21 17:05:13 -08:00
Chris Roberts
06e3185eb1 Use CURL_CA_BUNDLE environment variable inplace of building path at runtime 2017-11-02 12:49:34 -07:00
Chris Roberts
beffa70941 Downloader checksum output information and digester usage
Add more output information around type of checksum being validated.
Use builtin Digest#file to read target file for generation of hexdigest.
2016-11-14 10:22:25 -08:00
Chris Roberts
da45ca707c Add md5 and sha1 checksum support to Downloader.
Allows checksum validation on downloaded files via Util::Downloader
using MD5 and/or SHA1 checksums. This also integrates checksum validation
support with the shell provisioner for downloaded remote files.
2016-11-09 16:05:39 -08:00
Mitchell Hashimoto
e0ef592544 core: retry if server doesn't support byte ranges on download [GH-4479] 2015-11-19 16:14:13 -08:00
Seth Vargo
d88d126ad9 Use a properly-formatted custom User-Agent 2015-07-20 23:33:31 -04:00
Mitchell Hashimoto
6c06db776d core: test for URI escaping 2015-07-06 16:26:06 -06:00
Dmitry Moskalchuk
26e3994319 Add option to enable trusted HTTP redirects 2015-05-31 09:34:02 -07:00
Matthew Rahtz
29c77e5719 Escape/unescape cURL URLs/auth
so that we can deal with special characters in usernames and passwords
2015-04-29 14:34:00 +01:00
Mitchell Hashimoto
46b3ea64d1 core: retry download without continue if byte range not supported
[GH-4479]
2014-10-23 11:06:29 -07:00
Mitchell Hashimoto
e198652e75 core: don't load curlrc [GH-4328] 2014-08-10 20:49:53 -07:00
Kalman Hazins
bb052366f7 Change symbols inside hashes to 1.9 JSON-like syntax 2014-05-22 12:35:12 -04:00
Rémi Paulmier
00a2670406 added capath option to curl Downloader 2014-05-19 18:08:23 +02:00
Mitchell Hashimoto
513efa6739 core: Downloads with user/pass use curl -u flag [GH-3183] 2014-03-13 08:53:18 -07:00
Mitchell Hashimoto
d4c753c48d core: download metadata with JSON accept header 2014-02-07 10:30:25 -08:00
Mitchell Hashimoto
b71cde6b99 core: make box add UI much icer 2014-02-05 21:19:44 -08:00
Mitchell Hashimoto
05eeefbe36 core: Fix Downloader tests 2014-02-05 21:19:34 -08:00
Mitchell Hashimoto
09e8666296 core: BoxAdd now works with HTTP URLs 2014-02-05 21:19:31 -08:00
Mitchell Hashimoto
2a08302145 core: BoxAdd can add old boxes (happy path) 2014-02-05 21:19:26 -08:00
Mitchell Hashimoto
961d3607b9 core: add newline to end of download if windows 2014-02-05 21:19:24 -08:00
Mitchell Hashimoto
cd3e19306c commands/box/add: custom CA cert [GH-2337] 2013-11-26 19:32:56 -08:00
Mitchell Hashimoto
13b52f6b6e Merge branch 'client-certs' of https://github.com/sthulb/vagrant into sthulb-client-certs
Conflicts:
	config/default.rb
	lib/vagrant/action/builtin/handle_box_url.rb
	plugins/commands/box/command/add.rb
2013-11-25 16:50:11 -08:00
Mitchell Hashimoto
5d9c002bdd core: don't make all downloads continuable 2013-11-23 15:47:42 -08:00
Rick Harris
87a47abee8 Add resumable downloads
Since VM images can be fairly large and connections rather flaky, it would be
nice to support resumable downloads whereby, if a download is interrupted for
some reason, on the next attempt, it picks up where it left off.

To implement this, the following changes were made:

* The temporary download filename is now constructed from a SHA1 of the
  `box_url` instead of a timestamp. This allows separate invocations of
  Vagrant to 'share' the download-path if the URLs exactly match.

* Add `--continue-at -` option to `curl` which tells it to automatically resume
  downloading where it left off

* Modify the `recover` method in `box_add` to not remove the temporary
  download path if the download was interrupted

Known Issue:

* The progress on a resumed download will look a bit wonky in the sense that,
  it starts at 0% each time, instead of where it left off. Since Vagrant is
  pulling this directly from `curl`, this is more of an upstream issue.

Fixes #57
2013-11-20 15:15:38 -06:00
Brian Porter
accff3689b Comment typo fixes
Only comment changes.

Removed stray apostrophe from Util::Downloader.initialize() doc block. Corrected open => options for .download! description.
2013-09-04 14:37:17 -05:00
Mitchell Hashimoto
ff36a46178 Set user agent to Vagrant + version
/cc @fgrehm
2013-07-28 20:51:35 -07:00
Fabio Rehm
c7aed1a6a1 Provide a custom user agent header to cURL request so that URL shorteners are able to track the amount of downloads 2013-07-28 20:23:27 -03:00
Simon Thulbourn
c495fb7c5c adds options for client certs to downloader class
Adds :client_cert to the env array and then passes it into the curl
options array
2013-05-21 11:39:43 +01:00
Mitchell Hashimoto
2239036b59 Use Mozilla CA cert bundle for SSL validation 2013-04-16 17:32:30 -07:00
Mitchell Hashimoto
dc31725049 Follow redirects when downloading boxes [GH-1607] 2013-04-16 13:25:32 -07:00
Mitchell Hashimoto
0f0c0b0396 Add max redirects for download 2013-04-03 12:01:12 -07:00
Mitchell Hashimoto
5e2549fe8b Add "--insecure" flag for downloader 2013-04-03 11:57:40 -07:00
Mitchell Hashimoto
87f7cba16b Fix cURL parsing with invalid blanks 2013-04-03 08:31:41 -07:00
Mitchell Hashimoto
d1e2596ce5 Properly accumulate and parse cURL output for progress 2013-04-03 08:31:41 -07:00
Mitchell Hashimoto
05c6379abb Setup file protocol if adding a box from a file 2013-04-03 08:31:41 -07:00
Mitchell Hashimoto
6c1eb2b007 Download boxes using CURL! 2013-04-03 08:31:41 -07:00
Mitchell Hashimoto
b9a2855fcb Tests for the downloader 2013-04-03 08:31:41 -07:00