Repository navigation
Conversation
… FFI Adds an optional Tailcat SSH route mode backed by upstream tailscale/tailcat (cmd/libtailcat C ABI v1) via dart:ffi instead of an iOS-only Swift bridge or mobile Linux ProxyCommand. Reuses ServerBox's existing SSHClient auth, SFTP/SCP, port forwarding, HostKeyVerifier, and probeHostKey. - Model & storage (schema v47 -> v48, olderBuildsRead: true): add nullable tailcatAddress and tailcatDerpMapUrl on SshCredential and server table; enforce mutual exclusivity with jump, proxy, ProxyCommand, and Mosh; redact secret Tailcat addresses in displayAddr, crumbs, logs, and errors. - Transport: implement zero-pubspec-change dart:ffi bindings for libtailcat ABI v1 and isolate-backed TailcatSocket (SSHSocket), wired into genClient and probeHostKey. - UI & build tooling: add Tailcat route segment to ServerEditPage with obscured secret input (AppAuth-protected reveal) and cross-platform build script tools/tailcat-lib/build.sh. Co-authored-by: OpenBot <335604065+openbotgit[bot]@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
CLA signedEveryone who authored a commit here has signed the Contributor License Agreement. Thank you. |
CI failure root-cause analysisThe CI job is marked as a CLA failure, but no structured diagnostics were provided. The underlying cause cannot be determined from the available evidence. Verifiable fix Inspect the job's full log or CLA check details to identify the required action (for example, signing the contributor license agreement), then rerun the check. Incremental value: root cause, verifiable fix; confidence 96%. Passing CI ≠ absence of defects (§29.4). |
|
I have read the CLA Document and I hereby sign the CLA |
What this changes
Adds an optional, cross-platform Tailcat SSH route mode (
Direct | Jump | Proxy | Command | Tailcat) backed by upstreamgithub.com/tailscale/tailcat's versioned C ABI (cmd/libtailcat, ABI v1) viadart:ffi.Related to #2040 — addresses the cross-platform requirement without an iOS-only Swift bridge, CocoaPods dependency, mobile Linux rootfs download, or Tailscale account/system VPN. (Cross-platform userspace Tailscale multi-account support is intentionally out of scope for this PR.)
SchemaVersionv47 → v48,olderBuildsRead: true):tailcatAddressandtailcatDerpMapUrlfields toSshCredential(lib/data/model/server/ssh_credential.dart) and nullable columnsssh_tailcat_address/ssh_tailcat_derp_map_urlto theservertable (lib/data/store/db.dart,lib/data/store/server.dart,lib/data/store/migrations/m047_ssh_tailcat.dart).SpiValidationError.tailcatConflictso Tailcat is mutually exclusive with jump servers, SSH proxies, andProxyCommand, and disabled Mosh when Tailcat is active.tc...addresses fromSpix.displayAddr,TailcatSocket.toString(), diagnostic crumbs, and error messages.lib/core/ssh/tailcat_ffi.dart,lib/core/ssh/tailcat_socket.dart):pubspecdart:ffibindings to upstreamlibtailcatABI v1 (tc_abi_version == 1).TailcatSocket implements SSHSocketusing off-UI-thread dialing (Isolate.run), dedicated reader/writer isolates, TCP half-close, boundedtc_drain, and immediate interrupt-on-close (tc_close).genClient(lib/core/ssh/client.dart) andprobeHostKey(lib/core/ssh/host_key_probe.dart) so existing SSH auth,HostKeyVerifier,HostCertAuthority, SFTP/SCP, port forwarding, and terminal sessions work unchanged without silent fallback to direct TCP.lib/view/page/server/edit/,lib/l10n/app_en.arb):22, User defaults toroot), and an obscured Tailcat address input (protected by_revealStored/AppAuth) plus an optional custom DERP map URL input are shown.tools/tailcat-lib/build.sh,tools/tailcat-lib/README.md):cmd/libtailcatacross macOS, Linux, Windows, Android (jniLibs), and iOS (CTailcat.xcframework), with zero forked Go code. Whenlibtailcatis not bundled, all existing connection types continue to work untouched and Tailcat connections report a clearSSHErr.Open questions before marking Ready for Review
libtailcatbinaries (similar topackages/fl_tty/scripts/ensure-iul-libs.sh) or buildcmd/libtailcatin CI workflows?CTailcat.xcframework/ AndroidjniLibswiring be added in this PR or a follow-up packaging PR once the Dart transport & UI land?How it was tested
dart analyzeon all 19 modified/added handwritten Dart files and new tests: No issues found.flutter test --no-pub --concurrency=1across 11 migration suites (m028–m047),proxy_socket_test.dart,server_edit_tailcat_test.dart,server_edit_ssh_route_test.dart, andserver_edit_connection_test.dart: 112 passed.test/unit/ssh/tailcat_socket_test.dartagainst compiled macOSlibtailcat.dylibfrom upstreamtailscale/tailcat@9245129f+ local loopback DERP/STUN relay + real Go Ed25519 SSH server): 9/9 passed, verifyingtc_address_parse, bidirectional WireGuard/DERP TCP streaming, half-close,probeHostKey, and fullgenClient+HostKeyVerifierSSH handshake.sh -n tools/tailcat-lib/build.shandgit diff --check: clean.iOS Linux engine,macOS build,Windows buildinanalysis.yml) were not needed for this pure-Dart + build-script diff (ios/,macos/,windows/,pubspec.*,crates/,packages/,hook/are unchanged). iOSCTailcat.xcframeworkand AndroidjniLibspackaging have not been built/tested on-device yet.Checklist
dart analyzeand targetedflutter testsuites pass (full CI suite pending on PR)build_runnerandflutter gen-l10nwere run forssh_credential.dart,db.dart, andapp_en.arbcargo test --workspacepasses (not applicable — nothing undercrates/ormonitor/changed)