fix: read GASTOWN_HOST instead of bare HOST env var#32
Open
Ljferrer wants to merge 1 commit into
Open
Conversation
The server and CLI read `process.env.HOST` to determine the bind
address. `HOST` is also the standard compiler-toolchain target-triple
variable (set by conda/clang cross-compile shells, e.g.
`HOST=arm64-apple-darwin20.0.0`). In such a shell the server tries to
bind to that value as a hostname and crashes on startup:
Error: getaddrinfo ENOTFOUND arm64-apple-darwin20.0.0
Emitted 'error' event on WebSocketServer instance
Switch to a namespaced `GASTOWN_HOST` env var, mirroring the existing
`GASTOWN_PORT` convention, so the GUI no longer collides with the
toolchain `HOST` variable. The `--host` CLI flag is unchanged.
- server.js: read GASTOWN_HOST (with explanatory comment)
- bin/cli.js: read GASTOWN_HOST, pass it to the spawned server, update help/docs
- README.md: document GASTOWN_HOST
- test/integration: update spawned-server env to GASTOWN_HOST
Verified: with HOST=arm64-apple-darwin20.0.0 set and GASTOWN_HOST unset,
the server now binds to 127.0.0.1 and serves 200. Full suite green (343/343).
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.
The server and CLI read
process.env.HOSTto determine the bind address.HOSTis also the standard compiler-toolchain target-triple variable (set by conda/clang cross-compile shells, e.g.HOST=arm64-apple-darwin20.0.0). In such a shell the server tries to bind to that value as a hostname and crashes on startup:Switch to a namespaced
GASTOWN_HOSTenv var, mirroring the existingGASTOWN_PORTconvention, so the GUI no longer collides with the toolchainHOSTvariable. The--hostCLI flag is unchanged.Verified: with HOST=arm64-apple-darwin20.0.0 set and GASTOWN_HOST unset, the server now binds to 127.0.0.1 and serves 200. Full suite green (343/343).