tree: 936c61ef09400d33cb2cb5265c6e9a8a8e5adf5e [path history] [tgz]
  1. BUILD.bazel
  2. main.go
  3. README.md
build/mirror_proxy/README.md

Bazel downloader mirror

This is a small tool which acts as a transparent proxy-ish mirror for use in the bazel downloader. By using a bazel_downloader.cfg we can instruct bazel to rewrite the download URLs and use a custom target instead. We use this to mirror all dependencies to our S3 storage.

Usage

This is expected to run with a given bucket name and a hardcoded set of credentials which are used to authenticate requests. When an authenticated request is received, the mirror will download uncached data if it isn't in the cache yet. This is expected to be used by trusted users, e.g. employees.

There are two ways to authenticate with bazel. Either with the credential helper or a .netrc file, which a user should deploy a inside their home folder based on the following template to allow bazel to authenticate against the mirror.

~/.netrc

machine mirror.monogon.dev
login myfancyusername
password mysecretpassword