Skip to content
Gantry
Sign in

OCI, npm, and cargo registries in one container

Blobs live in object storage and metadata in Turso or Postgres. The stock docker, npm, and cargo CLIs work against it unchanged.

Gantry Cloud is in early access, and sign-in is limited to an allowlist. Self-hosting needs no account.

registry.gantry.willothy.dev
docker push registry.gantry.willothy.dev/acme/containers/api:1.4.0
npm publish --registry https://registry.gantry.willothy.dev/npm/acme/js/
cargo publish --registry acme

Registries

An org can have any number of registries, each in one format. All of them use the org's tokens and audit log.

Containers

OCI distribution

Passes the OCI distribution-spec conformance suite: 850 passed, 0 failed. The password for docker login is a Gantry token.

  • Multi-platform indexes, with sizes and layers shown in the console
  • Optional cosign signature checks on pull
terminal
docker login registry.gantry.willothy.dev -u ci
docker push registry.gantry.willothy.dev/acme/containers/api:1.4.0

npm

npm registry API

There is no npm login step. Point npm at the registry and give it a token, for all packages or one scope.

  • publish, install, view, search, dist-tag, deprecate, and unpublish work
  • An unpublished version number cannot be reused
terminal
npm config set registry https://registry.gantry.willothy.dev/npm/acme/js/
npm config set //registry.gantry.willothy.dev/npm/acme/js/:_authToken "$GANTRY_TOKEN"

Cargo

Sparse index

Cargo reads the sparse index directly and authenticates with its built-in cargo:token provider.

  • cargo publish and cargo yank with --registry acme
  • Public registries can be read without a token
~/.cargo/config.toml
[registry]
global-credential-providers = ["cargo:token"]

[registries.acme]
index = "sparse+https://registry.gantry.willothy.dev/cargo/acme/crates/index/"

Pull-through caches

A registry can mirror Docker Hub (or GHCR, ECR, Quay), npmjs, or crates.io. On the first request, Gantry fetches the content and checks it against its digest, integrity, or cksum. It keeps serving what it cached while the upstream is down.

terminal
docker pull registry.gantry.willothy.dev/acme/hub/alpine:3.20
npm config set registry https://registry.gantry.willothy.dev/npm/acme/npmjs/

Access control and audit

Every write records an audit event in the same database transaction as the change. Permissions come from org roles, teams, and token grants.

Hash-chained audit log

Each event's hash covers the previous event's hash, so editing or deleting an event breaks the chain. GET /api/v1/orgs/{org}/audit/verify recomputes it.

Export streams the chain as JSON lines to your bucket, Splunk HEC, or Datadog. gantry audit verify-export checks a copy offline.

terminal
aws s3 sync s3://acme-gantry/registry/audit ./audit && gantry audit verify-export ./audit
  1. token.createseq n
    target acme/ci
    prev_hash h(n-1)hash h(n)
  2. version.publishseq n+1
    target acme/containers/api
    prev_hash h(n)hash h(n+1)
  3. retention.updateseq n+2
    target acme/containers
    prev_hash h(n+1)hash h(n+2)

OpenID Connect SSO

Each org connects its own IdP, with allowed email domains and a default role. Teams map to IdP groups and are resynced at every sign-in.

Scoped tokens

A grant lists registries, a package glob such as team-*, and actions. A token a person creates can never do more than they can.

Trusted publishing

A CI job exchanges its OIDC token for a Gantry token that expires in 15 minutes. The trust policy pins claims like repository_id and ref.

Signed images

An OCI registry can refuse pulls of images without a cosign signature from a listed key or a trusted Sigstore identity. Audit mode logs what it would refuse.

Webhooks

Each delivery is a POST signed with HMAC-SHA256 and retried with backoff for a day. The console lists deliveries and can resend one.

SSRF guard

Upstream and IdP URLs must resolve to public addresses. Gantry checks this when the URL is saved and again on every connection and redirect.

SCIM

Coming soon

Provision and suspend users from your IdP.

SAML

Coming soon

Sign in with IdPs that do not support OpenID Connect.

Hosted or self-hosted

Both run the same server. A self-hosted server can sign people in through Gantry Cloud, so one account works on both.

For individuals and startups

Gantry Cloud

We run the registry. During early access, sign-in is limited to an allowlist.

  • Sign in with GitHub or an email link
  • Push to registry.gantry.willothy.dev
  • Invite people by email with a role and teams
  • Publish from GitHub Actions without a stored secret
~/.npmrc
@acme:registry=https://registry.gantry.willothy.dev/npm/acme/js/
//registry.gantry.willothy.dev/npm/acme/js/:_authToken=${GANTRY_TOKEN}

For enterprises

Self-hosted

Run the server in your own cloud, with your own bucket and IdP. There is no tagged release yet, so build the image from source.

  • SSO with your own OpenID Connect provider
  • SCIM provisioningComing soon
  • SAML sign-inComing soon
  • Audit export to S3, Splunk HEC, or Datadog
  • Secrets encrypted with AWS KMS or Vault transit
  • Compose files, a Helm chart, and Fly.io configs
terminal
git clone https://github.com/willothy/gantry && cd gantry
docker build -t gantry .
cd deploy/compose && mkdir -p secrets
openssl rand -base64 32 > secrets/encryption-key
GANTRY_IMAGE=gantry docker compose up -d
docker compose logs gantry | grep setup_token

How it works

One Rust process serves the registry protocols, the management API, and sign-in. Blobs go to object storage. Everything else goes to the metadata backend you choose.

Clients talk to one Gantry container, which keeps blobs in object storage and metadata in the backend you choose.
  • docker
  • npm
  • cargo
  • console
  • CI with OIDC

gantry

OCI · npm · cargo · /api/v1 · /auth · /metrics

Object storage

Layers, tarballs, .crate files, and optionally the metadata log and audit export

S3 · R2 · MinIO · Tigris · GCS · Azure · disk

Metadata

Registries, versions, tokens, members, and the audit chain

Turso · Turso Cloud · Postgres · bucket log

Metadata backends

  • Embedded Turso

    default

    Replicas
    One
    Local disk
    The volume is the database
  • Bucket change log

    GANTRY_META_LOG=bucket

    Replicas
    One writer; a second is fenced
    Local disk
    A cache; an empty one restores from the bucket
  • Turso Cloud

    GANTRY_TURSO_DATABASE_URL

    Replicas
    One
    Local disk
    A cache; an empty one restores from Turso Cloud
  • Postgres

    GANTRY_DATABASE_URL

    Replicas
    Any number, rolling updates
    Local disk
    None

Presigned downloads

With GANTRY_STORAGE_REDIRECTS=on, Gantry checks the token and answers a blob request with a 307 to a presigned URL. The bytes come from the bucket or your CDN.

Retention and GC

Per-registry policies keep the newest N versions or drop versions past an age. You can preview what a policy would delete. Tags are never deleted.

Metrics and traces

Prometheus /metrics, /healthz, and /readyz on their own listener. Traces go out over OTLP.

Shutdown and limits

On SIGTERM, /readyz fails first and in-flight requests drain. Over a limit, clients get 429 or 503 with Retry-After.

The full design is in docs/architecture.md.

Get started

Sign in to Gantry Cloud if you are on the allowlist, or clone the repository and run it.