Repository navigation
Users and sign in
Everyone who uses the control panel has their own account and their own two-factor. No shared logins.
| Role | Who | |
|---|---|---|
| Site owner | The client. | Edits their own site. |
| Administrator | Monate Media. | Looks after the site, updates and recovery. |
hammer install makes the first user an administrator. user:create makes site owners
unless told otherwise.
Accounts never start with a password. install, user:create and user:reset print a
welcome link instead. The person opens it, chooses their own password, and sets up
two-factor. So:
- shared hosts, which cannot hide a password typed on the command line, never see one;
- Monate Media never knows a client's password;
- a link works for 72 hours, once, and a newer link replaces an older one.
php hammer user:create --email=client@example.com --name="Client Name"
php hammer user:create --email=colleague@monatemedia.com --name="Colleague" --role=adminSend the link it prints to the person, by whatever channel you trust.
- Email address and password. At least 12 characters. A few words in a row works well.
- A six-digit code from an authenticator app on their phone. Or, without the phone, one of their recovery codes, typed in the same box.
Two-factor is required for everyone, so the first sign-in sets it up:
- Open Google Authenticator (free for iPhone and Android). Any other authenticator app works too.
- In the app, tap + → Scan a QR code, and scan the code on the page. Scan from inside the app, not with the phone's camera: on an iPhone the camera offers to save the code in Passwords instead (which also works, if the person prefers it). No camera? Enter a setup key and type the key shown under the QR code.
- Type the six-digit code the app shows.
The page then shows eight recovery codes, once. Download saves them as a text file. Each signs in once, in place of the six-digit code.
php hammer user:reset --email=client@example.comThis clears the password, two-factor and recovery codes, signs the person out everywhere, and prints a new welcome link. They start again from the welcome page. Remind them to delete the old entry from their authenticator app.
- Passwords are stored with Argon2id (bcrypt on a PHP without it).
- Codes cannot be used twice; recovery codes are single-use and stored as hashes.
- Guessing is slowed down: five wrong passwords for one address, or twenty from one IP address, or five wrong codes, means a 15-minute wait.
- Sessions live in the database, get a new token at every sign-in, and end after two hours without activity or twelve hours in all. Only a hash of the cookie is stored.
- Every form carries a token, so another website cannot act for someone signed in.
- The pages run under a strict Content Security Policy: no inline scripts or styles, nothing from other sites.
- An audit log records sign-ins, failed sign-ins, password and two-factor changes, and resets.
php hammer migrate # bring the database up to date (install does this too)