https://github.com/wcampbell0x2a/zerus
Lightweight binary to download only project required crates for offline crates.io mirror
https://github.com/wcampbell0x2a/zerus
build cargo crates-io mirror offline rust
Last synced: about 1 year ago
JSON representation
Lightweight binary to download only project required crates for offline crates.io mirror
- Host: GitHub
- URL: https://github.com/wcampbell0x2a/zerus
- Owner: wcampbell0x2a
- License: apache-2.0
- Created: 2022-07-23T14:26:14.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2025-04-29T23:38:53.000Z (about 1 year ago)
- Last Synced: 2025-04-30T22:46:06.375Z (about 1 year ago)
- Topics: build, cargo, crates-io, mirror, offline, rust
- Language: Rust
- Homepage:
- Size: 242 KB
- Stars: 43
- Watchers: 2
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE-APACHE
Awesome Lists containing this project
README
zerus
===========================
[
](https://github.com/wcampbell0x2a/zerus)
[
](https://crates.io/crates/zerus)
[
](https://docs.rs/zerus)
[
](https://github.com/wcampbell0x2a/zerus/actions?query=branch%3Amaster)
Lightweight binary to download only project required crates for offline crates.io mirror
## Build zerus
Either build from published source in crates.io.
```
$ cargo install zerus --locked
```
Or download from [github releases](https://github.com/wcampbell0x2a/zerus/releases).
## Usage
```console
Usage: zerus [OPTIONS] [WORKSPACES]...
Arguments:
new directory to contain offline mirror crate files
[WORKSPACES]... list of Cargo.toml files to vendor depends
Options:
--build-std Cache build-std depends for nightly version
--git-index-url Hostname for git index crates.io
--skip-git-index Skip download of git index crates.io
-h, --help Print help
-V, --version Print version
```
Example of adding dependencies of two projects, meant to be hosted on `127.0.0.1`.
```console
$ zerus new-mirror ../deku/Cargo.toml ../adsb_deku/Cargo.toml --git-index-url http://127.0.0.1
```
Adding the top 100 rust crates used by rust-playground is easy:
```console
$ git clone https://github.com/rust-lang/rust-playground
$ zerus new-mirror rust-playground/top-crates/Cargo.toml
```
## Serve mirror
Use any `http(s)` server.
### Build with mirror
Add the following to the `.cargo/config` file(replacing IP with your ip).
```toml
[source.zerus]
registry = "sparse+http://[IP]/crates.io-index/"
[source.crates-io]
replace-with = "zerus"
```
## Margo
Through the use of [margo](https://github.com/integer32llc/margo), you can make a alternate Cargo registry without
downloading the entire `crates.io` git index.
```
$ zerus mirror ../deku/Cargo.toml --build-std nightly --skip-git-index
$ margo add --registry my-registry-directory mirror/*/*/*/*/*/*.crate
```