We are pleased to announce the first official release of go-mirror-zig.
'Go Mirror Zig' is a self-hostable solution written in Go for creating a community mirror for the Zig programming language. This application is designed for communities, companies, or individuals looking to provide faster local access to Zig toolchains, reducing latency and bandwidth usage on the official servers.
Getting Started
You can download pre-compiled binaries for your platform from the Assets section below.
For detailed instructions on configuration, deployment, and usage examples, please refer to the project's README.md.
Community and Contributions
This is an open-source project, and we welcome contributions from the community. Whether it's bug reports, feature requests, or code contributions, your input is valuable. Please see the README.md for guidelines on contributing, and feel free to open an issue or pull request on GitHub.
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/).
Full Changelog
Added
- Initial project structure and basic mirroring functionality.
- Added README.md with project description and usage instructions.
- Added an internal package for parsing command-line flags.
- Comments to the Config package.
- Added support for serving content over HTTPS (TLS).
- Added command-line flags for configuring ports, TLS certificates, and HTTP-to-HTTPS redirection.
- Added optional redirection of all HTTP traffic to HTTPS.
- Implemented caching for official Zig download paths (
/builds/and/download/*/*) - Added ACME support for automatic TLS certificate acquisition from Let's Encrypt.
- Added a 'Features' section to README.md.
- Added new sections in the readme: Getting Started, Examples, Configuration, Deployment, Contributing, Licenses and Acknowledgements.
- Added version information flag support, updated readme.
- Added a make script for building the application.
- Added a build script for cross-compiling releases.
- Compiled releases are not tracked by git.
- Added 'From a Precompiled Binary' section in readme.
Fixed
- Fixed newline convention CRLF -> LF
- The application now correctly exits if the server fails to start.
- Improved server lifecycle management for graceful startup and shutdown.
- Ensured atomic writes to the cache to prevent serving partially downloaded files.
- Fixed grammar in the changelog.
Changed
- Renamed the internal
flagspackage toconfigfor clarity. - Improved error handling and robustness of the cache handler.
- Handlers log more information about requests and server tasks.
- Refactored logging to reduce noise and added a source field (e.g., 'cache' or 'upstream') to request logs.
- Changed the cache directory layout to mirror the official Zig download structure (
/builds/and/download/*/*). - Changed the appearance of the index page.
- Changed the appearance of the readme.
Removed
- Removed notice about the project being a draft.