Repository navigation
tools: add rclone-based dist mirror script - #4525
Open
ryanaslett wants to merge 1 commit into
Open
ryanaslett wants to merge 1 commit into
ryanaslett wants to merge 1 commit into
Conversation
Add tools/dist-mirror, a small wrapper around rclone's HTTP backend that mirrors https://nodejs.org/dist/ without credentials, as a replacement for the rsync endpoint on unencrypted.nodejs.org. The latest-* directories and node-latest.tar.gz are skipped during the transfer and recreated as local symlinks derived from index.json, matching the release worker's latestVersions.json. Refs: nodejs#3960 Refs: nodejs#4085 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Ryan Aslett <raslett@linuxfoundation.org>
This was referenced Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
tools/dist-mirror/, a replacement for the rsync endpoint onunencrypted.nodejs.org, so we can retire that server (#3960, #4085).What it is
A ~90-line bash wrapper around rclone's HTTP backend, pointed at
https://nodejs.org/dist/. It needs no Cloudflare credentials and doesn't touch R2 directly. It reads the same public listings and files everyone downloads, and the per-file HEAD checks are answered by Cloudflare's cache. Requirements: bash, rclone, jq.index.json/index.tab, so version managers never see a release listed before its files exist.--full: runs a completerclone sync, which also catches changes to older releases and deletions.latest/, thelatest-*directories andnode-latest.tar.gzare skipped during the transfer, then recreated as real local symlinks computed fromindex.json. The derived map matches the release worker'slatestVersions.jsonexactly. The roughly 70 static v0.x file aliases are mirrored as ordinary files (a few hundred MB of duplicates).nodejs-dist-mirrorUser-Agent, so we can recognise mirror traffic in our logs.Testing
Run against production nodejs.org, with
--max-size 2Mso large binaries weren't downloaded:latestVersions.jsonentry for entry, and they survive--fullsyncs.--fullrun takes about 52 s (all directory listings plus HEAD requests)..shellcheckrcand with--norc.Once this merges, I'll post usage instructions on #3960 for TUNA and the other mirrors.
🤖 Generated with Claude Code