-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Describe the problem you are trying to solve
I would like to setup a simple mirror of crates.io (including crates) for use within a company so that:
- we are able to build our products in the future if there are any issues with crates.io
- we have a local copy of all crates that we use to build our products
Describe the solution you'd like
For a mirror I would like to be able to override the download location for a registry so that it is possible to use something like artifactory to create a cache of all crates which are requested. I did originally propose a PR for this under #4697, which I managed to workaround the lack of support by modifying config.json to update the download location and then setup a job to perform the merges, however this is a pain as when there are merge conflicts merging the index it needs sorting before people using the mirror index can pick up the latest crates.
Having something along the following lines in cargo config would mean that a direct clone of the crates index file can be used in a mirror and thus reduce the overhead:
[source]
[source.mirror]
registry = "https://[host and path to your git server]/crates.io-index"
[source.mirror.config]
dl = <caching download location>
[source.crates-io]
replace-with = "mirror"
For completeness I would suggest allowing api as well to be overridden here (although in my scenario that is not required).
Notes