Seed the built-in roles when a role was made in recovery mode first #279

Merged
jcoffey-dev merged 1 commits from fix/recovery-first-boot-roles into main 2026-10-31 05:53:29 +00:00
Owner

Fixes #265.

Recovery mode doesn't seed defaults, and the first normal start only seeded them when there were no roles. A role made in recovery mode before that start meant the built-in roles, the default Authentication and the new-install privacy defaults (D1 to D6) were never created: every account got 403, except the recovery admin.

  • Recovery mode on a server with no roles leaves a note in the data store (SUBSPACE_INBUXA, key Bd).
  • A normal start seeds when there are no roles or the note is there, then clears the note.
  • A server that has started normally before has roles and no note, so nothing changes for it.

Checked with a debug build and the issue's steps: a fresh store, then recovery mode with a domain, an admin, a user and a custom role, then two normal starts.

  • main: the user and the admin both get 403, and there are no roles.
  • this branch: both sign in. The four built-in roles sit next to the custom one, and the second start adds nothing.

cargo fmt --check, the name and notice checks, and the manager::defaults tests pass.

Fixes #265. Recovery mode doesn't seed defaults, and the first normal start only seeded them when there were no roles. A role made in recovery mode before that start meant the built-in roles, the default Authentication and the new-install privacy defaults (D1 to D6) were never created: every account got 403, except the recovery admin. - Recovery mode on a server with no roles leaves a note in the data store (`SUBSPACE_INBUXA`, key `Bd`). - A normal start seeds when there are no roles **or** the note is there, then clears the note. - A server that has started normally before has roles and no note, so nothing changes for it. Checked with a debug build and the issue's steps: a fresh store, then recovery mode with a domain, an admin, a user and a custom role, then two normal starts. - main: the user and the admin both get 403, and there are no roles. - this branch: both sign in. The four built-in roles sit next to the custom one, and the second start adds nothing. `cargo fmt --check`, the name and notice checks, and the `manager::defaults` tests pass.
jcoffey-dev added 1 commit 2026-10-31 05:43:14 +00:00
Seed the built-in roles when a role was made in recovery mode first
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 10m6s
f065b818f7
Recovery mode on a server with no roles now leaves a note, and the first
normal start seeds the built-in roles, the default Authentication and the
new-install privacy defaults when there are no roles or the note is
there, then clears it. A role made in recovery mode no longer leaves every
account without permissions. Servers that have started normally before
have roles and no note, and are unchanged.

Fixes #265
jcoffey-dev merged commit 534c58de5c into main 2026-10-31 05:53:29 +00:00
jcoffey-dev deleted branch fix/recovery-first-boot-roles 2026-10-31 05:53:30 +00:00
Sign in to join this conversation.