PlatformRegistriesCargo

Cargo Registry

Publish and install Rust crates from Drok's integrated Cargo-compatible registry.

Drok's Cargo registry implements the Cargo registry protocol, allowing you to publish and consume private Rust crates using the standard cargo toolchain.

Configuration

Add Drok as a registry in your Cargo configuration:

# ~/.cargo/config.toml
[registries.drok]
index = "sparse+https://drok.us/api/v1/packages/cargo/your-org/index/"
token = "Bearer YOUR_Drok_TOKEN"

Or authenticate via the CLI:

cargo login --registry drok

Publishing

Specify the registry when publishing:

cargo publish --registry drok

Ensure your Cargo.toml includes the required metadata:

[package]
name = "my-crate"
version = "1.0.0"
edition = "2021"
description = "Description of my crate"
license = "MIT"

From Pipelines

# .lehub/pipeline.yml
stages:
  - name: publish
    when: tag =~ "v*"
    steps:
      - name: Publish crate
        run: cargo publish --registry drok
        secrets: [CARGO_REGISTRY_TOKEN]

Dependencies

Reference Drok-hosted crates in your Cargo.toml:

[dependencies]
my-crate = { version = "1.0", registry = "drok" }

Features

  • Sparse index protocol — Uses the sparse registry protocol (RFC 2789) for fast dependency resolution
  • Crate mirroring — Optionally mirror crates.io crates for air-gapped environments
  • Build metadata — Published crates include build provenance when published from Drok Pipelines
  • Documentation hostingcargo doc output is hosted alongside the crate
  • Yanking — Yank versions via cargo yank --registry drok --version 1.0.0

Dependency Resolution

Cargo resolves dependencies from Drok's registry for crates specifying registry = "drok" and from crates.io for all other dependencies. Mixed resolution is seamless — your crate can depend on both private Drok crates and public crates.io crates in the same project.