mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-07-26 11:49:16 +00:00
feat(onboarding): add first-run environment checker (#1290)
* feat(onboarding): add first-run environment checker Add a preflight that checks whether the host can run Docker deploys before a deploy fails for an avoidable reason. It verifies the Docker engine is reachable and permitted, the Compose plugin is present, the compose directory is writable and mounted at a matching host path, the dashboard is behind TLS, and the compose volume has disk headroom. Each result that needs attention carries a specific fix rather than a generic error, and the checks never block: an operator who knows their setup can continue. The checks run as the final step of first-boot setup and can be re-run any time from the Recovery settings tab. A new admin-only endpoint, GET /api/diagnostics/environment, backs both surfaces. * fix(onboarding): distinguish unverified path mapping and support parent binds Treat a container whose self-inspect fails as an unverified path-mapping warning instead of a false "not containerized" pass, so an unverifiable mapping never reads as healthy. Resolve the compose directory through the longest-prefix bind mount and compare the host path it resolves to, so a parent bind such as -v /opt:/opt correctly covers COMPOSE_DIR=/opt/compose instead of warning that the directory is not bind-mounted. * test(e2e): advance the setup wizard past the environment step in loginAs The first-run setup helper clicked "Initialize console" and immediately waited for the dashboard, but setup now shows an environment-preflight step before landing the console. Click "Enter Sencho" to complete onboarding before asserting the dashboard, so the first test on a fresh instance passes.
This commit is contained in:
+5
-1
@@ -69,7 +69,11 @@ export async function loginAs(page: Page, username = TEST_USERNAME, password = T
|
||||
const confirmInput = page.locator('#confirmPassword');
|
||||
if (await confirmInput.isVisible()) await confirmInput.fill(password);
|
||||
await page.locator('button[type="submit"]').click();
|
||||
// After setup, the app logs in automatically and shows the dashboard
|
||||
// Setup signs the new admin in and then shows an environment-preflight
|
||||
// step; clicking "Enter Sencho" completes onboarding and lands the dashboard.
|
||||
const enterButton = page.getByRole('button', { name: /enter sencho/i });
|
||||
await expect(enterButton).toBeVisible({ timeout: 10_000 });
|
||||
await enterButton.click();
|
||||
await expect(page.locator(DASHBOARD_INDICATOR)).toBeVisible({ timeout: 10_000 });
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user