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(browser): make viewer fixtures independent of host configuration

Rahman49e066d5df46
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5313ac04..fd3db1e9 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -68,6 +68,9 @@ jobs:
- name: Production build
run: bun run build
+ env:
+ # Matches the isolated local build; never uses a maintainer hostname.
+ NEXT_PUBLIC_MANAGED_APP_HOST_TEMPLATE: "{id}.mso.example.com"
- name: Bundle budget
run: bun run bundle:check
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 0c8c3079..68441db4 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -19,6 +19,7 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
**Tests**
+- `browser` make viewer fixtures independent of host configuration
- `security` inspect organization fixture through one descriptor
**Chores**
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index 07948bda..dab0f247 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -11,6 +11,9 @@ client accepts only that exact diagnostic; all other TLS/DNS/HTTP failures retai
their behavior. Configured separate origins, TLS, cookies and VNC auth are unchanged.
Boundary tests cover refused address classes and malformed hints; a desktop/mobile
browser journey verifies private viewer mounting while connection retry stays read-only.
+Both isolated local verification and hosted CI now compile with the same synthetic
+viewer hostname; the new iframe case no longer relies on an inherited deployment
+hostname. Production install/update configuration is not overridden by this fixture.
## 2026-09-18 — Resolve release review on Node support and browser retries
diff --git a/scripts/verify-build.sh b/scripts/verify-build.sh
index 5ef090e7..a25375fa 100755
--- a/scripts/verify-build.sh
+++ b/scripts/verify-build.sh
@@ -37,6 +37,9 @@ MSO_VERIFY_BUILD_LOG="$TMP/build-output.log"
echo "== verify 1/3: isolated Next build"
# nice/ionice: this box also serves prod. A build gate must not starve :4005.
+# A reviewed synthetic viewer origin is needed by iframe journeys. Never inherit
+# an installation's public hostname into verification artifacts.
+export NEXT_PUBLIC_MANAGED_APP_HOST_TEMPLATE='{id}.mso.example.com'
if ! nice -n 15 ionice -c2 -n7 node node_modules/.bin/next build 2>&1 | tee "$MSO_VERIFY_BUILD_LOG"; then
echo "verification failed during isolated compile/build" >&2
exit 40
diff --git a/scripts/viewer-fixture-build.test.ts b/scripts/viewer-fixture-build.test.ts
new file mode 100644
index 00000000..aa336b44
--- /dev/null
+++ b/scripts/viewer-fixture-build.test.ts
@@ -0,0 +1,14 @@
+import { readFileSync } from "node:fs";
+import { expect, it } from "vitest";
+import { parse } from "yaml";
+
+it("uses the same synthetic viewer origin in local and hosted release builds", () => {
+ const expected = "{id}.mso.example.com";
+ const local = readFileSync("scripts/verify-build.sh", "utf8");
+ expect(local).toContain(`export NEXT_PUBLIC_MANAGED_APP_HOST_TEMPLATE='${expected}'`);
+ const ci = parse(readFileSync(".github/workflows/ci.yml", "utf8"));
+ const build = ci.jobs.verify.steps.find((step: { name?: string }) => step.name === "Production build");
+ expect(build.env.NEXT_PUBLIC_MANAGED_APP_HOST_TEMPLATE).toBe(expected);
+ expect(readFileSync("scripts/self-update.sh", "utf8")).not.toContain(expected);
+ expect(readFileSync("scripts/ship.sh", "utf8")).not.toContain(expected);
+});