1
0
Fork
You've already forked zig-mirror
0
  • Zig 76%
  • CSS 18.1%
  • HTML 5.6%
  • Dockerfile 0.3%
2026年06月03日 17:37:52 +02:00
src refactor DirList to its own file 2026年05月08日 13:47:40 +02:00
.dockerignore fix dockerignore 2025年10月31日 10:24:53 +01:00
.gitignore zig 0.16.0-dev.2984+cb7d2b056 2026年03月26日 19:18:00 +01:00
.gitlab-ci.yml fix ci cmd format 2026年03月31日 13:45:01 +02:00
build.zig add windows targets 2026年03月30日 19:38:46 +02:00
build.zig.zon upgrade oci 2026年06月03日 17:37:52 +02:00
Dockerfile ci: upgrade zig-container 2025年11月01日 21:47:06 +01:00
LICENSE lic 2025年05月01日 19:28:04 +02:00
README.md bump version to 0.4.0 2026年03月29日 12:23:08 +02:00

Zig Community Mirror

This is a simple mirroring http server to provide a zig community mirror:

https://ziglang.org/download/community-mirrors/

Following the hosting specification:

https://github.com/ziglang/www.ziglang.org/blob/main/MIRRORS.md

All files are validated using their minisign signatures and the ZSF key before being stored in the cache and sent to the client.

It is built on std.http using a std.ThreadPool, and features a directory listing of the cache dir, and built in minizign for hash validation.

My personal deployment is located here

Running

mkdir -p zig-out/share/
zig build run -- serve ::1 8081 zig-out/share/

The mirror can be configured by the following environment variables:

# a f64 in days to cache the `-dev.` releases. By default, they are kept forever
ZIG_MIRROR_DEV_LIFETIME=0
# a u64 in seconds to cache the `index.json` file. By default, 300s (5min)
ZIG_MIRROR_INDEX_LIFETIME=300

Hosting

To fully comply, the server needs a IPv4/6 and TLS/SSL compatible Proxy, like nginx.

You can run the 8Mb Docker image:

docker run -it --rm -p 8081:8081 -e ZIG_MIRROR_LIFETIME=30 -v zig-mirror:/zig-mirror-cache registry.gitlab.com/dasimmet/zig-mirror:0.3.0