summaryrefslogtreecommitdiff
path: root/lib/bundler/compact_index_client
Commit message (Collapse)AuthorAgeFilesLines
* Prefer `require_relative` for internal requiresDavid Rodríguez2019-04-191-1/+1
| | | | | | | | Due to the way rubygems monkey-patched require interacts with default gems, and given that bundler is a default gem, and that bundler manipulates the LOAD_PATH in very intricated ways, we can reduce the risk of "leaking" to a different copy of `bundler` by using `require_relative` for internal requires.
* Cleanup more stuff only needed for old rubiesDavid Rodríguez2019-04-081-5/+1
|
* [CompactIndexClient::Updater] Use filesystem_access when copying filessegiddins/updater-use-more-filesystem-accessSamuel Giddins2018-03-101-1/+3
|
* handle gzip corruption errors in the compact index clientcolby/client-index-gzip-errorColby Swandale2018-01-191-0/+2
|
* Avoid activating stdlib digest under Ruby 2.5seg-ruby-2-5-digest-gemSamuel Giddins2017-10-222-4/+2
|
* Load digest subclasses in a thread-safe mannerseg-digest-loadingSamuel Giddins2017-10-152-3/+3
|
* keep block syntax so temp dir gets cleaned upAdam Wanninger2017-09-101-53/+48
|
* handle Dir.mktmpdir failure outside of filesystem_access blockAdam Wanninger2017-08-271-45/+53
|
* bundler already does validations on $HOMEAdam Wanninger2017-08-271-12/+0
|
* ensure $HOME and Dir.tmpdir are writableAdam Wanninger2017-08-271-41/+55
|
* [RuboCop] Enable Layout/EmptyLineAfterMagicComment copKoichi ITO2017-07-162-0/+2
|
* Auto merge of #5826 - greysteil:handle-invalid-range-errors, r=indirectThe Bundler Bot2017-07-081-3/+21
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid Range Not Satisfiable errors during normal request flow ### What was the end-user problem that led to this PR? Previously, Bundler was requesting partial response ranges for the Rubygems compact index that could be empty. Since Rubygems was [ignoring the `ETag` header](https://github.com/rubygems/rubygems.org/pull/1652) for these requests, empty ranges would occur whenever the versions index (for instance) hadn't been modified since the version Bundler currently had cached. When this happened, Rubygems would respond with a 416 (Range Not Satisfiable). Bundler would treat this as a `Bundler::HTTPError`, and fall back to using `Fetcher::Dependency` for dependency info. Sadly, that meant metadata about what Ruby version each dependency required was no-longer checked, and updates for gems which should be limited by the system Ruby version were failing. Closes #5373. ### What was your diagnosis of the problem? See above ### What is your fix for the problem, implemented in this PR? This PR updates the range Bundler requests from Rubygems to ensure it's always satisfiable. It does that but requesting all bytes from (and including) the final byte in the Bundler cache, rather than all bytes after (and not including) it. ### Why did you choose this fix out of the possible options? An alternative fix would be to catch the 416 responses and retry the index lookup in those cases, asking for a full response. That would mean an extra request in all of those cases, though - this method keeps the number of calls to Rubygems down.
| * Avoid Range Not Satisfiable errors during normal request flowGrey Baker2017-07-041-3/+21
| |
* | Vendor fileutils since it is now a gemSamuel Giddins2017-06-281-2/+2
|/
* Updater.rb: Avoid using String method on nilOlle Jonsson2017-02-221-1/+1
| | | - the ETag header may not be available in the response, if so, we ignore that
* unless var.nil? → if varAndre Arko2016-10-071-2/+2
|
* use /tmp for mktmpdirAndre Arko2016-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | As we noticed in #4519, we need to use a temporary directory to hold compact index downloads so that multiple processes don't write to the same files at the same time and break everything. The fix for that was #4561, which added temporary directories to hold all files as they download, and then uses the (atomic) `FileUtils.cp` to move the completed downloads into place, so there is never a point where multiple processes are trying to write into the file at once. Unfortunately, using `Dir.mktmpdir` requires that the parent directory be _either_ world writable or sticky, but not both. Based on #4599, it looks like it's common for home directories to be both world writable and sticky. While that's a security problem by itself, it's not a big concern for Bundler and the compact index. So we want to let users continue to use Bundler, even with the compact index, without having to change the permissions on their home directories. This commit changes the `mktmpdir` call to create the temporary directory inside the default OS tempdir, which is typically `/tmp` or `/var/tmp` depending on distro. Since that directory is designed to hold other temporary directories, that change should (theoretically) reduce or eliminate the problem reported in #4599.
* Use filesystem_access in the compact indexseg-unvendor-compact-index-clientSamuel Giddins2016-09-232-5/+15
|
* Un-vendor the compact index clientSamuel Giddins2016-09-212-0/+197