Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions reference/command-line-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1395,15 +1395,15 @@ Remote caching and execution options:
and preceded by a `#`. Example: `# evil.com is known to host malicious code`

The `allow` and `block` directives take a host name as an argument. For
example: `block mvnrepository.com` or `allow github.com`. The given host
example: `block mvnrepository.com.example` or `allow github.com.example`. The given host
and all subdomains will be allowed or blocked. Do not include the URL
scheme (`http://` or `https://`). You can block all hosts with the `*`
wildcard: `block *`.

The `rewrite` directive takes two regex patterns: the first to match a URL
and the second to substitute matched URLs with. For example, `rewrite github.com/bazel-contrib/rules_python/releases/download/(.*)/(.*) mycorp.com/rules_python_mirror/$1/$2` will cause the downloader
to access `mycorp.com/rules_python_mirror` whenever attempting
to download rules_python from GitHub. The substitute URL supports
and the second to substitute matched URLs with. For example, `rewrite github.com.example/bazel-contrib/rules_python/releases/download/(.*)/(.*) mycorp.example/rules_python_mirror/$1/$2` will cause the downloader
to access `mycorp.example/rules_python_mirror` whenever attempting
to download rules_python from example.com. The substitute URL supports
back-references starting from `$1`. It is possible for multiple
`rewrite` directives for the same matched URL to be provided, and in
this case multiple URLs will be returned and tried sequentially. Do not
Expand All @@ -1419,23 +1419,23 @@ Remote caching and execution options:
worked around by rewrite the path to a blocked host:

```
block dummy_host.com
rewrite foo.com/bar/.* dummy_host.com
block dummy_host.invalid
rewrite example.com/bar/.* dummy_host.invalid
```

An example config may look like:

```
all_blocked_message See mycorp.com/blocked-bazel-fetches for more information.
block mvnrepository.com
block maven-central.storage.googleapis.com
all_blocked_message See example.com/blocked-bazel-fetches for more information.
block mvnrepository.com.example
block maven-central.storage.googleapis.com.example

# See internal doc id1234 for why gitblit is blocked
block gitblit.github.io
rewrite repo.maven.apache.org/maven2/(.*) artifacts.mycorp.com/libs-release/$1
block gitblit.github.com.example
rewrite repo.maven.apache.org.example/maven2/(.*) artifacts.mycorp.example/libs-release/$1

# Use our GCS bucket for rules_python
rewrite github.com/bazel-contrib/rules_python/releases/download/(.*)/(.*) mycorp.com/rules_python_mirror/$1/$2
rewrite github.com.example/bazel-contrib/rules_python/releases/download/(.*)/(.*) mycorp.example/rules_python_mirror/$1/$2
```

See also: [Insulating Builds from the Internet](https://bazel.build/external/faq#how-do-i-insulate-my-builds-from-the-internet)
Expand Down
2 changes: 1 addition & 1 deletion upstream
Submodule upstream updated 230 files
31 changes: 31 additions & 0 deletions versions/8.6.0/reference/be/be-nav.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
\*\*Build Encyclopedia\*\*

* [Overview](/reference/be/overview)
* [Concepts](#be-menu)
+ [Common Definitions](/reference/be/common-definitions)
+ ["Make" variables](/reference/be/make-variables)
* [Rules](#be-rules)
+ [Functions](/reference/be/functions)
+ [C / C++](/reference/be/c-cpp)
+ [Java](/reference/be/java)
+ [Objective-C](/reference/be/objective-c)
+ [Protocol Buffer](/reference/be/protocol-buffer)
+ [Python](/reference/be/python)
+ [Shell](/reference/be/shell)
+ [Extra Actions](/reference/be/extra-actions)
+ [General](/reference/be/general)
+ [Platforms and Toolchains](/reference/be/platforms-and-toolchains)
+ [Workspace](/reference/be/workspace)
+ [AppEngine](https://github.com/bazelbuild/rules_appengine)
+ [Apple (Swift, iOS, macOS, tvOS, visionOS, watchOS)](https://github.com/bazelbuild/rules_apple)
+ [C#](https://github.com/bazelbuild/rules_dotnet)
+ [D](https://github.com/bazelbuild/rules_d)
+ [Docker](https://github.com/bazelbuild/rules_docker)
+ [Groovy](https://github.com/bazelbuild/rules_groovy)
+ [Go](https://github.com/bazelbuild/rules_go)
+ [JavaScript (Closure)](https://github.com/bazelbuild/rules_closure)
+ [Jsonnet](https://github.com/bazelbuild/rules_jsonnet)
+ [Packaging](/reference/be/pkg)
+ [Rust](https://github.com/bazelbuild/rules_rust)
+ [Sass](https://github.com/bazelbuild/rules_sass)
+ [Scala](https://github.com/bazelbuild/rules_scala)
Loading