ziglang/ziglang.org
14
29
Fork
You've already forked ziglang.org
31

Implement an easy solution for hosting a community mirror #490

Open
opened 2025年06月30日 17:43:24 +02:00 by mlugg · 6 comments
mlugg commented 2025年06月30日 17:43:24 +02:00 (Migrated from github.com)
Copy link

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.

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.
silversquirl commented 2025年07月01日 05:22:29 +02:00 (Migrated from github.com)
Copy link

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 :)

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](https://gist.github.com/silversquirl/5c8d734ce8e5712eff8126295847e99f). Unfortunately it's pretty tied to bunny.net, but it could serve as inspiration for other CDN-based solutions :)
jedisct1 commented 2025年07月01日 11:11:57 +02:00 (Migrated from github.com)
Copy link

Example configuration for Varnish with the Fastly CDN: https://fiddle.fastly.dev/fiddle/97803f6c

Example configuration for Varnish with the Fastly CDN: https://fiddle.fastly.dev/fiddle/97803f6c
andrewrk commented 2025年07月01日 16:34:28 +02:00 (Migrated from github.com)
Copy link

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

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 commented 2025年09月09日 13:47:04 +02:00 (Migrated from github.com)
Copy link

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.

I've built an application for this specific purpose - to provide the simplest possible way to create a Zig community mirror: * https://github.com/SavaLione/go-mirror-zig/ 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.
Contributor
Copy link
Perhaps interesting: https://devlog.hexops.org/2026/announcing-pkgmirror/

cc @mlugg for the above

cc @mlugg for the above
Sign in to join this conversation.
No Branch/Tag specified
main
release-0.16.0
apraga/french
homersimpsons/fix/mobile-responsiveness
MarkLagodych/patch-1
Zirunis/patch-1
zmitchell/zmitchell/build-graph-docs
generalmimon/fix-unit-testing-examples
generalmimon/fix-code-snippet-in-0.15.1-relnotes
TheConnorJohnson/main
meeting-minutes
enkvadrat/update-curl-example
No results found.
Labels
Clear labels
bounty
https://ziglang.org/news/announcing-donor-bounties
bug
Observed behavior contradicts documented or intended behavior.
contributor-friendly
This issue is limited in scope and/or knowledge of project internals.
downstream
An issue with a third-party project that uses this project.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
infra
An issue related to project infrastructure, e.g. continuous integration.
optimization
A task to improve performance and/or resource usage.
question
No questions on the issue tracker; use a community space instead.
regression
Something that used to work in a previous version stopped working
upstream
An issue with a third-party project that this project uses.
use case
Describes a real use case that is difficult or impossible, but does not propose a solution.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ziglang/ziglang.org#490
Reference in a new issue
ziglang/ziglang.org
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?