Skip to content

feat: require a setup token to create the first user on a tunnel (#32324) - #32515

Merged
BobbyHo merged 3 commits into
release/2.38from
backport/32324-to-2.38
Nov 20, 2026
Merged

BobbyHo merged 3 commits into
release/2.38from
backport/32324-to-2.38

Conversation

@coder-backporter-app

@coder-backporter-app coder-backporter-app Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Backport of #32324

Original PR: #32324 — feat: require a setup token to create the first user on a tunnel
Merge commit: 88d3494
Requested by: @BobbyHo

The automatic cherry-pick had conflicts. They are resolved by hand; the server and CLI changes are the same as in #32324.

Differences from #32324
  • scripts/develop: keeps this branch's password handling and adds only the setup token. password_test.go is left out because it comes from fix: generate per-instance dev passwords and remove the shared default #32283, which is not on this branch.
  • Docs: the setup token sentences for docs/install/index.md and docs/install/server/rpm.md are left out. Those pages do not mention the tunnel on this branch.
  • Generated CLI docs and the configuration reference are regenerated with this branch's generators.

@coder-backporter-app coder-backporter-app Bot added the backport/v2.38 Backport PR targeting release/2.38 label Nov 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey @coder-backporter-app[bot]!

This PR is targeting the release/2.38 release branch, but its title does not start with fix: or fix(scope):.

Only bug fixes should be cherry-picked to release branches. If this is a bug fix, please update the PR title to match the conventional commit format:

fix: description of the bug fix
fix(scope): description of the bug fix

If this is not a bug fix, it likely should not target a release branch.

)

fix(security): require setup token for first user on tunnels

Prevent unauthorized users from claiming Owner access on public `try.coder.app` tunnels before initial setup.

- Generate a setup token at startup when using a tunnel with no existing users.
- Require the token for first-user creation via the API, web UI, and CLI.
- Block GitHub/OIDC first-user signup until setup is complete.
- Support custom tokens via `--setup-token` / `CODER_SETUP_TOKEN` and non-interactive CLI setup.
- Update development scripts, documentation, and tests.
- Preserve existing behavior for deployments with an access URL or existing users.

Validated with automated tests and 23/23 manual scenarios using a real tunnel.

Refs CORE-784

(cherry picked from commit 88d3494)
@BobbyHo
BobbyHo force-pushed the backport/32324-to-2.38 branch from acab5e0 to 4fc77d6 Compare November 20, 2026 15:42
@BobbyHo BobbyHo changed the title feat: require a setup token to create the first user on a tunnel (#32324) (conflicts) feat: require a setup token to create the first user on a tunnel (#32324) Nov 20, 2026
@BobbyHo
BobbyHo merged commit e0bab67 into release/2.38 Nov 20, 2026
33 of 34 checks passed
@BobbyHo
BobbyHo deleted the backport/32324-to-2.38 branch November 20, 2026 21:25

This branch had an error being deployed

1 failed deployment
docs-preview — f0d0b780 Deployed Nov 20, 2026 by BobbyHo via cleanup #315
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/v2.38 Backport PR targeting release/2.38

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants