Skip to content

fix: generate per-instance dev passwords and remove the shared default - #32283

Open
BobbyHo wants to merge 11 commits into
mainfrom
bobby/core-784-generate-dev-passwords
Open

BobbyHo wants to merge 11 commits into
mainfrom
bobby/core-784-generate-dev-passwords

Conversation

@BobbyHo

@BobbyHo BobbyHo commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

TL;DR

Every Coder instance started by our development tooling had the same admin login, with a password that is printed in CONTRIBUTING.md. The member user had it too. scripts/develop.sh listens on every network interface, so anyone who could reach a developer's machine could sign in as Owner. This PR makes scripts/develop.sh, the compose dev environment and the deploy-ephemeral skill generate a random password for each user the first time they create it. The password is stored in a file only the owner can read, printed at startup, and reused on later runs. An instance that already exists is fixed on its next start: a user that still has the old default gets a generated password, or the stored one when a password file is already there. The old default is refused when someone passes it as an override.

Refs https://linear.app/codercom/issue/CORE-784

How to navigate this PR
  • About 340 lines of production Go, 200 lines of shell, 470 lines of tests, and small edits to one compose file, one skill and two docs. No server code changes.
  • Read closely: setupFirstUser in scripts/develop/main.go. Everything else supports it.
  • Suggested order:
    1. scripts/develop/password.go: the file helpers. storePassword never replaces an existing file. replacePassword does, and it has one caller: the override that the server has just accepted.
    2. scripts/develop/main.go, validate: refuses the old default as an override.
    3. scripts/develop/main.go, checkPasswordFiles: stops the run before the build when a password file is empty or unreadable.
    4. scripts/develop/main.go, setupFirstUser: the main logic. The rules to check are that a password is generated only when develop is about to create that user or is replacing the old default on it, and that after a sign-in with --password the admin file holds that password.
    5. scripts/develop/main.go, replaceOldDefault and replaceOldDefaultAdmin: replace the old default on an existing user. Check that the old default is always sent as the current password, that the admin change runs on a session made by signing in as admin@coder.com and not on the saved session, and that when the server refuses only a password generated in that call is removed.
    6. scripts/develop/main.go, knownLogin and loginBannerLines: the warning and the banner section.
    7. scripts/docker-dev/password.sh, then scripts/docker-dev/setup-init.sh and scripts/docker-dev/setup-users.sh: the same behaviour for the compose environment. In password.sh, read replace_old_default. In setup-init.sh, read replace_old_default_passwords and restore_bootstrap_token closely.
    8. .agents/skills/deploy-ephemeral/seed.sh and .agents/skills/deploy-ephemeral/SKILL.md: read the admin password from the file develop wrote.
    9. scripts/develop/password_test.go: TestSetupFirstUser is the test that proves the behaviour.
  • Skim: compose.dev.yaml, CONTRIBUTING.md, contributing/frontend.md.
Implementation

scripts/develop/

  • Removed the defaultPassword constant. The --password flag no longer has a default.
  • Added scripts/develop/password.go with readPassword, loadOrCreatePassword, storePassword and replacePassword. Passwords are 32 letters and digits from cryptorand.String, stored in .coderv2/admin-password and .coderv2/member-password with mode 0600.
  • validate refuses --password or CODER_DEV_ADMIN_PASSWORD when the value is the old default.
  • setupFirstUser generates a password only when it is about to create that user. The member user gets its own password. It used to get the admin's.
  • For a user that already exists, develop asks the server to replace the old default on every start. The new password is the stored one, or a generated one when no file exists. It sends the old default as the current password, so the server refuses when the password was changed by hand, and that password is kept.
  • A password file does not stop the attempt. A stored password does not show that the user has it: an older scripts/develop.sh run with --db-reset in the same checkout recreates both users with the old default and leaves the files in place.
  • A password file that holds the old default itself is discarded first, and a generated password takes its place. The server refuses a new password that equals the current one.
  • For the admin, develop signs in as admin@coder.com with the old default on a new client and changes the password with that session. It does not use the saved session, because ./scripts/coder-dev.sh login saves its session in the same directory and that session can be the member's. This request goes only to the developer's own server. On an instance that is not on the old default it is one refused sign-in per start.
  • Changing the admin password revokes every session of the admin, so develop signs in again with the new password and saves a new session.
  • With --password, the admin password is left alone. The member's old default is still replaced.
  • When the server refuses, develop removes a password it generated in that call and keeps a file that was already there. With no stored password it warns that it does not know the password, and carries on if the saved session works. Without a session it stops with advice.
  • When --password signs in, develop saves it to the admin password file, and replaces a stored password that differs. The server has just accepted the override, so a stored password that differs is one the server no longer accepts. This is the state after the admin password is changed in the dashboard.
  • A stored admin password that the server refuses has its own error. It names the file and says to run once with --password and the current password to replace it.
  • The advice in the unknown-password error now names two ways out that keep the database: run once with --password, or save the password in .coderv2/admin-password. --db-reset comes last.
  • The banner gains a login section. The first line of the banner is unchanged, because other tooling waits for that exact text.
  • The "creating first user" log line no longer includes the password.

scripts/docker-dev/ and compose.dev.yaml

  • Added scripts/docker-dev/password.sh, sourced by both setup scripts.
  • scripts/docker-dev/setup-init.sh generates both password files on the bootstrap volume. It writes the member file too, because setup-users mounts that volume read-only.
  • scripts/docker-dev/setup-users.sh reads the member file.
  • On every start with a working bootstrap token, scripts/docker-dev/setup-init.sh asks the server to replace the old default of both users, whether or not the password files exist. The new password is the stored one, or a generated one. It sends the old default as the current password, so a password that was changed by hand is kept. The request body is built with jq, because a stored override can hold any character.
  • Changing the admin password revokes the bootstrap token. scripts/docker-dev/setup-init.sh now recreates the token whenever the stored one is rejected and the admin password is known.
  • When that sign-in fails, the error names the password source that was refused (the password file or CODER_DEV_ADMIN_PASSWORD) and the HTTP status. It says to set CODER_DEV_ADMIN_PASSWORD to the current password or to remove the volumes. When the override signs in, it is written to the admin password file, so later starts work without the variable.
  • One case is left as it was: when the bootstrap token is rejected and the stored admin password is refused, setup-init stops with that error before it reaches the replacement of the old default.
  • scripts/docker-dev/setup-init.sh passes --delete to coder tokens delete. Without it the token is only expired and keeps its name, so creating a new "bootstrap" token failed. This was also the case on main.
  • When a user exists and its password is not known, the two scripts warn and exit 0. scripts/docker-dev/setup-users.sh still fails when the member has to be created and no password is available. Both scripts take the wording from one function in scripts/docker-dev/password.sh.
  • Both scripts refuse the old default as an override and print the login they used.
  • compose.dev.yaml no longer defaults either password variable. The CODER_DEV_ADMIN_PASSWORD entry on the coderd service is removed. The server never read it.

.agents/skills/deploy-ephemeral/

  • seed.sh reads the admin password from the file develop wrote. EPH_ADMIN_PASSWORD still overrides it, and EPH_ADMIN_PASSWORD_FILE overrides the path.
  • SKILL.md reads the passwords through the container for the license step and the report. It no longer contains a password.

Docs

  • CONTRIBUTING.md and contributing/frontend.md say where to find the password.

Not changed

  • The in-process test helpers in coderd/coderdtest and coderd/workspaceapps/apptest still use the old string. They never expose a listener publicly.
  • The listen address of scripts/develop.sh is unchanged. Workspaces in Docker cannot reach a loopback-only server.
Expected Output
  • A first run of scripts/develop.sh creates .coderv2/admin-password and .coderv2/member-password, each with mode 0600 and a different 32-character password.
  • The startup banner shows both logins and both file paths on every run.
  • Signing in as admin@coder.com or member@coder.com with the old default returns 401.
  • A second run, a run after the saved session expired, and a run with --db-reset all use the same passwords. The files are not rewritten.
  • A second checkout gets different passwords.
  • --password or CODER_DEV_ADMIN_PASSWORD sets the admin password only. The banner says it came from --password. When it signs in, it is saved to .coderv2/admin-password, so later runs do not need the flag. A stored password that differs is replaced.
  • Passing the old default as the override stops develop before the build with "--password must not be the old default password".
  • An empty password file stops develop before the build with an error that names the file.
  • --skip-setup writes no password file and prints no login section.
  • On an instance whose users still have the old default, the next start of develop replaces both passwords, writes both files and shows the new logins in the banner. This works with a saved admin session, with a saved member session and without a session. Afterwards the old default returns 401 for both users, and develop is signed in as the admin.
  • When the users have the old default and password files already exist, the next start gives each user its stored password. The files are not changed.
  • When a password file holds the old default, the next start replaces it with a generated password.
  • Browser sessions of both users on that instance are signed out once, because the server revokes them with the password.
  • On an instance whose passwords were changed by hand, nothing is changed. No file is written, and a file that already exists is kept. With a saved session develop starts, warns that it does not know the password, and the banner says "password not set by develop.sh". Without a saved session develop stops and says to run once with --password and the current password, or to save it in .coderv2/admin-password, or to run with --db-reset. One run with --password is enough, because the password is then stored.
  • After the admin password is changed in the dashboard, the stored password is refused. develop stops with "the server refused the password stored in .coderv2/admin-password" and says to run once with --password and the current password. That run replaces the file, and the run after it needs neither the flag nor a session.
  • The compose environment generates both passwords on first start, prints each login, and uses the same ones on the next start. It refuses the old default as an override.
  • A compose environment that already exists gets both passwords replaced on its next start, when they are still the old default. setup-init writes both files and creates a new bootstrap token, and both logins are printed. When the files already exist, each user gets its stored password.
  • After the admin password of a compose environment is changed in the dashboard, setup-init exits 1 and says which password source the server refused, with the HTTP status and the two ways out. One start with CODER_DEV_ADMIN_PASSWORD set to the current password creates a new bootstrap token and stores the password. The next start works without the variable and prints that password.
  • A compose environment whose passwords were changed by hand still starts. Each script warns that it does not know the password and prints "password was not set by this environment". Nothing is changed.
  • An ephemeral deployment is seeded with its own generated admin password. The skill's report lists the two logins of that deployment.
  • An ephemeral deployment that already exists and picks up this change should get its admin password replaced when develop restarts, so the seed can read the file. This has not been tried on a real deployment.
