61 Commits
Author SHA1 Message Date
胡飞 e0bfa684be fix(ssh): give kex compatibility tests more connect-timeout headroom 2026-09-09 21:00:25 +08:00
胡飞 3d340b0bd4 feat(known-hosts): add trusted host management view 2026-09-08 22:21:35 +08:00
胡飞 1b3d03f6ec Bump v0.15.2 2026-08-31 23:02:35 +08:00
胡飞 77f39ecff0 style: apply rustfmt formatting across crates 2026-08-29 12:06:28 +08:00
胡飞 49b456e675 feat(terminal): runtime SSH shell integration without remote writes
Replace the persistent remote install (exec-channel script that wrote
~/.config/onetcli/shell_integration.sh and managed blocks into rc files)
with a meatshell-style runtime PTY injection:

- Read-only probe on a separate exec channel confirms bash/zsh before
  injecting; ash/fish/restricted CLIs fall back to a plain shell.
- After the first output chunk (login expect complete), the integration
  script is injected as a single line via ANSI-C quoted eval with a
  leading space (history ignorespace) and bash history -d self-cleanup.
- Echo of the injected command is suppressed until the private
  OSC 1337;ShellIntegrationReady=1 marker; OSC 133/7/1337 protocol is
  preserved, so prompt readiness, cwd tracking, and command recording
  keep working.
- Terminal input and exec requests are deferred while injecting; a 5s
  timeout sends Ctrl+C and degrades to a plain terminal.
- Sessions that still carry legacy rc blocks are detected via an early
  OSC 133;B and skip injection.
- Drop the session-bound ShellIntegrationSetup cache; keep the explicit
  uninstall path as one-shot cleanup for legacy leftovers.
- Remove the "disable shell integration" form toggle (runtime injection
  no longer writes remote files); rework the form section into a legacy
  cleanup card.
- Add a #[ignore] live integration test (NAVOP_LIVE_SSH env) verifying
  probe -> inject -> echo suppression -> 133;B readiness -> command
  recording -> zero remote filesystem changes, with md5 snapshots
  before/after.
2026-08-28 14:18:05 +08:00
胡飞 32a3a2c973 feat(terminal): add background transfer progress 2026-08-26 16:41:44 +08:00
胡飞 a376b01dc6 style(core): 优化代码格式和导入顺序整理
- 调整 core 模块中 use 导入的顺序,使代码风格统一
- 格式化连接排序相关函数,提升代码可读性
- 优化 RemoteDesktopForm 中连接测试结果的匹配代码格式
- 格式化 windows_native_shutdown 模块中函数调用的换行
- 统一 ssh 模块中错误处理和测试断言的代码排版
- 修复连接导入相关模块中的未对齐和多余空白
- 完善对异步任务错误处理的格式,增强错误提示清晰度
- 调整 home_tab 和 connection_sort 模块的代码换行以符合风格规范
2026-08-24 22:10:19 +08:00
胡飞 b3d62f0a7b chore(deps): 更新依赖版本以提升安全性和功能
- 将clickhouse依赖版本从0.14.1升级到0.15.1
- 将sqlparser依赖版本从0.60.0升级到0.62.0
- 将russh依赖版本从0.62.4升级到0.63.1
- 将russh-sftp依赖版本从2.3.0升级到2.4.0
2026-08-24 20:54:40 +08:00
ariesshen 21c4e6f7a3 feat(ssh): add opt-in compatibility support for old SSH servers
- 支持老旧 SSH 设备的 1024 位 DH 组协商
- 调整 GEX 参数与 KEX 顺序,避免 Key exchange init failed
- 补充真实连接测试与错误提示
2026-08-24 16:08:47 +08:00
泡芙 d5522e0887 fix(ssh): 修复 windows_agent_backend_for_auth 未使用警告,收窄为仅测试编译 2026-08-23 19:02:53 +08:00
胡飞 57da0435a9 feat(ssh): add Pageant authentication 2026-08-23 09:44:22 +08:00
胡飞 a6e4fc8be4 feat(ssh): add opt-in support for legacy ssh-dss host keys 2026-08-20 15:27:48 +08:00
胡飞 893c5cdfd4 fix(terminal): preserve buffers and continue MFA auth 2026-08-12 10:17:24 +08:00
胡飞 438f1c3c68 fix(ssh): preserve full connection errors 2026-08-07 13:29:21 +08:00
胡飞 53a1047157 feat(ssh): require confirmation before accepting changed host keys 2026-08-06 17:56:55 +08:00
胡飞 fea22fbd16 fix(ssh): hint when legacy kex is required 2026-08-03 12:10:26 +08:00
胡飞 cad1e39201 feat(ssh): add opt-in legacy algorithm support
Add a per-connection legacy KEX toggle that defaults to disabled, propagate it through SSH/SFTP and connection pooling, and prioritize trusted host-key algorithms without weakening verification.
2026-08-03 10:40:31 +08:00
胡飞 8374448e7b Merge branch 'dev' into feat/terminal-optimization-rework 2026-07-31 09:50:22 +08:00
胡飞 c4cdd182a8 feat(port-forwarding): add SSH remote port forwarding 2026-07-30 22:33:12 +08:00
胡飞 b9acf00fc8 feat(terminal): improve SSH trust and reconnect behavior 2026-07-30 22:10:21 +08:00
胡飞 a19db35e73 fix(ssh): scope transport invalidation to client generation 2026-07-27 06:51:24 +08:00
胡飞 ac090f123d feat(ssh): add application session service 2026-07-27 05:49:46 +08:00
胡飞 efe9c076e1 feat(ssh): reap idle session generations 2026-07-27 03:06:45 +08:00
胡飞 d026738b7a feat(ssh): add generation-bound session leases 2026-07-27 02:03:54 +08:00
胡飞 0038747e96 feat(ssh): add single-flight session registry 2026-07-27 01:28:38 +08:00
胡飞 7dc2452401 feat(ssh): define secure connection keys 2026-07-27 00:51:51 +08:00
胡飞 003719b425 fix(ssh): verify server host keys 2026-07-26 18:28:17 +08:00
胡飞 4bfa7d8456 feat(ssh): add shared host-key verifier 2026-07-26 18:12:05 +08:00
胡飞 062df0ca62 fix(ssh): reload latest config on reconnect 2026-07-25 16:47:59 +08:00
胡飞 7835005afb chore(ssh): upgrade russh dependencies 2026-07-25 13:49:25 +08:00
胡飞 f898b23eb4 feat(ssh): 支持 SSH X11 转发
基于 X.Org 公开的 X11 协议规范独立实现:

