feat: remove tunnel and tailscale feature

This commit is contained in:
2026-07-18 19:46:52 +07:00
parent 3ebfab2684
commit 6bb03d85f7
60 changed files with 1172 additions and 4254 deletions
+1 -10
View File
@@ -22,16 +22,7 @@ describe("CLI tool endpoint resolution", () => {
})).toBe("https://router.customer.example");
});
it("uses a public endpoint for externally hosted tools when the dashboard is local", () => {
expect(resolveCliToolBaseUrl({
appUrl: "http://localhost:20128",
requiresExternalUrl: true,
tunnelEnabled: true,
tunnelPublicUrl: "https://tunnel.example/",
cloudEnabled: true,
cloudUrl: "https://cloud.example",
})).toBe("https://tunnel.example");
it("uses the cloud endpoint for externally hosted tools when the dashboard is local", () => {
expect(resolveCliToolBaseUrl({
appUrl: "http://localhost:20128",
requiresExternalUrl: true,
+1 -1
View File
@@ -234,7 +234,7 @@ describe("dashboard guard local-only access", () => {
expect(response.body.error).toBe("Unauthorized");
});
it("rejects local-only route from a tunnel host", async () => {
it("rejects local-only route from a remote host", async () => {
const response = await proxy(request("/api/cli-tools/antigravity-mitm", {
host: "router.example.com",
}));
+27
View File
@@ -66,6 +66,33 @@ describe("Schema migrations", () => {
expect(JSON.parse(settings.data)).toEqual({ foo: "bar" });
});
it("removes legacy tunnel settings during upgrade", async () => {
const { getAdapter } = await import("@/lib/db/driver.js");
const db = await getAdapter();
db.run(
`INSERT INTO settings(id, data) VALUES(1, ?) ON CONFLICT(id) DO UPDATE SET data = excluded.data`,
[JSON.stringify({
keep: "value",
tunnelEnabled: true,
tunnelUrl: "https://tunnel.example",
tunnelProvider: "cloudflare",
tailscaleEnabled: true,
tailscaleUrl: "https://machine.ts.net",
tunnelDashboardAccess: true,
})],
);
db.run(`UPDATE _meta SET value = '8' WHERE key = 'schemaVersion'`);
db.close?.();
delete global._dbAdapter;
vi.resetModules();
const { getAdapter: getAdapter2 } = await import("@/lib/db/driver.js");
const db2 = await getAdapter2();
const settings = db2.get(`SELECT data FROM settings WHERE id=1`);
expect(JSON.parse(settings.data)).toEqual({ keep: "value" });
});
it("fresh DB + legacy db.json → imports data automatically", async () => {
// Simulate user upgrading: place legacy JSON in DATA_DIR before first boot
const legacy = {