Testing
  • scripts/develop/password_test.go, TestSetupFirstUser: runs setupFirstUser against an in-process server.
    • A fresh server gets two stored passwords that differ. The old default returns 401 for both users. A second run without a saved session signs in with the stored password.
    • With an override and no stored password, the override signs in and is saved to the admin file, and the member does not get the override. The next run signs in without the flag and without a saved session.
    • With an override and a stored password that differs, the override signs in and the file then holds the override.
    • On a server whose two users have the old default, develop replaces both passwords, with a saved session and without one. Both files exist, the stored passwords sign in, the old default returns 401 for both users, and the session develop saved is a working one that belongs to the admin.
    • The same result when the saved session belongs to the member.
    • The same result when both password files already exist with other values. Each user ends up with its stored password.
    • The same result when both password files hold the old default. Each file ends up with a generated password.
    • With an override on that server, the admin keeps its password and no admin file is written. The member's old default is still replaced.
    • When the users have other passwords, develop leaves no file and carries on with a saved session, and both passwords still sign in. Without a session it returns the "does not know the password" error. After one run with the override, a run without the flag and without a session signs in. A stored password that the server refuses gives the "server refused the password stored in" error. One run with the override replaces the file, and the run after it signs in with neither the flag nor a session.
  • TestLoadOrCreatePassword: the file is created with mode 0600, the server's own password check accepts the value, a second call returns the same value, and an empty file is an error that is not replaced.
  • TestCheckPasswordFiles: an empty admin file is an error, except with an override or with setup skipped.
  • TestLoginBannerLines: the banner section for generated passwords, an override, unknown passwords and skipped setup. Every line fits the banner box.
  • TestDevConfigValidate in scripts/develop/main_test.go: the old default is refused, and a longer password that contains it is accepted.
  • Not covered by automated tests: the shell changes in scripts/docker-dev/ and .agents/skills/deploy-ephemeral/. shellcheck and shfmt pass on them, and I ran the helper functions by hand. scripts/docker-dev/setup-users.sh was also run in a container with a stub in place of the CLI, for five cases: an existing member without a file, a missing member without a file, a fresh start, a second start, and the old default as an override. scripts/docker-dev/setup-init.sh was run the same way for four cases: an existing first user without a file, with a file, with an override, and a fresh start. The scripts were then run for real in the compose environment and in one ephemeral deployment. See Manual Test.
  • The replacement in compose was checked after that run, without the compose environment. The real scripts/docker-dev/setup-init.sh and scripts/docker-dev/setup-users.sh, with only the server URL and the /bootstrap path changed, were run against an in-process server whose two users had the old default and a bootstrap token. Before, the old default got 201 for both users. After one run it got 401 for both, the stored passwords got 201, and the new bootstrap token got 200. A second run changed nothing. With the files removed, so that the passwords were no longer the old default and not known, nothing was changed and both scripts exited 0. With a rejected token and a known admin password, the token was recreated.
  • The last compose changes (always attempting the replacement, the sign-in error, storing the override) were checked with scripts/docker-dev/setup-init.sh against a stub in place of curl and the CLI, with only the /scripts and /bootstrap paths changed. Seven cases: a stale file after a dashboard change with no override (exit 1 with the new message), the same with the override set (token recreated, file updated), the two starts after that without the override, both users on the old default with files present (each gets its stored password), passwords changed by hand with files present (nothing changed), and an old volume without files. These changes have not been run in the compose environment or against a real server.
  • Ran go test ./scripts/develop/ -count=1, and it passes. golangci-lint, shellcheck and shfmt pass on the changed files.
Manual Test

Run on 2026-11-16 and 2026-11-17 (UTC) against this branch at 7f79cd2593. Seven commits came after the run, and the scenarios have not been rerun. Three are merges of main, which do not touch any file of this PR. The first of the other four is 81a51b1c05, which adds the admin warning described in fact 3. It was checked with stubs (see Testing) and has not been run in the compose environment. The second is d547e427d6, which replaces the old default on an instance that already exists. Scenarios 11 and 15 show the behaviour from before that commit and have not been rerun. The new behaviour is covered by the unit tests and the script run described in Testing. The third is c86525464a, which stores a working --password when no admin password is stored and rewords the unknown-password error. The error text in scenario 11 is the old one. The fourth is e05a98618f, which replaces the old default even when a password file exists, signs in as the admin for that change, and replaces a stored password with a --password that signs in. Scenario 8 shows the behaviour from before that commit: there the admin file was left alone, and now it would hold the override. The new behaviour is covered by the unit tests and the stub run described in Testing. Everything except scenario 17 ran inside one dogfood development workspace (13 cores, 33 GiB, Docker inside the workspace). Each develop instance was a real scripts/develop.sh built from the branch in its own git worktree, with its own built-in database. Worktree c was first built from main at b4f8b6756c, so its database had users with the old default, and was then moved to this branch with the database kept. That is how the run produced "an instance from before this change". Scenario 17 is one real deployment made with the deploy-ephemeral skill, deleted afterwards.

No password was printed during the run. The helpers compare a short SHA-256 fingerprint of each password file and count how often a stored value appears in a log. In the output below, a password is shown as <32 characters>.

20 of 20 scenarios passed. Two needed a change to the setup before they could run, and both are explained under the facts.

# Scenario Result
1 Environment: worktrees, versions, helpers Pass
2 Before: an instance built from main accepts the old default Pass
3 A first run generates and stores two passwords Pass
4 The banner shows both logins and both file paths Pass
5 The generated passwords sign in and the old default is refused, also in the dashboard Pass
6 A restart, a lost session and --db-reset all reuse the same passwords Pass
7 A second checkout gets different passwords Pass
8 --password sets the admin password only and does not replace a stored password Pass
9 The old default is refused as an override, before the build Pass
10 --skip-setup writes no file and prints no login section Pass
11 An instance from before this change: a warning, then an error with advice, then recovery with --db-reset Pass
12 An empty password file stops the run and is not replaced Pass
13 Compose: first start generates both passwords, second start reuses them Pass
14 Compose refuses the old default as an override Pass
15 Compose on a volume without password files still starts Pass
16 seed.sh reads the admin password from the file Pass
17 One real ephemeral deployment Pass
18 Repository search and docs Pass
19 Unit tests and shell lint Pass
20 Cleanup Pass

Facts worth knowing from the run:

  1. The same two sign-in requests give the before and after. On the instance built from main, admin@coder.com and member@coder.com with the old default both got 201 (scenario 2). On this branch they both got 401, on develop, on compose and on the ephemeral deployment (scenarios 5, 13 and 17).
  2. develop prints its advice between Go code locations. The three new errors have the right text, but the command framework prints each wrapped error with the function and file where it was made. In scenario 11 the sentence that says to run with --db-reset sits between main.develop and main.init. The framework does this for every develop error, including ones on main. It matters more here because these errors exist to say what to run next. Not changed in this PR.
  3. In compose, only the member got the warning about the old default. Fixed after the run. On a volume without password files, scripts/docker-dev/setup-users.sh printed three lines for the member. scripts/docker-dev/setup-init.sh printed one line for the admin, "password was not set by this environment". develop warns for both users. Commit 81a51b1c05 makes setup-init print the same three lines for the admin. Scenario 15 shows the output from before that commit.
  4. Two develop instances cannot run on one machine at the same time. This is on main. Each server's embedded NATS pubsub listens on 127.0.0.1:6222, and the second server stops with "bind: address already in use". develop gives each worktree its own API, web and metrics ports, but the server has no flag for this one. To run instances side by side, every instance after the first was started with -- --experiments no_nats_pubsub. That changes which pubsub the server uses. The password code runs in the develop program and talks to the server over HTTP, so it is not affected. The first instance, used in scenarios 3 to 6 and 16, ran with the default pubsub.
  5. The compose environment does not build from a git worktree. This is on main. The compose file mounts the checkout into its containers, and a worktree's .git file points at a path outside the mount. build-slim stops with "fatal: not a git repository". Scenarios 13 to 15 ran from a full clone at the same commit.
  6. --db-reset keeps the password files. It removes only the database directory. The users are created again with the stored passwords, so a password saved in a browser keeps working.
  7. The seed's default path is right for the ephemeral template. In scenario 17 the seed ran with no path override and read /home/coder/coder/.coderv2/admin-password inside the eph-dev container. Scenario 16 could only show this with the path overridden.
  8. The first coder create for the ephemeral workspace failed once in the template's dry run, with an empty error message. The same command three minutes later worked. No workspace existed in between. The cause was not looked into, and it is not related to this PR.
1. Environment
# workspace
cd ~/coder && git fetch origin main bobby/core-784-generate-dev-passwords
PR_HEAD=$(git rev-parse origin/bobby/core-784-generate-dev-passwords); echo "PR head $PR_HEAD"
git worktree add --detach ~/core784/a "$PR_HEAD"
git worktree add --detach ~/core784/b "$PR_HEAD"
git worktree add --detach ~/core784/c b4f8b6756c      # main, for the "before" build
git worktree list
docker info --format '{{.ServerVersion}}'; go version; node --version; pnpm --version
PR head 7f79cd2593cb1de53bb0e27bd94d3d14333b2997
/home/coder/coder     ffd50177aa [main]
/home/coder/core784/a 7f79cd2593 (detached HEAD)
/home/coder/core784/b 7f79cd2593 (detached HEAD)
/home/coder/core784/c b4f8b6756c (detached HEAD)
27.5.1
go version go1.26.10 linux/amd64
v22.23.4
12.16.1

The helpers used below, all defined in one file in the workspace:

  • dev_start NAME [flags] starts ./scripts/develop.sh in worktree NAME in the background, with fixed ports (a on 3100, b on 3200, c on 3300, d on 3400) and the starter template off, and writes its output to a new log file. dev_wait waits for the banner or for the process to exit. dev_stop sends an interrupt and waits.
  • signin HOST:PORT EMAIL PASSWORD posts to /api/v2/users/login and prints only the HTTP status.
  • pwfiles NAME prints, for both password files of an instance, the mode, the length, whether the value is only letters and digits, the number of lines, a 12-character SHA-256 fingerprint and the modification time. It never prints the value.
  • banner NAME prints the login section of the newest banner with passwords masked. shown NAME FILE counts how often the stored password appears in the newest log.

