Skip to content

feat: add a --bind-address flag to scripts/develop - #31815

Merged
ThomasK33 merged 4 commits into
mainfrom
develop-bind-address
Nov 6, 2026
Merged

ThomasK33 merged 4 commits into
mainfrom
develop-bind-address

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

scripts/develop.sh always binds the API server, its metrics listener, the Vite dev server and the Prometheus UI container to 0.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 takes 0.0.0.0 (the default, unchanged behavior) or 127.0.0.1. With 127.0.0.1, all four listeners stay on loopback and the banner lists only localhost. Other addresses are refused, because develop's health check, the Vite proxy and the Prometheus scrape target reach the API on 127.0.0.1. A running coder-prometheus container 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 docker starter template's, cannot reach a loopback-bound server, because their agents connect through host.docker.internal. The flag description and .claude/docs/DEV_ISOLATION.md say so.

The verify-coder skill 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 --host argument (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.1 run listened on 127.0.0.1 only 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

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.
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T03:10:06.484979Z 9e8551c Manual request
🔒 Security Review ✅ Completed 2026-11-06T03:11:22.639495Z 9e8551c Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 3653618ec5

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread scripts/develop/main.go Resolved
Comment thread scripts/develop/main.go Resolved
Comment thread scripts/develop/main.go Resolved
Comment thread scripts/develop/main.go Resolved
Comment thread scripts/develop/main.go Resolved
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.
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 4d9275c94a

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 4d9275c94a

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread scripts/develop/main.go Resolved
…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.
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 9e8551c2bf

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 9e8551c2bf

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33
ThomasK33 merged commit bf47fc6 into main Nov 6, 2026
28 of 29 checks passed
@ThomasK33
ThomasK33 deleted the develop-bind-address branch November 6, 2026 03:26
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants