Skip to content

Commit 04a8575

Browse files
fix: Include SSH authentication fields in installed scripts data
- Add SSH key fields (auth_type, ssh_key, ssh_key_passphrase, ssh_port) to database query - Update InstalledScript interface to include SSH authentication fields - Fix server data construction in handleOpenShell and handleUpdateScript - Now properly supports SSH key authentication for shell and update operations This fixes the issue where SSH key authentication was not being used even when configured in server settings, as the installed scripts data was missing the SSH authentication fields.
1 parent 8d9f119 commit 04a8575

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

src/app/_components/InstalledScriptsTab.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ interface InstalledScript {
2020
server_ip: string | null;
2121
server_user: string | null;
2222
server_password: string | null;
23+
server_auth_type: string | null;
24+
server_ssh_key: string | null;
25+
server_ssh_key_passphrase: string | null;
26+
server_ssh_port: number | null;
2327
server_color: string | null;
2428
installation_date: string;
2529
status: 'in_progress' | 'success' | 'failed';
@@ -527,13 +531,17 @@ export function InstalledScriptsTab() {
527531
onConfirm: () => {
528532
// Get server info if it's SSH mode
529533
let server = null;
530-
if (script.server_id && script.server_user && script.server_password) {
534+
if (script.server_id && script.server_user) {
531535
server = {
532536
id: script.server_id,
533537
name: script.server_name,
534538
ip: script.server_ip,
535539
user: script.server_user,
536-
password: script.server_password
540+
password: script.server_password,
541+
auth_type: script.server_auth_type || 'password',
542+
ssh_key: script.server_ssh_key,
543+
ssh_key_passphrase: script.server_ssh_key_passphrase,
544+
ssh_port: script.server_ssh_port || 22
537545
};
538546
}
539547

@@ -564,13 +572,17 @@ export function InstalledScriptsTab() {
564572

565573
// Get server info if it's SSH mode
566574
let server = null;
567-
if (script.server_id && script.server_user && script.server_password) {
575+
if (script.server_id && script.server_user) {
568576
server = {
569577
id: script.server_id,
570578
name: script.server_name,
571579
ip: script.server_ip,
572580
user: script.server_user,
573-
password: script.server_password
581+
password: script.server_password,
582+
auth_type: script.server_auth_type || 'password',
583+
ssh_key: script.server_ssh_key,
584+
ssh_key_passphrase: script.server_ssh_key_passphrase,
585+
ssh_port: script.server_ssh_port || 22
574586
};
575587
}
576588

src/app/_components/ScriptInstallationCard.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ interface InstalledScript {
1414
server_ip: string | null;
1515
server_user: string | null;
1616
server_password: string | null;
17+
server_auth_type: string | null;
18+
server_ssh_key: string | null;
19+
server_ssh_key_passphrase: string | null;
20+
server_ssh_port: number | null;
1721
server_color: string | null;
1822
installation_date: string;
1923
status: 'in_progress' | 'success' | 'failed';

src/server/database.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ class DatabaseService {
180180
s.ip as server_ip,
181181
s.user as server_user,
182182
s.password as server_password,
183+
s.auth_type as server_auth_type,
184+
s.ssh_key as server_ssh_key,
185+
s.ssh_key_passphrase as server_ssh_key_passphrase,
186+
s.ssh_port as server_ssh_port,
183187
s.color as server_color
184188
FROM installed_scripts inst
185189
LEFT JOIN servers s ON inst.server_id = s.id

0 commit comments

Comments
 (0)