This is a list of potential use cases for something like alternative registries & some analysis of how to solve these use cases.
As context, a registry contains two network service components:
- The index: a git repository containing metadata about the packages in the registry
- The crate source: an HTTP server serving the actual package data
I want to host my own crates separately from crates.io, to serve to people with appropriate access.
This is the use case squarely covered by the current alternative registries feature. The alternative registries feature lets you teach cargo about the existence of a registry other than the default registry, allowing you to depend on crates from multiple registries at the same time.
I want to replace crates.io with my own private mirror, possibly containing additional crates. I want to "airgap" myself from the official ecosystem.
We already allow you to redirect the crates.io index to a new index through two different mechanisms (!), both through .cargo/config
:
- The
registry.index
key will override the index for the default registry - Using source replacement with a registry source.