Public: anyone can read this; the crew can change it.

The owner can close signup: invite-only by default on a forge that holds private work #900

Closed opened this in answer to
Closed without merging

Signup is now a live forge setting, signup = open | invite | closed, and a new forge defaults to invite. I ran tsc --noEmit, test/signup.test.ts and test/accounts.test.ts (29 pass). I did not get a full bun test or the shard gate to complete.

Notes

stopped closed without shipping deploy f64f917

opened this

Signup is now a live forge setting, signup = open | invite | closed, and a new forge defaults to invite.

I ran tsc --noEmit, test/signup.test.ts and test/accounts.test.ts (29 pass). I did not get a full bun test or the shard gate to complete. The full run timed out in the sandbox, and in the part that ran, tests that open a unix socket failed with EPERM. The two suites above passed once I re-ran them with the sandbox lifted. The other suites in the gate have not been run against these changes.

What changed

  • Setting: an admin changes it live from the settings page, PATCH /api/v1/admin/settings, or MCP, with no restart. FORGE_SIGNUP sets it at boot, and every change is written to the audit.
  • invite: an admin mints single-use invite links that expire. /signup works only through a valid link, and a link is spent only if the signup succeeds.
  • closed: /signup says signup is closed, and POST /api/v1/users returns 403, even with a link.
  • Admin token: in invite and closed, POST /api/v1/users creates an account only for an admin-scope token. The first account on a fresh forge is always allowed.
  • Edge sign-in (FORGE_EDGE_TOKEN): it follows the same rule. An unknown person is refused when the setting is closed, or invite with no invitation. An invitee is created, and existing accounts still sign in.
  • Tests: test/signup.test.ts covers each mode on the page, API and edge path, plus a live change, MCP, the audit, and the settings page. It is added to the gate.
  • bunfig.toml: it now preloads test/open-signup.ts, so the other suites' forges boot open. Without that, the new invite default would stop them making accounts.

Not done

  • Deleting the edge rule signup-gate.yaml and the forge-signup-gate* resources in trevato-apps/gitops is not part of this pull. That is the release step the issue names, and it should happen after merge, followed by a check that the forge's own setting governs /signup.

Try it

  • Run FORGE_SIGNUP=invite bun run src/main.ts, sign in as the first user, and mint an invite from the settings page.
  • Open /signup with the link, then flip the setting to closed and reload.

🤖 Generated with Claude Code

Closes #624

commented

Parked by the crew: the check failed ("every open pull's preview on the studio page > a change's page names its preview's data as its own copy and gives the moment it was taken; production's card does not") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs