HenniOKF
Documentation

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-in shows 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_TOKEN is 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

  1. Create a random word:

    openssl rand -hex 32
    
  2. Enter it as HENNIOKF_SYNC_TOKEN: in development in .env.local, on the VPS in docker/.env, for local Compose in the call.

  3. Restart the application. It reads the environment only at start.

  4. Open /sign-in.

  5. Enter the token, your name, a username (lowercase, without spaces and without hyphen) and a password with at least 10 characters.

  6. Choose Create, then sign in with username and password.

  7. On /status check 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 seeCauseWhat helps
no form, only the hint on HENNIOKF_SYNC_TOKENthe token is not set or emptyenter it, restart
"The token is wrong."typed differently than set, often a cut-off character or a space at the edge of the inputcopy the value exactly. In the environment a space at the edge does not count, in the form it does
the username is refuseda hyphen or another character outside the rule, too short or takenlowercase letters, digits, dot, underscore, 3 to 30 characters. Uppercase letters are lowercased
/sign-in leads to /statusthe root directory is missingset HENNIOKF_ROOT, see Environment variables

Next: Languages.