scripts/develop is the same at b4f8b6756c and at the merge base of this branch, so b4f8b6756c is a valid "before" build.

2. Before: an instance built from main accepts the old default
# workspace, worktree c at b4f8b6756c
dev_start c && dev_wait c
signin 127.0.0.1:3300 admin@coder.com  'SomeSecurePassword!'
signin 127.0.0.1:3300 member@coder.com 'SomeSecurePassword!'
pwfiles c
grep 'creating first user' ~/core784/logs/c.log
curl -s http://127.0.0.1:3300/api/v2/buildinfo | jq -r .version
dev_stop c
c ready at 23:09:30
admin@coder.com -> 201
member@coder.com -> 201
/home/coder/core784/c/.coderv2/admin-password: missing
/home/coder/core784/c/.coderv2/member-password: missing
2026-11-16 23:09:25.528 [info]  creating first user  email=admin@coder.com  password=SomeSecurePassword!
v2.39.0-devel+b4f8b6756c
c stopped at 23:09:42

This is the state the PR removes: both users have the public password, and it is written to the log. The instance is left stopped with its database for scenario 11.

3. A first run generates and stores two passwords
# workspace, worktree a at 7f79cd2593, never run before
ls ~/core784/a/.coderv2 2>/dev/null || echo "no dev config dir yet"
dev_start a && dev_wait a
pwfiles a
git -C ~/core784/a status --porcelain
git -C ~/core784/a check-ignore -v .coderv2/admin-password
grep -E 'creating first user|created member user' ~/core784/logs/a.log
grep -c 'password=' ~/core784/logs/a.log
curl -s http://127.0.0.1:3100/api/v2/buildinfo | jq -r .version
no dev config dir yet
a ready at 23:14:34
/home/coder/core784/a/.coderv2/admin-password: mode=600 len=32 alnum=yes lines=1 fp=5dfaad982503 mtime=1794870870
/home/coder/core784/a/.coderv2/member-password: mode=600 len=32 alnum=yes lines=1 fp=251d9d9116d6 mtime=1794870870
.gitignore:81:**/.coderv2/*	.coderv2/admin-password
2026-11-16 23:14:30.324 [info]  creating first user  email=admin@coder.com
2026-11-16 23:14:30.457 [info]  created member user  email=member@coder.com
0
v2.39.0-devel+7f79cd2593

Two files, mode 600, 32 letters and digits each, with different fingerprints. Both carry the time 23:14:30, the second in which the two users were created. git status prints nothing. The first-user log line no longer has a password field, where scenario 2 had password=SomeSecurePassword!.

4. The banner shows both logins and both file paths
# workspace
banner a
grep -cF "Coder is now running in development mode." ~/core784/logs/a.log
shown a admin-password; shown a member-password
         ║ Logins:                                                          ║
         ║            admin@coder.com   <32 characters>    ║
         ║            member@coder.com  <32 characters>    ║
         ║                                                                  ║
         ║ Password files:                                                  ║
         ║            .coderv2/admin-password                               ║
         ║            .coderv2/member-password                              ║
         ║                                                                  ║
         ║ Use ./scripts/coder-dev.sh to talk to this instance!             ║
1
1
1

The right border looks out of line only because the mask is shorter than a password. In the log all three lines are 81 characters wide. The ready line appears once and its text is unchanged. Each stored password appears exactly once in the whole log, on its own user's banner line.

5. The generated passwords sign in and the old default is refused
# workspace
IP=$(hostname -i | awk '{print $1}')      # the workspace's own non-loopback address
signin 127.0.0.1:3100 admin@coder.com  "$(tr -d '\n' <~/core784/a/.coderv2/admin-password)"
signin 127.0.0.1:3100 member@coder.com "$(tr -d '\n' <~/core784/a/.coderv2/member-password)"
signin 127.0.0.1:3100 member@coder.com "$(tr -d '\n' <~/core784/a/.coderv2/admin-password)"
signin 127.0.0.1:3100 admin@coder.com  'SomeSecurePassword!'
signin 127.0.0.1:3100 member@coder.com 'SomeSecurePassword!'
signin "$IP:3100"     admin@coder.com  'SomeSecurePassword!'
signin "$IP:3100"     admin@coder.com  "$(tr -d '\n' <~/core784/a/.coderv2/admin-password)"
ss -ltn | grep ':3100\b'
admin@coder.com -> 201
member@coder.com -> 201
member@coder.com -> 401
admin@coder.com -> 401
member@coder.com -> 401
admin@coder.com -> 401
admin@coder.com -> 201
LISTEN 0      0                  *:3100             *:*

Each stored password signs in as its own user, and the admin's password does not work for the member. The old default is refused for both users, on loopback and on the workspace's network address. The body of the refusal is {"message":"Incorrect email or password."}. The last sign-in shows the network address does reach this instance, so the 401 before it comes from the password. The listener is still on every interface, which this PR does not change.

The dashboard was then opened through a port forward of the web port. Signing in as admin@coder.com with the password pasted from the file worked, and the Users page listed admin with the Owner role and member with the Member role, on a page whose version badge read v2.39.0-devel+7f79cd2593.

6. A restart, a lost session and --db-reset all reuse the same passwords
# workspace
dev_stop a; dev_start a && dev_wait a                     # plain restart
pwfiles a; grep -c 'creating first user' ~/core784/logs/a.log; shown a admin-password

dev_stop a; rm ~/core784/a/.coderv2/session               # stands in for an expired session
dev_start a && dev_wait a
pwfiles a; test -s ~/core784/a/.coderv2/session && echo "session saved again"
grep -c 'creating first user' ~/core784/logs/a.log

dev_stop a; dev_start a --db-reset && dev_wait a          # database reset
pwfiles a; grep -E 'wiping|creating first user|created member user' ~/core784/logs/a.log
signin 127.0.0.1:3100 admin@coder.com  "$(tr -d '\n' <~/core784/a/.coderv2/admin-password)"
signin 127.0.0.1:3100 member@coder.com "$(tr -d '\n' <~/core784/a/.coderv2/member-password)"
signin 127.0.0.1:3100 admin@coder.com  'SomeSecurePassword!'
a ready at 23:33:02
/home/coder/core784/a/.coderv2/admin-password: mode=600 len=32 alnum=yes lines=1 fp=5dfaad982503 mtime=1794870870
/home/coder/core784/a/.coderv2/member-password: mode=600 len=32 alnum=yes lines=1 fp=251d9d9116d6 mtime=1794870870
0
1

a ready at 23:34:32
/home/coder/core784/a/.coderv2/admin-password: mode=600 len=32 alnum=yes lines=1 fp=5dfaad982503 mtime=1794870870
/home/coder/core784/a/.coderv2/member-password: mode=600 len=32 alnum=yes lines=1 fp=251d9d9116d6 mtime=1794870870
session saved again
0

a ready at 23:35:48
/home/coder/core784/a/.coderv2/admin-password: mode=600 len=32 alnum=yes lines=1 fp=5dfaad982503 mtime=1794870870
/home/coder/core784/a/.coderv2/member-password: mode=600 len=32 alnum=yes lines=1 fp=251d9d9116d6 mtime=1794870870
2026-11-16 23:35:29.947 [warn]  wiping built-in database (--db-reset)
2026-11-16 23:35:46.427 [info]  creating first user  email=admin@coder.com
2026-11-16 23:35:46.552 [info]  created member user  email=member@coder.com
admin@coder.com -> 201
member@coder.com -> 201
admin@coder.com -> 401

The fingerprints and the modification time are the ones from scenario 3 after all three starts, so the files were only read. The banner showed the logins again each time.

  • After the plain restart no user was created and the session file was unchanged, so develop read the files only for the banner.
  • After the session was removed, develop came up in 10 seconds and wrote a session file with a different token. The only password it had was the one in the file.
  • After the reset both users were created again at 23:35:46, while the files still carry the time 23:14:30. The stored passwords sign in to the new database.
7. A second checkout gets different passwords

The first try stopped on the NATS port (fact 4). The run below has the experiment on instance b, with instance a still up.

# workspace, worktree b at 7f79cd2593, never run before
dev_start b -- --experiments no_nats_pubsub && dev_wait b
pwfiles a; pwfiles b
{ pwfiles a; pwfiles b; } | sed -E 's/.*fp=([0-9a-f]+).*/\1/' | sort -u | wc -l
signin 127.0.0.1:3200 admin@coder.com "$(tr -d '\n' <~/core784/a/.coderv2/admin-password)"
signin 127.0.0.1:3200 admin@coder.com "$(tr -d '\n' <~/core784/b/.coderv2/admin-password)"
signin 127.0.0.1:3100 admin@coder.com "$(tr -d '\n' <~/core784/b/.coderv2/admin-password)"
signin 127.0.0.1:3100 admin@coder.com "$(tr -d '\n' <~/core784/a/.coderv2/admin-password)"
b ready at 23:45:42
/home/coder/core784/a/.coderv2/admin-password: mode=600 len=32 alnum=yes lines=1 fp=5dfaad982503 mtime=1794870870
/home/coder/core784/a/.coderv2/member-password: mode=600 len=32 alnum=yes lines=1 fp=251d9d9116d6 mtime=1794870870
/home/coder/core784/b/.coderv2/admin-password: mode=600 len=32 alnum=yes lines=1 fp=ef0b2704cdd3 mtime=1794872739
/home/coder/core784/b/.coderv2/member-password: mode=600 len=32 alnum=yes lines=1 fp=37ead54d3247 mtime=1794872740
4
admin@coder.com -> 401
admin@coder.com -> 201
admin@coder.com -> 401
admin@coder.com -> 201

Four files, four different fingerprints. Each instance refuses the other's admin password and accepts its own.

