Skip to content

docs: self-hosted first-run setup wizard - #35

Merged
zzzoryn merged 3 commits into
v1.0.0-beta.4from
cursor/tsk-321-setup-wizard
Dec 1, 2026
Merged

zzzoryn merged 3 commits into
v1.0.0-beta.4from
cursor/tsk-321-setup-wizard

Conversation

@zzzoryn

@zzzoryn zzzoryn commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Rewrite first-time setup for the self-hosted /setup wizard: 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.
  • Document setup-code lockout after 10 wrong attempts (restart API to unblock) in first-setup and install troubleshooting. After restart on a normal install the same installer code works again (hash kept in .env); a new code appears in API logs only if that hash is missing.
  • Remove the outdated first-sign-in-without-mail block from install steps; keep a short first-run wizard pointer (PUBLIC_APP_URL kept on that page).
  • Document wizard-only SMTP presets (including SendGrid username apikey); settings Mail stays manual.
  • Update security/keys.md: first self-hosted owner account is created at /setup with the installer setup code (link to first-setup), not without a code.

Verified against okkey dev and web RU/EN locales. npm run docs:check and npm run build (ru + en) pass.

Test plan

  • npm run docs:check
  • npm run build (ru + en)
Open in Web Open in Cursor 

cursoragent and others added 2 commits December 1, 2026 06:45
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 zzzoryn left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread docs/getting-started/first-setup.md Outdated
Когда аккаунт уже есть и почта активна, вход по тому же адресу идёт через одноразовый код. Пока почту не проверили тестовым письмом, после email открывается мастер-пароль. Код подтверждения записан в логах worker. См. [Почта](../install/email.md).
Одноразовый код настройки печатает установщик. Если кода нет под рукой, смотрите логи API. Введите код в одну строку в поле «Код настройки» и нажмите «Продолжить».

После 10 неверных попыток код блокируется. Перезапустите сервис API - блокировка снимется. Если после перезапуска кода всё ещё нет, снова откройте логи API.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 zzzoryn left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@zzzoryn
zzzoryn marked this pull request as ready for review December 1, 2026 07:14
@zzzoryn
zzzoryn merged commit cc88c01 into v1.0.0-beta.4 Dec 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants