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(integrations): verify self-hosted Convex admin keys

Rahmanb666b387d2f6
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 7784c82f..bf7d907f 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -10,6 +10,10 @@ this is the *what*, and it is what Settings → About shows as “What's new”.
- `desktop` give Finder, Explorer and Settings native platform layouts
+**Fixed**
+
+- `integrations` verify self-hosted Convex admin keys
+
## 2026-09-07
**Added**
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index 0859a5f4..0d820a17 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -2800,6 +2800,9 @@ MCP now exposes `fs_upload_file` with `_meta["openai/fileParams"]`, so ChatGPT c
Screenshot evidence previously lived in unrelated scratch directories or only in MCP image responses. Added one derived session path policy, a private manifest, explicit image/report reads, and bounded registration/retention. Exec receives non-secret session directories; original bytes remain private and session responses compute paths instead of persisting absolute homes. Cleanup is lazy, lease-aware and fail-closed for unknown files; it does not run during builds or remove durable history. User/client isolation, retry de-duplication and existing integration changes are preserved. See SESSION-ARTIFACTS.md for limits and verification scope.
+### 2026-09-08 — Self-hosted Convex doctor endpoint reconciliation
+- Self-hosted Convex credential verification now checks `/api/check_admin_key` with the configured admin key, while retaining the existing SSRF safeguards, loopback-only HTTP exception, redirect refusal, and redacted failure behavior.
+
### 2026-09-06 — Convex Cloud custom-domain control
- Added a native `convex-cloud` CLI credential import that reads only `~/.convex/config.json`, refuses symlink/non-owner inputs, hardens the local credential directory/file to `0700/0600`, validates the token before saving, and never returns the credential.
- Added bounded exact-connection operations for listing/ensuring Convex custom domains and reading/updating canonical `convexCloud` / `convexSite` URLs. Canonical operations mint a scoped short-lived deploy key and revoke it in `finally`; custom canonical URLs must already be registered and verified.
diff --git a/lib/infra/additional-doctor.test.ts b/lib/infra/additional-doctor.test.ts
index 9ee1a02a..1412878e 100644
--- a/lib/infra/additional-doctor.test.ts
+++ b/lib/infra/additional-doctor.test.ts
@@ -66,6 +66,23 @@ describe("additional native credential providers", () => {
vi.stubGlobal("fetch", vi.fn(async () => { throw new Error(KEY); }));
await expect(doctorAdditionalProvider("github", { apiKey: KEY })).rejects.toThrow("GitHub request failed");
});
+ it("checks self-hosted Convex admin keys at the fixed admin endpoint", async () => {
+ const mock = vi.fn(async (input: RequestInfo | URL, init?: RequestInit) => {
+ const request = input instanceof Request ? input : new Request(input, init);
+ expect(request.url).toBe("http://localhost:3210/api/check_admin_key");
+ expect(request.headers.get("authorization")).toBe(`Convex ${KEY}`);
+ return new Response(null, { status: 200 });
+ });
+ vi.stubGlobal("fetch", mock);
+ await expect(doctorAdditionalProvider("convex", { apiUrl: "http://localhost:3210/base", adminKey: KEY })).resolves.toBe("authenticated; deployment access verified");
+ expect(mock).toHaveBeenCalledTimes(1);
+ });
+ it("redacts self-hosted Convex admin-key rejection responses", async () => {
+ vi.stubGlobal("fetch", vi.fn(async () => new Response(KEY, { status: 403 })));
+ const result = doctorAdditionalProvider("convex", { apiUrl: "http://localhost:3210", adminKey: KEY });
+ await expect(result).rejects.toThrow("Convex HTTP 403");
+ await expect(result).rejects.not.toThrow(KEY);
+ });
it("rejects arbitrary Convex targets before sending any key", async () => {
const mock = vi.fn(); vi.stubGlobal("fetch", mock);
for (const apiUrl of ["http://169.254.169.254/", "https://owner:[email protected]", "https://example.com/?credential=x"])
diff --git a/lib/infra/additional-doctor.ts b/lib/infra/additional-doctor.ts
index 1fbde4db..5ec1c57d 100644
--- a/lib/infra/additional-doctor.ts
+++ b/lib/infra/additional-doctor.ts
@@ -18,7 +18,7 @@ function convexFetch(input: RequestInfo | URL, init?: RequestInit): Promise<Resp
return safeProviderFetch(requestInput);
}
-function selfHostedDeploymentInfoUrl(rawUrl: string): string {
+function selfHostedAdminKeyCheckUrl(rawUrl: string): string {
let url: URL;
try {
url = new URL(rawUrl.trim());
@@ -30,7 +30,7 @@ function selfHostedDeploymentInfoUrl(rawUrl: string): string {
if (url.protocol !== "https:" && !(url.protocol === "http:" && LOOPBACK_HOSTS.has(host))) {
throw new Error("Convex invalid deployment URL");
}
- url.pathname = "/api/v1/deployment_info";
+ url.pathname = "/api/check_admin_key";
return url.toString();
}
@@ -132,7 +132,7 @@ export async function doctorAdditionalProvider(id: string, values: Record<string
}
case "convex": {
if (!present(values.apiUrl) || !present(values.adminKey)) return null;
- await checked("Convex", selfHostedDeploymentInfoUrl(values.apiUrl), { authorization: `Convex ${values.adminKey}`, accept: "application/json" }, convexFetch);
+ await checked("Convex", selfHostedAdminKeyCheckUrl(values.apiUrl), { authorization: `Convex ${values.adminKey}`, accept: "application/json" }, convexFetch);
return "authenticated; deployment access verified";
}
default: