From 62655711821fae64e6a45f04952d917b37501516 Mon Sep 17 00:00:00 2001 From: haipengno1 Date: Thu, 11 Jun 2026 00:39:30 +0800 Subject: [PATCH] feat(ssh): add ssh-agent authentication support (#1023) Thanks for adding ssh-agent support, this is a great addition! --- .../connection/ConnectionDialog.vue | 12 ++- apps/desktop/src/i18n/locales/en.ts | 3 +- apps/desktop/src/i18n/locales/es.ts | 3 +- apps/desktop/src/i18n/locales/it.ts | 3 +- apps/desktop/src/i18n/locales/pt-BR.ts | 3 +- apps/desktop/src/i18n/locales/zh-CN.ts | 3 +- apps/desktop/src/i18n/locales/zh-TW.ts | 3 +- apps/desktop/src/types/database.ts | 1 + crates/dbx-core/src/cloud_sync.rs | 1 + crates/dbx-core/src/connection_secrets.rs | 1 + crates/dbx-core/src/db/ssh_tunnel.rs | 75 ++++++++++++++++++- .../dbx-core/src/db/transport_layer_tunnel.rs | 2 + crates/dbx-core/src/models/connection.rs | 2 + packages/node-core/src/connections.ts | 2 + 14 files changed, 106 insertions(+), 8 deletions(-) diff --git a/apps/desktop/src/components/connection/ConnectionDialog.vue b/apps/desktop/src/components/connection/ConnectionDialog.vue index a7de81f529..f93c771260 100644 --- a/apps/desktop/src/components/connection/ConnectionDialog.vue +++ b/apps/desktop/src/components/connection/ConnectionDialog.vue @@ -138,6 +138,7 @@ function defaultSshTunnel(): SshTunnelConfig { key_passphrase: "", connect_timeout_secs: 5, expose_lan: false, + use_ssh_agent: false, }; } @@ -154,6 +155,7 @@ function normalizeSshTunnel(hop: Partial): SshTunnelConfig { key_passphrase: hop.key_passphrase || "", connect_timeout_secs: Number(hop.connect_timeout_secs) || 5, expose_lan: !!hop.expose_lan, + use_ssh_agent: !!hop.use_ssh_agent, }; } @@ -229,6 +231,7 @@ function sshLayersForConfig(config: LegacyConnectionConfig): SshTunnelConfig[] { key_passphrase: config.ssh_key_passphrase || "", connect_timeout_secs: config.ssh_connect_timeout_secs || 5, expose_lan: config.ssh_expose_lan || false, + use_ssh_agent: false, }), ]; } @@ -1701,7 +1704,7 @@ function validateTransportLayers(config: LegacyConnectionConfig) { } if (layer.type === "ssh") { if (!layer.user?.trim()) throw new Error(t("connection.sshHopInvalidUser", { hop: label })); - if (!layer.password?.trim() && !layer.key_path?.trim()) { + if (!layer.password?.trim() && !layer.key_path?.trim() && !layer.use_ssh_agent) { throw new Error(t("connection.sshHopInvalidAuth", { hop: label })); } const timeout = Number(layer.connect_timeout_secs); @@ -2991,6 +2994,13 @@ function openExternalUrl(url: string) { +
+ + +