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.

fix: isolate legacy browser credentials and close scanner findings

Rahman06a04b05edbc
diff --git a/.gitleaksignore b/.gitleaksignore
index 284f847c..3e14fc23 100644
--- a/.gitleaksignore
+++ b/.gitleaksignore
@@ -6,3 +6,11 @@
71a430389e0c5c2d7ba93f760e4ff7c786a412cf:lib/managed-apps/redact.test.ts:generic-api-key:43
71a430389e0c5c2d7ba93f760e4ff7c786a412cf:lib/managed-apps/redact.test.ts:generic-api-key:65
71a430389e0c5c2d7ba93f760e4ff7c786a412cf:lib/managed-apps/redact.test.ts:jwt:50
+
+# Reviewed synthetic Dokploy test keys; every network call is mocked in these tests.
+122cebcb276973cbc417c7c44dfc7e6b58b3fcfb:lib/infra/dokploy-application-ensure.test.ts:generic-api-key:7
+f68cd5567321efb9ac84bc940ebc2429cc088153:lib/infra/dokploy-deploy.test.ts:generic-api-key:12
+6b71cac06145a08028d35ee83db7e0eee88b6256:lib/infra/dokploy-deployment-read.test.ts:generic-api-key:7
+# Reviewed DOM property assignments: maxLength=1024 and hidden=true, no credential literals.
+67d4b3ec64a456cb6015c65f5e7d6aaa7de2a2af:lib/infra/portable/ui.ts:generic-api-key:11
+db292708a0ce5554a1a265091a65fb6a19636538:lib/infra/portable/ui.ts:generic-api-key:11
diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md
index 46c83ec3..01cb928d 100644
--- a/docs/DEVELOPMENT.md
+++ b/docs/DEVELOPMENT.md
@@ -159,3 +159,5 @@ Three things that will bite:
from their prebuilt binaries. Don't "fix" the `bun pm untrusted` warning by trusting
them. `sharp` was a third entry until 0.35.0 removed its install script entirely; do
NOT add it to `trustedDependencies` to "restore" anything.
+
+For deeper Files/Settings and Preview acceptance, run `bash scripts/verify-build.sh --extended`. It reuses the isolated production build and synthetic credentials; legacy browser scripts no longer read deployment secrets. Media samples skip only when ffmpeg or a system PDF is unavailable.
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index 7759b1d4..b1a46e6c 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -4,7 +4,11 @@ The audit found outdated security dependencies, implicit command retargeting, hi
Integrations now links directly to login with a validated same-origin return destination, refreshes cards after Verify, uses embedded provider SVG marks where available, and exposes setup instructions without two collapsed levels. Signed-out desktop entry labels mock data persistently; Settings avoids fetching owner AI configuration for anonymous/delegated visitors. Standalone heading hierarchy and verified text contrast are corrected.
-The release build is followed by synthetic browser journeys for desktop, phone portrait and landscape, login/return, a local provider that changes from success to 401, state after reload, harmless file/exec operations and live device-role demotion. Public Integrations also runs automated accessibility checks. All fixture state is disposable; no production credentials are used. Unit test environment baselines and two-instance resource/CSP tests prevent host configuration from changing default-test expectations. Coverage floors follow the observed baseline; palette regressions now fail; strict dependencies are checked daily in CI. Validation: full `bun run verify` passed with 2,668 tests (7 environment-dependent/legacy skips), 44.02% line coverage, zero lint errors, and zero palette contrast failures. The exact committed production build passed all required browser journeys at 1363×936, 390×844 and 844×390, including automated WCAG checks on public Integrations. Strict dependency audit found no high/critical advisories. Eleven existing file-length lint warnings remain. This is synthetic-provider/browser evidence; it does not claim live third-party OAuth, physical-device/screen-reader, load or disaster-recovery coverage. The canonical ship gate repeats verification before deployment. Production screenshot review additionally exposed a mobile mode badge overlapping the Settings title; compact mobile placement and a required geometric non-overlap assertion correct that regression.
+The release build is followed by synthetic browser journeys for desktop, phone portrait and landscape, login/return, a local provider that changes from success to 401, state after reload, harmless file/exec operations and live device-role demotion. Public Integrations also runs automated accessibility checks. All fixture state is disposable; no production credentials are used. Unit test environment baselines and two-instance resource/CSP tests prevent host configuration from changing default-test expectations. Coverage floors follow the observed baseline; palette regressions now fail; strict dependencies are checked daily in CI. Initial validation: full `bun run verify` passed with 2,668 tests (7 environment-dependent/legacy skips), 44.02% line coverage, zero lint errors, and zero palette contrast failures. The exact committed production build passed all required browser journeys at 1363×936, 390×844 and 844×390, including automated WCAG checks on public Integrations. Strict dependency audit found no high/critical advisories. Eleven existing file-length lint warnings remain. This is synthetic-provider/browser evidence; it does not claim live third-party OAuth, physical-device/screen-reader, load or disaster-recovery coverage. The canonical ship gate repeats verification before deployment. Production screenshot review additionally exposed a mobile mode badge overlapping the Settings title; compact mobile placement and a required geometric non-overlap assertion correct that regression.
+
+### Security scanner follow-up
+
+Public GitHub CI passed, but separate security gates identified a legacy E2E credential flow, a missing explicit GCM tag-length option, and historical scanner false positives. Native desktop and Preview scripts now run a built app with disposable credentials/stores and explicitly seeded live test preferences; they never read deployment passwords or approved production devices. Authentication refuses redirects. AES-GCM encryption/decryption explicitly require 16-byte tags, with a regression test rejecting truncated tags before import. The history allowlist adds only reviewed commit/path/line fingerprints for synthetic Dokploy keys and DOM maxLength/hidden assignments; no broad rule/path exclusion or history rewrite is used. Chained form assignments are split to avoid new false positives. Local pinned Semgrep reports zero findings (38 existing parser warnings); pinned Gitleaks scans 541 commits with no unignored findings. The seven transfer tests pass.
## 2026-09-09 — Instance portability and MCP privacy boundary
diff --git a/lib/infra/portable/codec.js b/lib/infra/portable/codec.js
index e4bc1ea5..5632542d 100644
--- a/lib/infra/portable/codec.js
+++ b/lib/infra/portable/codec.js
@@ -57,7 +57,7 @@ function base64(value,size){if(typeof value!=='string'||value.length>MAX_BYTES||
async function seal(payload,passphrase){
validate(payload,true);pass(passphrase);
const salt=crypto.randomBytes(16),iv=crypto.randomBytes(12),key=await scrypt(passphrase,salt,32,{N:32768,r:8,p:1,maxmem:64*1024*1024});
- const plain=Buffer.from(JSON.stringify(payload));try{const cipher=crypto.createCipheriv('aes-256-gcm',key,iv);cipher.setAAD(AAD);const data=Buffer.concat([cipher.update(plain),cipher.final()]);
+ const plain=Buffer.from(JSON.stringify(payload));try{const cipher=crypto.createCipheriv('aes-256-gcm',key,iv,{authTagLength:16});cipher.setAAD(AAD);const data=Buffer.concat([cipher.update(plain),cipher.final()]);
const envelope={format:ENCRYPTED,version:1,kdf:{name:'scrypt',N:32768,r:8,p:1,salt:salt.toString('base64')},cipher:{name:'aes-256-gcm',iv:iv.toString('base64'),tag:cipher.getAuthTag().toString('base64')},data:data.toString('base64')};
if(Buffer.byteLength(JSON.stringify(envelope))>MAX_BYTES)fail('bundle_too_large');return envelope;
}finally{key.fill(0);plain.fill(0)}
@@ -68,7 +68,7 @@ async function open(input,passphrase){
if(d.version!==1||d.kdf.name!=='scrypt'||d.kdf.N!==32768||d.kdf.r!==8||d.kdf.p!==1||d.cipher.name!=='aes-256-gcm')fail('unsupported_encryption');
const salt=base64(d.kdf.salt,16),iv=base64(d.cipher.iv,12),tag=base64(d.cipher.tag,16),data=base64(d.data);pass(passphrase);
const key=await scrypt(passphrase,salt,32,{N:32768,r:8,p:1,maxmem:64*1024*1024});let plain;
- try{const decipher=crypto.createDecipheriv('aes-256-gcm',key,iv);decipher.setAAD(AAD);decipher.setAuthTag(tag);try{plain=Buffer.concat([decipher.update(data),decipher.final()])}catch{fail('wrong_passphrase_or_tampered_bundle')}
+ try{const decipher=crypto.createDecipheriv('aes-256-gcm',key,iv,{authTagLength:16});decipher.setAAD(AAD);decipher.setAuthTag(tag);try{plain=Buffer.concat([decipher.update(data),decipher.final()])}catch{fail('wrong_passphrase_or_tampered_bundle')}
return validate(parse(plain.toString('utf8')),true);
}finally{key.fill(0);plain?.fill(0)}
}
diff --git a/lib/infra/portable/data.test.ts b/lib/infra/portable/data.test.ts
index 6b00adda..4f00e475 100644
--- a/lib/infra/portable/data.test.ts
+++ b/lib/infra/portable/data.test.ts
@@ -45,3 +45,11 @@ it('resets external authorization instead of copying session identifiers',async(
const api=await import('./data'),{readIntegrationState}=await import('../connection-storage');const bundle=structuredClone(sample);Object.assign(bundle.users[0].connections[0],{source:'composio',authMethod:'oauth2',fields:[]});
const p=await api.importIntegrationData(bundle);expect(p.requiresWarningAcceptance).toBe(true);await api.importIntegrationData(bundle,{apply:true,confirm:p.planId,acceptWarnings:true});const c=(await readIntegrationState()).users['sample-user'].connections.github.work;expect(c.source).toBe('composio');expect(c.external).toBeUndefined();expect(c.values).toEqual({});
});
+it('rejects truncated GCM authentication tags before importing any credentials',async()=>{
+ const codec=await import('./codec.js');
+ const envelope=await codec.seal(structuredClone(sample),PASS);
+ expect(Buffer.from(envelope.cipher.tag,'base64')).toHaveLength(16);
+ envelope.cipher.tag=Buffer.from(envelope.cipher.tag,'base64').subarray(0,12).toString('base64');
+ await expect(codec.open(envelope,PASS)).rejects.toThrow('invalid_envelope');
+ await expect(fs.stat(process.env.OS_INFRA_STORE!)).rejects.toMatchObject({code:'ENOENT'});
+});
diff --git a/lib/infra/portable/ui.ts b/lib/infra/portable/ui.ts
index d8e55da9..756c82f6 100644
--- a/lib/infra/portable/ui.ts
+++ b/lib/infra/portable/ui.ts
@@ -8,7 +8,10 @@ function mountPortability(root,bridge){
const back=button('← Connections',()=>{cleanup();bridge.back()});root.append(back,el('h2','Import / export JSON'),el('p','Move credential users and named connections between independent applications. This is a one-time copy, not live synchronization. No existing connection is overwritten.'));
const exp=el('section'),imp=el('section');exp.className=imp.className='connection-card';exp.append(el('h3','Export'));
const owner=field('User ID (blank exports all users)'),secrets=field('Include direct credentials — encrypted JSON','checkbox'),password=field('Export passphrase (12+ characters)','password'),repeat=field('Confirm export passphrase','password');
- password.i.maxLength=repeat.i.maxLength=1024;password.l.hidden=repeat.l.hidden=true;
+ password.i.maxLength=1024;
+ repeat.i.maxLength=1024;
+ password.l.hidden=true;
+ repeat.l.hidden=true;
secrets.i.addEventListener('change',()=>{password.l.hidden=repeat.l.hidden=!secrets.i.checked;if(!secrets.i.checked)password.i.value=repeat.i.value=''});
const note=el('p','Metadata export includes names, source/auth methods and field status only. All field values, active OAuth sessions, defaults and folder mappings are excluded.');
const exportStatus=el('p');exportStatus.setAttribute('role','status');
diff --git a/scripts/e2e/desktop-native.mjs b/scripts/e2e/desktop-native.mjs
index 53b134b5..5fb405eb 100644
--- a/scripts/e2e/desktop-native.mjs
+++ b/scripts/e2e/desktop-native.mjs
@@ -1,45 +1,46 @@
#!/usr/bin/env node
// Native desktop acceptance: real navigation/search, taskbar reuse, narrow windows.
-// E2E_BASE_URL=http://127.0.0.1:4173 E2E_DEMO=1 node scripts/e2e/desktop-native.mjs
+// Uses a built app with disposable credentials; E2E_BASE_URL is demo-only.
import assert from "node:assert/strict";
-import { createRequire } from "node:module";
-import { readFileSync, mkdirSync } from "node:fs";
+import { chromium } from "@playwright/test";
+import { releaseFixture } from "./release-fixture.mjs";
+import { mkdirSync } from "node:fs";
import os from "node:os";
import path from "node:path";
-const require = createRequire(import.meta.url);
-const { chromium } = require(path.join(process.cwd(), "os-browser/node_modules/playwright"));
-const base = process.env.E2E_BASE_URL ?? "http://127.0.0.1:4005";
+process.umask(0o077);
const demo = process.env.E2E_DEMO === "1";
+const fixture = demo ? null : await releaseFixture({ live: true });
+const base = fixture?.base ?? process.env.E2E_BASE_URL ?? "http://127.0.0.1:4005";
const captureOnly = process.env.E2E_CAPTURE_ONLY === "1";
const out = process.env.MSO_SCREENSHOT_DIR ?? path.join(os.tmpdir(), "mso-desktop-native");
mkdirSync(out, { recursive: true, mode: 0o700 });
-let device, cookie;
-if (!demo) {
- const env = readFileSync(".env.local", "utf8");
- const password = /^OS_LOGIN_PASSWORD=(.*)$/m.exec(env)?.[1]?.trim().replace(/^["']|["']$/g, "");
- const devices = JSON.parse(readFileSync(process.env.OS_DEVICE_STORE ?? path.join(os.homedir(), ".mso/auth-devices.json"), "utf8")).approved;
- device = Object.keys(devices).find((id) => devices[id].role === "owner") ?? Object.keys(devices)[0];
- assert(device, "An approved device is required");
- const r = await fetch(base + "/api/auth/login", { method: "POST", headers: { "content-type": "application/json", origin: base }, body: JSON.stringify({ password, deviceId: device, deviceLabel: "desktop-native-e2e" }) });
- assert(r.ok, "Authentication failed: " + r.status);
- cookie = /(?:^|,\s*)session=([^;]+)/.exec(r.headers.get("set-cookie") ?? "")?.[1];
- assert(cookie, "Missing authenticated session");
-}
-const browser = await chromium.launch({ headless: true, executablePath: "/usr/bin/google-chrome", args: ["--no-sandbox"] });
+let browser;
try {
+ let device, cookie;
+ if (fixture) {
+ device = fixture.device;
+ const r = await fetch(base + "/api/auth/login", { method: "POST", headers: { "content-type": "application/json", origin: base }, body: JSON.stringify({ password: fixture.password, deviceId: device, deviceLabel: "desktop-native-e2e" }), redirect: "error" });
+ assert(r.ok, "Authentication failed: " + r.status);
+ cookie = /(?:^|,\s*)session=([^;]+)/.exec(r.headers.get("set-cookie") ?? "")?.[1];
+ assert(cookie, "Missing authenticated session");
+ }
+ browser = await chromium.launch({ headless: true });
for (const shell of ["windows", "macos"]) {
const ctx = await browser.newContext({ viewport: { width: 1440, height: 1000 } });
if (cookie) await ctx.addCookies([{ name: "session", value: cookie, url: base, sameSite: "Strict" }]);
await ctx.addInitScript(({ shell, device }) => {
localStorage.setItem("sv:shell", JSON.stringify({ desktop: shell, mobile: "ios" }));
localStorage.setItem("mso:onboarding:v1", "done");
- if (device) localStorage.setItem("mso.device.id", device);
+ if (device) {
+ localStorage.setItem("mso.device.id", device);
+ localStorage.setItem("mso:tweaks", JSON.stringify({server:{mode:"live",activeTargetId:"vps",url:""}}));
+ }
}, { shell, device });
const page = await ctx.newPage();
const errors = [];
page.on("pageerror", (e) => errors.push(e.message));
- await page.goto(base + "/files", { waitUntil: "networkidle", timeout: 90000 });
+ await page.goto(base + "/files" + (fixture?.dir ?? ""), { waitUntil: "networkidle", timeout: 90000 });
await page.waitForSelector('#main-content[data-shell="' + shell + '"]');
if (!demo) assert.equal(await page.evaluate(async () => (await (await fetch("/api/auth/me")).json()).authenticated), true);
const files = page.locator('[data-window]').last();
@@ -111,4 +112,4 @@ try {
console.log("PASS " + shell + ": " + (captureOnly ? "baseline captured" : "Files search/view, taskbar, Settings search/navigation, narrow layouts"));
await ctx.close();
}
-} finally { await browser.close(); }
+} finally { await browser?.close(); await fixture?.close(); }
diff --git a/scripts/e2e/preview.mjs b/scripts/e2e/preview.mjs
index 87bd0ffd..e74854da 100644
--- a/scripts/e2e/preview.mjs
+++ b/scripts/e2e/preview.mjs
@@ -3,14 +3,14 @@
//
// node scripts/e2e/preview.mjs # desktop, 1280
// node scripts/e2e/preview.mjs 390 # the mobile shell
-// E2E_BASE_URL=… E2E_PASSWORD=… node scripts/e2e/preview.mjs
+// Uses a built app with disposable credentials and files; no deployment secrets.
//
// Preview is the app most likely to LOOK fine and be wrong: an <img> that never
// decoded, a PDF frame that 404s, an HTML file rendered with its scripts live. Every
// check here asserts the bytes actually arrived (naturalWidth, readyState, frame
// text), not that an element exists.
//
-// It provisions its own fixtures under ~/.cache/mso-e2e-preview and skips the ones
+// It provisions its own fixtures in a disposable temporary folder and skips the ones
// it cannot make (no ffmpeg → no video/audio; no system PDF → no PDF), so a fresh
// machine runs a smaller suite rather than a red one.
//
@@ -18,31 +18,20 @@
// because Chromium refuses to STORE a Secure cookie arriving over plain http, and
// the shell renders for signed-out visitors too (backed by mocks) — a run that
// quietly tested fakes would report green forever.
-import { createRequire } from "node:module";
+import { chromium } from "@playwright/test";
+import { releaseFixture } from "./release-fixture.mjs";
import { execFileSync } from "node:child_process";
import { existsSync, mkdirSync, writeFileSync, copyFileSync } from "node:fs";
-import { readFileSync } from "node:fs";
-import os from "node:os";
import path from "node:path";
-const require = createRequire(import.meta.url);
-const { chromium } = require(path.join(process.cwd(), "os-browser/node_modules/playwright"));
-
-const BASE = process.env.E2E_BASE_URL ?? "http://127.0.0.1:4005";
+process.umask(0o077);
+const fixture = await releaseFixture({ live: true });
+const BASE = fixture.base;
const WIDTH = Number(process.argv[2] ?? 1280);
const MOBILE = WIDTH < 768;
-const DIR = process.env.E2E_PREVIEW_DIR ?? path.join(os.homedir(), ".cache", "mso-e2e-preview");
-
-const env = (key) =>
- new RegExp(`^${key}=(.*)$`, "m").exec(readFileSync(path.join(process.cwd(), ".env.local"), "utf8"))?.[1]?.trim().replace(/^["']|["']$/g, "");
-const approvedDevice = () => {
- const file = process.env.OS_DEVICE_STORE ?? path.join(os.homedir(), ".mso", "auth-devices.json");
- const ids = Object.keys(JSON.parse(readFileSync(file, "utf8")).approved ?? {});
- if (!ids.length) throw new Error(`no approved device in ${file} — run: mso device approve <id> "e2e"`);
- return ids[0];
-};
-const PASSWORD = process.env.E2E_PASSWORD ?? env("OS_LOGIN_PASSWORD");
-const DEVICE = process.env.E2E_DEVICE ?? approvedDevice();
+const DIR = path.join(fixture.dir, "preview");
+const PASSWORD = fixture.password, DEVICE = fixture.device;
+let browser;
const failures = [];
const pass = (m) => console.log(` ✓ ${m}`);
@@ -86,6 +75,7 @@ function fixtures() {
async function mintSession() {
const r = await fetch(`${BASE}/api/auth/login`, {
method: "POST",
+ redirect: "error",
headers: { "content-type": "application/json", origin: BASE },
body: JSON.stringify({ password: PASSWORD, deviceId: DEVICE, deviceLabel: "e2e-preview" }),
});
@@ -102,7 +92,7 @@ const scope = (page, name) =>
const run = async () => {
const have = fixtures();
- const browser = await chromium.launch({ headless: process.env.E2E_HEADED !== "1" });
+ browser = await chromium.launch({ headless: process.env.E2E_HEADED !== "1" });
const ctx = await browser.newContext({
viewport: { width: WIDTH, height: MOBILE ? 800 : 900 },
hasTouch: MOBILE,
@@ -112,16 +102,25 @@ const run = async () => {
ctx.on("console", (m) => {
const t = m.text();
// The sandbox refusing to run the fixture's script IS the passing behaviour.
- if (m.type() === "error" && !/favicon|DevTools|Blocked script execution/i.test(t)) errors.push(t);
+ if (m.type() === "error" && !/favicon|DevTools|Blocked script execution|Failed to load resource: the server responded with a status of/i.test(t)) errors.push(t);
});
const http = [];
- ctx.on("response", (r) => r.status() >= 400 && http.push(`${r.status()} ${new URL(r.url()).pathname}`));
+ ctx.on("response", (r) => {
+ if (r.status() < 400) return;
+ const url = new URL(r.url());
+ // Background shell windows may probe home; the fixture deliberately grants
+ // only its temporary directory. Keep these expected boundary refusals exact.
+ const homeProbe = r.status() === 400 && ["/api/v1/fs/list", "/api/v1/fs/usage"].includes(url.pathname)
+ && [null, "~"].includes(url.searchParams.get("path"));
+ if (!homeProbe) http.push(`${r.status()} ${url.pathname}${url.search}`);
+ });
await ctx.addCookies([{ name: "session", value: await mintSession(), url: BASE, sameSite: "Strict" }]);
const page = await ctx.newPage();
await page.addInitScript(
([id]) => {
localStorage.setItem("mso.device.id", id);
+ localStorage.setItem("mso:tweaks", JSON.stringify({server:{mode:"live",activeTargetId:"vps",url:""}}));
localStorage.setItem("mso:onboarding:v1", "done");
},
[DEVICE],
@@ -211,17 +210,20 @@ const run = async () => {
const settings = await (MOBILE ? page.locator("#main-content") : page.locator("[data-window]").last()).innerText();
check(/Software update/i.test(settings), "Settings → About shows the update panel");
check(/Up to date|available|build is pending/i.test(settings), "Update panel reported a state");
- check(/Release notes and docs/i.test(settings), "Release notes + docs row present");
+ const update = await page.evaluate(async () => (await fetch("/api/v1/sys/update?check=0")).json());
+ if (update.supported === false) {
+ check(typeof update.reason === "string" && settings.includes(update.reason), "Isolated fixture explains why self-update is unavailable");
+ check(!/Update to .* and restart/.test(settings), "Isolated fixture offers no deployment action");
+ } else check(/Release notes and docs/i.test(settings), "Release notes + docs row present");
console.log(`\n console errors: ${errors.length ? [...new Set(errors)].slice(0, 5).join(" | ") : "none"}`);
console.log(` http >=400: ${http.length ? [...new Set(http)].join(" | ") : "none"}`);
if (errors.length) fail(`${errors.length} console error(s)`);
+ if (http.length) fail(`${http.length} unexpected HTTP error(s)`);
await browser.close();
console.log(failures.length ? `\n${failures.length} FAILED` : "\nall good");
- process.exit(failures.length ? 1 : 0);
+ process.exitCode = failures.length ? 1 : 0;
};
-run().catch((e) => {
- console.error(e);
- process.exit(1);
-});
+try { await run(); } catch (e) { console.error(e); process.exitCode = 1; }
+finally { await browser?.close(); await fixture.close(); }
diff --git a/scripts/e2e/release-fixture.mjs b/scripts/e2e/release-fixture.mjs
index c1aeda79..eb612c92 100644
--- a/scripts/e2e/release-fixture.mjs
+++ b/scripts/e2e/release-fixture.mjs
@@ -5,7 +5,7 @@ import { createServer } from "node:http";
import { randomUUID, randomBytes } from "node:crypto";
import { spawn } from "node:child_process";
-export async function releaseFixture() {
+export async function releaseFixture({ live = false } = {}) {
const dir = await mkdtemp(path.join(tmpdir(), "mso-release-e2e-"));
let providerStatus = 200;
const provider = createServer((req, res) => {
@@ -20,6 +20,7 @@ export async function releaseFixture() {
approved: { [device]: { label: "Release fixture", role, approvedAt: Date.now() } }, pending: {},
}), { mode: 0o600 });
await setRole("owner");
+ if (live) await writeFile(path.join(dir, "prefs.json"), JSON.stringify({ tweaks: { server: { mode: "live", activeTargetId: "vps", url: "" } } }), { mode: 0o600 });
await writeFile(path.join(dir, "fixture.txt"), "MSO release fixture");
await writeFile(path.join(dir, "infra.json"), JSON.stringify({
version: 2, instanceId: randomUUID(), defaultUser: "fixture", bindings: [],
diff --git a/scripts/verify-build.sh b/scripts/verify-build.sh
index 1c5974ba..07e23821 100755
--- a/scripts/verify-build.sh
+++ b/scripts/verify-build.sh
@@ -38,3 +38,9 @@ nice -n 15 ionice -c2 -n7 node node_modules/.bin/next build
# Reuse this exact built tree for mandatory browser journeys; synthetic stores only.
node scripts/e2e/release.mjs
+
+# Optional deeper media/native acceptance, using the same isolated built tree.
+if [ "${1:-}" = "--extended" ]; then
+ node scripts/e2e/desktop-native.mjs
+ node scripts/e2e/preview.mjs
+fi