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 setupDockerContainerLogsWebSocketServer = (
@@ -50,7 +49,6 @@ export const setupDockerContainerLogsWebSocketServer = (
const server = await findServerById(serverId);
if (!server.sshKeyId) return;
const keys = await readSSHKey(server.sshKeyId);
const client = new Client();
new Promise<void>((resolve, reject) => {
client
@@ -82,7 +80,7 @@ export const setupDockerContainerLogsWebSocketServer = (
host: server.ipAddress,
port: server.port,
username: server.username,
privateKey: keys.privateKey,
privateKey: server.sshKey?.privateKey,
timeout: 99999,
});
});