Class AdminAccountInstaller
- Namespace
- FishMMO.Installer
- Assembly
- FishMMO-Installer.dll
Creates an Administrator account from the console: Database ▸ Create Admin Account.
public static class AdminAccountInstaller
- Inheritance
-
AdminAccountInstaller
- Inherited Members
Remarks
A fresh deployment has nobody who can sign in to the Control Panel, and with the beta gate on nobody can register either, because registration needs a beta code that only an administrator can mint. This is the way in.
The account must be indistinguishable from one the game or the Control Panel registered, so the
steps are theirs (AccountRegistrationService.RegisterAsync and
SelfServiceService.EnrolAsync), through the same database services: an SRP salt and
verifier from the fixed identity and the game client's parameters, the profile with email as its
channel, verified without a code (an operator at the server's console needs none), and two-factor
enrolled: a TOTP secret encrypted under the deployment master key, enabled, and the hashed
recovery codes. The Control Panel's Operator policies require Admin AND two-factor, so an
administrator without it could sign in but not mint a beta code. Unlike a registration, the
writes are one transaction, so a failure leaves no half-made administrator behind. The level
change is recorded in the audit log, as every caller of PersistAccessLevelAsync must.
The connection is the servers' own (the installer's appsettings.json Npgsql section with the credentials from FISHMMO_DB_USERNAME / FISHMMO_DB_PASSWORD or the secrets file), not a superuser: creating an account is an application write.
Fields
AuditAction
Audit log action for an administrator created here.
public const string AuditAction = "account.create-admin"
Field Value
AuditSource
Audit log source for rows this step writes (the column holds 16 characters).
public const string AuditSource = "installer"
Field Value
Methods
CreateAdminAccountAsync()
Database ▸ Create Admin Account.
public static Task CreateAdminAccountAsync()