Skip to content
This repository was archived by the owner on Mar 15, 2026. It is now read-only.
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

Open

Description

@mlugg

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.

Activity

  1. silversquirl commented on Jul 1, 2025

    @silversquirl
    Contributor

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

  2. jedisct1 commented on Jul 1, 2025

    @jedisct1
    Contributor

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

  3. andrewrk commented on Jul 1, 2025

    @andrewrk
    Member

    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

  4. SavaLione commented on Sep 9, 2025

    @SavaLione
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions