Skip to content

Instantly share code, notes, and snippets.

@withoutboats
Created July 11, 2018 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save withoutboats/28ab585b7161d763f1e1839e5c1b6b4b to your computer and use it in GitHub Desktop.
Save withoutboats/28ab585b7161d763f1e1839e5c1b6b4b to your computer and use it in GitHub Desktop.
use cases for alternative registries

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:

  1. The index: a git repository containing metadata about the packages in the registry
  2. The crate source: an HTTP server serving the actual package data

Private registry

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.

Mirroring crates.io

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:

  1. The registry.index key will override the index for the default registry
  2. Using source replacement with a registry source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment