Repository navigation
feat: add a --bind-address flag to scripts/develop - #31815
Conversation
The API server, the Vite dev server and the embedded Prometheus UI always listened on 0.0.0.0. --bind-address (CODER_DEV_BIND_ADDRESS) sets the listen IP for all three, so a run on a shared host can stay on loopback. The default stays 0.0.0.0, and the banner lists only the bound host when it is not the unspecified address.
|
@codex review |
|
@codex security review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3653618ec5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
develop's health check, the Vite proxy and the Prometheus scrape target reach the API on 127.0.0.1, so other addresses never became ready. The default passes a bare --host to Vite again, which keeps its IPv6 listener. The options and the server and Prometheus arguments move into methods, so tests cover the flag binding and every listen address.
… address A running coder-prometheus container from an earlier run was reused whatever its listen address, so a loopback run could keep a UI that the earlier run exposed on every interface.
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
…dress A running coder-prometheus container usually belongs to another live develop run, for example in a second worktree. Replacing it removed that run's UI, and the old run's exit then stopped the replacement. develop now logs a warning and runs without the UI instead.
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
scripts/develop.shalways binds the API server, its metrics listener, the Vite dev server and the Prometheus UI container to0.0.0.0. On a shared or reachable host, anyone on the network can then reach a dev instance whose admin uses the published default password, or race the first-user setup on a new database.This adds
--bind-address(CODER_DEV_BIND_ADDRESS), which takes0.0.0.0(the default, unchanged behavior) or127.0.0.1. With127.0.0.1, all four listeners stay on loopback and the banner lists onlylocalhost. Other addresses are refused, because develop's health check, the Vite proxy and the Prometheus scrape target reach the API on127.0.0.1. A runningcoder-prometheuscontainer is reused only when it listens on the same address. Otherwise develop logs a warning and runs without the Prometheus UI, because that container usually belongs to another live run.Workspaces in Docker containers, such as the
dockerstarter template's, cannot reach a loopback-bound server, because their agents connect throughhost.docker.internal. The flag description and.claude/docs/DEV_ISOLATION.mdsay so.The
verify-coderskill in #31782 needs this. A review of that PR found the exposure, and this PR is its prerequisite.Verification:
go test ./scripts/develop/passes, with tests for the flag and env binding, validation, every listen address, the Vite--hostargument (bare by default), the banner and the Prometheus reuse check. Reverting each of those turns a test red. A live--bind-address 127.0.0.1run listened on127.0.0.1only and refused connections on the host's network IPs. golangci-lint (full and new-code) is clean. I did not run the repo git hooks locally.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high