https://github.com/integer32llc/margo
An alternate Cargo registry using static files
https://github.com/integer32llc/margo
cargo registry rust
Last synced: 4 days ago
JSON representation
An alternate Cargo registry using static files
- Host: GitHub
- URL: https://github.com/integer32llc/margo
- Owner: integer32llc
- License: apache-2.0
- Created: 2024-04-19T19:59:12.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2026-03-25T18:17:41.000Z (3 months ago)
- Last Synced: 2026-06-16T21:30:13.397Z (12 days ago)
- Topics: cargo, registry, rust
- Language: Rust
- Homepage: https://integer32llc.github.io/margo/
- Size: 723 KB
- Stars: 143
- Watchers: 2
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome - integer32llc/margo - An alternate Cargo registry using static files (Rust)
README
# Margo
Margo is an alternate [Cargo registry][registry] that is built using
completely static files, allowing it to be easily served.
[registry]: https://doc.rust-lang.org/cargo/reference/registries.html
## Quickstart
To use Margo in GitHub Actions, such as hosting your registry on
GitHub Pages, check out our [action][].
[action]: https://github.com/integer32llc/margo-actions
### Install Margo
```bash
cargo install margo --index sparse+https://integer32llc.github.io/margo/
```
### Initialize the registry
This will create a new registry in the directory
`my-registry-directory` that you plan to serve from
`https://my-registry.example.com`.
```bash
margo init my-registry-directory --base-url https://my-registry.example.com
```
### Add a crate to the registry
To add a new crate or version to the registry, run `margo add` and specify
the path to the directory you gave to `margo init` and the `.crate` file
to publish.
```bash
# Acquire a crate package, such as by running `cargo package`
margo add --registry my-registry-directory some-crate/target/package/some-crate-1.2.3.crate
```
### Serve the registry files with your choice of webserver
For example, using Python and serving the registry in the directory
at `127.0.0.1`:
```bash
python3 -m http.server --bind '127.0.0.1' --dir 'my-registry-directory'
```
You should be able to visit `127.0.0.1/config.json` in your browser.
Your next step is to serve those files from
`https://my-registry.example.com` instead, in whatever way you
serve static files from whatever URL you've specified.
### Configure Cargo
```bash
# In your Rust project that wants to use `some-crate`
mkdir .cargo
cat >>.cargo/config.toml <