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(dns): support wildcard staging hosts

Rahmana28d60ba6c66
diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json
index 6945361d..33b89ed8 100644
--- a/.codex-plugin/plugin.json
+++ b/.codex-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "mso",
- "version": "0.2.22",
+ "version": "0.2.23",
"description": "Operate MSO projects, workflows, VPS resources, integrations, deployments, and MCP capabilities through reusable safety-first skills.",
"author": {
"name": "MSO"
diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md
index c92d66f6..32b2fae5 100644
--- a/docs/PROGRESS.md
+++ b/docs/PROGRESS.md
@@ -1,3 +1,9 @@
+## 2026-09-23 — Allow exact wildcard Hostinger DNS owners for Batonly staging
+
+The bounded Hostinger DNS adapter now accepts a leading wildcard label in the requested owner while preserving all existing per-RR-set safeguards. Validation still resolves the exact portfolio root, refuses ambiguous rows and CNAME/A conflicts, and sends one overwrite payload containing only the requested name/type. This enables wildcard staging under batonly.site to route deterministic Batonly preview hosts to the verified Dokploy origin without creating one DNS record per preview.
+
+A dedicated regression asserts that the wildcard request writes only the wildcard staging owner and leaves unrelated zone rows outside the provider mutation payload.
+
## 2026-09-23 — Isolate Termux installations inside Ubuntu PRoot
The Termux adapter now starts installation and the generated CLI launcher with a fresh guest environment, explicit Linux-only PATH and non-root owner. It rejects an Android Node/Bun runtime accidentally visible inside the guest, retains the legacy native launcher target while replacing its symlink, and supports bounded build workers, Node heap, resumable installs and a private persistent install log for low-memory tablets. Shell tests exercise the exact guest argv boundary, hostile inherited environment, argument forwarding and failed guest-runtime probes without installing packages. The launcher test reads its generated file directly instead of first checking filesystem metadata, avoiding a check/read race flagged by CodeQL.
diff --git a/lib/infra/clients.test.ts b/lib/infra/clients.test.ts
index 525af341..bb701624 100644
--- a/lib/infra/clients.test.ts
+++ b/lib/infra/clients.test.ts
@@ -59,6 +59,25 @@ describe("infrastructure clients", () => {
expect(fetchMock.mock.calls.every(([, init]) => !init || (init as RequestInit).method == null || (init as RequestInit).method === "GET")).toBe(true);
});
+ it("supports an exact wildcard Hostinger owner without widening the zone mutation", async () => {
+ const store = await import("./store");
+ await store.setInfraProvider("hostinger", { apiToken: "h".repeat(32) });
+ let putBody: unknown = null;
+ vi.stubGlobal("fetch", vi.fn(async (input: string | URL | Request, init?: RequestInit) => {
+ const url = String(input); const method = init?.method ?? "GET";
+ if (url.includes("/domains/v1/portfolio")) return response([{ domain: "example.com" }]);
+ if (url.includes("/dns/v1/zones/example.com") && method === "GET") return response([]);
+ if (url.includes("/dns/v1/zones/example.com") && method === "PUT") { putBody = JSON.parse(String(init?.body)); return response({ ok: true }); }
+ throw new Error(`unexpected ${method} ${url}`);
+ }));
+ const client = await import("./clients");
+ const result = await client.upsertHostingerDns({ name: "*.staging.example.com", type: "A", content: "203.0.113.9", ttl: 300 });
+ expect(result).toMatchObject({ action: "created", name: "*.staging.example.com", type: "A" });
+ const payload = putBody as { overwrite: boolean; zone: Array<{ name: string; type: string; records: Array<{ content: string }> }> };
+ expect(payload.overwrite).toBe(true);
+ expect(payload.zone).toEqual([{ name: "*.staging", type: "A", ttl: 300, records: [{ content: "203.0.113.9", is_disabled: false }] }]);
+ });
+
it("sends only the requested Hostinger RR-set so unrelated zone rows cannot be overwritten", async () => {
const store = await import("./store");
await store.setInfraProvider("hostinger", { apiToken: "h".repeat(32) });
diff --git a/lib/infra/hostinger.ts b/lib/infra/hostinger.ts
index 7a407d81..27950eff 100644
--- a/lib/infra/hostinger.ts
+++ b/lib/infra/hostinger.ts
@@ -6,6 +6,7 @@ import { doctorHostingerMail } from "./hostinger-mail";
const API = "https://developers.hostinger.com/api";
const headers = (token: string) => ({ authorization: `Bearer ${token}`, accept: "application/json", "content-type": "application/json" });
+const validDnsOwner = (name: string) => HOST_RE.test(name.startsWith("*.") ? name.slice(2) : name);
export async function doctorHostinger(candidate?: InfraProviderValues): Promise<string | null> {
const values = candidate ?? await readInfraProvider("hostinger");
@@ -34,7 +35,7 @@ export async function upsertHostingerDns(input: { name: string; type: string; co
if (!values.apiToken) throw new Error("Hostinger is not configured; run `mso provider set hostinger`");
const fullDomain = input.name.trim().replace(/\.$/, "").toLowerCase();
const type = input.type.trim().toUpperCase(); const content = input.content.trim();
- if (!HOST_RE.test(fullDomain)) throw new Error("invalid DNS hostname");
+ if (!validDnsOwner(fullDomain)) throw new Error("invalid DNS hostname");
if (!["A", "CNAME", "TXT"].includes(type)) throw new Error("Hostinger DNS type must be A, CNAME, or TXT");
if (type === "A" && isIP(content) !== 4) throw new Error("A record content must be an IPv4 address");
if (type === "CNAME" && !HOST_RE.test(content.replace(/\.$/, ""))) throw new Error("CNAME content must be a hostname");
diff --git a/package.json b/package.json
index 0f4f2514..e8ad5f54 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "mso",
- "version": "0.2.22",
+ "version": "0.2.23",
"private": true,
"engines": {
"node": "^22.12.0 || ^24.0.0 || >=26.0.0",