8. --password sets the admin password only and does not replace a stored password
# workspace
dev_stop b; pwfiles b
dev_start b --db-reset --password "$OVERRIDE" -- --experiments no_nats_pubsub && dev_wait b
pwfiles b
signin 127.0.0.1:3200 admin@coder.com  "$OVERRIDE"
signin 127.0.0.1:3200 admin@coder.com  "$(tr -d '\n' <~/core784/b/.coderv2/admin-password)"
signin 127.0.0.1:3200 member@coder.com "$(tr -d '\n' <~/core784/b/.coderv2/member-password)"
signin 127.0.0.1:3200 member@coder.com "$OVERRIDE"
banner b                                  # with the override masked as well
grep -cF "$OVERRIDE" ~/core784/logs/b.log
/home/coder/core784/b/.coderv2/admin-password: mode=600 len=32 alnum=yes lines=1 fp=ef0b2704cdd3 mtime=1794872739
/home/coder/core784/b/.coderv2/member-password: mode=600 len=32 alnum=yes lines=1 fp=37ead54d3247 mtime=1794872740
b ready at 00:00:11
/home/coder/core784/b/.coderv2/admin-password: mode=600 len=32 alnum=yes lines=1 fp=ef0b2704cdd3 mtime=1794872739
/home/coder/core784/b/.coderv2/member-password: mode=600 len=32 alnum=yes lines=1 fp=37ead54d3247 mtime=1794872740
admin@coder.com -> 201
admin@coder.com -> 401
member@coder.com -> 201
member@coder.com -> 401
         ║ Logins:                                                          ║
         ║            admin@coder.com   <override>             ║
         ║              (from --password)                                   ║
         ║            member@coder.com  <32 characters>    ║
         ║                                                                  ║
         ║ Password files:                                                  ║
         ║            .coderv2/member-password                              ║
         ║                                                                  ║
         ║ Use ./scripts/coder-dev.sh to talk to this instance!             ║
1

The override signs in as the admin, and the stored admin password no longer does. The member keeps its own stored password and does not get the override. Neither file was written. The banner says where the admin password came from and leaves the admin file out of the list. The override appears once in the log, on that banner line.

9. The old default is refused as an override, before the build
# workspace
dev_stop b
( export CODER_DEV_ADMIN_PASSWORD='SomeSecurePassword!'; dev_start b -- --experiments no_nats_pubsub ) && dev_wait b
cat ~/core784/logs/b.log
ss -ltn | grep -E ':(3200|8280)\b' || echo "ports 3200 and 8280 closed"
started b pid 189572 log /home/coder/core784/logs/b.4.log at 00:01:43
b exited at 00:01:48 without a banner
error: running command "develop": --password must not be the old default password: unset --password and CODER_DEV_ADMIN_PASSWORD to use a generated one:
    main.(*devConfig).validate
        /home/coder/core784/b/scripts/develop/main.go:412
ports 3200 and 8280 closed

The three lines are the whole log: nothing was built and no server started. dev_wait looks every 5 seconds, so the exit took under 5 seconds. Running the binary with --password set to the old default exits 1 at the same check.

10. --skip-setup writes no file and prints no login section
# workspace, a fourth worktree d at 7f79cd2593
dev_start d --skip-setup -- --experiments no_nats_pubsub && dev_wait d
pwfiles d; ls ~/core784/d/.coderv2
banner d | head -3; grep -c 'Logins:' ~/core784/logs/d.log
curl -s -w '\nfirst user -> %{http_code}\n' http://127.0.0.1:3400/api/v2/users/first
dev_stop d
d ready at 00:09:02
/home/coder/core784/d/.coderv2/admin-password: missing
/home/coder/core784/d/.coderv2/member-password: missing
postgres
url
0
{"message":"The initial user has not been created!"}
first user -> 404
d stopped at 00:09:15

No password file, no session file, no login section in the banner, and no user on the server.

11. An instance from before this change

This output is from before d547e427d6. With that commit, the first start replaces both passwords and writes both files, so the warning, the 201 for the old default and the error on the second start no longer happen on such an instance. Not rerun.

Worktree c still has the database from scenario 2. It is moved to this branch and started three times.

# workspace
git -C ~/core784/c switch --detach 7f79cd2593
dev_start c -- --experiments no_nats_pubsub && dev_wait c       # the saved session still works
grep 'did not generate the password' ~/core784/logs/c.log
pwfiles c; banner c
signin 127.0.0.1:3300 admin@coder.com  'SomeSecurePassword!'
signin 127.0.0.1:3300 member@coder.com 'SomeSecurePassword!'

dev_stop c; rm ~/core784/c/.coderv2/session                     # no session any more
dev_start c -- --experiments no_nats_pubsub && dev_wait c
grep -A5 '^error:' ~/core784/logs/c.log; pwfiles c

dev_start c --db-reset -- --experiments no_nats_pubsub && dev_wait c   # follow the advice
pwfiles c; grep -c 'did not generate the password' ~/core784/logs/c.log
signin 127.0.0.1:3300 admin@coder.com  'SomeSecurePassword!'
signin 127.0.0.1:3300 admin@coder.com  "$(tr -d '\n' <~/core784/c/.coderv2/admin-password)"
signin 127.0.0.1:3300 member@coder.com 'SomeSecurePassword!'
signin 127.0.0.1:3300 member@coder.com "$(tr -d '\n' <~/core784/c/.coderv2/member-password)"
c ready at 00:12:32
2026-11-17 00:12:29.355 [warn]  develop.sh did not generate the password of admin@coder.com on this instance. If it is still the old public default, anyone who can reach this instance can sign in as that user. Run with --db-reset, or change the password in the dashboard.
2026-11-17 00:12:29.364 [warn]  develop.sh did not generate the password of member@coder.com on this instance. If it is still the old public default, anyone who can reach this instance can sign in as that user. Run with --db-reset, or change the password in the dashboard.
/home/coder/core784/c/.coderv2/admin-password: missing
/home/coder/core784/c/.coderv2/member-password: missing
         ║ Logins:                                                          ║
         ║            admin@coder.com   password not set by develop.sh      ║
         ║            member@coder.com  password not set by develop.sh      ║
         ║                                                                  ║
         ║ Use ./scripts/coder-dev.sh to talk to this instance!             ║
admin@coder.com -> 201
member@coder.com -> 201

c exited at 00:14:30 without a banner
error: running command "develop": setup:
    main.develop
        /home/coder/core784/c/scripts/develop/main.go:730
  - cannot sign in as admin@coder.com: develop.sh does not know the password of this instance: run with --db-reset to start fresh, or pass the current password with --password:
    main.init
        <autogenerated>:1
/home/coder/core784/c/.coderv2/admin-password: missing
/home/coder/core784/c/.coderv2/member-password: missing

c ready at 00:17:29
/home/coder/core784/c/.coderv2/admin-password: mode=600 len=32 alnum=yes lines=1 fp=d13485a9d8bb mtime=1794874647
/home/coder/core784/c/.coderv2/member-password: mode=600 len=32 alnum=yes lines=1 fp=bce991556677 mtime=1794874647
0
admin@coder.com -> 401
admin@coder.com -> 201
member@coder.com -> 401
member@coder.com -> 201
  • With a working session, develop starts, warns once for each user, generates no file, and the banner says the passwords were not set by develop. The old default still signs in. That 201 is expected: the PR does not change the password of a user that already exists, and the warning is what tells the developer.
  • Without a session, develop has no password to try. It stops with the advice and makes no sign-in attempt. See fact 2 for how the error is printed.
  • After --db-reset it is a first run again: two generated files, no warning, and the old default is refused on the same worktree where it was accepted a few minutes earlier.
12. An empty password file stops the run and is not replaced
# workspace, instance b stopped
cp -p ~/core784/b/.coderv2/member-password ~/core784/member-password.keep
truncate -s 0 ~/core784/b/.coderv2/member-password
dev_start b -- --experiments no_nats_pubsub && dev_wait b
cat ~/core784/logs/b.log
pwfiles b
cp -p ~/core784/member-password.keep ~/core784/b/.coderv2/member-password
started b pid 216938 log /home/coder/core784/logs/b.5.log at 00:20:09
b exited at 00:20:14 without a banner
error: running command "develop": password file /home/coder/core784/b/.coderv2/member-password is empty: put the password back, or delete the file and run with --db-reset:
    main.readPassword
        /home/coder/core784/b/scripts/develop/password.go:40
/home/coder/core784/b/.coderv2/admin-password: mode=600 len=32 alnum=yes lines=1 fp=ef0b2704cdd3 mtime=1794872739
/home/coder/core784/b/.coderv2/member-password: mode=600 len=0 alnum=no lines=0 fp=e3b0c44298fc mtime=1794874809

develop stopped before the build and named the file with its full path. The file is still empty and still has the time of the truncate, so develop did not write a new password over it. The member file was used so the check is shown to cover both files. The empty admin file is covered by TestCheckPasswordFiles.

13. Compose: first start generates both passwords, second start reuses them

From a full clone at 7f79cd2593 (fact 5). The two setup services were run one at a time so each one's output could be read.

# workspace, ~/core784/compose
DC="docker compose -p core784 -f compose.dev.yaml"
$DC up -d database init-volumes build-slim coderd
curl -s -o /dev/null -w 'first user -> %{http_code}\n' http://127.0.0.1:3000/api/v2/users/first
$DC run --rm -T setup-init               # below: the script's own status lines, passwords masked
vol() { docker run --rm -v core784_bootstrap_token:/b alpine sh -c "$1"; }
vol 'ls -l /b | tail -n +2; for f in admin member; do printf "%s len=%s fp=%s\n" $f "$(tr -d "\n" </b/$f-password | wc -c)" "$(tr -d "\n" </b/$f-password | sha256sum | cut -c1-12)"; done'
$DC run --rm -T --no-deps setup-users
signin 127.0.0.1:3000 admin@coder.com  "$(vol 'cat /b/admin-password')"
signin 127.0.0.1:3000 member@coder.com "$(vol 'cat /b/member-password')"
signin 127.0.0.1:3000 admin@coder.com  'SomeSecurePassword!'
signin 127.0.0.1:3000 member@coder.com 'SomeSecurePassword!'

