Stop silently installing the devcontainer CLI from the npm registry - #29
Merged
Conversation
install.sh auto-installed @devcontainers/cli by piping the devcontainers/cli standalone installer to sh with all output suppressed. That fetches from registry.npmjs.org, which corporate egress policies (e.g. Microsoft Defender's NPM URL block) intercept -- and because it ran silently, the network activity and the resulting failure were invisible. Make the devcontainer CLI detect-only, consistent with how devpod and gh are already handled: report whether it is present and, if not, print the install URL (plus a 'brew install devcontainer' alternative that avoids the npm registry). Nothing is downloaded on the user's behalf. install.ps1 needs no change -- it only detects devcontainer in WSL and delegates the binary install to install.sh, so the silent fetch is gone from the Windows/WSL path too. Copilot-Session: 1061ab5c-0b78-4baa-87e2-2ba93359413f
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.
Problem
install.shauto-installed the devcontainer CLI by piping the devcontainers/cli standalone installer toshwith all output suppressed (>/dev/null 2>&1). That installer fetches@devcontainers/clifromregistry.npmjs.org, which corporate egress policies — e.g. Microsoft Defender's "[TE] NPM URL Block" — intercept.Because it ran silently:
Fix
Make the devcontainer CLI detect-only, consistent with how
devpodandghare already handled:install_devcontainer_cli()function and the silentcurl … | shpipe.✓ devcontainerwhen found, or✗ devcontainer — https://github.com/devcontainers/cli#install-script (or 'brew install devcontainer')when missing (thebrewbottle avoids the npm registry entirely).install.ps1needs no change — it only detectsdevcontainerin WSL and delegates the binary install toinstall.sh, so the silent fetch is gone from the Windows/WSL path too. The README already documents manual devcontainer CLI install.Testing
bash -n install.shpasses.