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

View File

@@ -12,7 +12,6 @@ import {
} from "@/server/setup/traefik-setup";
import { Client } from "ssh2";
import { recreateDirectory } from "../utils/filesystem/directory";
import { readSSHKey } from "../utils/filesystem/ssh";
import slug from "slugify";
@@ -70,13 +69,7 @@ const installRequirements = async (serverId: string, logPath: string) => {
writeStream.close();
throw new Error("No SSH Key found");
}
const keys = await readSSHKey(server.sshKeyId);
if (!keys.privateKey) {
writeStream.write("❌ No SSH Key found");
writeStream.close();
throw new Error("No SSH Key found");
}
return new Promise<void>((resolve, reject) => {
client
.once("ready", () => {
@@ -142,7 +135,7 @@ const installRequirements = async (serverId: string, logPath: string) => {
host: server.ipAddress,
port: server.port,
username: server.username,
privateKey: keys.privateKey,
privateKey: server.sshKey?.privateKey,
timeout: 99999,
});
});