$DC down                                  # volumes kept
$DC up -d database init-volumes build-slim coderd
$DC run --rm -T setup-init
$DC run --rm -T --no-deps setup-users
vol 'for f in admin member; do printf "%s fp=%s\n" $f "$(tr -d "\n" </b/$f-password | sha256sum | cut -c1-12)"; done; ls -l --full-time /b | tail -n +2 | awk "{print \$1, \$5, \$6, \$7, \$9}"'
first user -> 404
=== Coder Dev Environment Init ===
Creating bootstrap token...
Bootstrap token created and saved.
Admin login: admin@coder.com / <32 characters>
=== Init complete ===
-rw-------    1 1000     1000            32 Nov 17 00:42 admin-password
-rw-------    1 1000     1000            32 Nov 17 00:42 member-password
-rw-r--r--    1 1000     1000            34 Nov 17 00:43 token
admin len=32 fp=41da8628e741
member len=32 fp=e17f0f0e8f8a
=== Setting up users ===
Creating member user...
Member login: member@coder.com / <32 characters>
=== Users setup complete ===
admin@coder.com -> 201
member@coder.com -> 201
admin@coder.com -> 401
member@coder.com -> 401

=== Coder Dev Environment Init ===
First user already exists, skipping setup
Admin login: admin@coder.com / <32 characters>
=== Setting up users ===
Creating member user...
Member user already exists.
Member login: member@coder.com / <32 characters>
=== Users setup complete ===
admin fp=41da8628e741
member fp=e17f0f0e8f8a
-rw------- 32 2026-11-17 00:42:50 admin-password
-rw------- 32 2026-11-17 00:42:50 member-password
-rw-r--r-- 34 2026-11-17 00:43:01 token

On the first start both files were on the volume, mode 600, after setup-init alone, before setup-users ran. Each password was printed once, by the service that creates its user, and neither is in the server's log. On the second start both services printed the stored login again, and the fingerprints and file times did not change.

14. Compose refuses the old default as an override
# workspace, a second compose project with an empty database
DC="docker compose -p core784x -f compose.dev.yaml"
export CODER_DEV_ADMIN_PASSWORD='SomeSecurePassword!'
$DC up -d database init-volumes build-slim coderd
$DC run --rm -T setup-init; echo "exit $?"
curl -s -o /dev/null -w 'first user -> %{http_code}\n' http://127.0.0.1:3000/api/v2/users/first
unset CODER_DEV_ADMIN_PASSWORD
CODER_DEV_MEMBER_PASSWORD='SomeSecurePassword!' $DC run --rm -T --no-deps setup-users; echo "exit $?"
=== Coder Dev Environment Init ===
CODER_DEV_ADMIN_PASSWORD must not be the old default password. Unset it to use a generated one.
exit 1
first user -> 404
=== Setting up users ===
CODER_DEV_MEMBER_PASSWORD must not be the old default password. Unset it to use a generated one.
exit 1

Both variables are refused. No user was created and nothing was written to the volume.

15. Compose on a volume without password files still starts

This output is from before d547e427d6. The users here had generated passwords, not the old default, so the scripts would still change nothing. The warning is now one line: "This environment does not know the password of ..., so it cannot print it." Not rerun.

The two password files were removed from the volume of the first project while its database kept its users. This stands in for an environment created before this change.

# workspace
DC="docker compose -p core784 -f compose.dev.yaml"
docker run --rm -v core784_bootstrap_token:/b alpine sh -c 'rm /b/admin-password /b/member-password; ls /b'
$DC up -d database init-volumes build-slim coderd
$DC run --rm -T setup-init; echo "exit $?"
$DC run --rm -T --no-deps setup-users; echo "exit $?"
docker run --rm -v core784_bootstrap_token:/b alpine ls /b
$DC up -d; echo "up exit $?"
docker ps -a --filter label=com.coder.dev --format '{{.Names}}  {{.Status}}' | grep setup
token
=== Coder Dev Environment Init ===
First user already exists, skipping setup
Admin login: admin@coder.com (password was not set by this environment)
exit 0
=== Setting up users ===
Member login: member@coder.com (password was not set by this environment)
=== Users setup complete ===
This environment did not generate the password of member@coder.com.
If it is still the old public default, anyone who can reach this instance can sign in as that user.
Remove this environment's volumes to start fresh, or change the password in the dashboard.
exit 0
token
up exit 0
core784-setup-init-1  Exited (0) 45 seconds ago
core784-setup-template-1  Exited (0) 32 seconds ago
core784-setup-users-1  Exited (0) 42 seconds ago

Both services exit 0 and no file is generated, so a plain docker compose up finishes on such a volume. The script writes the three warning lines first, to stderr. The capture collected the two streams separately, which is why they appear after the stdout lines here. The admin has no warning lines here because this output is from before 81a51b1c05 (fact 3). The users on this database were created in scenario 13 with generated passwords, so this scenario shows what the scripts say, not an instance where the old default still works. Scenario 11 shows that for develop.

16. seed.sh reads the admin password from the file

Run by hand against develop instance a, which stands in for the deployment inside an ephemeral workspace.

# workspace
SEED=~/core784/a/.agents/skills/deploy-ephemeral/seed.sh
grep -c 'SomeSecurePassword' "$SEED" ~/core784/a/.agents/skills/deploy-ephemeral/SKILL.md
export CODER_URL=http://127.0.0.1:3100
EPH_ADMIN_PASSWORD_FILE=/nonexistent/admin-password bash "$SEED"; echo "exit $?"
EPH_ADMIN_PASSWORD_FILE=~/core784/c/.coderv2/admin-password bash "$SEED"; echo "exit $?"   # another instance's password
EPH_ADMIN_PASSWORD_FILE=~/core784/a/.coderv2/admin-password bash "$SEED"; echo "exit $?"
EPH_ADMIN_PASSWORD_FILE=~/core784/a/.coderv2/admin-password bash "$SEED"; echo "exit $?"   # again
/home/coder/core784/a/.agents/skills/deploy-ephemeral/seed.sh:0
/home/coder/core784/a/.agents/skills/deploy-ephemeral/SKILL.md:0
seed: admin password file /nonexistent/admin-password is missing or empty
exit 1
seed: POST /api/v2/users/login returned HTTP 401: {"message":"Incorrect email or password."}
exit 4
seed: created provider anthropic
seed: created provider openai
seed: created model claude-opus-5-5
seed: created model claude-sonnet-5-5
seed: created model claude-haiku-4-5
seed: created model gpt-6-astra
seed: set the title generation model to claude-haiku-4-5
seed: done
exit 0
seed: done
exit 0

Without the file the seed fails with a message that names it. An empty file gives the same message. With another instance's password the server refuses the sign-in, which shows the seed uses the file's value and has nothing to fall back on. With the right file it runs to the end, and a second run creates nothing. The seed's output does not contain the password.

17. One real ephemeral deployment

Made by following .agents/skills/deploy-ephemeral/SKILL.md from this branch. The skill chose full mode. The license step does not apply to this PR, so it was not exercised.

# laptop
coder create eph-pr-32283 -O coder --template coder-ephemeral -y \
  --parameter pr_number=32283 --parameter branch=bobby/core-784-generate-dev-passwords \
  --parameter mode=full --parameter instance_type=c7i.xlarge
# ... port shares, seed install and sync as in the skill ...
coder ssh eph-pr-32283 -- cat /var/lib/eph/status/status.json |
  jq '{mode, state, deployed_sha, build_sha, seeded_at, seed_error, last_recovery}'
coder ssh eph-pr-32283 -- 'sudo docker exec -u coder eph-dev ls -l /home/coder/coder/.coderv2/' |
  grep password | awk '{print $1, $3, $5, $9}'
