Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
6c7c9cd to
021d0a3
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds an optional dev-env startup flow that tries to repair local DNS resolution problems by downloading a helper binary and using it to update the system hosts file when Lando URLs do not resolve to loopback. It extends the dev-environment startup path and introduces a new helper module to install and invoke the external updater.
Changes:
- Added a new
hosts-updaterhelper that resolves release URLs, downloads/checksums the updater binary, picks an install directory, and spawns the updater process. - Wired optional domain autofix behavior into
landoStart/landoRebuildand the core start flow. - Added a new non-Windows CLI flag,
--autofix-domain-resolution, to enable the feature.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
src/lib/dev-environment/hosts-updater.ts |
New helper module for downloading, installing, validating, and executing the hosts updater binary. |
src/lib/dev-environment/dev-environment-lando.ts |
Hooks autofix logic into Lando start/rebuild and domain-resolution checks. |
src/lib/dev-environment/dev-environment-core.ts |
Threads the new autofix option through the environment start orchestration. |
src/bin/vip-dev-env-start.js |
Exposes the new CLI flag and passes it into the start flow. |
| try { | ||
| await access( binary, constants.X_OK ); | ||
| } catch { | ||
| try { | ||
| binary = await installBinary( 'latest', dir, AUTOFIX_DOWNLOAD_TIMEOUT_MS ); | ||
| } catch ( err: unknown ) { | ||
| return new Error( | ||
| 'Failed to install hosts updater binary, cannot autofix domain resolution issues.', | ||
| { cause: ensureError( err ) } | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| const fixableDomains = domains.filter( domain => ! domain.includes( '*' ) ); | ||
| if ( fixableDomains.length ) { | ||
| try { | ||
| await updateDomains( binary, fixableDomains ); |
There was a problem hiding this comment.
That's acceptable for now. Anyway, we cannot write the file to a location that isn't writable by the user.
| const filename = getExeName(); | ||
| let binary: string = path.join( dir, filename ); | ||
|
|
||
| try { | ||
| await access( binary, constants.X_OK ); | ||
| } catch { | ||
| try { | ||
| binary = await installBinary( 'latest', dir, AUTOFIX_DOWNLOAD_TIMEOUT_MS ); | ||
| } catch ( err: unknown ) { | ||
| return new Error( | ||
| 'Failed to install hosts updater binary, cannot autofix domain resolution issues.', | ||
| { cause: ensureError( err ) } | ||
| ); | ||
| } |
|
|



Description
We will try to automatically update the
/etc/hostsfile when domain resolution fails.This feature is not enabled by default and is guarded by a command-line option (TBD).
Currently, it is not available on Windows (console handles don't cross the UAC boundary; Node's
spawnwill also fail due to therequireAdministratormanifest. These issues are solvable, but I will address them later).The idea is to collect the list of the failed domains and add them to the system's
hostsfile using an external binary with elevated privileges.hosts-updater.mp4
Changelog Description
Added
Pull request checklist
New release checklist
Steps to Test