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.

refactor(security): keep authority fixes within architecture line limits

rahmanef2bb3ca6c78ac
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 06891524..70b84de9 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -33,6 +33,10 @@ this is the *what*, and it is what Settings → Account → About shows as “Wh
- `security` require authenticated workflow webhooks
- `security` block delegated writes to control plane
+**Changed**
+
+- `security` keep authority fixes within architecture line limits
+
**Tests**
- `security` verify production sockets and preserve bounded project scans
diff --git a/lib/agent/local-agent-standby-store.ts b/lib/agent/local-agent-standby-store.ts
index 324392da..8ecf0bd4 100644
--- a/lib/agent/local-agent-standby-store.ts
+++ b/lib/agent/local-agent-standby-store.ts
@@ -10,7 +10,6 @@ import {
import type { LocalAgentStandbyRecord } from "./local-agent-types";
const DEFAULT_EXECUTION_LEASE_MS = 15 * 60_000;
-
export { standbyRecordView } from "./local-agent-standby-storage";
export async function listLocalAgentStandbyRecords(
diff --git a/lib/managed-apps/manager.test.ts b/lib/managed-apps/manager.test.ts
index 082797dd..8d365dd3 100644
--- a/lib/managed-apps/manager.test.ts
+++ b/lib/managed-apps/manager.test.ts
@@ -1,6 +1,4 @@
-// The two defects this covers were both live in a shipped build, and both were
-// invisible without a test: detection could not tell a stopped unit from a
-// non-existent one, and backup refused every real install.
+// Regressions: stopped versus missing service detection, and backups of real installs.
import { promises as fs } from "node:fs";
import os from "node:os";
import path from "node:path";
@@ -13,8 +11,7 @@ vi.mock("./runner", () => ({
resolveCommand: vi.fn().mockResolvedValue(null),
requireProgram: vi.fn(),
}));
-// Stubbed so these tests describe MSO's behaviour rather than whether the machine
-// running them happens to have a user bus.
+// Stub the host user bus so service behavior is deterministic.
vi.mock("./user-bus", () => ({
userBusEnv: vi.fn(() => ({ XDG_RUNTIME_DIR: "/run/user/1000" })),
userBusUnavailable: vi.fn(() => false),
@@ -40,9 +37,7 @@ function systemctl(byUnit: Record<string, { code: number; stdout: string; stderr
});
}
-afterEach(() => {
- vi.restoreAllMocks();
-});
+afterEach(() => { vi.restoreAllMocks(); });
it("never follows a managed-app health redirect outside its reviewed loopback endpoint", async () => {
systemctl({ "hermes-dashboard.service": ACTIVE });
@@ -210,15 +205,14 @@ describe("backup copies a real install instead of refusing it", () => {
expect(await fs.readFile(path.join(backup, "openclaw.json"), "utf8")).toBe("{}");
expect(await fs.readFile(path.join(backup, "agents", "one.md"), "utf8")).toBe("agent");
- // The symlink out of the app is neither followed (no /etc/passwd bytes) nor
- // recreated (a restore would then write outside the tree).
+ // Escaping symlinks are neither followed nor recreated during restore.
await expect(fs.lstat(path.join(backup, "escape"))).rejects.toThrow();
await expect(fs.lstat(path.join(backup, "node_modules"))).rejects.toThrow();
await expect(fs.lstat(path.join(backup, "backups"))).rejects.toThrow();
const manifest = JSON.parse(await fs.readFile(path.join(backup, "manifest.json"), "utf8"));
expect(manifest.applicationId).toBe("openclaw");
- // node_modules is skipped as a DIR, so the link inside it is never reached.
+ // Skipping node_modules also skips its nested link.
expect(manifest.skipped).toMatchObject({ symlinks: 1, dirs: 2 });
expect(manifest.skipped.dirNames).toContain("node_modules");
});