@@ -44,8 +44,8 @@ If you want to use one specific mirror, you can set it using the `mirror` option
44
44
45
45
Please don't do this unnecessarily; it's not nice to hammer one mirror. This mirror is not permitted to
46
46
be https://ziglang.org/download to avoid the official website being hit with large amounts of requests.
47
- If you've experienced issues with a default mirror, please open an issue, and I will communicate with the
48
- mirror's owner or remove it from the list.
47
+ If you've experienced issues with a default mirror, please [ open an issue][report-bad-mirror] on the Zig
48
+ website repository, which is where the list of mirrors is maintained .
49
49
50
50
If necessary, the caching of the global Zig cache directory can be disabled by setting the option
51
51
`use-cache : false`. Don't do this without reason: preserving the Zig cache will typically speed things up
@@ -63,6 +63,7 @@ setting `cache-size-limit: 0`.
63
63
64
64
[mach-nominated] : https://machengine.org/about/nominated-zig/
65
65
[matrix] : https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow
66
+ [report-bad-mirror] : https://github.com/ziglang/www.ziglang.org/issues/new
66
67
67
68
# # Details
68
69
@@ -75,65 +76,10 @@ local caches are redirected to the global cache directory to make optimal use of
75
76
76
77
# # Adding a mirror
77
78
78
- Anyone is welcome to host a Zig download mirror; thanks to the tarball signatures, the mirror provider need
79
- not be trusted. Naturally, if a mirror is found to be a bad actor, it will be removed, and likewise if a
80
- mirror repeatedly encounters reliability problems.
81
-
82
- The rules for adding a mirror are listed below. Note that I (@mlugg) reserve the right to, for any or no
83
- reason, exclude mirrors which obey these rules, or include mirrors which violate them.
84
-
85
- > [!NOTE]
86
- > While there are a lot of rules listed here, most of them should be obvious. They are stated explicitly here
87
- > to ensure complete clarity on what is expected of a mirror. Please do read these requirements through before
88
- > attempting to add a mirror.
89
-
90
- * A mirror provides a single base URL, which we will call `X`.
91
- * `X` **may** include a path component, but is not required to. For instance, `https://foo.bar/zig/` is okay,
92
- as is `https://zig.baz.qux/`.
93
- * The mirror **must** have working HTTPS support. `X` **must** start with `https://`.
94
- * The mirror **must** cache tarballs locally. For instance, it may not simply forward all requests to another
95
- mirror.
96
- * The mirror **may** routinely evict its local tarball caches based on any reasonable factor, such as age,
97
- access frequency, or the existence of newer versions. This does not affect whether the mirror may return 404
98
- for requests to these files (see below).
99
- * The mirror **must** download its tarballs from either `https://ziglang.org/`, or another mirror which
100
- follows these rules.
101
- * Tarballs **must** be accessible by sending GET requests for files under `X`, where the filename matches that
102
- of the files provided by `https://ziglang.org/`, not including the directory part. For instance,
103
- ` X/zig-linux-x86_64-0.13.0.tar.xz` is a valid access, and should return the same file as
104
- ` https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz` .
105
- * Files provided by the mirror **must** be bit-for-bit identical to their `https://ziglang.org/` counterparts.
106
- * If a file is accessed whose Zig version is a master branch build (i.e. a `-dev` version), and the version is
107
- ordered before the latest major release of Zig, the mirror **may** respond with 404 Not Found, but is not
108
- required to. For instance, at the time of writing, `0.13.0` is the latest major release of Zig, so a mirror
109
- may respond with 404 for `0.13.0-dev...` builds, but *not* for `0.14.0-dev...` builds.
110
- * If a file is accessed whose Zig version is `0.5.0` or below, the mirror **may** respond with 404 Not Found,
111
- but is not required to.
112
- * If a file is acccessed which represents a *source* tarball, such as `X/zig-0.13.0.tar.xz`, the mirror
113
- **may** respond with 404 Not Found, but is not required to. The same applies to "bootstrap source tarballs",
114
- such as `X/zig-bootstrap-0.13.0.tar.xz`.
115
- * For all other accesses of valid Zig tarballs, the mirror **must** respond with status code 200 OK and the
116
- file in question. If the mirror has not yet cached the file locally, it should immediately download it from
117
- a permitted source (as covered above), and respond with the downloaded file.
118
- * If a tarball `X/foo.ext` is available by the above rules, requesting the minisign signature file
119
- ` X/foo.ext.minisig` **must** also respond with status code 200 OK and the signature file in question, like
120
- the tarball itself.
121
- * The mirror **may** rate-limit accesses. If an access failed due to rate-limiting, the mirror **should**
122
- return HTTP status code 429 Too Many Requests.
123
- * The mirror **may** undergo maintenance, upgrades, and other scheduled downtime. If an access fails for this
124
- reason, where possible, the mirror **should** return HTTP status code 503 Unavailable. The mirror **should**
125
- try to minimize such downtime.
126
- * The mirror **may** undergo occasional unintended and unscheduled downtime. The mirror **must** go to all
127
- efforts to minimize such outages, and **must** resolve such outages within a reasonable time upon being
128
- notified of them.
129
- * The mirror **may** observe the `?source=github-actions` query parameter to track how many requests originate
130
- from this Action. This Action will provide this query parameter to all mirror requests.
131
-
132
- The easiest way to set up a mirror right now is using Mach's [Wrench][wrench]. For instructions, please see
133
- [the relevant section of their README][setup-wrench].
134
-
135
- [wrench] : https://github.com/hexops/wrench
136
- [setup-wrench] : https://github.com/hexops/wrench?tab=readme-ov-file#run-your-own-ziglangorgdownload-mirror
137
-
138
- After setting up a mirror, you can add it to this GitHub Action by opening a PR which adds it to the list in
139
- [mirrors.json](https://github.com/mlugg/setup-zig/blob/main/mirrors.json).
79
+ The list of tarball mirrors is not in this repository; rather, the [community mirror list][mirrors] from
80
+ ziglang.org is used. If you are interested in hosting a mirror of your own, check out the
81
+ [documentation][host-mirror] on the Zig website repository. That way, your mirror can benefit not just
82
+ setup-zig, but also any other tooling which wants to fetch Zig!
83
+
84
+ [mirrors] : https://ziglang.org/download/community-mirrors/
85
+ [host-mirror] : https://github.com/ziglang/www.ziglang.org/blob/main/MIRRORS.md
0 commit comments