coder ssh eph-pr-32283 -- bash -s <<'EOF'
rd() { sudo docker exec -u coder eph-dev cat "/home/coder/coder/.coderv2/$1-password"; }
signin() { jq -cn --arg e "$1" --arg p "$2" '{email: $e, password: $p}' |
  curl -s -o /dev/null -w "$1 $3 -> %{http_code}\n" -H 'Content-Type: application/json' \
    --data-binary @- http://127.0.0.1:3100/api/v2/users/login; }
signin admin@coder.com  'SomeSecurePassword!' "old default"
signin admin@coder.com  "$(rd admin)"  "stored"
signin member@coder.com 'SomeSecurePassword!' "old default"
signin member@coder.com "$(rd member)" "stored"
sudo tail -n 3 /var/lib/eph/status/seed.log
sudo grep -c 'password=' /var/lib/eph/status/develop.log
EOF
{
  "mode": "full",
  "state": "running",
  "deployed_sha": "7f79cd2593cb1de53bb0e27bd94d3d14333b2997",
  "build_sha": "7f79cd2593cb1de53bb0e27bd94d3d14333b2997",
  "seeded_at": "2026-11-17T01:22:21Z",
  "seed_error": "",
  "last_recovery": ""
}
-rw------- coder 33 admin-password
-rw------- coder 33 member-password
admin@coder.com old default -> 401
admin@coder.com stored -> 201
member@coder.com old default -> 401
member@coder.com stored -> 201
seed: created model gpt-6-astra
seed: set the title generation model to claude-haiku-4-5
seed: done
0

The deployment was built from this branch and seeded with no path override, 71 seconds after develop started. Both files exist in the container with mode 600. The old default is refused for both users. The command the skill uses for its report printed two logins, each with a 32-character password. The shared dashboard URL loaded through the organization port share, and signing in there as member@coder.com with the stored password worked. The workspace was then torn down with the skill's Teardown section.

Not covered: a second deployment beside this one, an existing deployment that picks up this change, the license step, and frontend mode.

18. Repository search and docs
# workspace, worktree a
git grep -n 'SomeSecurePassword' -- . ':!*_test.go' ':!site/src' ':!site/e2e'
git grep -c 'SomeSecurePassword' b4f8b6756c -- . ':!*_test.go' ':!site/src' ':!site/e2e' | sed 's/^b4f8b6756c://'
git grep -n 'defaultPassword' -- scripts/develop || echo "(none)"
coderd/coderdtest/coderdtest.go:866:	Password: "SomeSecurePassword!",
coderd/coderdtest/coderdtest.go:988:		Password:        "SomeSecurePassword!",
coderd/workspaceapps/apptest/apptest.go:1911:			const password = "SomeSecurePassword!"
scripts/develop/password.go:22:	oldDefaultPassword = "SomeSecurePassword!"
scripts/docker-dev/password.sh:5:OLD_DEFAULT_PASSWORD='SomeSecurePassword!'

.agents/skills/deploy-ephemeral/SKILL.md:2
.agents/skills/deploy-ephemeral/seed.sh:1
CONTRIBUTING.md:1
coderd/coderdtest/coderdtest.go:2
coderd/workspaceapps/apptest/apptest.go:1
compose.dev.yaml:3
contributing/frontend.md:1
scripts/develop/main.go:1
scripts/docker-dev/setup-init.sh:1
scripts/docker-dev/setup-users.sh:1
(none)

On this branch the string is left in four files: two in-process test helpers, and the two files that name it in order to refuse it. The second list is the same search on main. The eight other files there no longer have it. With no path filter the only further hits are _test.go files and two files under site/. CONTRIBUTING.md and contributing/frontend.md now point to the banner and to .coderv2/admin-password, which is what scenarios 3 and 4 saw.

19. Unit tests and shell lint
# workspace, worktree a
go test ./scripts/develop/... -count=1
go test ./scripts/develop/... -count=1 -v \
  -run 'TestLoadOrCreatePassword|TestCheckPasswordFiles|TestLoginBannerLines|TestSetupFirstUser|TestDevConfigValidate' |
  grep -E '^--- |^ok'
make lint/shellcheck
shellcheck --external-sources scripts/docker-dev/password.sh scripts/docker-dev/setup-init.sh \
  scripts/docker-dev/setup-users.sh .agents/skills/deploy-ephemeral/seed.sh; echo "exit $?"
shfmt -d scripts/docker-dev/password.sh scripts/docker-dev/setup-init.sh \
  scripts/docker-dev/setup-users.sh .agents/skills/deploy-ephemeral/seed.sh; echo "exit $?"
ok  	github.com/coder/coder/v2/scripts/develop	4.080s
--- PASS: TestLoginBannerLines (0.00s)
--- PASS: TestDevConfigValidate (0.00s)
--- PASS: TestCheckPasswordFiles (0.00s)
--- PASS: TestLoadOrCreatePassword (0.00s)
--- PASS: TestSetupFirstUser (0.00s)
ok  	github.com/coder/coder/v2/scripts/develop	0.771s
--- shellcheck
exit 0
exit 0

The five tests ran 44 subtests, none failed and none was skipped. shellcheck 0.11.0 and shfmt report nothing for the four shell files, and the lint/shellcheck target's file list includes all four.

20. Cleanup
# workspace
for n in a b c d; do dev_stop "$n"; done
( cd ~/core784/compose && docker compose -p core784 -f compose.dev.yaml down -v
  docker compose -p core784x -f compose.dev.yaml down -v )
for n in a b c d; do git -C ~/coder worktree remove --force ~/core784/$n; done
git -C ~/coder worktree prune && rm -rf ~/core784

# laptop: the skill's Teardown section for eph-pr-32283
coder ssh eph-pr-32283 -- sudo /opt/eph/bin/eph-proxy deregister
coder delete eph-pr-32283 -y
  • The last develop instance stopped at 02:09:00 UTC. Afterwards the workspace had no container with the compose dev label, no volume of either compose project, and no run directory.
  • The ephemeral workspace was torn down earlier, right after scenario 17. eph-proxy deregister printed "no OAuth client registered", as expected for a workspace that never ran in frontend mode. After coder delete the workspace lookup answered 404.
  • One thing was left in the development workspace: the coder-test-postgres container that the Go tests in scenario 19 started.

Every instance, both compose projects with their volumes, the worktrees and the ephemeral workspace are gone, so the passwords generated during the run open nothing.

develop.sh, the compose dev environment and the deploy-ephemeral skill
created every admin and member user with the same public password.
Each now generates a random password per user on first use, stores it
in a file only the owner can read, prints it, and reuses it on later
runs. The old default is refused as an override.

A user that already exists keeps its password. develop.sh warns when
it did not set that password, and stops with advice when it has no
way to sign in.
@BobbyHo
BobbyHo temporarily deployed to main November 16, 2026 20:57 — with GitHub Actions Inactive
@BobbyHo
BobbyHo temporarily deployed to main November 16, 2026 20:57 — with GitHub Actions Inactive
@linear-code

linear-code Bot commented Nov 16, 2026

Copy link
Copy Markdown

CORE-784

@BobbyHo

BobbyHo commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review Please limit the review to P0, P1, and P2 issues only.

@coder-agents-review

coder-agents-review Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Review could not be started
Requested: BobbyHo

deep-review v0.13.0 | Round 4 | da64286..782b673

Last posted: Round 4, 11 findings (11 P2), APPROVE. Review

Finding inventory

Findings

# Sev Status Location Summary Round Reviewer Posted
CRF-1 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/main.go:1045 Any member lookup error, not only 404, writes a member password file for an existing member R1 Netero No
CRF-2 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/docker-dev/setup-users.sh:47 Prints $PASSWORD as member login even when users create failed; echoes override value R1 Netero No
CRF-3 P4 Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/main.go:1088 With saved session, banner shows --password value without checking it against the server R1 Netero No
CRF-4 Note Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/main.go:964 Expired-session path not exercised by TestSetupFirstUser R1 Netero No
CRF-5 P2 Author fixed (d547e42) scripts/develop/main.go:1086 Pre-existing develop instances keep the old public password; develop only warns instead of rotating R1 Kurapika, Ryosuke, Luffy, Pen Botter, Pariston Yes
CRF-6 P2 Author fixed (d547e42) scripts/docker-dev/setup-init.sh:28 Pre-existing compose volumes keep the old public password for admin and member; scripts only warn R1 Kurapika, Ryosuke, Luffy, Pariston Yes
CRF-7 P2 Author fixed (c865254, d547e42) scripts/develop/main.go:1070 errUnknownAdminPassword advises --password, but the current password is the old default that validate refuses; override never stored R1 Mafuuu, Hisoka, Leorio, Luffy, Meruem, Pariston Yes
CRF-8 P2 Author fixed (d547e42) scripts/develop/main.go:1094 Following "change the password in the dashboard" revokes develop's session and the next run fails with errUnknownAdminPassword R1 Pen Botter, Leorio, Meruem Yes
CRF-9 P2 Author fixed (d547e42) scripts/docker-dev/password.sh:23 In compose, the dashboard advice revokes /bootstrap/token and setup-init never recreates it R1 Pen Botter Yes
CRF-10 P3 Dropped by orchestrator (downgraded from P2: naming, no wrong behavior; below requester's P0-P2 limit) scripts/develop/main.go:288 devLogin.seeded is true for logins develop did not seed R1 Gon No
CRF-11 Nit Dropped by orchestrator (downgraded from P2: comment wording; below requester's P0-P2 limit) scripts/develop/main.go:976 Comment first sentence restates the switch R1 Gon No
CRF-12 Nit Dropped by orchestrator (downgraded from P2: comment wording; below requester's P0-P2 limit) scripts/develop/main.go:674 Comment "not after it" restates "before the build" R1 Gon No
CRF-13 Note Dropped by orchestrator (below requester's P0-P2 limit) .agents/skills/dogfood/SKILL.md:69 dogfood skill and DEV_ISOLATION.md do not say where the generated password is stored R1 Pen Botter No
CRF-14 OOS Out of scope (body) scripts/develop/main.go:845 Server listens on 0.0.0.0 before the first user exists; anyone can claim Owner in that window R1 Meruem No
CRF-15 OOS Out of scope (body) compose.dev.yaml:106 Same unclaimed-first-user window in compose, lasting the go run compile R1 Meruem No
CRF-16 OOS Out of scope (body) scripts/develop/main.go:115 Corrective error text is printed between xerrors frames R1 Leorio No
CRF-17 OOS Out of scope (body) coderd/database/migrations/000643_skill_display_name.up.sql:1 Two migrations numbered 000643 on main; TestSetupFirstUser fails at head R2 Netero, Meruem No
CRF-18 P3 Dropped by orchestrator (below requester's P0-P2 limit) .agents/skills/deploy-ephemeral/SKILL.md:269 admin-password-missing guidance states the old cause and points to the destructive recovery R2 Netero No
CRF-19 Note Dropped by orchestrator (below requester's P0-P2 limit) .agents/skills/deploy-ephemeral/seed.sh:11 Comment omits the other paths that write the admin password file R2 Netero No
CRF-20 P2 Author fixed (e05a986) scripts/develop/main.go:1052 Stale admin password file: --password recovery lasts one session, banner shows refused value R2 Pen Botter P2, Pariston P2, Mafuuu P2, Leorio P2, Chopper P3 Yes
CRF-21 P2 Author fixed (e05a986) scripts/docker-dev/setup-init.sh:75 Compose: stale admin file after dashboard change makes setup-init exit 1 every start with no recovery named R2 Pen Botter P2, Pariston P2, Mafuuu P3, Leorio P3, Chopper P3 Yes
CRF-22 P2 Author fixed (e05a986) scripts/develop/main.go:1141 replaceOldDefaultAdmin uses codersdk.Me, so a member session replaces the member's password and stores it as the admin's R2 Hisoka Yes
CRF-23 P2 Author fixed (e05a986) scripts/develop/main.go:1149 Old default is replaced only when no file exists; a stale file keeps the public password R2 Hisoka P2, Meruem P3 Yes
CRF-24 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/main.go:978 With --password set, the admin's old default is never replaced; test asserts it with the old default as override R2 Kurapika, Bisky No
CRF-25 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/main.go:1163 replaceOldDefault deletes the new file on any error, including when the server may have applied the change R2 Ryosuke, Meruem No
CRF-26 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/main.go:1036 Wrong --password gets advice to run with --password R2 Ryosuke No
CRF-27 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/main.go:974 Non-401 replacement failure ends in the misleading unknown-password error R2 Chopper No
CRF-28 P3 Dropped by orchestrator (downgraded from P2: comment wording, no behavior impact; below requester's P0-P2 limit) scripts/develop/main.go:993 Comment says a password is generated after replacing the old default; this block does not R2 Gon No
CRF-29 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/password.go:20 oldDefaultPassword doc omits that it is sent to replace the password R2 Gon No
CRF-30 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/docker-dev/setup-init.sh:28 Token-delete comment gives only one of two reasons R2 Gon No
CRF-31 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/main.go:1178 knownLogin name and unused receiver R2 Gon No
CRF-32 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/password_test.go:164 Banner width 64 duplicated in test; fixtures shorter than generated passwords R2 Gon P3, Bisky P4 No
CRF-33 P4 Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/main.go:1654 indent means a string here and a function in printBanner R2 Gon No
CRF-34 P4 Dropped by orchestrator (below requester's P0-P2 limit) scripts/docker-dev/password.sh:33 head -c 32 duplicates generatedPasswordLength R2 Gon No
CRF-35 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/docker-dev/password.sh:54 Admin error message names the user as "me" R2 Leorio No
CRF-36 P4 Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/main.go:1166 os.Remove failure drops the UpdateUserPassword error R2 Leorio No
CRF-37 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/docker-dev/setup-init.sh:40 Compose replacement and token restore have no automated test R2 Bisky No
CRF-38 Note Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/main.go:1156 Replacing the old default revokes all API tokens of both users; not documented R2 Pen Botter No
CRF-39 Note Dropped by orchestrator (below requester's P0-P2 limit) scripts/docker-dev/setup-init.sh:45 Member-before-admin order is required and undocumented R2 Meruem No
CRF-40 OOS Out of scope (body) site/e2e/playwright.config.ts:89 e2e server on 0.0.0.0 with users on the public default password R2 Luffy No
CRF-41 OOS Out of scope (body) scripts/develop/main.go:960 setupFirstUser treats any valid saved session as the admin session R2 Hisoka No
CRF-42 OOS Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/main.go:1584 Unnamed banner width w := 64 R2 Gon No
CRF-43 P2 Author fixed (782b673) scripts/docker-dev/setup-init.sh:71 Pre-PR compose env older than 7 days keeps the old default: expired bootstrap token, restore never tries the old default R3 Pariston P2, Knov P2, Leorio P3 Yes
CRF-44 P2 Author fixed (782b673) scripts/docker-dev/setup-init.sh:104 Compose env created with CODER_DEV_ADMIN_PASSWORD never stores the override R3 Mafuuu P2, Pen Botter P3 Yes
CRF-45 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/main.go:1101 Member password file refused by the server is shown in the banner on every run R3 Pen Botter, Leorio, Meruem No
CRF-46 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/docker-dev/setup-init.sh:102 Member file generated even when CODER_DEV_MEMBER_PASSWORD is set; setup-users prints a refused login R3 Meruem, Pen Botter No
CRF-47 P4 Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/main.go:1131 Old-default sign-in attempt on every start; failed-login audit entry per start R3 Pen Botter P4, Ryosuke Note No
CRF-48 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/main.go:1039 Non-400 replacement failure with a stored file returns errRefusedAdminPassword R3 Chopper No
CRF-49 P3 Dropped by orchestrator (downgraded from P2: comment only; behavior guarded by GeneratesStoresAndReuses and AStoredOldDefaultIsReplaced; below requester's P0-P2 limit) scripts/develop/password.go:45 loadOrCreatePassword and create_password_file comments state the reason the CRF-23 fix disproved R3 Gon P2, Leorio P3 No
CRF-50 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/docker-dev/password.sh:38 store_password overwrites, while Go storePassword refuses to R3 Gon No
CRF-51 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/docker-dev/setup-init.sh:58 restore_bootstrap_token also writes the password file and can exit; comment omits it R3 Gon No
CRF-52 Nit Dropped by orchestrator (below requester's P0-P2 limit) scripts/develop/main.go:999 refused holds an error but reads as a boolean R3 Gon No
CRF-53 P3 Dropped by orchestrator (below requester's P0-P2 limit; fix folded into CRF-43) scripts/docker-dev/setup-init.sh:31 "no expiry" comment is false: --lifetime 0 gives 7 days R3 Knov No
CRF-54 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/docker-dev/password.sh:70 CRF-37 reopened: the stored guard in replace_old_default runs on every start and has no test R3 Bisky No
CRF-55 OOS Out of scope (body) scripts/docker-dev/setup-init.sh:32 On main, the bootstrap token expires after 7 days and its consumers get an expired token R3 Pariston No
CRF-56 P3 Dropped by orchestrator (downgraded from P2: comment wording, no behavior impact; below requester's P0-P2 limit) scripts/docker-dev/setup-init.sh:67 restore_bootstrap_token header says "while the password is known"; it now signs in with the old default R4 Gon No
CRF-57 P3 Dropped by orchestrator (downgraded from P2: comment wording, no behavior impact; below requester's P0-P2 limit) scripts/docker-dev/setup-init.sh:58 admin_sign_in doc omits its return contract R4 Gon No
CRF-58 Nit Dropped by orchestrator (below requester's P0-P2 limit) scripts/docker-dev/setup-init.sh:32 "unless it is configured" does not name CODER_DEFAULT_TOKEN_LIFETIME R4 Gon No
CRF-59 Nit Dropped by orchestrator (below requester's P0-P2 limit) scripts/docker-dev/setup-init.sh:76 source is both a message label and the password-known flag R4 Gon No
CRF-60 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/docker-dev/setup-init.sh:99 PR description still says the refused-stored-password case is left unfixed R4 Leorio No
CRF-61 P3 Dropped by orchestrator (below requester's P0-P2 limit) scripts/docker-dev/setup-init.sh:99 Old-default fallback has no committed test; stub harness only in /tmp (CRF-37, CRF-54) R4 Bisky No
CRF-62 Note Dropped by orchestrator (below requester's P0-P2 limit) scripts/docker-dev/setup-init.sh:99 Hand-changed admin password plus rejected token now exits 1; description says "still starts" R4 Netero No
CRF-63 OOS Out of scope (body) scripts/docker-dev/setup-init.sh:147 First-user path reuses a non-empty /bootstrap/token without checking it R4 Knov No
CRF-64 OOS Out of scope (body) scripts/docker-dev/setup-init.sh:34 Owner bootstrap token written with default umask (0644) R4 Kurapika No

Law analysis

Round 3, head 6ea1564: effective LOC +1040 -39 (569 production, 471 test). Verdict: Don't split. Enforcement: Advisory. Optional: land the coder tokens delete --delete fix in setup-init.sh as its own PR first.

Contested and acknowledged

None.

Round log

Round 1

Full panel (round 1). Netero first pass: 2 P3, 1 P4, 1 Note, no P0, so the panel ran. Law not run (effective additions 615). Panel: ging-go, kurapika, ryosuke, luffy, pen-botter (triggered specialists); pariston, mafuuu (core); bisky, hisoka, gon, leorio (pool, Gon and Leorio for the once-per-PR floor); meruem (random wildcard). Multi-domain, security-sensitive: 12 reviewers. Requester asked for P0-P2 only, so P3 and below are recorded but not posted. 5 P2 posted, 3 OOS in body. Gon P2 naming and comment items downgraded (no behavior impact). Reviewed against 6e2ff20..81a51b1.

Round 2

Churn guard PROCEED: CRF-5 to CRF-9 addressed (d547e42, c865254); panel verified CRF-5, 6, 7 (for the no-file case), 8 and 9 (except the stale-file case, now CRF-21). Fix round, not a restructure: no files added or renamed, no exported signature or goal change, effective additions +317 since R1. Panel: kurapika, ryosuke, luffy, pen-botter, pariston, mafuuu, hisoka, leorio, meruem (raised R1 findings whose code changed); ging-go, bisky (specialists for changed Go and tests); gon (comments touched); chopper (random wildcard). All new agents. Netero: CRF-17 moved to out of scope (main's duplicate migration). 4 P2 posted (CRF-20 to CRF-23); CRF-21 and CRF-23 kept at P2 by the higher-severity tiebreaker. P3 and below recorded, not posted. Reviewed against 3211ca0..070107c.

Round 3

Churn guard PROCEED: CRF-20 to CRF-23 addressed in e05a986; panel verified all four (develop by test, compose by reading). Law ran (effective additions crossed 1000, Law had not run): Don't split, advisory. Netero: no findings; tests pass at head. Fix round, not a restructure: no files added, +108 effective since R2. Panel: pen-botter, pariston, mafuuu, leorio, chopper, hisoka, meruem (raised R2 findings whose code changed); ging-go, kurapika, ryosuke, bisky (specialists); gon (comments touched); knov (random wildcard). All new agents. 2 P2 posted (CRF-43, CRF-44; CRF-44 kept at P2 by the higher-severity tiebreaker). CRF-43 also covers the compose case the author's CRF-23 reply left open. Gon P2 comment items downgraded (CRF-49). Reviewed against da64286..6ea1564.

Round 4

Churn guard PROCEED: CRF-43 and CRF-44 addressed in 782b673; verified by Netero's stub harness (/tmp/netero-r4, scenarios A to H) and by Pariston, Knov, Leorio, Mafuuu, Pen Botter, Kurapika, Razor. Law not run (+27 effective since R3 analysis). Fix round: one shell file changed. Panel: pariston, knov, leorio (CRF-43), mafuuu, pen-botter (CRF-44), kurapika (auth in shell), gon (comments touched), bisky (untested behavior change), razor (random wildcard). All new agents. No P0-P2 findings; Gon's two P2 comment items downgraded (CRF-56, CRF-57). APPROVE event. Reviewed against da64286..782b673.

About deep-review

CRF = Coder Review Finding (P0-P4, Nit, Note)

Reviewer Focus
Bisky tests
Chopper ops/errors
Churn-guard change verification
Ging language modernization
Gon naming
Hisoka edge cases
Killua perf
Kite change integrity
Knov contracts
Knuckle SQL
Komugi flake/determinism
Kurapika security
Law decomposition
Leorio docs
Luffy product
Mafu-san process
Mafuuu contracts
Melody dispatch/pairing
Meruem structural
Nami frontend
Netero mechanical checks
Pariston premise testing
Pen-botter product gaps
Razor verification
Robin duplication
Ryosuke Go arch
Takumi concurrency
Zoro shape

🤖 Managed by Coder Agents.

@BobbyHo

BobbyHo commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review Please limit the review to P0, P1, and P2 issues only.

@coder-agents-review

coder-agents-review Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Review could not be started
Requested: BobbyHo

🤖 Managed by Coder Agents.

A compose environment created before passwords were generated has the
member user but no member password file. setup-users exited 1 there, and
the site service never started because it waits for setup-users. It now
warns that it did not set the member's password and exits 0. It still
fails when the member has to be created and no password is available.
@BobbyHo
BobbyHo temporarily deployed to main November 16, 2026 22:44 — with GitHub Actions Inactive
@BobbyHo
BobbyHo temporarily deployed to main November 16, 2026 22:44 — with GitHub Actions Inactive
@BobbyHo
BobbyHo temporarily deployed to main November 17, 2026 02:08 — with GitHub Actions Inactive
@BobbyHo
BobbyHo temporarily deployed to main November 17, 2026 02:18 — with GitHub Actions Inactive
…vironment

setup-users warned when the member existed without a password file.
setup-init only said the admin password was not set by the
environment. The admin is the Owner, so it now gets the same warning.
Both scripts call one function in password.sh.
@BobbyHo
BobbyHo temporarily deployed to main November 17, 2026 02:23 — with GitHub Actions Inactive
@BobbyHo
BobbyHo temporarily deployed to main November 17, 2026 02:23 — with GitHub Actions Inactive
@BobbyHo

BobbyHo commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review Please limit the review to P0, P1, and P2 issues only.

@coder-agents-review

coder-agents-review Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Review could not be started
Requested: BobbyHo

🤖 Managed by Coder Agents.

@BobbyHo
BobbyHo marked this pull request as ready for review November 17, 2026 02:24
@BobbyHo
BobbyHo temporarily deployed to main November 17, 2026 02:24 — with GitHub Actions Inactive
@BobbyHo
BobbyHo requested review from a team and geokat November 17, 2026 02:24
@mafredri

Copy link
Copy Markdown
Member

/coder-agents-review Please limit the review to P0, P1, and P2 issues only.

@coder-agents-review

coder-agents-review Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Chat: Review posted | View chat
Requested: 2026-11-17 19:53 UTC by @BobbyHo
Spend: $45.37 / $100.00

Review history
  • R1 (2026-11-17): 12 reviewers, 5 P2, COMMENT. Review
  • R2 (2026-11-17): 13 reviewers, 9 P2, COMMENT. Review
  • R3 (2026-11-17): 13 reviewers, 11 P2, COMMENT. Review
  • R4 (2026-11-17): 9 reviewers, 11 P2, APPROVE. Review

🤖 Managed by Coder Agents.

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR replaces the shared dev password with generated per-instance passwords in develop.sh, the compose environment and the deploy-ephemeral skill. 5 P2 findings, all about instances and volumes created before this change: they keep the old password, and the recovery advice leads to dead ends. As requested, only P0 to P2 findings are posted.

Out of scope (needs a ticket or explicit acceptance by a human):

  • scripts/develop/main.go:845: develop starts the server on 0.0.0.0 before setupFirstUser creates the first user, so anyone who can reach the port in that window can call POST /api/v2/users/first and become Owner.
  • compose.dev.yaml:106: coderd publishes port 3000 on every host interface, and setup-init.sh creates the first user only after go run ./cmd/coder compiles, so the same unclaimed-first-user window lasts as long as that compile.
  • scripts/develop/main.go:115: develop prints every wrapped xerrors frame, so the corrective sentence of each develop error, including the three this PR adds, sits between Go function names and file paths.

🤖 This review was automatically generated with Coder Agents.

Comment thread scripts/develop/main.go Resolved
Comment thread scripts/docker-dev/setup-init.sh Resolved
Comment thread scripts/develop/main.go Resolved
Comment thread scripts/develop/main.go Resolved
Comment thread scripts/docker-dev/password.sh Resolved
An instance created before passwords were generated kept the old public
default for admin@coder.com and member@coder.com. develop.sh and the
compose setup now give such a user a generated password. The old default
is sent as the current password, so the server keeps a password that was
changed by hand.

Changing the admin password revokes its tokens, so develop.sh signs in
again and the compose setup recreates the bootstrap token.
@BobbyHo
BobbyHo temporarily deployed to main November 17, 2026 15:58 — with GitHub Actions Inactive
@BobbyHo
BobbyHo temporarily deployed to main November 17, 2026 15:59 — with GitHub Actions Inactive
…that keep the database

When --password signed in and no admin password was stored, develop.sh
forgot it, so the next run without the flag stopped once the saved
session expired. It is now saved to the admin password file, which is
never replaced when it already exists.

The unknown-password error now lists the two ways out that keep the
database before --db-reset.
@BobbyHo
BobbyHo temporarily deployed to main November 17, 2026 16:09 — with GitHub Actions Inactive
@BobbyHo
BobbyHo temporarily deployed to main November 17, 2026 16:09 — with GitHub Actions Inactive
@BobbyHo

BobbyHo commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review Please limit the review to P0, P1, and P2 issues only.

@BobbyHo
BobbyHo temporarily deployed to main November 17, 2026 16:11 — with GitHub Actions Inactive

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Round 2. The round 1 findings are fixed: develop and compose now replace the old default on existing instances, a working --password is stored when no file exists, and the dashboard advice is gone. This round has 4 P2 findings: two about a stored admin password that the server no longer accepts, and two about when develop replaces the old default. As requested, only P0 to P2 findings are posted.

go test ./scripts/develop/ fails at this head with duplicate migration file: 000643_skill_display_name.down.sql, because main has two migrations numbered 000643. Reviewers ran the tests with one of them renamed locally; the branch needs another merge of main after that is fixed there.

Out of scope (needs a ticket or explicit acceptance by a human):

  • coderd/database/migrations/000643_skill_display_name.up.sql:1: two migrations share number 000643 on main, so every test that creates a database fails on main and on every branch that merges it.
  • site/e2e/playwright.config.ts:89: the Playwright server listens on 0.0.0.0, and site/e2e/api.ts:39 creates users with the same public password from site/e2e/constants.ts:29, so a local e2e run exposes those logins to anyone who can reach the port while it runs.
  • scripts/develop/main.go:960: setupFirstUser treats any valid saved session as the admin session, so with a member session the multi-org, starter template and proxy setup run as the member and fail with warnings.

🤖 This review was automatically generated with Coder Agents.

Comment thread scripts/develop/main.go Resolved
Comment thread scripts/docker-dev/setup-init.sh Resolved
Comment thread scripts/develop/main.go Resolved
Comment thread scripts/develop/main.go Resolved
A stored password did not show that the server still accepted it.
develop and compose now replace the old default whether or not a
password file exists, and store an override that signs in when the
stored password differs. develop signs in as the admin with the old
default instead of using the saved session, which can belong to
another user. A refused stored password has its own error in develop,
and the compose error names the source, the HTTP status and the
recovery.
@BobbyHo
BobbyHo temporarily deployed to main November 17, 2026 18:56 — with GitHub Actions Inactive
@BobbyHo
BobbyHo temporarily deployed to main November 17, 2026 19:10 — with GitHub Actions Inactive
@BobbyHo

BobbyHo commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review Please limit the review to P0, P1, and P2 issues only.

@BobbyHo
BobbyHo temporarily deployed to main November 17, 2026 19:11 — with GitHub Actions Inactive

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Round 3. The four round 2 findings are fixed: a --password that signs in replaces a stored admin password that differs, compose names the refused source and the recoveries, the admin replacement signs in as admin@coder.com on its own client, and the old default is replaced whether or not a file exists. go test ./scripts/develop/ passes at this head. This round has 2 P2 findings, both in the compose scripts. The first also covers the case your reply on the stored-file thread left open. As requested, only P0 to P2 findings are posted.

Out of scope (needs a ticket or explicit acceptance by a human):

  • scripts/docker-dev/setup-init.sh:32: on main, --lifetime 0 gives the bootstrap token the 7-day default lifetime and setup-init never checks it once the first user exists, so setup-template, wsproxy and the other /bootstrap/token readers get an expired token in every compose environment older than 7 days.

🤖 This review was automatically generated with Coder Agents.

Comment thread scripts/docker-dev/setup-init.sh Resolved
Comment thread scripts/docker-dev/setup-init.sh Resolved
…expired

The bootstrap token expires after the default token lifetime of 7 days.
An environment created before passwords were generated then kept the old
default password, because setup-init had no way to sign in. It now signs
in with the old default to replace it.

An accepted CODER_DEV_ADMIN_PASSWORD is also stored on the first run, so
a later start without the variable can still create a new token.
@BobbyHo
BobbyHo temporarily deployed to main November 17, 2026 19:38 — with GitHub Actions Inactive
@BobbyHo

BobbyHo commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review Please limit the review to P0, P1, and P2 issues only.

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Round 4. Both round 3 findings are fixed in 782b673: when the bootstrap token is rejected and no stored password signs in, restore_bootstrap_token signs in with the old default so both users get new passwords, and an accepted CODER_DEV_ADMIN_PASSWORD is stored when the first user is created. A run of the real setup-init.sh and password.sh against a stateful stub server covered the expired-token, stale-file, override and hand-changed-password paths. No P0 to P2 findings this round; lower-severity items are not posted, as requested.

Out of scope (needs a ticket or explicit acceptance by a human):

  • scripts/docker-dev/setup-init.sh:147: on the first-user path a non-empty /bootstrap/token is reused without a check, so removing the database volume while keeping the bootstrap_token volume leaves setup-users and setup-template with a token the new server rejects.
  • scripts/docker-dev/setup-init.sh:34: the Owner bootstrap token is written with the default umask (0644), next to password files written as 0600, so any process that can read the bootstrap_token volume gets an Owner API token.

🤖 This review was automatically generated with Coder Agents.

This branch was previously deployed

1 inactive deployment
main — 782b6736 Deployed Nov 17, 2026 by BobbyHo via cla #258908
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants