tree: 768cbb46abc9b581857404d8d210adc607e52f3d [path history] [tgz]
  1. bcr-mirror.js
  2. README.md
  3. wrangler.jsonc
tools/bcr-mirror/README.md

BCR source archive mirror

This directory contains a Cloudflare Worker that mirrors source archives for modules in a Bazel registry to a Cloudflare R2 bucket. The bucket can then be used with Bazel's --module_mirrors flag (available as of Bazel 8.4.0).

Usage

The worker supports requests to /<module>/<version> and mirrors the source archive for the specified module version to the configured R2 bucket. Since this operation is idempotent and can only be used to add source archives referenced by the configured registry, the worker does not require authentication.

Deployment

You may have to modify the variables and bindings in wrangler.jsonc as needed. Then deploy the worker via npx wrangler deploy.