dasimmet/zig-mirror
No description provided.
master6b1fbdcb30059508ac6ed3abfd8573ae72a94458fa55f4080752ce1c48f2bb392e9513f87b59d8cbThis 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
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
To fully comply, the server needs a IPv4/6 and TLS/SSL compatible Proxy, like nginx.
On Linux, 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.2.0