Who may open an account
open is the default because it is what an unset variable has always meant,
and changing that would silently close sign-up on a deployment relying on it.
It is the right mode for an evaluation or a public sandbox. A deployment
holding real customer data should choose one of the other two.
An unrecognised value is a startup failure rather than a fallback. Falling
back to open would turn a typo into an open door, and falling back to
closed would turn one into an outage.
What invite_only checks
The mode gates both ways an account comes into existence:
POST /api/v1/auth/signupmust carry aninvitation_token, the token must resolve, and the email in the request must be the address the invitation was issued to. A forwarded link does not let someone else take the seat.- A first sign-in through GitHub, GitLab or Google creates an account only if the address the provider reports has a pending invitation, and only if the provider says that address is verified. Anyone can put a colleague’s address on a profile; an unverified one is refused.
403 with the reason in error. People who already
have an account sign in exactly as before under every mode.
invite_only does not need a mail relay. An invitation’s link is shown once
to the person who created it, who can send it however they like. See
Signing in.
The first account of a new customer
Underinvite_only, an invitation needs an organization to invite into, and
an invitation cannot confer the owner role. Under closed, nothing creates an
account at all. In both, a new customer’s first owner is created from your side:
Add customer in the staff console, or, where nobody
can reach the console yet, on the host:
staffctl.
Check the running deployment
A variable in a file is not a variable in a process. The production Compose file passesSIGNUP_MODE to the API explicitly, and defaults it to open when
your env file does not set it. After a deploy, ask the API itself:
403 means sign-up is gated. Anything else means the API is not running the
mode you think it is. On a deployment that is still open the request
succeeds and creates the account, so use an address you control and remove the
account afterwards.
External sign-in providers
Each provider is optional and independent. Configure the ones you want to offer; the others stay off.1
Register an OAuth application with the provider
Give it the callback URL on your API’s public origin:
2
Set the three variables for that provider
The redirect URI defaults to
http://localhost:8080/api/v1/auth/<provider>/callback, which is correct
only in development. Set it to exactly the callback URL you registered:3
Restart the API and try it
Sign-in starts at
/api/v1/auth/github, /api/v1/auth/gitlab or
/api/v1/auth/google. A provider with no client ID configured answers
501 (not_implemented) with GitHub OAuth not configured (or the equivalent for the other
two) instead of redirecting.The production Compose file passes the provider variables from your
environment file to the
api service. Before 2026-10-13 it passed none of
them; see Production Compose.SameSite=Lax, so the API and the dashboard must share a
registrable domain for a provider sign-in to end in a signed-in dashboard. See
Environment variables.
Linking to an existing account
A provider sign-in for an address that already has an account links the two only when both sides have verified the address: the provider reports it as verified, and the existing TRUSTIVAN account’s email is verified too. Otherwise the sign-in is refused and recorded as a failed sign-in on that account, which is what stops a provider identity from taking over an account by claiming its address. An account created withstaffctl org create is marked verified for
this reason: its owner can add a provider sign-in later.
The GitHub App
Sign-in with GitHub and the GitHub App are separate registrations with separate variables. The App is what grants access to repositories.
Once
GITHUB_APP_ID or GITHUB_PRIVATE_KEY is set, a deployed environment
refuses to start without GITHUB_WEBHOOK_SECRET. Unsigned deliveries are
rejected whether or not the check fires.
Linking an installation
needs GITHUB_APP_CLIENT_ID and GITHUB_APP_CLIENT_SECRET as well, because GitHub
lists installations only for a token from the App’s own sign-in. On the App,
register the callback URL https://<api-origin>/api/v1/auth/github-app/callback,
on the same origin as GITHUB_REDIRECT_URI.
Email verification
It needs a working mail relay outside development. See
Send mail through your SMTP relay.
Related
staffctl: provisioning an organization and its owner.- Signing in: what the people you let in see.
- Environment variables: the full list.