fix: Update readme
This commit is contained in:
@@ -413,6 +413,27 @@ app.post("/ssh/file_manager/ssh/connect", async (req, res) => {
|
||||
});
|
||||
|
||||
client.on("error", (err) => {
|
||||
if (
|
||||
(err.message.includes("All configured authentication methods failed") ||
|
||||
err.message.includes("No authentication methods remaining")) &&
|
||||
resolvedCredentials.authType === "password" &&
|
||||
!config.password &&
|
||||
resolvedCredentials.password &&
|
||||
!userProvidedPassword
|
||||
) {
|
||||
fileLogger.info(
|
||||
"Retrying password auth with password method for file manager",
|
||||
{
|
||||
operation: "file_connect_retry",
|
||||
sessionId,
|
||||
hostId,
|
||||
},
|
||||
);
|
||||
config.password = resolvedCredentials.password;
|
||||
client.connect(config);
|
||||
return;
|
||||
}
|
||||
|
||||
if (responseSent) return;
|
||||
responseSent = true;
|
||||
fileLogger.error("SSH connection failed for file manager", {
|
||||
|
||||
@@ -362,7 +362,10 @@ wss.on("connection", async (ws: WebSocket, req) => {
|
||||
}
|
||||
});
|
||||
|
||||
async function handleConnectToHost(data: ConnectToHostData) {
|
||||
async function handleConnectToHost(
|
||||
data: ConnectToHostData,
|
||||
retryWithPassword = false,
|
||||
) {
|
||||
const { hostConfig, initialPath, executeCommand } = data;
|
||||
const {
|
||||
id,
|
||||
@@ -658,6 +661,22 @@ wss.on("connection", async (ws: WebSocket, req) => {
|
||||
sshConn.on("error", (err: Error) => {
|
||||
clearTimeout(connectionTimeout);
|
||||
|
||||
if (
|
||||
(err.message.includes("All configured authentication methods failed") ||
|
||||
err.message.includes("No authentication methods remaining")) &&
|
||||
resolvedCredentials.authType === "password" &&
|
||||
!retryWithPassword &&
|
||||
!(hostConfig as any).userProvidedPassword
|
||||
) {
|
||||
sshLogger.info("Retrying password auth with password method", {
|
||||
operation: "ssh_connect_retry",
|
||||
hostId: id,
|
||||
});
|
||||
cleanupSSH();
|
||||
handleConnectToHost(data, true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
(authMethodNotAvailable && resolvedCredentials.authType === "none") ||
|
||||
(resolvedCredentials.authType === "none" &&
|
||||
@@ -912,7 +931,7 @@ wss.on("connection", async (ws: WebSocket, req) => {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((hostConfig as any).userProvidedPassword) {
|
||||
if ((hostConfig as any).userProvidedPassword || retryWithPassword) {
|
||||
connectConfig.password = resolvedCredentials.password;
|
||||
}
|
||||
} else if (
|
||||
|
||||
Reference in New Issue
Block a user