Make it possible to resume an automatic upgrade download
Originally created by @Anonymous on #15875 (Redmine)
reported by users, but we do it only if it’s cheap to implement because it might be superseded if we look into replacing our upgrader.
Downloading target files should be more robust on flaky Internet connections.
E.g. when a target file download times out, it should be retried a few times. Ideally, the download should be resumed using the already downloaded partial content.
Tails::IUK::TargetFile::Download
currently uses
Tails::IUK::LWP::UserAgent::WithProgress
, which is a child class of
LWP::UserAgent
.
Possible implentation ideas:
- https://metacpan.org/pod/LWP::UserAgent::ExponentialBackoff - not in Debian, does not resume interrupted downloads
- https://metacpan.org/pod/LWP::UserAgent::Determined - in Debian, does not resume interrupted downloads
- https://metacpan.org/pod/LWP::UserAgent::Patch::Retry - not in Debian, does not resume interrupted downloads
- code samples that use the Range header when needed
- more code samples
- https://metacpan.org/pod/HTTP::RangeSaver
If we instead used Curl:
- we could switch to the
curl
CLI tool that has a--retry
option - https://curl.haxx.se/libcurl/c/CURLOPT_RESUME_FROM.html
- https://curl.haxx.se/libcurl/c/CURLOPT_RANGE.html
Alternatively, there could be a button for manually retrying or resuming an interrupted download.
Feature Branch: feature/15875-upgrader-resume-iuk-download
Testing SOCKS proxying
Thanks to anonym for figuring this out!
SOCKS proxy
ssh -N -D 127.0.0.1:6666 localhost
Target server (e.g. web server)
netcat -l 8080
Client
# /etc/tor/torsocks.conf needs "AllowOutboundLocalhost 1"
echo test1234 | torsocks --user foo --pass bar --port 6666 netcat localhost 8080