Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

test: stabilize authenticated release journeys and retain build failure logs

Rahman8180f9355054
diff --git a/frontend/slices/auth/components/session-mode-banner.tsx b/frontend/slices/auth/components/session-mode-banner.tsx
index 6ff2ad54..41031064 100644
--- a/frontend/slices/auth/components/session-mode-banner.tsx
+++ b/frontend/slices/auth/components/session-mode-banner.tsx
@@ -13,7 +13,7 @@ export function SessionModeBanner() {
return (
<aside
aria-label="Server connection mode"
- className="fixed right-2 top-9 z-[60] flex max-w-[calc(100vw-1rem)] items-center gap-3 rounded-lg border border-border bg-popover px-3 py-2 text-xs text-popover-foreground shadow-sm"
+ className="fixed left-1/2 top-9 -translate-x-1/2 z-[60] flex max-w-[calc(100vw-1rem)] items-center gap-3 rounded-lg border border-border bg-popover px-3 py-2 text-xs text-popover-foreground shadow-sm"
data-connection-mode={live ? "live" : "mock"}
>
<span>{live ? `Live server · ${role}` : "Demo · Mock data only"}</span>
diff --git a/scripts/e2e/release-fixture.mjs b/scripts/e2e/release-fixture.mjs
index 9e4f29a7..c1aeda79 100644
--- a/scripts/e2e/release-fixture.mjs
+++ b/scripts/e2e/release-fixture.mjs
@@ -14,7 +14,7 @@ export async function releaseFixture() {
});
await new Promise(resolve => provider.listen(0, "127.0.0.1", resolve));
const providerUrl = `http://127.0.0.1:${provider.address().port}`;
- const device = randomUUID(), password = randomBytes(24).toString("hex");
+ const device = randomBytes(16).toString("hex"), password = randomBytes(24).toString("hex");
const deviceFile = path.join(dir, "devices.json");
const setRole = role => writeFile(deviceFile, JSON.stringify({
approved: { [device]: { label: "Release fixture", role, approvedAt: Date.now() } }, pending: {},
diff --git a/scripts/e2e/release.mjs b/scripts/e2e/release.mjs
index b8dbb5cb..dd8c5800 100644
--- a/scripts/e2e/release.mjs
+++ b/scripts/e2e/release.mjs
@@ -31,9 +31,11 @@ try {
await expect(page.getByLabel("Server connection mode")).toContainText("Mock data only");
// Real launcher click, not only deep-link route mounting.
const settingsName = /^(System )?Settings(?: \(running\))?$/;
- const links = page.getByRole("link", { name: settingsName });
- const settings = await links.count() ? links.first() : page.getByRole("button", { name: settingsName }).first();
+ const settings = viewport.width >= 768
+ ? page.getByRole("link", { name: settingsName }).first()
+ : page.getByRole("button", { name: settingsName }).first();
await expect(settings).toBeVisible();
+ await settings.hover(); // Let dock magnification move its hit target before pressing.
await settings.click();
await expect(page).toHaveURL(/\/settings/);
await expect(page.getByLabel("Server connection mode")).toContainText("Mock data only");
@@ -53,7 +55,7 @@ try {
await page.getByRole("button", { name: "Unlock", exact: true }).click();
await expect(page).toHaveURL(fixture.base + "/integrations");
await expect(page.getByLabel("Credential owner")).toHaveValue("fixture");
- await page.getByRole("button", { name: "Self-hosted Convex", exact: true }).click();
+ await page.getByRole("button", { name: /^Self-hosted Convex(?: 1)?$/ }).click();
await page.getByRole("button", { name: "Verify", exact: true }).click();
await expect(page.locator(".connection-state")).toHaveText("Verified");
await expect(page.getByRole("status")).toContainText("Verified: authenticated");
@@ -61,7 +63,7 @@ try {
await page.getByRole("button", { name: "Verify", exact: true }).click();
await expect(page.locator(".connection-state")).toHaveText("Access rejected");
await page.reload();
- await page.getByRole("button", { name: "Self-hosted Convex", exact: true }).click();
+ await page.getByRole("button", { name: /^Self-hosted Convex(?: 1)?$/ }).click();
await expect(page.locator(".connection-state")).toHaveText("Access rejected");
const call = (route, body) => page.evaluate(async ([route, body]) => {
const res = await fetch(route, body ? { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(body) } : {});
@@ -73,7 +75,8 @@ try {
expect((await call("/api/v1/fs/list?path=" + encodeURIComponent(fixture.dir))).status).toBe(200);
await fixture.setRole("viewer");
expect((await call("/api/v1/integrations")).status).toBe(403);
- expect((await call("/api/v1/exec/run", { cmd: "pwd", cwd: fixture.dir })).status).toBe(403);
+ // Legacy privileged shell routes return 401 for a non-owner session.
+ expect((await call("/api/v1/exec/run", { cmd: "pwd", cwd: fixture.dir })).status).toBe(401);
console.log("PASS browser login/return, live provider revocation, reload, file/exec boundaries and immediate role demotion");
await context.close();
} finally {
diff --git a/scripts/gates.sh b/scripts/gates.sh
index b596720d..a8782b58 100755
--- a/scripts/gates.sh
+++ b/scripts/gates.sh
@@ -66,6 +66,13 @@ node scripts/audit.mjs --strict || fail "audit: high/critical advisory or incomp
# ── Guard 1d — build. Never build in THIS directory: `next build` wipes .next
# before compiling, while the live :4005 process may be serving from it.
# verify-build.sh compiles a throwaway copy of HEAD instead.
-bash scripts/verify-build.sh >/dev/null 2>&1 \
- && echo "build: HEAD compiles (out-of-tree)." \
- || fail "build failed." "reproduce: bash scripts/verify-build.sh"
+MSO_GATE_BUILD_LOG="$(mktemp)"
+if bash scripts/verify-build.sh >"$MSO_GATE_BUILD_LOG" 2>&1; then
+ rm -f "$MSO_GATE_BUILD_LOG"
+ echo "build: HEAD compiles (out-of-tree)."
+ echo "browser: required release journeys passed (synthetic stores)."
+else
+ tail -n 60 "$MSO_GATE_BUILD_LOG" >&2
+ rm -f "$MSO_GATE_BUILD_LOG"
+ fail "build or browser journey failed." "reproduce: bash scripts/verify-build.sh"
+fi