Files
orca/src/main/node-runtime/node-dist-mirror-setting.ts
T
Neil 66d37178da feat(ssh): let a nodejs.org mirror serve the pinned Node on this computer and the host (#30981)
* feat(ssh): let a nodejs.org mirror serve the pinned Node on both machines

* fix(ssh): share one deadline across every host download URL

* fix(ssh): give each host download URL its share of the deadline and cap its size

* refactor(ssh): one tool per host, labelled sources and a portable wget watchdog

* fix(ssh): quote this computer's short download reason in the combined error

* fix(ssh): fetch only validated mirror URLs on the host

* fix(ssh): drop an empty query or fragment from the mirror URL

* fix(ssh): keep a cancel or a local error as it is after the mirror fails
2026-10-19 20:52:44 -07:00

16 lines
639 B
TypeScript

/** This computer's Node mirror: the Settings value, else the conventional environment variables. */
import { resolveNodeDistMirror } from '../../shared/node-dist-mirror'
let readMirrorSetting: (() => string | undefined) | null = null
/** Registered once the settings store exists; read on every download, so edits apply at once. */
export function setNodeDistMirrorSettingReader(read: (() => string | undefined) | null): void {
readMirrorSetting = read
}
export function configuredNodeDistMirror(
env: Record<string, string | undefined> = process.env
): string | null {
return resolveNodeDistMirror(readMirrorSetting?.(), env)
}