- 新增 x11_forwarding crate:DISPLAY 解析并在解析期求出本机端点
  (含 macOS XQuartz launchd 套接字)、迭代器风格 Xauthority 读取与
  按匹配度排序选条目、定长 16 字节 MIT-MAGIC-COOKIE-1 类型、setup
  报文"解码-校验-重编码"(read_exact 两阶段精确读取,不过量消费)、
  按 fake cookie 路由的连接级授权表(dashmap)、回连通道桥接运行时
- ssh crate:SshConnectConfig 增加 x11_forwarding 开关;连接建立时探测
  本机 X server(DISPLAY 缺失时回退 launchctl getenv DISPLAY),失败
  仅告警降级;RusshHandler 实现 server_channel_open_x11,校验 fake
  cookie 后换成本机真实 cookie 再桥接,未校验字节不到达本机 X server
- terminal:交互 shell 在 pty 之后、shell 之前发送 x11-req,服务端拒绝
  (如未开 X11Forwarding)时撤销授权并告警,不影响终端使用
- 连接配置与 SSH 表单新增 X11 转发开关(en/zh-CN/zh-HK),sftp/隧道等
  非交互连接固定关闭
2026-07-23 21:03:53 +08:00
胡飞 55a4ee25c0 fix(ci): isolate ssh key discovery tests 2026-07-19 06:25:59 +08:00
胡飞 8ef141fde6 fix(ci): remove remaining platform assumptions 2026-07-19 03:15:57 +08:00
胡飞 71692c5a4a fix(ssh): add transparent legacy kex fallback 2026-07-16 21:44:51 +08:00
胡飞 ef04fb8877 fix(port-forwarding): keep tunnels alive and record traffic 2026-07-13 17:46:54 +08:00
胡飞 e00821404a fix(port-forwarding): polish activity and shutdown 2026-07-13 14:28:52 +08:00
胡飞 382ce6007b feat: 支持数据库远程桌面代理与终端 profile 2026-07-11 07:01:47 +08:00
胡飞 20ac487e13 feat(proxy): 添加通用本地代理隧道 2026-07-10 22:55:21 +08:00
胡飞 eb83634037 feat: support synced ssh private key content 2026-07-07 11:25:10 +08:00
胡飞 0933290cd6 Add port forwarding connections 2026-06-22 08:04:10 +08:00
胡飞 c9f96c4324 feat(ssh): 支持keyboard-interactive多因素认证(MFA)并在跳板机登录中集成
- 在ssh连接配置中添加keyboard_interactive_responder字段支持MFA回调
- 实现keyboard-interactive认证流程,包括提示请求与响应处理逻辑
- 扩展ssh认证策略自动判断并支持keyboard-interactive认证
- 新增多语言支持,增加MFA相关的国际化文案
- 在跳板机认证中集成MFA支持,UI新增跳板机MFA表单填写界面
- 跳板机MFA表单支持动态请求提示和用户输入响应管理
- 添加跳板机MFA验证结果标记和表单错误处理逻辑
- 测试覆盖keyboard-interactive认证流程及响应处理器行为
- 更新相关依赖,支持异步trait以实现响应器接口异步处理
2026-04-30 13:27:07 +08:00
胡飞 672ee64b2f feat(db): 为 ClickHouse、DuckDB 和 MSSQL 添加完整的 UI manifest 支持
- 为 ClickHouse 插件实现 UI manifest,包括连接表单、数据库表单和操作清单
- 为 DuckDB 插件实现 UI manifest,支持默认数据库路径和全面的操作定义
- 为 MSSQL 插件实现 UI manifest,增加连接、数据库、模式表单和丰富的数据库操作
- 使用 LazyLock 延迟初始化 UI manifest,提升访问性能
- 添加相关测试覆盖,验证各数据库插件 UI manifest 的正确性
- 引入 manifest_helpers 辅助宏和类型,规范表单字段及操作配置
- 点击引擎类型列表和数据库表单支持多种属性及条件可视化配置
- 各数据库插件新增 ui_manifest() 和 engines() 方法接口实现
2026-04-22 13:34:18 +08:00
胡飞 23fd199eac fix(ssh): 修复 publickey 认证参数传递错误
- 将 authenticate_publickey_with 方法中 identity 参数改为公钥所有权的拷贝
- 修正可能导致认证失败的参数使用错误
2026-04-21 15:34:12 +08:00
胡飞 df793137bf fix(ssh): 修复 ssh 公钥认证和代理连接问题
- 修正 authenticate_publickey_with 函数调用,使用正确的公钥所有权传递
- 修复 connect_agent_client 调用,简化命名空间引用
- 更新依赖库版本,多项安全性和性能改进
- 移除以及合并部分重复或过时的依赖项,优化依赖管理
- 升级多项加密相关的依赖库,提升加密算法支持与稳定性
- 修复因依赖版本不一致导致的兼容性问题
2026-04-21 10:58:50 +08:00
胡飞 3a863937e1 refactor(ssh): 优化会话管理,添加轻量探活与shell集成缓存
- 在 SessionPool 中增加 ping 探活机制,避免频繁连接失败
- 实现连接共享和并发连接请求合并,减少资源浪费
- 对会话管理增加 shell integration 结果缓存,提高交互效率
- 增加 ping 超时和失败处理,自动断线重连
- 将 russh 默认超时和心跳参数集中为常量,提高代码一致性
- 为 RusshClient 添加异步 ping 方法并支持超时控制
- SSH 终端后端增加 shell integration 安装步骤,支持超时和失败降级
- 优化 shell integration 安装失败后的错误日志,增加脚本上下文输出
- 新增多项单元测试覆盖会话缓存、断线重连、并发连接合并等场景
- 连接时遇到 channel open 错误自动重连,提升稳定性与容错率
2026-04-18 09:54:51 +08:00
胡飞 5bd7ddb20f refactor(ssh): 引入 SshSessionManager 实现会话复用管理
- 新增 SshSessionManager 及其内部 SessionPool,实现共享 SSH 连接的创建、复用与失效
- RusshClient 实现 SharedSessionClient,支持检查连接状态与断开连接
- 修改 RusshSftpClient 支持基于共享 RusshClient 创建连接,改用 SessionOwner 枚举管理所有权
- 终端组件中使用 SshSessionManager 替代直接连接 RusshClient,实现连接复用
- 文件管理器面板改用共享的 SshSessionManager,简化连接创建逻辑
- 服务器监控面板改用 SshSessionManager 管理 SSH 连接,优化重连与状态刷新流程
- ssh 库导出并使用 SshSessionManager,封装连接逻辑,提升整体资源利用效率
- 细节调整:代码格式规范与注释优化,保证所有异步调用均正确异步执行
2026-04-17 12:41:18 +08:00
胡飞 2e73467b94 fix: unblock release pipeline 2026-04-04 15:32:03 +08:00
胡飞 b8cfb8dd31 refactor(db): 优化代码结构及格式规范一致性调整
- 统一集合与导入语句顺序和格式
- 精简表设计中索引和列定义为单行
- 调整SQL语句多行闭包和方法链格式保持一致
- 优化部分正则表达式初始化代码格式
- 修正代码注释和换行以提升阅读性
- 统一表单字段结构定义格式,避免多余换行
- 优化缓存相关代码的条件写法可读性提升
- 新增数据库插件中多条SQL语句拆分及EXPLAIN语句构建逻辑
- 调整消息渲染中变量声明缩进和链式调用格式
- 统一界面组件构建中复杂表达式的换行样式
- 删除多余代码块空行和提升代码一致性
- 优化测试用例中断言格式规范
2026-04-01 22:06:21 +08:00
DurianPankek 99f7e7b620 Merge remote-tracking branch 'upstream/dev' into feature/ssh-auto-publickey-auth 2026-03-26 10:59:57 +08:00
胡飞 579dd9c3bd fix(build): 修复 build.rs 和 ssh.rs 的 Clippy lint 警告
- 将 crates/core/build.rs 与 main/build.rs 中嵌套 if 改写为 let-chain 形式,消除 collapsible_if 警告
- 对 ssh.rs 中仅用于 Unix 测试的辅助代码和导入添加 #[cfg(unix)] 条件编译,避免 Windows 测试下 unused/dead code
- 移除 ssh.rs 中对 Copy 类型 hash_alg 的不必要 clone,消除 clone_on_copy 警告
- 保持现有测试逻辑及环境变量导出行为不变,遵循最小变更原则修复 lint
- 本地测试通过,相关 lint 警告消除,避免后续失败
2026-03-26 10:39:57 +08:00