Repository navigation
docs: self-hosted first-run setup wizard - #35
Conversation
Rewrite first-setup for /setup, SMTP presets, lock screen after finish, and setup-code lockout. Remove the outdated first-sign-in-without-mail block and align install mail docs with wizard-only provider presets. Co-authored-by: Alexander Zorin <zzzoryn@users.noreply.github.com>
Replace the outdated first-account-without-code note with the self-hosted owner flow via /setup and the installer setup code. Co-authored-by: Alexander Zorin <zzzoryn@users.noreply.github.com>
zzzoryn
left a comment
There was a problem hiding this comment.
Reviewed against okkey dev @ e15c26ca (this is still the current dev tip; no later commits).
The rewrite matches the /setup wizard: the installer prints the one-time setup code (deploy/docker/install.sh, First-run setup code (one-time): and Open ${web_url}/setup), the code is entered in one line, lockout is after 10 failed attempts (DEFAULT_SETUP_CODE_MAX_ATTEMPTS = 10 in services/api/src/setup/service.ts), and a restart of the API clears the lock (ensureBootstrapCode() on boot). SMTP presets exist only in the wizard (including SendGrid username apikey); Settings → Mail stays manual. The first owner account is created in the wizard. Screen and button labels match the RU/EN web locales (auth.setup.title, step titles, «Пропустить пока» / "Skip for now", «Завершить настройку» / "Finish setup", «Хранилище закрыто», «Попробовать снова»).
All four trees (RU/EN, current and version-v1.0) are identical. No competitor comparisons, no TSK numbers, hyphens only. CI build is green on this head. The PR is a draft, mergeable / clean, base v1.0.0-beta.4, head 6a3a61f1.
One non-blocking wording nit on the lockout paragraph (same wording should be adjusted in all four trees and in install/troubleshooting.md). The TSK-321 nl/de/fr item correctly stays open until TSK-193.
Verdict: OK. I am not merging this draft; only Alex merges.
| Когда аккаунт уже есть и почта активна, вход по тому же адресу идёт через одноразовый код. Пока почту не проверили тестовым письмом, после email открывается мастер-пароль. Код подтверждения записан в логах worker. См. [Почта](../install/email.md). | ||
| Одноразовый код настройки печатает установщик. Если кода нет под рукой, смотрите логи API. Введите код в одну строку в поле «Код настройки» и нажмите «Продолжить». | ||
|
|
||
| После 10 неверных попыток код блокируется. Перезапустите сервис API - блокировка снимется. Если после перезапуска кода всё ещё нет, снова откройте логи API. |
There was a problem hiding this comment.
Non-blocking. Restarting the API does clear the lock: ensureBootstrapCode() in services/api/src/setup/service.ts (lines 212-221) deletes the attempt counter on API start.
On a normal install, OKKEY_SETUP_CODE_HASH is already in .env, so the API reloads the same hash and logs setup_code_loaded without printing the plaintext again (lines 237-238 and 264-269). A new code is written to the API logs only when there is no env hash/plaintext and the process mints one (setup_code_minted, lines 241-262).
The sentence «Если после перезапуска кода всё ещё нет, снова откройте логи API» can send an operator looking for a code that will not be there. Suggestion: after restart, use the same code from the installer; a new code appears in the API logs only if the hash was not saved in .env.
Please apply the same wording in versioned_docs/version-v1.0/getting-started/first-setup.md, both EN trees, and docs/install/troubleshooting.md (line 72) with its copies.
After lockout, a normal install reuses the installer code whose hash is kept in .env; API logs mint a new code only when that hash is gone. Co-authored-by: Alexander Zorin <zzzoryn@users.noreply.github.com>
zzzoryn
left a comment
There was a problem hiding this comment.
Re-reviewed head a7276052 against the previous head 6a3a61f1. One commit (docs: clarify setup-code unlock after API restart) changes only first-setup.md and install/troubleshooting.md in all four trees.
The new wording matches the code: after a restart the same installer code works again because its hash is kept in .env; a new code appears in the API logs only if that hash is missing. The environment variable name is not used in the public docs, which is appropriate. RU current equals RU version-v1.0, EN current equals EN version-v1.0. No other files changed. No em dashes or competitor comparisons in the new lines.
CI build is green on this head (https://github.com/okkeyapp/okkey-docs/actions/runs/46595965060). The PR is still a draft, mergeable / clean, base v1.0.0-beta.4.
Verdict: OK. I am not merging this draft; only Alex merges.
Summary
/setupwizard: one-line setup code, steps Mail / Server / Workspace / Master password / Recovery key, skippable SMTP with test-mail activation, vault lock screen after Finish setup, and Try again on device registration failure..env); a new code appears in API logs only if that hash is missing.PUBLIC_APP_URLkept on that page).apikey); settings Mail stays manual.security/keys.md: first self-hosted owner account is created at/setupwith the installer setup code (link to first-setup), not without a code.Verified against okkey
devand web RU/EN locales.npm run docs:checkandnpm run build(ru + en) pass.Test plan
npm run docs:checknpm run build(ru + en)