Skip to content
This repository was archived by the owner on Mar 15, 2026. It is now read-only.

A new Community-Written Solution for setting up a community mirror#536

Merged
mlugg merged 2 commits intoziglang:mainfrom
SavaLione:feature/a-new-mirror-solution
Mar 15, 2026
Merged

A new Community-Written Solution for setting up a community mirror#536
mlugg merged 2 commits intoziglang:mainfrom
SavaLione:feature/a-new-mirror-solution

Conversation

@SavaLione
Copy link
Copy Markdown
Contributor

This adds a new new community-written solution for setting up a community mirror.

Go Mirror Zig is a simple way to set up a Zig community mirror.
It is lightweight, distributed as a single binary and supports automatic ACME challenges.

Features:

  • Efficient caching: Downloads files from an upstream server once and serves them from a local cache for all subsequent requests.
  • Automatic TLS: Full support for ACME (Let's Encrypt) to automatically obtain and renew TLS certificates.
  • Secure by default: Supports HTTPS and automatic redirection from HTTP to HTTPS.
  • Standalone binary: Compiles to a single, dependency-free binary for easy deployment.
  • Configurable: All settings are manageable via command-line flags, including ports, cache directories, and upstream URL.
  • Path correctness: Caches files using the official Zig directory layout (/download/<version>/ and /builds/).

The solution source code: https://github.com/SavaLione/go-mirror-zig/

Thanks!

@mlugg
Copy link
Copy Markdown
Member

mlugg commented Mar 12, 2026

I'd prefer not to add this until there's a mirror using it (like you were trying to add in #533) just so that I know it works. I'll leave this open for now, but if you decide not to open a follow-up to #533, would you mind closing this? Either way, thank you! :)

@SavaLione
Copy link
Copy Markdown
Contributor Author

Hi @mlugg ,

I've created a new PR that adds a new community mirror (#592).
It uses the newest version of this solution (v1.1.0)

I've also added some new features:

  • You can now customize or remove the index.html root page, which is useful for those who prefer not to display branding.
  • The application can now periodically remove cached dev builds based on a configured interval. This solves the issue mentioned in (#591), where the mirror went down due to significant disk space usage (~120GB of builds per server).

If you have any questions or suggestions, I'd be happy to answer them.

Thanks!

@mlugg mlugg merged commit ddc86ce into ziglang:main Mar 15, 2026
@mlugg
Copy link
Copy Markdown
Member

mlugg commented Mar 15, 2026

Thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants