From cbb0196959a62ad86969846b7031fd574408b4ad Mon Sep 17 00:00:00 2001 From: voidzero-bot <348775505+voidzero-bot@users.noreply.github.com> Date: Mon, 23 Nov 2026 14:17:31 +0000 Subject: [PATCH] docs(global-cli): list hosts to allow through a firewall (#3534) Users behind a firewall need to know which hosts to allow during setup and which hosts the CLI uses afterward. The guide lists the npm registry and the Node.js download host for each platform. It identifies extra hosts for installer redirects, preview builds, and GitHub templates. It also explains when users can copy an installer or use a private mirror. Closes #3533 Automated triage bot fix (AI-assisted). --- docs/guide/env.md | 7 ++++++- docs/guide/global-cli.md | 43 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/docs/guide/env.md b/docs/guide/env.md index c8e021fb70..bd5a884ad9 100644 --- a/docs/guide/env.md +++ b/docs/guide/env.md @@ -310,7 +310,10 @@ Selectors omit unselected top-level fields or PM families. Registry listing is a ## Custom Node.js Mirror -By default, Vite+ downloads Node.js from `https://nodejs.org/dist`. If you're behind a corporate proxy or need to use an internal mirror (e.g., Artifactory), set the `VP_NODE_DIST_MIRROR` environment variable: +Set `VP_NODE_DIST_MIRROR` to use a mirror for Node.js version lookups and downloads. The default URL depends on your platform. + +- macOS, Windows, and glibc Linux use `https://nodejs.org/dist`. +- musl Linux uses `https://unofficial-builds.nodejs.org/download/release`. ```bash # Install a specific version from your custom mirror @@ -323,6 +326,8 @@ VP_NODE_DIST_MIRROR=https://my-mirror.example.com/nodejs/dist vp env default lts echo 'export VP_NODE_DIST_MIRROR=https://my-mirror.example.com/nodejs/dist' >> ~/.zshrc ``` +For firewall rules, see [Network Hosts](/guide/global-cli#network-hosts). + ## Node.js Signature Verification When installing Node.js from the official `nodejs.org` distribution, Vite+ downloads the PGP-signed `SHASUMS256.txt.asc` and verifies it against the bundled Node.js release keys before trusting any checksum. This protects against a tampered `SHASUMS256.txt` paired with a matching malicious archive. The SHA-256 checksum of the downloaded archive is always verified afterward. diff --git a/docs/guide/global-cli.md b/docs/guide/global-cli.md index 709aa9bf50..8b4755d400 100644 --- a/docs/guide/global-cli.md +++ b/docs/guide/global-cli.md @@ -73,6 +73,8 @@ On Windows, you can instead download and run [`vp-setup.exe`](https://setup.vite For macOS and Linux, see the [Homebrew tap guide](/guide/homebrew) for installation instructions. +If your firewall restricts outbound connections, see [Network Hosts](#network-hosts). + The installer uses the Node.js version pinned in the Vite+ repository's [`.node-version`](https://github.com/voidzero-dev/vite-plus/blob/main/.node-version) to install its JavaScript dependencies. Each Vite+ release embeds this version at build time. Development and CI use the same file, which the dependency-upgrade workflow keeps up to date. CI integrations can select another compatible version through [`VP_SETUP_NODE_VERSION`](#vp-setup-node-version). After installation, open a new shell and run: @@ -215,6 +217,15 @@ Low-priority managed shims live in `/fallback-bin`, where `` is the curl -fsSL https://vite.plus | NPM_CONFIG_REGISTRY=https://registry.npmmirror.com bash ``` +#### `VP_LEGACY_INSTALLER_URL` + +- **Purpose**: URL of the fallback script for older binaries that cannot run their own setup. The installer uses this URL only if the matching legacy script is missing from the installer's directory. +- **Default**: `https://viteplus.dev/install-legacy.sh` on macOS and Linux, or `https://viteplus.dev/install-legacy.ps1` on Windows. +- **Example**: + ```bash + VP_LEGACY_INSTALLER_URL=file:///opt/vite-plus/install-legacy.sh bash ./install.sh + ``` + #### `VP_NODE_MANAGER` - **Purpose**: Control Node.js version manager setup during installation. @@ -265,7 +276,7 @@ These variables configure the installed Vite+ CLI. `VP_HOME` (above) also applie #### `VP_NODE_DIST_MIRROR` - **Purpose**: Node.js distribution mirror URL -- **Default**: `https://nodejs.org/dist` +- **Default**: `https://nodejs.org/dist` on macOS, Windows, and glibc Linux, or `https://unofficial-builds.nodejs.org/download/release` on musl Linux. - **Details**: [Custom Node.js Mirror](/guide/env#custom-node-js-mirror) #### `VP_NODE_VERSION` @@ -482,6 +493,36 @@ Use Homebrew to [upgrade](/guide/upgrade#homebrew) or [remove](/guide/implode#ho See the [official tap guide](/guide/homebrew) for registry configuration and migration instructions. +## Network Hosts + +On Linux, you can copy `install.sh` from a connected machine and run `bash ./install.sh`. For a stable release using npm or pnpm with public registry packages, allow outbound HTTPS to the npm registry and the Node.js host for your platform. + +### Setup and everyday use + +| Default host | When you need it | Override | +| --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------- | +| `registry.npmjs.org` | Setup and `vp upgrade` fetch the CLI, pnpm, and dependencies. `vp env` downloads package managers. `vp install`, `vp dlx`, and `vp create` can fetch npm packages. | [`NPM_CONFIG_REGISTRY`](#npm-config-registry). Managed package-manager downloads also read `.npmrc`. | +| `nodejs.org` on macOS, Windows, and glibc Linux. `unofficial-builds.nodejs.org` on musl Linux (such as Alpine). | Setup and `vp env` resolve versions such as `lts` and download Node.js. | [`VP_NODE_DIST_MIRROR`](#vp-node-dist-mirror) | + +`vp env list-remote` lists Node.js and package-manager versions. Use `vp env list-remote node` to query only the Node.js index. [Node.js signature verification](/guide/env#node-js-signature-verification) uses bundled keys and needs no keyserver. + +Interactive `vp` commands can check npm for updates even with all tools installed. Vite+ caches the result for 24 hours. Set `VP_NO_UPDATE_CHECK=1` to disable [automatic update checks](/guide/upgrade#automatic-update-checks). + +### Hosts for specific features + +| Feature | Additional hosts | When you need them | +| -------------------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| One-line installer | `vite.plus`, `viteplus.dev` | `vite.plus` redirects to `install.sh` or `install.ps1` on `viteplus.dev`. A local copy skips this download. Older binaries may also need the [legacy installer](#vp-legacy-installer-url). | +| Windows standalone installer | `setup.viteplus.dev`, `github.com`, `release-assets.githubusercontent.com` | The setup page links to GitHub Releases, which redirects to the asset host. You can copy the executable from a connected machine. | +| Stable [Homebrew tap](/guide/homebrew) | `github.com`, `release-assets.githubusercontent.com` | Homebrew fetches the tap and release archive on install or upgrade. First use also needs the npm and Node.js hosts above. | +| [Preview builds](#vp-pr-version) | `registry-bridge.viteplus.dev` | The bridge serves preview packages. Other dependencies can still come from `registry.npmjs.org`. | +| GitHub templates for `vp create` | `github.com`, `codeload.github.com` | For templates such as `vite:library`, `degit` resolves the revision on GitHub and downloads the archive from codeload. | +| Yarn projects | `registry.yarnpkg.com` | Yarn fetches project dependencies here by default. In modern Yarn, set [`npmRegistryServer`](https://yarnpkg.com/configuration/yarnrc#npmRegistryServer) in `.yarnrc.yml` to change it. | + +Project dependencies, generators, and tasks can contact other hosts. Generators can call `api.github.com`. Vite+ disables these lookups for [workspace Bingo generators](/guide/create#run-a-generator) with `--skip-requests`. See [which commands can use the network](/guide/ci#which-commands-can-use-the-network). + +For machines without public internet access, see [Install from private mirrors](#install-from-private-mirrors). + ## Use It Without a Local Package The global installation is enough for runtime, package-manager, and task-runner workflows: