Lightweight tool for creating project-specific offline crates.io mirrors
Either build from published source in crates.io.
$ cargo install zerus --locked
Or download from github releases.
Use zerus mirror to download .crate files for your project's dependencies.
$ zerus mirror new-mirror ../deku/Cargo.toml ../adsb_deku/Cargo.tomlAdding the top 100 rust crates used by rust-playground is easy:
$ git clone https://github.com/rust-lang/rust-playground
$ zerus mirror new-mirror rust-playground/top-crates/Cargo.tomlCopy the mirror directory to your proxy or offline network.
On the offline network, use update-index to generate a registry index from the .crate files.
$ zerus update-index new-mirror --dl-url http://[IP]Use any http(s) server to host the mirror directory.
Add the following to .cargo/config.toml (replacing [IP] with your server address).
[source.zerus]
registry = "sparse+http://[IP]/crates.io-index/"
[source.crates-io]
replace-with = "zerus"