Repository navigation
Conversation
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.
|
/coder-agents-review Please limit the review to P0, P1, and P2 issues only. |
|
Review could not be started deep-review v0.13.0 | Round 4 | Last posted: Round 4, 11 findings (11 P2), APPROVE. Review Finding inventoryFindings
Law analysisRound 3, head 6ea1564: effective LOC +1040 -39 (569 production, 471 test). Verdict: Don't split. Enforcement: Advisory. Optional: land the Contested and acknowledgedNone. Round logRound 1Full 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 2Churn 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 3Churn 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 4Churn 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-reviewCRF = Coder Review Finding (P0-P4, Nit, Note)
|
|
/coder-agents-review Please limit the review to P0, P1, and P2 issues only. |
|
Review could not be started
|
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.
…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.
|
/coder-agents-review Please limit the review to P0, P1, and P2 issues only. |
|
Review could not be started
|
|
/coder-agents-review Please limit the review to P0, P1, and P2 issues only. |
|
Chat: Review posted | View chat Review history
|
There was a problem hiding this comment.
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 on0.0.0.0beforesetupFirstUsercreates the first user, so anyone who can reach the port in that window can callPOST /api/v2/users/firstand become Owner.compose.dev.yaml:106:coderdpublishes port 3000 on every host interface, andsetup-init.shcreates the first user only aftergo run ./cmd/codercompiles, 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.
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.
…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.
|
/coder-agents-review Please limit the review to P0, P1, and P2 issues only. |
There was a problem hiding this comment.
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 onmain, so every test that creates a database fails onmainand on every branch that merges it.site/e2e/playwright.config.ts:89: the Playwright server listens on0.0.0.0, andsite/e2e/api.ts:39creates users with the same public password fromsite/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:setupFirstUsertreats 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.
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.
|
/coder-agents-review Please limit the review to P0, P1, and P2 issues only. |
There was a problem hiding this comment.
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: onmain,--lifetime 0gives the bootstrap token the 7-day default lifetime andsetup-initnever checks it once the first user exists, sosetup-template,wsproxyand the other/bootstrap/tokenreaders get an expired token in every compose environment older than 7 days.
🤖 This review was automatically generated with Coder Agents.
…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.
|
/coder-agents-review Please limit the review to P0, P1, and P2 issues only. |
There was a problem hiding this comment.
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/tokenis reused without a check, so removing the database volume while keeping thebootstrap_tokenvolume leavessetup-usersandsetup-templatewith 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 thebootstrap_tokenvolume gets an Owner API token.
🤖 This review was automatically generated with Coder Agents.
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.shlistens on every network interface, so anyone who could reach a developer's machine could sign in as Owner. This PR makesscripts/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
setupFirstUserinscripts/develop/main.go. Everything else supports it.scripts/develop/password.go: the file helpers.storePasswordnever replaces an existing file.replacePassworddoes, and it has one caller: the override that the server has just accepted.scripts/develop/main.go,validate: refuses the old default as an override.scripts/develop/main.go,checkPasswordFiles: stops the run before the build when a password file is empty or unreadable.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--passwordthe admin file holds that password.scripts/develop/main.go,replaceOldDefaultandreplaceOldDefaultAdmin: 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 asadmin@coder.comand not on the saved session, and that when the server refuses only a password generated in that call is removed.scripts/develop/main.go,knownLoginandloginBannerLines: the warning and the banner section.scripts/docker-dev/password.sh, thenscripts/docker-dev/setup-init.shandscripts/docker-dev/setup-users.sh: the same behaviour for the compose environment. Inpassword.sh, readreplace_old_default. Insetup-init.sh, readreplace_old_default_passwordsandrestore_bootstrap_tokenclosely..agents/skills/deploy-ephemeral/seed.shand.agents/skills/deploy-ephemeral/SKILL.md: read the admin password from the file develop wrote.scripts/develop/password_test.go:TestSetupFirstUseris the test that proves the behaviour.compose.dev.yaml,CONTRIBUTING.md,contributing/frontend.md.Implementation
scripts/develop/defaultPasswordconstant. The--passwordflag no longer has a default.scripts/develop/password.gowithreadPassword,loadOrCreatePassword,storePasswordandreplacePassword. Passwords are 32 letters and digits fromcryptorand.String, stored in.coderv2/admin-passwordand.coderv2/member-passwordwith mode 0600.validaterefuses--passwordorCODER_DEV_ADMIN_PASSWORDwhen the value is the old default.setupFirstUsergenerates 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.scripts/develop.shrun with--db-resetin the same checkout recreates both users with the old default and leaves the files in place.admin@coder.comwith 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 loginsaves 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.--password, the admin password is left alone. The member's old default is still replaced.--passwordsigns 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.--passwordand the current password to replace it.--password, or save the password in.coderv2/admin-password.--db-resetcomes last.scripts/docker-dev/andcompose.dev.yamlscripts/docker-dev/password.sh, sourced by both setup scripts.scripts/docker-dev/setup-init.shgenerates both password files on the bootstrap volume. It writes the member file too, becausesetup-usersmounts that volume read-only.scripts/docker-dev/setup-users.shreads the member file.scripts/docker-dev/setup-init.shasks 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 withjq, because a stored override can hold any character.scripts/docker-dev/setup-init.shnow recreates the token whenever the stored one is rejected and the admin password is known.CODER_DEV_ADMIN_PASSWORD) and the HTTP status. It says to setCODER_DEV_ADMIN_PASSWORDto 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.setup-initstops with that error before it reaches the replacement of the old default.scripts/docker-dev/setup-init.shpasses--deletetocoder 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 onmain.scripts/docker-dev/setup-users.shstill fails when the member has to be created and no password is available. Both scripts take the wording from one function inscripts/docker-dev/password.sh.compose.dev.yamlno longer defaults either password variable. TheCODER_DEV_ADMIN_PASSWORDentry on thecoderdservice is removed. The server never read it..agents/skills/deploy-ephemeral/seed.shreads the admin password from the file develop wrote.EPH_ADMIN_PASSWORDstill overrides it, andEPH_ADMIN_PASSWORD_FILEoverrides the path.SKILL.mdreads the passwords through the container for the license step and the report. It no longer contains a password.Docs
CONTRIBUTING.mdandcontributing/frontend.mdsay where to find the password.Not changed
coderd/coderdtestandcoderd/workspaceapps/appteststill use the old string. They never expose a listener publicly.scripts/develop.shis unchanged. Workspaces in Docker cannot reach a loopback-only server.Expected Output
scripts/develop.shcreates.coderv2/admin-passwordand.coderv2/member-password, each with mode 0600 and a different 32-character password.admin@coder.comormember@coder.comwith the old default returns 401.--db-resetall use the same passwords. The files are not rewritten.--passwordorCODER_DEV_ADMIN_PASSWORDsets 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.--skip-setupwrites no password file and prints no login section.--passwordand the current password, or to save it in.coderv2/admin-password, or to run with--db-reset. One run with--passwordis enough, because the password is then stored.--passwordand the current password. That run replaces the file, and the run after it needs neither the flag nor a session.setup-initwrites both files and creates a new bootstrap token, and both logins are printed. When the files already exist, each user gets its stored password.setup-initexits 1 and says which password source the server refused, with the HTTP status and the two ways out. One start withCODER_DEV_ADMIN_PASSWORDset to the current password creates a new bootstrap token and stores the password. The next start works without the variable and prints that password.Testing
scripts/develop/password_test.go,TestSetupFirstUser: runssetupFirstUseragainst an in-process server.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.TestDevConfigValidateinscripts/develop/main_test.go: the old default is refused, and a longer password that contains it is accepted.scripts/docker-dev/and.agents/skills/deploy-ephemeral/.shellcheckandshfmtpass on them, and I ran the helper functions by hand.scripts/docker-dev/setup-users.shwas 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.shwas 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.scripts/docker-dev/setup-init.shandscripts/docker-dev/setup-users.sh, with only the server URL and the/bootstrappath 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.scripts/docker-dev/setup-init.shagainst a stub in place ofcurland the CLI, with only the/scriptsand/bootstrappaths 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.go test ./scripts/develop/ -count=1, and it passes.golangci-lint,shellcheckandshfmtpass 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 ofmain, which do not touch any file of this PR. The first of the other four is81a51b1c05, 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 isd547e427d6, 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 isc86525464a, which stores a working--passwordwhen no admin password is stored and rewords the unknown-password error. The error text in scenario 11 is the old one. The fourth ise05a98618f, 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--passwordthat 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 realscripts/develop.shbuilt from the branch in its own git worktree, with its own built-in database. Worktreecwas first built frommainatb4f8b6756c, 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.
mainaccepts the old default--db-resetall reuse the same passwords--passwordsets the admin password only and does not replace a stored password--skip-setupwrites no file and prints no login section--db-resetseed.shreads the admin password from the fileFacts worth knowing from the run:
main,admin@coder.comandmember@coder.comwith 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).--db-resetsits betweenmain.developandmain.init. The framework does this for every develop error, including ones onmain. It matters more here because these errors exist to say what to run next. Not changed in this PR.scripts/docker-dev/setup-users.shprinted three lines for the member.scripts/docker-dev/setup-init.shprinted one line for the admin, "password was not set by this environment". develop warns for both users. Commit81a51b1c05makessetup-initprint the same three lines for the admin. Scenario 15 shows the output from before that commit.main. Each server's embedded NATS pubsub listens on127.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.main. The compose file mounts the checkout into its containers, and a worktree's.gitfile points at a path outside the mount.build-slimstops with "fatal: not a git repository". Scenarios 13 to 15 ran from a full clone at the same commit.--db-resetkeeps 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./home/coder/coder/.coderv2/admin-passwordinside theeph-devcontainer. Scenario 16 could only show this with the path overridden.coder createfor 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
The helpers used below, all defined in one file in the workspace:
dev_start NAME [flags]starts./scripts/develop.shin worktreeNAMEin the background, with fixed ports (aon 3100,bon 3200,con 3300,don 3400) and the starter template off, and writes its output to a new log file.dev_waitwaits for the banner or for the process to exit.dev_stopsends an interrupt and waits.signin HOST:PORT EMAIL PASSWORDposts to/api/v2/users/loginand prints only the HTTP status.pwfiles NAMEprints, 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 NAMEprints the login section of the newest banner with passwords masked.shown NAME FILEcounts how often the stored password appears in the newest log.scripts/developis the same atb4f8b6756cand at the merge base of this branch, sob4f8b6756cis a valid "before" build.2. Before: an instance built from main accepts the old default
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
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 statusprints nothing. The first-user log line no longer has a password field, where scenario 2 hadpassword=SomeSecurePassword!.4. The banner shows both logins and both file paths
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
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.comwith the password pasted from the file worked, and the Users page listedadminwith the Owner role andmemberwith the Member role, on a page whose version badge readv2.39.0-devel+7f79cd2593.6. A restart, a lost session and --db-reset all reuse the same passwords
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.
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 instanceastill up.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
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
The three lines are the whole log: nothing was built and no server started.
dev_waitlooks every 5 seconds, so the exit took under 5 seconds. Running the binary with--passwordset to the old default exits 1 at the same check.10. --skip-setup writes no file and prints no login section
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
cstill has the database from scenario 2. It is moved to this branch and started three times.--db-resetit 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
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 byTestCheckPasswordFiles.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.On the first start both files were on the volume, mode 600, after
setup-initalone, beforesetup-usersran. 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
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.
Both services exit 0 and no file is generated, so a plain
docker compose upfinishes 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 before81a51b1c05(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.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.mdfrom this branch. The skill chose full mode. The license step does not apply to this PR, so it was not exercised.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.comwith 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
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.gofiles and two files undersite/.CONTRIBUTING.mdandcontributing/frontend.mdnow point to the banner and to.coderv2/admin-password, which is what scenarios 3 and 4 saw.19. Unit tests and shell lint
The five tests ran 44 subtests, none failed and none was skipped.
shellcheck0.11.0 andshfmtreport nothing for the four shell files, and thelint/shellchecktarget's file list includes all four.20. Cleanup
eph-proxy deregisterprinted "no OAuth client registered", as expected for a workspace that never ran in frontend mode. Aftercoder deletethe workspace lookup answered 404.coder-test-postgrescontainer 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.