Two roles
- Editor: edit drafts, upload and delete media, view preview links, publish, and roll back.
- Admin: everything an editor can do, plus creating/revoking invites, managing members, and pushing new schemas.
Without a role, a signed-in account can only read public live content and the schema — the same read-only level used by our public demo.
Bootstrapping the first admin
On first startup with zero admins, headcode serve writes a 24-hour one-time admin invite token (file mode 0600, never printed to logs) to /data/bootstrap-invite.txt and deletes it automatically once redeemed.
# Create a one-time invite offline or on the server
cargo run -- invite create editor "Anna"
# On first boot with zero admins, read the auto-generated 24h bootstrap token:
uc exec headcode cat /data/bootstrap-invite.txtOpen https://mywebsite.com/admin?invite=<token> while signed in (or pass the token to MCP invite_redeem) to claim the role.
Inviting your team
Admins can mint new editor or admin invite links either from /admin (Team & Invites) or directly from an MCP client:
Create a one-time editor invite labeled "Anna" and give me the link.Only the SHA-256 hash of the invite token is stored in Turso. Once Anna opens the link and authenticates via Better Auth, her opaque (iss, sub) identity receives the editor role and the invite is burned.
The last admin stays
A site always keeps at least one admin. Removing the last admin is refused, and membership changes are audited.