diff --git a/src/backend/database/routes/ssh.ts b/src/backend/database/routes/ssh.ts index c4d084ec..ab8f317d 100644 --- a/src/backend/database/routes/ssh.ts +++ b/src/backend/database/routes/ssh.ts @@ -226,7 +226,7 @@ router.post( authType, credentialId, key, - key_password, + keyPassword, keyType, pin, enableTerminal, @@ -412,7 +412,7 @@ router.put( authType, credentialId, key, - key_password, + keyPassword, keyType, pin, enableTerminal, @@ -727,7 +727,7 @@ router.get( authType: resolvedHost.authType, password: resolvedHost.password || null, key: resolvedHost.key || null, - key_password: resolvedHost.key_password || null, + keyPassword: resolvedHost.key_password || null, keyType: resolvedHost.keyType || null, folder: resolvedHost.folder, tags: @@ -1433,7 +1433,7 @@ router.post( credentialId: hostData.authType === "credential" ? hostData.credentialId : null, key: hostData.authType === "key" ? hostData.key : null, - key_password: + keyPassword: hostData.authType === "key" ? hostData.keyPassword || hostData.key_password || null : null, diff --git a/src/backend/ssh/terminal.ts b/src/backend/ssh/terminal.ts index 22a5d768..f43398c7 100644 --- a/src/backend/ssh/terminal.ts +++ b/src/backend/ssh/terminal.ts @@ -674,7 +674,7 @@ wss.on("connection", async (ws: WebSocket, req) => { }, ); - const connectConfig: ConnectConfig = { + const connectConfig: any = { host: ip, port, username, @@ -682,6 +682,8 @@ wss.on("connection", async (ws: WebSocket, req) => { keepaliveInterval: 30000, keepaliveCountMax: 3, readyTimeout: 60000, + tcpKeepAlive: true, + tcpKeepAliveInitialDelay: 30000, env: { TERM: "xterm-256color", LANG: "en_US.UTF-8", diff --git a/src/types/index.ts b/src/types/index.ts index 33b3fe2a..242409fe 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,7 +1,6 @@ // ============================================================================ // CENTRAL TYPE DEFINITIONS // ============================================================================ -// This file contains all shared interfaces and types used across the application import type { Client } from "ssh2"; import type { Request } from "express"; @@ -265,7 +264,7 @@ export interface TabContextTab { | "user_profile"; title: string; hostConfig?: SSHHost; - terminalRef?: React.RefObject; + terminalRef?: any; } // ============================================================================