Skip to content

Storage & Health ​

Storage ​

Filesystem ​

toml
[storage]
type = "filesystem"
path = "/var/cache/batlehub"

S3-compatible (AWS S3, RustFS) ​

toml
[storage]
type   = "s3"
bucket = "batlehub-artifacts"
region = "us-east-1"

# For self-hosted S3 (RustFS): set a custom endpoint
# endpoint_url     = "http://rustfs:9900"
# force_path_style = true

The block takes no credentials, and an unknown key here is ignored rather than refused. They come from the AWS SDK chain — an IAM role, or AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY in the environment.

Multi-backend storage ​

Different registries can use different backends — for example, filesystem for most registries and dedicated S3 for large GitHub release artifacts:

toml
[storage]
type = "filesystem"
path = "/var/cache/batlehub"

[[storage.backends]]
name = "github-s3"
type = "s3"
bucket = "batlehub-github"
region = "us-east-1"

[[registries]]
type    = "github"
name    = "github"
storage = "github-s3"

S3 with RustFS (self-hosted) ​

Start RustFS via the bundled Compose file, then create the bucket:

sh
task compose:s3:db            # start RustFS + Postgres + Authentik
rc alias set local http://localhost:9900 rustfsadmin rustfsadmin
rc bucket create local/artifacts   # or: task compose:s3:bucket:create
task run:s3                   # run the server with the S3 config

Health & Observability ​

Health endpoint ​

sh
curl -H "Authorization: Bearer <admin-token>" \
  http://localhost:8080/api/v1/admin/health

Returns per-registry status (upstream reachability, cache hit rate) and overall server status.

The registry page ​

Admin → Registries → All registries lists every registry; each name opens its page (GET /api/v1/admin/registries/{name}). A strip at the top carries the five signals someone opens it for — upstream, cache, scan, queue and advice — and four tabs (?tab=overview|activity|scan|config) hold the detail:

  • Overview: the suggestions, a closed list computed by the server — an upstream degraded while stale metadata is not served, security on with no rescan interval, versions whose scan ran out of attempts.
  • Activity: upstream error rate and latency for this replica since it started (each replica counts its own), and the hourly history of [stats] (hits, misses, listing reads). Error and latency history are not kept by BatleHub: that is what the monitoring link is for.
  • Scan: whether the registry scans, its rescan interval, the last and next SBOM re-check, the queue counts, and a link to the Scans page filtered on it.
  • Configuration: the effective settings, built from an allow-list: a credential shows as configured (bearer), never as a value, and upstream URLs are shown with their credentials and query removed.

The page needs system:read. The Configuration tab also needs config:read, the upstream URLs upstreams:read, and the queue counts quarantine:read on the registry. With [stats] registry_dashboard_url set (configuration), a [Monitoring ↗] button opens your dashboard filtered on the registry, in a new tab that receives no referrer; [stats] dashboard_url puts the same button on the Dashboard.

Clear registry cache ​

Forces the next request for any package in the registry to re-fetch from upstream:

sh
curl -X POST \
  -H "Authorization: Bearer <admin-token>" \
  http://localhost:8080/api/v1/admin/registries/npm/clear-cache

OpenTelemetry (Jaeger, Tempo) ​

Enable distributed tracing by adding an [otel] block:

toml
[otel]
endpoint = "http://jaeger:4317"

Start the full observability stack locally:

sh
task compose:otel   # starts Postgres + server + Jaeger

Then open http://localhost:16686 for the Jaeger UI.

Released under the Apache 2.0 License. Made with care and too much coffee.