mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 06:05:24 +00:00
feat: move desktop, status, import, audit and branding features into plugins
This commit is contained in:
1 parent
9d93fb0893
commit
1cdbfc674c
166 files changed
+21298
-12041
No files matched your search
@@ -32,14 +32,18 @@ const OFFICIAL_IDS = [
|
||||
"acme-ssl",
|
||||
"ai",
|
||||
"alerts",
|
||||
"audit-tools",
|
||||
"automations",
|
||||
"classic-layout",
|
||||
"classic-themes",
|
||||
"credential-tools",
|
||||
"docker",
|
||||
"file-manager",
|
||||
"fleets",
|
||||
"homepage",
|
||||
"host-metrics",
|
||||
"host-status",
|
||||
"import-export",
|
||||
"ldap",
|
||||
"network-topology",
|
||||
"opkssh",
|
||||
|
||||
@@ -136,13 +136,11 @@ const ALLOWED = [
|
||||
"DropdownMenuTrigger",
|
||||
"EditingWidth",
|
||||
"EmptyState",
|
||||
"ExportPayload",
|
||||
"FOLDER_COLORS",
|
||||
"FONT_SIZES",
|
||||
"Facts",
|
||||
"FakeSwitch",
|
||||
"Field",
|
||||
"FieldGroup",
|
||||
"FieldPair",
|
||||
"FolderAccessRule",
|
||||
"FolderIconEl",
|
||||
@@ -235,6 +233,7 @@ const ALLOWED = [
|
||||
"PasswordInput",
|
||||
"PermissionCatalogEntry",
|
||||
"PluginComponent",
|
||||
"PRESETS",
|
||||
"PluginIcon",
|
||||
"PluginSettingsErrors",
|
||||
"PluginSettingsField",
|
||||
@@ -369,9 +368,7 @@ const ALLOWED = [
|
||||
"applyUiFont",
|
||||
"assignRoleToUser",
|
||||
"beginSplitDrag",
|
||||
"buildExportPayload",
|
||||
"buildOriginWsUrl",
|
||||
"bulkImportSSHHosts",
|
||||
"bulkUpdateSSHHosts",
|
||||
"canConfigureUpdates",
|
||||
"canJoinSplit",
|
||||
@@ -400,22 +397,17 @@ const ALLOWED = [
|
||||
"deleteRole",
|
||||
"deleteSSHHost",
|
||||
"deleteUser",
|
||||
"deployCredentialToHost",
|
||||
"desktopUpdates",
|
||||
"docsUrl",
|
||||
"duplicateCredential",
|
||||
"enabledHostProtocols",
|
||||
"endSplitDrag",
|
||||
"exportAllSSHHosts",
|
||||
"filterPaletteItems",
|
||||
"findCoreHostDefault",
|
||||
"findMatchingKeybinding",
|
||||
"generateKeyPair",
|
||||
"generatePublicKeyFromPrivate",
|
||||
"getActiveSessions",
|
||||
"getAdaptiveResourceBudget",
|
||||
"getApiKeys",
|
||||
"getAuditForwarding",
|
||||
"getAuditLogActions",
|
||||
"getAuditLogs",
|
||||
"getBasePath",
|
||||
@@ -484,11 +476,11 @@ const ALLOWED = [
|
||||
"hasVisibleFields",
|
||||
"hostActionsFor",
|
||||
"hostBadgesFor",
|
||||
"hostKey",
|
||||
"hostEditorToolbarItemsFor",
|
||||
"hostMenuItemsFor",
|
||||
"hostProtocolFlags",
|
||||
"hostStatusIndicatorsFor",
|
||||
"hydrateLocalSharedHostAuth",
|
||||
"importSSHConfigHosts",
|
||||
"invalidateHostsAndStatusCaches",
|
||||
"invalidateServerStatusCache",
|
||||
"isCoreRailView",
|
||||
@@ -513,7 +505,6 @@ const ALLOWED = [
|
||||
"mapCredentials",
|
||||
"markAdaptiveResourceUsed",
|
||||
"markTabSurfaceUsed",
|
||||
"maskSecrets",
|
||||
"moveRailItem",
|
||||
"moveSplitDrag",
|
||||
"normalizeLanguageCode",
|
||||
@@ -524,7 +515,6 @@ const ALLOWED = [
|
||||
"parseServerTime",
|
||||
"pluginKey",
|
||||
"pluginName",
|
||||
"pluginSecretKeys",
|
||||
"pluginWsUrl",
|
||||
"preloadTabSurface",
|
||||
"previewHostDefaultsLevel",
|
||||
@@ -597,8 +587,6 @@ const ALLOWED = [
|
||||
"takePendingManageRequest",
|
||||
"unlinkExternalFromPasswordAccount",
|
||||
"unlinkServer",
|
||||
"updateAuditForwarding",
|
||||
"updateBranding",
|
||||
"updateCredential",
|
||||
"updateExternalAutoProvision",
|
||||
"updateFolderMetadata",
|
||||
@@ -633,6 +621,8 @@ const ALLOWED = [
|
||||
"useHostActions",
|
||||
"useHostBadges",
|
||||
"useHostContextMenuItems",
|
||||
"useHostEditorToolbarItems",
|
||||
"useHostStatusIndicators",
|
||||
"useHostEditorSections",
|
||||
"useHostProtocols",
|
||||
"useHostStatus",
|
||||
|
||||
@@ -48,7 +48,11 @@ function start() {
|
||||
writeFileSync: vi.fn(),
|
||||
},
|
||||
fork: () => child,
|
||||
app: { isPackaged: true, getVersion: () => "2.9.0" },
|
||||
app: {
|
||||
isPackaged: true,
|
||||
getVersion: () => "2.9.0",
|
||||
getPath: () => "/user-data",
|
||||
},
|
||||
process: { env: { LOG_LEVEL: "error" } },
|
||||
isDev: false,
|
||||
appRoot: "/app",
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
import { createRequire } from "node:module";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
const { isLaunchableFileName } = require("../electron/external-editor.cjs") as {
|
||||
isLaunchableFileName: (fileName: unknown) => boolean;
|
||||
};
|
||||
|
||||
describe("Electron external editor", () => {
|
||||
it("refuses remote file names the OS would run instead of open", () => {
|
||||
for (const name of [
|
||||
"payload.exe",
|
||||
"run.BAT",
|
||||
"script.ps1",
|
||||
"a.exe. ",
|
||||
"a.cmd...",
|
||||
"../../evil.vbs",
|
||||
"start.command",
|
||||
"launch.desktop",
|
||||
"install.sh",
|
||||
]) {
|
||||
expect(isLaunchableFileName(name)).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
it("opens ordinary text files", () => {
|
||||
for (const name of [
|
||||
"nginx.conf",
|
||||
"README.md",
|
||||
"Dockerfile",
|
||||
".bashrc",
|
||||
"config.json",
|
||||
"index.ts",
|
||||
"",
|
||||
undefined,
|
||||
]) {
|
||||
expect(isLaunchableFileName(name)).toBe(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -39,12 +39,24 @@ describe("Electron security boundary", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("launches only the editor saved from a file dialog", () => {
|
||||
expect(main).not.toContain("fileData?.editorPath");
|
||||
expect(main).toContain("readSetting(EXTERNAL_EDITOR_SETTING)");
|
||||
it("saves an external editor only if it was chosen in a file dialog", () => {
|
||||
expect(main).toContain("dialogChosenPaths.has(value)");
|
||||
});
|
||||
|
||||
it("keeps local files, the local terminal and the external editor out of Electron", () => {
|
||||
for (const channel of [
|
||||
"open-external-editor",
|
||||
"close-external-editor",
|
||||
"local-terminal-start",
|
||||
"local-fs:",
|
||||
"local-transfer:",
|
||||
"list-local-directory",
|
||||
]) {
|
||||
expect(main).not.toContain(channel);
|
||||
expect(preload).not.toContain(channel);
|
||||
}
|
||||
});
|
||||
|
||||
it("scopes proxy headers and basic auth to the linked origin", () => {
|
||||
expect(main).toContain('"sync-proxy-config"');
|
||||
expect(main).toContain("linkedServer.applyLinkHeaders(");
|
||||
|
||||
Reference in new issue
Block a user