Guide
The first admin
How the first account arises on a fresh instance with the instance token.
What it is about
A fresh instance has no account. The first one should not be created by
whoever finds the address on the internet first. Creating it therefore
requires the instance token: a random word known only to whoever sets the
environment of the instance. It is in HENNIOKF_SYNC_TOKEN.
What the application does
- As long as there is no account,
/sign-inshows the form "Create the first admin" instead of signing in, with the fields instance token, name, username and password. Reading the start page and the documentation stays open meanwhile. - If the token matches, an account with the role admin arises, and the page says "Created. Now sign in."
- If it does not match, the page says "The token is wrong." and creates nothing. Name and username stay in the form.
- If the token is not set, the page says that
HENNIOKF_SYNC_TOKENis missing and shows no form. - As soon as there is an account, the form is gone. All further accounts an
admin creates on
/users.
Step by step
-
Create a random word:
openssl rand -hex 32 -
Enter it as
HENNIOKF_SYNC_TOKEN: in development in.env.local, on the VPS indocker/.env, for local Compose in the call. -
Restart the application. It reads the environment only at start.
-
Open
/sign-in. -
Enter the token, your name, a username (lowercase, without spaces and without hyphen) and a password with at least 10 characters.
-
Choose Create, then sign in with username and password.
-
On
/statuscheck that "Accounts" now shows "yes, 1".
The token is never in the repository, in an address or in a log. After the
first admin the application does not need it for signing in. Keep it set
anyway: /status reports "not set" otherwise, whoever loses every account
needs it again, and from the next phase it also starts a sync of the
bundles.
What goes wrong
| What you see | Cause | What helps |
|---|---|---|
no form, only the hint on HENNIOKF_SYNC_TOKEN | the token is not set or empty | enter it, restart |
| "The token is wrong." | typed differently than set, often a cut-off character or a space at the edge of the input | copy the value exactly. In the environment a space at the edge does not count, in the form it does |
| the username is refused | a hyphen or another character outside the rule, too short or taken | lowercase letters, digits, dot, underscore, 3 to 30 characters. Uppercase letters are lowercased |
/sign-in leads to /status | the root directory is missing | set HENNIOKF_ROOT, see Environment variables |
Next: Languages.