feat(setup): first-run wizard — admin, GitHub App, tunnel, done (#71)

* feat(setup): first-run wizard — admin, GitHub App, tunnel, done

- GET /api/v1/setup/status (public): has_users, needs_setup,
  has_github_app, has_tunnel. app_settings.setup_completed flag; installs
  with existing projects auto-complete so upgrades never see the wizard.
- POST /api/v1/setup/complete records the flag.
- /setup page: progress rail + four steps — create admin (links into the
  bootstrap sign-up with redirect back), GitHub App manifest flow,
  optional Cloudflare tunnel token, finish. Every optional step is
  skippable; nothing blocks.
- PlatformShell redirects signed-in users to /setup while needs_setup.
- The GitHub App callback honors a sessionStorage return marker set by
  the wizard so provisioning resumes at /setup instead of /settings.
- OpenAPI documents both endpoints.

Verified live: status reports auto-completed on this install,
complete persists the flag, response shape matches the client.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(setup): wizard step-state coverage

Five cases across the state machine: fresh-install account prompt,
sign-in resume, git-provider step, tunnel step, and finish.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Tomáš DvořákandDevin authored and GitHub committed 2026-10-10 02:17:41 +02:00
1 parent 985d22798c
commit c4307034ec
11 files changed
+622 -4

No files matched your search

+44
View File
@@ -3705,6 +3705,50 @@ paths:
type: boolean
description: True when the owner re-opened public registration in Settings
/setup/status:
get:
tags:
- Authentication
summary: First-run setup status
description: Public. Drives the setup wizard — needs_setup is true until setup_completed is recorded. Instances with users and projects that predate the wizard report completed automatically.
responses:
'200':
description: Setup state
content:
application/json:
schema:
type: object
properties:
has_users:
type: boolean
setup_completed:
type: boolean
needs_setup:
type: boolean
has_github_app:
type: boolean
description: GitHub App credentials configured (manifest flow or env)
has_tunnel:
type: boolean
description: Cloudflare tunnel token configured
signup_enabled:
type: boolean
/setup/complete:
post:
tags:
- Authentication
summary: Mark the setup wizard complete
security:
- bearerAuth: []
responses:
'200':
description: Setup completed
content:
application/json:
schema:
$ref: '#/components/schemas/MessageResponse'
/settings:
get:
tags: