refactor: stash

This commit is contained in:
Mauricio Siu
2024-10-02 21:55:54 -06:00
parent ffd19f591d
commit d256998677
32 changed files with 4023 additions and 293 deletions
@@ -4,7 +4,6 @@ import { Client } from "ssh2";
import { WebSocketServer } from "ws";
import { findServerById } from "@/server/services/server";
import { validateWebSocketRequest } from "../auth/auth";
import { readSSHKey } from "../utils/filesystem/ssh";
import { getShell } from "./utils";
export const setupDockerContainerTerminalWebSocketServer = (
@@ -51,7 +50,6 @@ export const setupDockerContainerTerminalWebSocketServer = (
if (!server.sshKeyId)
throw new Error("No SSH key available for this server");
const keys = await readSSHKey(server.sshKeyId);
const conn = new Client();
let stdout = "";
let stderr = "";
@@ -107,7 +105,7 @@ export const setupDockerContainerTerminalWebSocketServer = (
host: server.ipAddress,
port: server.port,
username: server.username,
privateKey: keys.privateKey,
privateKey: server.sshKey?.privateKey,
timeout: 99999,
});
} else {