You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 15, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 15, 2026. It is now read-only.
Implement an easy solution for hosting a community mirror #490
This issue supersedes mlugg/setup-zig#15. Currently, the easiest way to set up a "community mirror" of Zig tarballs is using Mach's Wrench. It works well, but is written in Go and part of a more monolithic program. It'd be good to have a more minimal solution to point to.
So, someone should make one! It should expose an HTTP server locally, take requests for files, and cache them in a given directory, with some reasonable eviction policy. SSL is out of scope for this project; a local web server can be used to rproxy to the mirror software instead.
I reckon this should be pretty easily doable in a couple of hundred lines of Zig.
This need not be an official ZSF project; this issue is just to track the creation of something along these lines.
While not exactly what this issue is asking for, I have implemented my own solution for running https://zig.squirl.dev, based on bunny.net's CDN, using edge scripts for routing. The setup is pretty simple, and documented here.
Unfortunately it's pretty tied to bunny.net, but it could serve as inspiration for other CDN-based solutions :)
This depends on progressing our fuzzing toolchain, and then doing fuzzing against std.http and std.crypto.tls. Otherwise users are looking at security vulnerabilities.
I have also rewritten http client and server API in a branch. still not happy with it but it's better than status quo
I've also created a pull request #536 in case the application is worth mentioning there.
I believe that a solution written in Zig would suit this purpose better, but I'm not confident enough in my Zig skills, so I used Go.
Due to Nginx's support for regex, it is theoretically possible to use Nginx as a caching proxy (with 'Certbot' for automatically obtaining certificates) and a bash script with curl, but I haven't dug deep into that approach.
Activity
silversquirl commentedon Jul 1, 2025
While not exactly what this issue is asking for, I have implemented my own solution for running https://zig.squirl.dev, based on bunny.net's CDN, using edge scripts for routing. The setup is pretty simple, and documented here.
Unfortunately it's pretty tied to bunny.net, but it could serve as inspiration for other CDN-based solutions :)
jedisct1 commentedon Jul 1, 2025
Example configuration for Varnish with the Fastly CDN: https://fiddle.fastly.dev/fiddle/97803f6c
andrewrk commentedon Jul 1, 2025
This depends on progressing our fuzzing toolchain, and then doing fuzzing against std.http and std.crypto.tls. Otherwise users are looking at security vulnerabilities.
I have also rewritten http client and server API in a branch. still not happy with it but it's better than status quo
SavaLione commentedon Sep 9, 2025
I've built an application for this specific purpose - to provide the simplest possible way to create a Zig community mirror:
I've also created a pull request #536 in case the application is worth mentioning there.
I believe that a solution written in Zig would suit this purpose better, but I'm not confident enough in my Zig skills, so I used Go.
Due to Nginx's support for regex, it is theoretically possible to use Nginx as a caching proxy (with 'Certbot' for automatically obtaining certificates) and a bash script with
curl, but I haven't dug deep into that approach.