Compare commits

..

54 Commits

Author SHA1 Message Date
DuProcess be98fb8d91 Harden release artifact verification
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-13 01:03:16 -04:00
DuProcess 0125966d2a Drive SDK maintenance while receiving
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-13 00:58:54 -04:00
DuProcess 8b33a5d20b Retransmit stream controls in transport
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-13 00:51:09 -04:00
DuProcess bbf45db0f6 Retransmit stream window adjustments
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-13 00:43:39 -04:00
DuProcess d8cc462077 Retransmit stream close controls
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-13 00:37:30 -04:00
DuProcess 4954059c6e Retransmit stream EOF controls
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-13 00:32:19 -04:00
DuProcess b1cc6bf8ae Reset terminal modes before snapshot repaint
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-13 00:24:45 -04:00
DuProcess bf50b38ce2 Support stream EOF half closes
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-13 00:20:52 -04:00
DuProcess dccd648ac9 Handle overlapping stream receive chunks
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-13 00:05:30 -04:00
DuProcess 3ab314698b Split stream writes into packet chunks
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 23:59:42 -04:00
DuProcess c4301f192c Bound stream receive reordering window
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 23:48:46 -04:00
DuProcess 7ebc6533a7 Reject trailing bytes in protocol packets
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 23:42:00 -04:00
DuProcess e67e06ebb5 Clear service decoders on oversized frames
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 23:37:47 -04:00
DuProcess fbedd54eaa Make 1.0 checks run full soaks
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 23:34:22 -04:00
DuProcess 247a1669ce Align CI with release checks
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 23:31:16 -04:00
DuProcess de179dd3e9 Run all-target tests in release gates
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 23:28:34 -04:00
DuProcess 7184b42b7a Reconnect before stale terminal input
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 23:25:43 -04:00
DuProcess 17cc1f6131 Parse bracketed IPv6 file endpoints
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 23:18:31 -04:00
DuProcess 4b82334e02 Adapt runtime stream retransmit pacing
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 23:11:25 -04:00
DuProcess b9d8b32ff1 Adapt stream retransmit pacing to RTT
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 23:00:53 -04:00
DuProcess 52a319fe9d Preserve restored screen during ticket reattach
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 22:54:39 -04:00
DuProcess 6bca98d1ce Default missing config fields on upgrade
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 22:45:05 -04:00
DuProcess ab256285d1 Align Windows client auth defaults
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 22:41:48 -04:00
DuProcess b076a84dc7 Reject unsafe Windows update cache segments
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 22:37:51 -04:00
DuProcess c0b9e17214 Harden Unix update source cache path
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 22:35:16 -04:00
DuProcess 0bc2a05586 Preserve restored screen through update reattach
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 22:32:04 -04:00
DuProcess c29c43d4db Reuse Windows update source cache
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 22:20:35 -04:00
DuProcess 6f055e9fc1 Use effective artifact tag in update checks
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 22:13:36 -04:00
DuProcess 306a636e32 Mark RC Gitea releases as prereleases
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 22:09:19 -04:00
DuProcess a529061e58 Compare prerelease versions correctly for updates
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 22:05:21 -04:00
DuProcess 5a85e6508d Require checksums for prebuilt installers
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 22:00:01 -04:00
DuProcess efddd1544e Mark sessions empty on final client removal
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 21:55:50 -04:00
DuProcess 0a05c68e94 Arm wake repaint retry from input paths
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 21:51:02 -04:00
DuProcess 695f356411 Retry wake repaint after local sleep
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 21:47:02 -04:00
DuProcess fca1f9a08e Strip mouse reports unless a TUI owns them
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 21:42:17 -04:00
DuProcess 7f48af45cd Require complete release uploads by default
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 21:37:27 -04:00
DuProcess ae619c6a78 Skip stale latest prebuilts in installers
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 21:34:25 -04:00
DuProcess bea4674700 Prevent update from using stale latest release
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 21:30:14 -04:00
DuProcess c9332f707d Clarify update check when local is newer
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 21:25:42 -04:00
DuProcess d883e1cdb2 Cover health log trace selection
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 21:21:36 -04:00
DuProcess e061b11974 Keep reconnect health breadcrumbs
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 21:18:19 -04:00
DuProcess 0f2cb82be6 Trace reconnect failure reasons
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 21:11:49 -04:00
DuProcess f74495765f Retry wake repaint quickly
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 21:08:37 -04:00
DuProcess b2c407ab6e Publish complete release artifacts to Gitea
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / publish-gitea-release (push) Blocked by required conditions
ci / remote-bench (push) Waiting to run
2026-07-12 12:21:26 -04:00
DuProcess 4b9d05a185 Cover traced ticket reattach recovery
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / remote-bench (push) Waiting to run
2026-07-12 12:18:09 -04:00
DuProcess 3d5bb126c5 Trace ticket reattach recovery
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / remote-bench (push) Waiting to run
2026-07-12 12:15:25 -04:00
DuProcess 37632a96b7 Filter trace reports to latest run
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / remote-bench (push) Waiting to run
2026-07-12 12:09:37 -04:00
DuProcess e69be4fdf0 Reconnect before input after local sleep
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / remote-bench (push) Waiting to run
2026-07-12 12:01:46 -04:00
DuProcess fdbd58b628 Fetch remote server trace reports
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / remote-bench (push) Waiting to run
2026-07-12 11:55:23 -04:00
DuProcess c65aba9d7a Repaint terminal after local sleep
ci / test (push) Waiting to run
ci / fuzz-smoke (push) Waiting to run
ci / windows-client (push) Waiting to run
ci / package-release (linux-x86_64, ubuntu-latest) (push) Waiting to run
ci / package-release (macos-aarch64, macos-14) (push) Waiting to run
ci / package-release (macos-x86_64, macos-13) (push) Waiting to run
ci / package-release (windows-x86_64, windows-latest) (push) Waiting to run
ci / remote-bench (push) Waiting to run
2026-07-12 11:48:18 -04:00
DuProcess 818b481154 Cover terminal mouse input filtering
ci / test (push) Has been cancelled
ci / fuzz-smoke (push) Has been cancelled
ci / windows-client (push) Has been cancelled
ci / package-release (linux-x86_64, ubuntu-latest) (push) Has been cancelled
ci / package-release (macos-aarch64, macos-14) (push) Has been cancelled
ci / package-release (macos-x86_64, macos-13) (push) Has been cancelled
ci / package-release (windows-x86_64, windows-latest) (push) Has been cancelled
ci / remote-bench (push) Has been cancelled
2026-07-12 01:08:38 -04:00
DuProcess 70650e221b Flag trace terminal input anomalies
ci / test (push) Has been cancelled
ci / fuzz-smoke (push) Has been cancelled
ci / windows-client (push) Has been cancelled
ci / package-release (linux-x86_64, ubuntu-latest) (push) Has been cancelled
ci / package-release (macos-aarch64, macos-14) (push) Has been cancelled
ci / package-release (macos-x86_64, macos-13) (push) Has been cancelled
ci / package-release (windows-x86_64, windows-latest) (push) Has been cancelled
ci / remote-bench (push) Has been cancelled
2026-07-12 01:04:37 -04:00
DuProcess 01e8870578 Add trace report summarizer
ci / test (push) Has been cancelled
ci / fuzz-smoke (push) Has been cancelled
ci / windows-client (push) Has been cancelled
ci / package-release (linux-x86_64, ubuntu-latest) (push) Has been cancelled
ci / package-release (macos-aarch64, macos-14) (push) Has been cancelled
ci / package-release (macos-x86_64, macos-13) (push) Has been cancelled
ci / package-release (windows-x86_64, windows-latest) (push) Has been cancelled
ci / remote-bench (push) Has been cancelled
2026-07-12 00:59:15 -04:00
DuProcess 99d54899bd Add trace command for reconnect debugging
ci / test (push) Has been cancelled
ci / fuzz-smoke (push) Has been cancelled
ci / windows-client (push) Has been cancelled
ci / package-release (linux-x86_64, ubuntu-latest) (push) Has been cancelled
ci / package-release (macos-aarch64, macos-14) (push) Has been cancelled
ci / package-release (macos-x86_64, macos-13) (push) Has been cancelled
ci / package-release (windows-x86_64, windows-latest) (push) Has been cancelled
ci / remote-bench (push) Has been cancelled
2026-07-12 00:52:47 -04:00
22 changed files with 6351 additions and 519 deletions
+40 -1
View File
@@ -15,8 +15,14 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- name: Format check
run: cargo fmt -- --check
- name: Shell syntax check
run: sh -n install.sh scripts/*.sh
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Test
run: cargo test
run: cargo test --all-targets
- name: TUI harness
run: sh scripts/tui-harness.sh
- name: Build release
run: cargo build --release
- name: Docker SSH benchmark gate
@@ -86,6 +92,39 @@ jobs:
target/dosh-release/dosh-*
!target/dosh-release/stage/**
publish-gitea-release:
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags/')
needs: package-release
runs-on: ubuntu-latest
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_URL: ${{ secrets.GITEA_URL || 'https://git.palav.dev' }}
GITEA_REPO: ${{ secrets.GITEA_REPO || 'Palav/dosh' }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: dosh-*
path: target/dosh-release
merge-multiple: true
- name: Verify release artifacts
run: sh scripts/verify-release-artifacts.sh
- name: Skip Gitea upload without token
if: env.GITEA_TOKEN == ''
run: echo "GITEA_TOKEN secret is not configured; release artifacts were verified but not uploaded."
- name: Upload Gitea release assets
if: env.GITEA_TOKEN != ''
run: |
set -eu
case "$GITHUB_REF" in
refs/tags/*) tag="${GITHUB_REF_NAME}" ;;
*)
version="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | sed -n '1p')"
tag="v$version"
;;
esac
scripts/upload-gitea-release.sh "$tag"
remote-bench:
runs-on: ubuntu-latest
env:
Generated
+1 -1
View File
@@ -436,7 +436,7 @@ dependencies = [
[[package]]
name = "dosh"
version = "1.0.0-rc29"
version = "1.0.0-rc42"
dependencies = [
"anyhow",
"base64",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "dosh"
version = "1.0.0-rc29"
version = "1.0.0-rc42"
edition = "2024"
license = "MIT"
+4 -4
View File
@@ -4,7 +4,7 @@ build:
cargo build --release
test:
cargo test
cargo test --all-targets
fmt:
cargo fmt
@@ -16,18 +16,18 @@ release-check:
cargo fmt --check
sh -n install.sh scripts/*.sh
cargo clippy --all-targets -- -D warnings
cargo test
cargo test --all-targets
$(MAKE) tui-harness
1.0-check: release-check reconnect-check hostile-network-check persistence-check package-check
reconnect-check:
cargo test --test integration_smoke resume_updates_udp_endpoint_for_roaming -- --nocapture
DOSH_SOAK_SECONDS=$${DOSH_SOAK_SECONDS:-300} cargo test --test integration_smoke sleep_roaming_soak_30m -- --ignored --nocapture
DOSH_SOAK_SECONDS=$${DOSH_SOAK_SECONDS:-1800} cargo test --test integration_smoke sleep_roaming_soak_30m -- --ignored --nocapture
hostile-network-check:
cargo test --test hostile_network -- --nocapture
DOSH_BADNET_SOAK_SECONDS=$${DOSH_BADNET_SOAK_SECONDS:-300} cargo test --test hostile_network bad_network_tui_work_soak_30m -- --ignored --nocapture
DOSH_BADNET_SOAK_SECONDS=$${DOSH_BADNET_SOAK_SECONDS:-1800} cargo test --test hostile_network bad_network_tui_work_soak_30m -- --ignored --nocapture
persistence-check:
cargo test --test integration_smoke session_survives_server_restart_same_shell_and_screen -- --nocapture
+18 -4
View File
@@ -73,12 +73,26 @@ File copy must be enabled by the server config.
For terminal/reconnect bugs, run a client with:
```sh
DOSH_TRACE=/tmp/dosh-client.log DOSH_TRACE_BYTES=1 dosh HOST
dosh trace HOST
```
Set `DOSH_TRACE=/tmp/dosh-server.log` on `dosh-server` for matching server
events. `DOSH_TRACE_BYTES=1` records byte prefixes, so use it only for short
reproductions.
The client log path is printed before the session starts. To choose it:
```sh
dosh trace --client-log /tmp/dosh-client.log HOST
```
Summarize collected traces with:
```sh
dosh trace report HOST --client-log /tmp/dosh-client.log
```
When `HOST` is given, Dosh fetches `/tmp/dosh-server.log` over SSH before
building the report. Set `DOSH_TRACE=/tmp/dosh-server.log` on `dosh-server` for
matching server events. Reports default to the latest traced client/server
process run; add `--all-runs` to include older appended log entries. Trace byte
prefixes are enabled for `dosh trace`, so use it only for short reproductions.
## VS Code
+192 -9
View File
@@ -11,6 +11,7 @@ param(
[string]$BinaryBase = $env:DOSH_BINARY_BASE,
[string]$BinaryName = $env:DOSH_BINARY_NAME,
[string]$BinaryVersion = $(if ($env:DOSH_BINARY_VERSION) { $env:DOSH_BINARY_VERSION } else { "latest" }),
[string]$UpdateCache = $(if ($env:DOSH_UPDATE_CACHE) { $env:DOSH_UPDATE_CACHE } else { Join-Path $HOME ".cache\dosh\source" }),
[switch]$BinaryRequired = $($env:DOSH_BINARY_REQUIRED -and $env:DOSH_BINARY_REQUIRED -ne "0"),
[switch]$ForceConfig
)
@@ -100,14 +101,127 @@ function Release-LatestTagDownloadUrl {
return $null
}
function Version-Core($Value) {
$base = $Value.TrimStart("v").Split("+")[0]
$base.Split("-")[0]
}
function Version-Prerelease($Value) {
$base = $Value.TrimStart("v").Split("+")[0]
$dash = $base.IndexOf("-")
if ($dash -lt 0) {
return ""
}
$base.Substring($dash + 1).ToLowerInvariant()
}
function Version-Parts($Value) {
[regex]::Matches((Version-Core $Value), "\d+") | ForEach-Object { [int64]$_.Value }
}
function Compare-Prerelease($Left, $Right) {
if (-not $Left -and -not $Right) {
return 0
}
if (-not $Left) {
return 1
}
if (-not $Right) {
return -1
}
if ($Left -eq $Right) {
return 0
}
if ($Left -match "(?i)^rc(\d+)$" -and $Right -match "(?i)^rc(\d+)$") {
$leftRc = [int64]([regex]::Match($Left, "(?i)^rc(\d+)$").Groups[1].Value)
$rightRc = [int64]([regex]::Match($Right, "(?i)^rc(\d+)$").Groups[1].Value)
return $leftRc.CompareTo($rightRc)
}
return [string]::CompareOrdinal($Left, $Right)
}
function Compare-DoshVersion($Left, $Right) {
$leftParts = @(Version-Parts $Left)
$rightParts = @(Version-Parts $Right)
$width = [Math]::Max($leftParts.Count, $rightParts.Count)
for ($i = 0; $i -lt $width; $i++) {
$l = if ($i -lt $leftParts.Count) { $leftParts[$i] } else { 0 }
$r = if ($i -lt $rightParts.Count) { $rightParts[$i] } else { 0 }
if ($l -lt $r) { return -1 }
if ($l -gt $r) { return 1 }
}
return Compare-Prerelease (Version-Prerelease $Left) (Version-Prerelease $Right)
}
function Current-SourceVersion {
if (Test-Path "Cargo.toml") {
$raw = Get-Content "Cargo.toml" -Raw
} else {
$web = Repo-WebBase $Repo
if (-not $web) {
return $null
}
try {
$raw = (Invoke-WebRequest -UseBasicParsing -Uri "$web/raw/branch/main/Cargo.toml").Content
}
catch {
return $null
}
}
if ($raw -match '(?m)^version = "([^"]+)"') {
return $Matches[1]
}
return $null
}
function Latest-ReleaseTag {
$web = Repo-WebBase $Repo
if (-not $web) {
return $null
}
try {
$response = Invoke-WebRequest -UseBasicParsing -Uri "$web/releases/latest" -MaximumRedirection 5
$effective = $null
if ($response.BaseResponse.ResponseUri) {
$effective = $response.BaseResponse.ResponseUri.AbsoluteUri
} elseif ($response.BaseResponse.RequestMessage -and $response.BaseResponse.RequestMessage.RequestUri) {
$effective = $response.BaseResponse.RequestMessage.RequestUri.AbsoluteUri
}
$prefix = "$web/releases/tag/"
if ($effective -and $effective.StartsWith($prefix)) {
return $effective.Substring($prefix.Length)
}
}
catch {
return $null
}
return $null
}
function Latest-ReleaseIsStale {
if ($BinaryUrl -or $BinaryBase -or $BinaryVersion -ne "latest") {
return $false
}
$latest = Latest-ReleaseTag
$current = Current-SourceVersion
if (-not $latest -or -not $current) {
return $false
}
$latestVersion = $latest.TrimStart("v")
if ((Compare-DoshVersion $latestVersion $current) -lt 0) {
Write-Warning "latest release $latestVersion is older than source $current; skipping stale prebuilt"
return $true
}
return $false
}
function Verify-ArchiveChecksum($Url, $Archive) {
$checksumPath = "$Archive.sha256"
try {
Invoke-WebRequest -UseBasicParsing -Uri "$Url.sha256" -OutFile $checksumPath
}
catch {
Write-Warning "prebuilt checksum unavailable; continuing without sidecar verification"
return
throw "prebuilt checksum unavailable; refusing unverified binary for $Url"
}
$expected = ((Get-Content $checksumPath -Raw).Trim() -split "\s+")[0].ToLowerInvariant()
$actual = (Get-FileHash -Algorithm SHA256 $Archive).Hash.ToLowerInvariant()
@@ -155,11 +269,44 @@ function Install-Binary($Source, $Destination) {
}
}
function Normalize-PathForCompare($Path) {
[System.IO.Path]::GetFullPath($Path).TrimEnd(
[System.IO.Path]::DirectorySeparatorChar,
[System.IO.Path]::AltDirectorySeparatorChar
)
}
function Assert-NoRelativePathSegments($Path) {
foreach ($segment in ($Path -split '[\\/]')) {
if ($segment -eq "." -or $segment -eq "..") {
throw "refusing unsafe update cache path: $Path"
}
}
}
function Assert-SafeUpdateCache($Path) {
if (-not $Path) {
throw "refusing unsafe update cache path: $Path"
}
Assert-NoRelativePathSegments $Path
$full = Normalize-PathForCompare $Path
$root = Normalize-PathForCompare ([System.IO.Path]::GetPathRoot($full))
$homePath = Normalize-PathForCompare $HOME
$homeCache = Normalize-PathForCompare (Join-Path $HOME ".cache")
if ($full -eq $root -or $full -eq $homePath -or $full -eq $homeCache) {
throw "refusing unsafe update cache path: $Path"
}
$full
}
$bindir = Join-Path $Prefix "bin"
$configDir = Join-Path $HOME ".config\dosh"
New-Item -ItemType Directory -Force -Path $bindir, $configDir | Out-Null
function Install-Prebuilt {
if (Latest-ReleaseIsStale) {
return $false
}
$url = Release-LatestTagDownloadUrl
if (-not $url) {
$url = Release-DownloadUrl
@@ -200,7 +347,6 @@ function Install-Prebuilt {
function Install-FromSource {
Require-Command cargo
$tmp = $null
if (Test-Path "Cargo.toml") {
$src = (Get-Location).Path
} else {
@@ -208,9 +354,20 @@ function Install-FromSource {
throw "DOSH_REPO is required when running the installer from irm/iex"
}
Require-Command git
$tmp = Join-Path ([System.IO.Path]::GetTempPath()) ("dosh-" + [guid]::NewGuid())
git clone --depth 1 $Repo $tmp | Out-Null
$src = $tmp
$sourceCache = Assert-SafeUpdateCache $UpdateCache
$parent = Split-Path -Parent $sourceCache
New-Item -ItemType Directory -Force -Path $parent | Out-Null
if (Test-Path (Join-Path $sourceCache ".git")) {
git -C $sourceCache remote set-url origin $Repo
git -C $sourceCache fetch --depth 1 origin main
git -C $sourceCache checkout -q -B main FETCH_HEAD
} else {
if (Test-Path $sourceCache) {
Remove-Item -Recurse -Force $sourceCache
}
git clone --depth 1 --branch main $Repo $sourceCache | Out-Null
}
$src = $sourceCache
}
try {
@@ -222,9 +379,6 @@ function Install-FromSource {
}
finally {
Pop-Location
if ($tmp) {
Remove-Item -Recurse -Force $tmp
}
}
}
@@ -261,10 +415,38 @@ predict = true
predict_mode = "experimental"
cache_attach_tickets = true
credential_cache = "~/.local/share/dosh/credentials"
auth_preference = "native,ssh"
trust_on_first_use = false
native_auth_timeout_ms = 700
known_hosts = "~/.config/dosh/known_hosts"
identity_files = ["~/.ssh/id_ed25519"]
use_ssh_agent = true
forward_agent = false
escape_key = "^]"
"@ | Set-Content -NoNewline -Encoding utf8 $clientConfig
}
$hostsConfig = Join-Path $configDir "hosts.toml"
if ($ForceConfig -or -not (Test-Path $hostsConfig)) {
$defaultServer = if ($Server) { $Server } else { "user@example.com" }
$hostUdp = if ($DoshHost) { $DoshHost } else { $defaultServer }
@"
# Example:
# [server]
# ssh = "server"
# dosh_host = "server.example.com"
# port = 50000
# default_command = "tm"
# predict = true
[default]
ssh = "$defaultServer"
dosh_host = "$hostUdp"
port = $Port
predict = true
"@ | Set-Content -NoNewline -Encoding utf8 $hostsConfig
}
$userPath = [Environment]::GetEnvironmentVariable("Path", "User")
if (-not (($userPath -split ';') -contains $bindir)) {
[Environment]::SetEnvironmentVariable("Path", "$userPath;$bindir", "User")
@@ -281,5 +463,6 @@ Write-Host " $bindir\dosh.exe update --check"
Write-Host ""
Write-Host "Client config:"
Write-Host " $configDir\client.toml"
Write-Host " $configDir\hosts.toml"
Write-Host ""
Write-Host "Open a new terminal for PATH changes to apply."
+144 -8
View File
@@ -119,6 +119,37 @@ need() {
fi
}
normalize_update_cache_path() {
case "$1" in
/*) printf '%s\n' "$1" ;;
*) printf '%s\n' "$(pwd)/$1" ;;
esac | sed 's#//*#/#g; s#/$##'
}
safe_update_cache_path() {
raw="$1"
if [ -z "$raw" ]; then
echo "refusing unsafe update cache path: $raw" >&2
exit 2
fi
case "$raw" in
"."|".."|./*|../*|*/.|*/..|*/./*|*/../*)
echo "refusing unsafe update cache path: $raw" >&2
exit 2
;;
esac
normalized="$(normalize_update_cache_path "$raw")"
home_norm="$(normalize_update_cache_path "$HOME")"
home_cache_norm="$(normalize_update_cache_path "$HOME/.cache")"
case "$normalized" in
""|"/"|"$home_norm"|"$home_cache_norm")
echo "refusing unsafe update cache path: $raw" >&2
exit 2
;;
esac
printf '%s\n' "$normalized"
}
ensure_cargo() {
if command -v cargo >/dev/null 2>&1; then
return
@@ -222,6 +253,113 @@ release_latest_tag_download_url() {
esac
}
version_core() {
value="${1#v}"
value="${value%%+*}"
printf '%s\n' "${value%%-*}"
}
version_prerelease() {
value="${1#v}"
value="${value%%+*}"
case "$value" in
*-*) printf '%s\n' "${value#*-}" ;;
*) printf '\n' ;;
esac
}
version_core_part() {
version="$1"
index="$2"
version_core "$version" \
| sed 's/[^0-9][^0-9]*/ /g' \
| awk -v index="$index" '{ value=$index; if (value == "") value=0; print value }'
}
prerelease_less_than() {
left="$1"
right="$2"
if [ -z "$left" ] && [ -z "$right" ]; then
return 1
fi
if [ -z "$left" ]; then
return 1
fi
if [ -z "$right" ]; then
return 0
fi
if [ "$left" = "$right" ]; then
return 1
fi
left_rc="$(printf '%s\n' "$left" | sed -n 's/^[Rr][Cc]\([0-9][0-9]*\)$/\1/p')"
right_rc="$(printf '%s\n' "$right" | sed -n 's/^[Rr][Cc]\([0-9][0-9]*\)$/\1/p')"
if [ -n "$left_rc" ] && [ -n "$right_rc" ]; then
[ "$left_rc" -lt "$right_rc" ]
return
fi
first="$(printf '%s\n%s\n' "$left" "$right" | LC_ALL=C sort | sed -n '1p')"
[ "$first" = "$left" ]
}
version_less_than() {
left="$1"
right="$2"
for index in 1 2 3 4 5 6 7 8; do
lpart="$(version_core_part "$left" "$index")"
rpart="$(version_core_part "$right" "$index")"
if [ "$lpart" -lt "$rpart" ]; then
return 0
fi
if [ "$lpart" -gt "$rpart" ]; then
return 1
fi
done
prerelease_less_than "$(version_prerelease "$left")" "$(version_prerelease "$right")"
}
current_source_version() {
if [ -f Cargo.toml ]; then
sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | sed -n '1p'
return 0
fi
[ -n "$repo" ] || return 1
web_base="$(repo_web_base "$repo")" || return 1
curl -fsSL "$web_base/raw/branch/main/Cargo.toml" 2>/dev/null \
| sed -n 's/^version = "\(.*\)"/\1/p' \
| sed -n '1p'
}
latest_release_tag() {
[ -n "$repo" ] || return 1
web_base="$(repo_web_base "$repo")" || return 1
latest_url="$(curl -fsSL -o /dev/null -w '%{url_effective}' "$web_base/releases/latest" 2>/dev/null || true)"
case "$latest_url" in
"$web_base"/releases/tag/*)
tag="${latest_url##"$web_base"/releases/tag/}"
[ -n "$tag" ] || return 1
printf '%s\n' "$tag"
;;
*)
return 1
;;
esac
}
latest_release_is_stale() {
if [ -n "$binary_url" ] || [ -n "$binary_base" ] || [ "$binary_version" != "latest" ]; then
return 1
fi
latest="$(latest_release_tag || true)"
current="$(current_source_version || true)"
[ -n "$latest" ] && [ -n "$current" ] || return 1
latest="${latest#v}"
if version_less_than "$latest" "$current"; then
echo "latest release $latest is older than source $current; skipping stale prebuilt" >&2
return 0
fi
return 1
}
find_extracted_binary() {
find "$1" -type f -name "$2" 2>/dev/null | sed -n '1p'
}
@@ -263,8 +401,8 @@ verify_archive_checksum() {
archive="$2"
checksum_file="$3"
if ! curl -fsL "$url.sha256" -o "$checksum_file"; then
echo "prebuilt checksum unavailable; continuing without sidecar verification" >&2
return 0
echo "prebuilt checksum unavailable; refusing unverified binary for $url" >&2
return 1
fi
expected="$(awk '{print $1}' "$checksum_file" | sed -n '1p')"
actual="$(sha256_file "$archive")" || {
@@ -312,6 +450,9 @@ verify_archive_version() {
}
try_install_prebuilt() {
if latest_release_is_stale; then
return 1
fi
download_url="$(release_latest_tag_download_url || release_download_url)" || return 1
tmpdir="$(mktemp -d)"
archive="$tmpdir/$(release_artifact_name)"
@@ -356,12 +497,7 @@ install_from_source() {
echo "DOSH_REPO or --repo is required when running the installer from curl" >&2
exit 2
fi
case "$update_cache" in
""|"/"|"$HOME"|"$HOME/"|"$HOME/.cache")
echo "refusing unsafe update cache path: $update_cache" >&2
exit 2
;;
esac
update_cache="$(safe_update_cache_path "$update_cache")"
need git
mkdir -p "$(dirname "$update_cache")"
if [ -d "$update_cache/.git" ]; then
+52 -1
View File
@@ -11,6 +11,8 @@ Environment:
GITEA_REPO owner/repo, default Palav/dosh
GITEA_TOKEN Token with release write permission
GITEA_TITLE Release title, default TAG
DOSH_RELEASE_ALLOW_PARTIAL=1
Allow uploading an incomplete platform set. Default: refuse.
EOF
}
@@ -31,6 +33,11 @@ repo="${GITEA_REPO:-Palav/dosh}"
token="${GITEA_TOKEN:-}"
title="${GITEA_TITLE:-$tag}"
expected_version="${tag#v}"
allow_partial="${DOSH_RELEASE_ALLOW_PARTIAL:-0}"
release_prerelease=false
case "$expected_version" in
*-*) release_prerelease=true ;;
esac
artifact_version() {
artifact="$1"
@@ -80,6 +87,42 @@ if [ "$#" -eq 0 ]; then
done
fi
require_complete_release_artifacts() {
[ "$allow_partial" = "1" ] && return 0
missing=0
for required in \
dosh-linux-x86_64.tar.gz \
dosh-macos-aarch64.tar.gz \
dosh-macos-x86_64.tar.gz \
dosh-windows-x86_64.zip; do
found=0
checksum_found=0
for artifact in "$@"; do
name="$(basename "$artifact")"
if [ "$name" = "$required" ]; then
found=1
fi
if [ "$name" = "$required.sha256" ]; then
checksum_found=1
fi
done
if [ "$found" -ne 1 ]; then
echo "missing required release artifact: $required" >&2
missing=1
fi
if [ "$checksum_found" -ne 1 ]; then
echo "missing required release checksum: $required.sha256" >&2
missing=1
fi
done
if [ "$missing" -ne 0 ]; then
echo "refusing partial release upload; set DOSH_RELEASE_ALLOW_PARTIAL=1 to override" >&2
exit 1
fi
}
require_complete_release_artifacts "$@"
api="$base/api/v1/repos/$repo"
auth_header="Authorization: token $token"
@@ -92,7 +135,7 @@ elif [ -n "$release_json" ]; then
fi
if [ -z "$release_id" ]; then
payload="$(printf '{"tag_name":"%s","target_commitish":"main","name":"%s","body":"Dosh release %s","draft":false,"prerelease":false}\n' "$tag" "$title" "$tag")"
payload="$(printf '{"tag_name":"%s","target_commitish":"main","name":"%s","body":"Dosh release %s","draft":false,"prerelease":%s}\n' "$tag" "$title" "$tag" "$release_prerelease")"
release_json="$(curl -fsS -H "$auth_header" -H 'Content-Type: application/json' -X POST "$api/releases" -d "$payload")"
if command -v jq >/dev/null 2>&1; then
release_id="$(printf '%s\n' "$release_json" | jq -r '.id // empty')"
@@ -106,6 +149,14 @@ if [ -z "$release_id" ]; then
exit 1
fi
metadata_payload="$(printf '{"name":"%s","body":"Dosh release %s","draft":false,"prerelease":%s}\n' "$title" "$tag" "$release_prerelease")"
curl -fsS \
-H "$auth_header" \
-H 'Content-Type: application/json' \
-X PATCH \
"$api/releases/$release_id" \
-d "$metadata_payload" >/dev/null
delete_existing_asset() {
name="$1"
if ! command -v jq >/dev/null 2>&1; then
+74 -1
View File
@@ -22,10 +22,74 @@ artifact_version() {
esac
}
archive_contains() {
artifact="$1"
member="$2"
case "$artifact" in
*.tar.gz)
tar -tzf "$artifact" "$member" >/dev/null 2>&1
;;
*.zip)
unzip -Z1 "$artifact" 2>/dev/null | grep -Fx "$member" >/dev/null 2>&1
;;
*)
return 1
;;
esac
}
expected_members() {
artifact_name="$(basename -- "$1")"
case "$artifact_name" in
dosh-windows-*.zip)
cat <<EOF
dosh/VERSION
dosh/bin/dosh.exe
dosh/bin/dosh-client.exe
dosh/bin/dosh-bench.exe
EOF
;;
dosh-*.tar.gz)
cat <<EOF
dosh/VERSION
dosh/bin/dosh
dosh/bin/dosh-client
dosh/bin/dosh-server
dosh/bin/dosh-auth
dosh/bin/dosh-bench
EOF
;;
*)
cat <<EOF
dosh/VERSION
EOF
;;
esac
}
checksum_value() {
artifact="$1"
if command -v sha256sum >/dev/null 2>&1; then
sha256sum "$artifact" | awk '{print $1}'
elif command -v shasum >/dev/null 2>&1; then
shasum -a 256 "$artifact" | awk '{print $1}'
else
return 1
fi
}
verify_checksum() {
artifact="$1"
checksum="$artifact.sha256"
expected="$(awk '{print $1; exit}' "$checksum")"
actual="$(checksum_value "$artifact" || true)"
[ -n "$actual" ] && [ "$actual" = "$expected" ]
}
if [ "$#" -gt 0 ]; then
artifacts="$*"
else
artifacts="$out_dir/dosh-linux-x86_64.tar.gz $out_dir/dosh-macos-aarch64.tar.gz $out_dir/dosh-windows-x86_64.zip"
artifacts="$out_dir/dosh-linux-x86_64.tar.gz $out_dir/dosh-macos-aarch64.tar.gz $out_dir/dosh-macos-x86_64.tar.gz $out_dir/dosh-windows-x86_64.zip"
fi
failed=0
@@ -38,12 +102,21 @@ for artifact in $artifacts; do
if [ ! -f "$artifact.sha256" ]; then
echo "missing release checksum: $artifact.sha256" >&2
failed=1
elif ! verify_checksum "$artifact"; then
echo "release checksum mismatch: $artifact" >&2
failed=1
fi
actual="$(artifact_version "$artifact" || true)"
if [ "$actual" != "$version" ]; then
echo "artifact version mismatch: $artifact has ${actual:-unknown}, expected $version" >&2
failed=1
fi
for member in $(expected_members "$artifact"); do
if ! archive_contains "$artifact" "$member"; then
echo "artifact missing expected member: $artifact:$member" >&2
failed=1
fi
done
done
exit "$failed"
+2965 -126
View File
File diff suppressed because it is too large Load Diff
+1121 -76
View File
File diff suppressed because it is too large Load Diff
+62
View File
@@ -5,6 +5,7 @@ use std::fs;
use std::path::PathBuf;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(default)]
pub struct ServerConfig {
pub port: u16,
pub bind: String,
@@ -95,6 +96,7 @@ impl Default for ServerConfig {
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(default)]
pub struct ClientConfig {
pub update_repo: Option<String>,
pub update_port: Option<u16>,
@@ -330,3 +332,63 @@ pub fn expand_tilde(path: &str) -> PathBuf {
}
PathBuf::from(path)
}
#[cfg(test)]
mod tests {
use super::{ClientConfig, ServerConfig};
#[test]
fn old_client_configs_fill_new_fields_from_defaults() {
let raw = r#"
server = "palav"
dosh_port = 50000
"#;
let config: ClientConfig = toml::from_str(raw).expect("parse old client config");
assert_eq!(config.server, "palav");
assert!(config.predict);
assert_eq!(config.predict_mode, "experimental");
assert_eq!(config.auth_preference, "native,ssh");
assert_eq!(config.native_auth_timeout_ms, 700);
assert_eq!(config.known_hosts, "~/.config/dosh/known_hosts");
assert_eq!(config.identity_files, vec!["~/.ssh/id_ed25519"]);
assert!(config.use_ssh_agent);
assert!(!config.forward_agent);
assert!(config.disconnect_status);
assert_eq!(config.escape_key, "^]");
assert!(config.send_env.iter().any(|value| value == "TERM"));
}
#[test]
fn old_server_configs_fill_new_fields_from_defaults() {
let raw = r#"
port = 50000
"#;
let config: ServerConfig = toml::from_str(raw).expect("parse old server config");
assert_eq!(config.port, 50000);
assert_eq!(config.bind, "0.0.0.0");
assert_eq!(config.client_timeout_secs, 2_592_000);
assert_eq!(config.output_frame_interval_ms, 16);
assert!(config.native_auth);
assert_eq!(config.host_key, "~/.config/dosh/host_key");
assert!(
config
.authorized_keys
.iter()
.any(|path| path == "~/.ssh/authorized_keys")
);
assert_eq!(config.native_auth_rate_limit_per_minute, 30);
assert_eq!(config.rekey_after_packets, 100_000);
assert_eq!(config.rekey_after_secs, 3600);
assert!(config.allow_tcp_forwarding);
assert!(!config.allow_remote_forwarding);
assert!(!config.allow_agent_forwarding);
assert!(config.allow_file_transfer);
assert!(config.allow_exec_command);
assert!(config.persist_sessions);
assert!(config.accept_env.iter().any(|value| value == "TERM"));
}
}
+21
View File
@@ -32,6 +32,7 @@ impl FrameDecoder {
}
let len = u32::from_be_bytes(self.buf[..4].try_into().unwrap()) as usize;
if len > FRAME_MAX_LEN {
self.buf.clear();
bail!("exec protocol frame too large: {len} bytes");
}
if self.buf.len() < 4 + len {
@@ -69,3 +70,23 @@ fn encode_frame(payload: &[u8]) -> Result<Vec<u8>> {
out.extend_from_slice(payload);
Ok(out)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn oversized_frame_clears_decoder_state() {
let mut decoder = FrameDecoder::default();
let too_large = ((FRAME_MAX_LEN + 1) as u32).to_be_bytes();
assert!(decoder.push(&too_large).is_err());
let valid = encode_response(&ExecResponse::Exit { code: Some(0) }).unwrap();
let frames = decoder.push(&valid).unwrap();
assert_eq!(frames.len(), 1);
assert_eq!(
decode_response(&frames[0]).unwrap(),
ExecResponse::Exit { code: Some(0) }
);
}
}
+64
View File
@@ -123,6 +123,7 @@ impl FrameDecoder {
}
let len = u32::from_be_bytes(self.buf[..4].try_into().unwrap()) as usize;
if len > FRAME_MAX_LEN {
self.buf.clear();
bail!("file protocol frame too large: {len} bytes");
}
if self.buf.len() < 4 + len {
@@ -165,6 +166,12 @@ pub fn parse_copy_endpoint(raw: &str) -> CopyEndpoint {
if looks_like_windows_path(raw) {
return CopyEndpoint::Local(PathBuf::from(raw));
}
if let Some((host, path)) = parse_bracketed_remote_endpoint(raw) {
return CopyEndpoint::Remote { host, path };
}
if raw.starts_with('[') {
return CopyEndpoint::Local(PathBuf::from(raw));
}
let Some(index) = raw.find(':') else {
return CopyEndpoint::Local(PathBuf::from(raw));
};
@@ -183,6 +190,25 @@ pub fn parse_copy_endpoint(raw: &str) -> CopyEndpoint {
}
}
fn parse_bracketed_remote_endpoint(raw: &str) -> Option<(String, String)> {
let rest = raw.strip_prefix('[')?;
let close = rest.find(']')?;
let host = &rest[..close];
let suffix = &rest[close + 1..];
if host.is_empty() || host.contains('/') || host.contains('\\') || !suffix.starts_with(':') {
return None;
}
let path = &suffix[1..];
Some((
host.to_string(),
if path.is_empty() {
".".to_string()
} else {
path.to_string()
},
))
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum CopyEndpoint {
Local(PathBuf),
@@ -263,6 +289,18 @@ mod tests {
assert_eq!(frames.len(), 1);
}
#[test]
fn oversized_frame_clears_decoder_state() {
let mut decoder = FrameDecoder::default();
let too_large = ((FRAME_MAX_LEN + 1) as u32).to_be_bytes();
assert!(decoder.push(&too_large).is_err());
let valid = encode_response(&FileResponse::Ok).unwrap();
let frames = decoder.push(&valid).unwrap();
assert_eq!(frames.len(), 1);
assert_eq!(decode_response(&frames[0]).unwrap(), FileResponse::Ok);
}
#[test]
fn copy_endpoint_parses_scp_style_but_not_windows_drive() {
assert_eq!(
@@ -277,4 +315,30 @@ mod tests {
CopyEndpoint::Local(PathBuf::from("C:\\Users\\palav\\x"))
);
}
#[test]
fn copy_endpoint_parses_bracketed_ipv6_remote_paths() {
assert_eq!(
parse_copy_endpoint("[2001:db8::1]:/var/log/syslog"),
CopyEndpoint::Remote {
host: "2001:db8::1".to_string(),
path: "/var/log/syslog".to_string()
}
);
assert_eq!(
parse_copy_endpoint("[::1]:"),
CopyEndpoint::Remote {
host: "::1".to_string(),
path: ".".to_string()
}
);
assert_eq!(
parse_copy_endpoint("[bad/host]:path"),
CopyEndpoint::Local(PathBuf::from("[bad/host]:path"))
);
assert_eq!(
parse_copy_endpoint("[::1]"),
CopyEndpoint::Local(PathBuf::from("[::1]"))
);
}
}
+3 -1
View File
@@ -5,7 +5,9 @@
//! handle native authentication, host key checks, roaming, keepalives, reliable
//! streams, and service routing. Use [`transport::DoshTransport`] only when an
//! application already owns session establishment and wants direct access to the
//! encrypted stream transport.
//! encrypted stream transport. The SDK receive loops drive retransmission and
//! keepalives while waiting, so simple applications can call `recv().await`
//! without building their own maintenance loop.
pub mod auth;
pub mod build_info;
+11 -7
View File
@@ -5,10 +5,11 @@ use anyhow::{Context, Result, bail};
use serde::{Deserialize, Serialize};
use std::time::{SystemTime, UNIX_EPOCH};
/// Generate a name for an implicit, ephemeral terminal session the kind
/// created by `dosh host` with no `--session`. Single source of truth shared by
/// the client (which generates it) and the server (which recognizes it via
/// [`is_implicit_session_name`] to decide a session is NOT worth persisting).
/// Generate a name for an implicit terminal session: the kind created by
/// `dosh host` with no `--session`. Single source of truth shared by the client
/// (which generates it) and the server (which recognizes it via
/// [`is_implicit_session_name`] to apply shorter cleanup grace than named
/// sessions).
pub fn generate_implicit_session_name() -> String {
let millis = SystemTime::now()
.duration_since(UNIX_EPOCH)
@@ -18,9 +19,9 @@ pub fn generate_implicit_session_name() -> String {
}
/// Whether `name` is a client-generated implicit session name
/// (`term-<digits>-<digits>`). Such sessions are ephemeral: the user can never
/// reattach by name, so the server must not persist them across restarts.
/// Explicitly-named (`--session work`) and prewarmed sessions are not implicit.
/// (`term-<digits>-<digits>`). Such sessions are update-survivable while the
/// original client can reconnect with its ticket, but they are reaped sooner
/// than explicitly-named sessions once no clients remain.
pub fn is_implicit_session_name(name: &str) -> bool {
let Some(rest) = name.strip_prefix("term-") else {
return false;
@@ -272,6 +273,9 @@ pub fn decode(input: &[u8]) -> Result<Packet> {
if input.len() < end {
bail!("truncated packet body");
}
if input.len() > end {
bail!("trailing packet bytes");
}
Ok(Packet {
header,
body: input[HEADER_LEN..end].to_vec(),
+113 -15
View File
@@ -10,8 +10,8 @@ use crate::protocol::{
NativeServerHelloBody, NativeUserAuthBody, PacketKind, SERVER_TO_CLIENT,
};
use crate::transport::{
DoshTransport, SessionEvent, SessionRole, SessionTransportConfig, TransportConfig,
service_name_from_target,
ADAPTIVE_RETRANSMIT_MIN, DoshTransport, SessionEvent, SessionRole, SessionTransportConfig,
TransportConfig, service_name_from_target,
};
use crate::udp::{is_transient_udp_error, is_transient_udp_send_error};
use anyhow::{Context, Result, anyhow, bail};
@@ -169,33 +169,52 @@ impl DoshServer {
let mut buf = vec![0u8; 65535];
loop {
self.expire_pending();
let (n, peer) = match self.socket.recv_from(&mut buf).await {
Ok(value) => value,
Err(err) if is_transient_udp_error(&err) => continue,
Err(err) => return Err(err.into()),
let (n, peer) = match tokio::time::timeout(
ADAPTIVE_RETRANSMIT_MIN,
self.socket.recv_from(&mut buf),
)
.await
{
Ok(Ok(value)) => value,
Ok(Err(err)) if is_transient_udp_error(&err) => continue,
Ok(Err(err)) => return Err(err.into()),
Err(_) => {
self.maintenance().await?;
continue;
}
};
let packet = match protocol::decode(&buf[..n]) {
if let Some(event) = self.handle_datagram(peer, &buf[..n]).await? {
return Ok(event);
}
}
}
async fn handle_datagram(
&mut self,
peer: SocketAddr,
datagram: &[u8],
) -> Result<Option<DoshServerEvent>> {
let packet = match protocol::decode(datagram) {
Ok(packet) => packet,
Err(_) => continue,
Err(_) => return Ok(None),
};
if packet.header.kind == PacketKind::NativeClientHello {
self.handle_client_hello(peer, packet.body).await?;
return Ok(DoshServerEvent::Ignored);
return Ok(Some(DoshServerEvent::Ignored));
}
if packet.header.kind == PacketKind::NativeUserAuth {
return self.handle_user_auth(peer, &packet).await;
return self.handle_user_auth(peer, &packet).await.map(Some);
}
if let Some(transport) = self.transports.get_mut(&packet.header.conn_id) {
let event = transport.handle_datagram(&buf[..n], peer).await?;
return Ok(DoshServerEvent::Session {
let event = transport.handle_datagram(datagram, peer).await?;
return Ok(Some(DoshServerEvent::Session {
conn_id: packet.header.conn_id,
event,
});
}));
}
self.send_reject(peer, packet.header.conn_id, "unknown Dosh connection")
.await?;
return Ok(DoshServerEvent::Ignored);
}
Ok(Some(DoshServerEvent::Ignored))
}
pub async fn accept_stream(&mut self, conn_id: [u8; 16], stream_id: u64) -> Result<()> {
@@ -620,6 +639,85 @@ mod tests {
}
}
#[tokio::test]
async fn sdk_server_recv_drives_transport_maintenance_while_idle() {
let dir = tempfile::tempdir().unwrap();
let host_key = dir.path().join("host_key");
let authorized_keys = dir.path().join("authorized_keys");
let signing = SigningKey::from_bytes(&[94u8; 32]);
let keypair = ssh_key::private::Ed25519Keypair::from(&signing);
let private =
ssh_key::PrivateKey::new(ssh_key::private::KeypairData::from(keypair), "").unwrap();
std::fs::write(
&authorized_keys,
format!("{}\n", private.public_key().to_openssh().unwrap()),
)
.unwrap();
let server_config = ServerConfig {
host_key: host_key.to_string_lossy().to_string(),
authorized_keys: vec![authorized_keys.to_string_lossy().to_string()],
..ServerConfig::default()
};
let server_config = DoshServerConfig::new(server_config)
.bind_addr("127.0.0.1:0".parse().unwrap())
.service("echo")
.unwrap()
.require_current_user(false)
.transport(TransportConfig {
retransmit_after: Duration::from_millis(20),
keepalive_after: Duration::from_secs(60),
..TransportConfig::default()
});
let mut server = DoshServer::bind(server_config).await.unwrap();
let client_socket = UdpSocket::bind("127.0.0.1:0").await.unwrap();
let client_addr = client_socket.local_addr().unwrap();
let conn_id = [95u8; 16];
let session_key = [96u8; 32];
let transport = DoshTransport::new(
Arc::clone(&server.socket),
SessionTransportConfig {
role: SessionRole::Server,
conn_id,
session_key,
peer_addr: client_addr,
initial_send_seq: 1,
initial_ack: 0,
stream: server.config.transport.clone(),
},
);
server.transports.insert(conn_id, transport);
server
.transport_mut(&conn_id)
.unwrap()
.open_service("echo")
.await
.unwrap();
let mut buf = [0u8; 65535];
tokio::time::timeout(
Duration::from_millis(200),
client_socket.recv_from(&mut buf),
)
.await
.unwrap()
.unwrap();
let recv_task = tokio::spawn(async move { server.recv().await });
let (n, _) =
tokio::time::timeout(Duration::from_secs(1), client_socket.recv_from(&mut buf))
.await
.unwrap()
.unwrap();
recv_task.abort();
let packet = protocol::decode(&buf[..n]).unwrap();
assert_eq!(packet.header.kind, PacketKind::StreamOpen);
let plain = protocol::decrypt_body(&packet, &session_key, SERVER_TO_CLIENT).unwrap();
let open: protocol::StreamOpen = protocol::from_body(&plain).unwrap();
assert_eq!(open.target_host, "@dosh-echo");
}
#[tokio::test]
async fn bad_native_auth_does_not_consume_pending_challenge() {
let dir = tempfile::tempdir().unwrap();
+68 -6
View File
@@ -1,11 +1,13 @@
use std::fs::{File, OpenOptions};
use std::io::Write;
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use std::sync::{Mutex, OnceLock};
use std::time::{SystemTime, UNIX_EPOCH};
static TRACE_FILE: OnceLock<Option<Mutex<File>>> = OnceLock::new();
static HEALTH_FILE: OnceLock<Option<Mutex<File>>> = OnceLock::new();
static TRACE_BYTES: OnceLock<bool> = OnceLock::new();
const HEALTH_LOG_MAX_BYTES: u64 = 1024 * 1024;
pub fn enabled() -> bool {
TRACE_FILE.get_or_init(open_trace_file).is_some()
@@ -19,6 +21,21 @@ pub fn event(name: &str, fields: &[(&str, String)]) {
let Some(file) = TRACE_FILE.get_or_init(open_trace_file) else {
return;
};
write_event(file, name, fields);
}
pub fn health_event(name: &str, fields: &[(&str, String)]) {
let Some(file) = HEALTH_FILE.get_or_init(open_health_file) else {
return;
};
write_event(file, name, fields);
}
pub fn default_health_log_path() -> PathBuf {
trace_root().join("health.log")
}
fn write_event(file: &Mutex<File>, name: &str, fields: &[(&str, String)]) {
let now = SystemTime::now()
.duration_since(UNIX_EPOCH)
.map(|duration| duration.as_millis())
@@ -81,11 +98,49 @@ fn open_trace_file() -> Option<Mutex<File>> {
.map(Mutex::new)
}
fn open_health_file() -> Option<Mutex<File>> {
let path = health_log_path_from_env()?;
rotate_health_log_if_needed(&path);
if let Some(parent) = path.parent() {
let _ = std::fs::create_dir_all(parent);
}
OpenOptions::new()
.create(true)
.append(true)
.open(&path)
.ok()
.map(Mutex::new)
}
fn health_log_path_from_env() -> Option<PathBuf> {
match std::env::var_os("DOSH_HEALTH_LOG") {
Some(raw) => {
let normalized = raw.to_string_lossy().to_ascii_lowercase();
if normalized.is_empty() || matches!(normalized.as_str(), "0" | "false" | "off") {
None
} else if matches!(normalized.as_str(), "1" | "true" | "on") {
Some(default_health_log_path())
} else {
Some(PathBuf::from(raw))
}
}
None => Some(default_health_log_path()),
}
}
fn rotate_health_log_if_needed(path: &Path) {
let Ok(metadata) = std::fs::metadata(path) else {
return;
};
if metadata.len() <= HEALTH_LOG_MAX_BYTES {
return;
}
let rotated = path.with_extension("log.1");
let _ = std::fs::remove_file(&rotated);
let _ = std::fs::rename(path, rotated);
}
fn default_trace_path() -> PathBuf {
let root = dirs::cache_dir()
.unwrap_or_else(std::env::temp_dir)
.join("dosh")
.join("trace");
let exe = std::env::current_exe()
.ok()
.and_then(|path| {
@@ -93,7 +148,14 @@ fn default_trace_path() -> PathBuf {
.map(|stem| stem.to_string_lossy().to_string())
})
.unwrap_or_else(|| "dosh".to_string());
root.join(format!("{}-{}.log", exe, std::process::id()))
trace_root().join(format!("{}-{}.log", exe, std::process::id()))
}
fn trace_root() -> PathBuf {
dirs::cache_dir()
.unwrap_or_else(std::env::temp_dir)
.join("dosh")
.join("trace")
}
fn truthy_env(name: &str) -> bool {
+950 -94
View File
File diff suppressed because it is too large Load Diff
+50 -7
View File
@@ -152,21 +152,41 @@ fn write_server_config_with_retransmit_window(
}
fn start_server(dir: &tempfile::TempDir, config: &std::path::Path) -> Child {
start_server_with_trace(dir, config, None)
}
fn start_server_with_trace(
dir: &tempfile::TempDir,
config: &std::path::Path,
trace: Option<&Path>,
) -> Child {
let server = env!("CARGO_BIN_EXE_dosh-server");
let child = Command::new(server)
let mut command = Command::new(server);
command
.arg("serve")
.arg("--config")
.arg(config)
.env("HOME", dir.path())
.stdout(Stdio::null())
.stderr(Stdio::null())
.spawn()
.unwrap();
.stderr(Stdio::null());
if let Some(trace) = trace {
command.env("DOSH_TRACE", trace);
}
let child = command.spawn().unwrap();
thread::sleep(Duration::from_millis(500));
child
}
fn attach_once(dir: &tempfile::TempDir, port: u16, cache: bool) -> std::process::Output {
attach_once_with_trace(dir, port, cache, None)
}
fn attach_once_with_trace(
dir: &tempfile::TempDir,
port: u16,
cache: bool,
trace: Option<&Path>,
) -> std::process::Output {
let client = env!("CARGO_BIN_EXE_dosh-client");
let mut cmd = Command::new(client);
cmd.arg("--local-auth")
@@ -181,6 +201,9 @@ fn attach_once(dir: &tempfile::TempDir, port: u16, cache: bool) -> std::process:
if !cache {
cmd.arg("--no-cache");
}
if let Some(trace) = trace {
cmd.env("DOSH_TRACE", trace);
}
cmd.output().unwrap()
}
@@ -1564,7 +1587,9 @@ fn ticket_attach_after_server_restart_smoke() {
let dir = tempfile::tempdir().unwrap();
let port = free_udp_port();
let config = write_server_config(&dir, port);
let mut server = start_server(&dir, &config);
let server_trace = dir.path().join("server-trace.log");
let client_trace = dir.path().join("client-trace.log");
let mut server = start_server_with_trace(&dir, &config, Some(&server_trace));
let first = attach_once(&dir, port, true);
let _ = server.kill();
let _ = server.wait();
@@ -1574,8 +1599,8 @@ fn ticket_attach_after_server_restart_smoke() {
String::from_utf8_lossy(&first.stderr)
);
let mut server = start_server(&dir, &config);
let second = attach_once(&dir, port, true);
let mut server = start_server_with_trace(&dir, &config, Some(&server_trace));
let second = attach_once_with_trace(&dir, port, true, Some(&client_trace));
let _ = server.kill();
let _ = server.wait();
let stderr = String::from_utf8_lossy(&second.stderr);
@@ -1584,6 +1609,24 @@ fn ticket_attach_after_server_restart_smoke() {
stderr.contains("udp_ticket_attach_ready"),
"stderr={stderr}"
);
let server_trace = fs::read_to_string(&server_trace).unwrap();
let client_trace = fs::read_to_string(&client_trace).unwrap();
assert!(
server_trace.contains("event=server.ticket_attach_start"),
"server trace={server_trace}"
);
assert!(
server_trace.contains("event=server.ticket_attach_ok"),
"server trace={server_trace}"
);
assert!(
client_trace.contains("event=client.ticket_attach_start"),
"client trace={client_trace}"
);
assert!(
client_trace.contains("event=client.ticket_attach_ok"),
"client trace={client_trace}"
);
}
#[test]
+15
View File
@@ -58,6 +58,21 @@ fn encrypted_packet_round_trips() {
assert_eq!(plain, b"hello");
}
#[test]
fn packet_decode_rejects_truncated_or_trailing_datagrams() {
let packet =
protocol::encode_plain(PacketKind::Ping, crypto::random_16(), 1, 0, b"hello").unwrap();
let truncated = &packet[..packet.len() - 1];
let err = protocol::decode(truncated).unwrap_err();
assert!(err.to_string().contains("truncated packet body"));
let mut trailing = packet.clone();
trailing.extend_from_slice(b"junk");
let err = protocol::decode(&trailing).unwrap_err();
assert!(err.to_string().contains("trailing packet bytes"));
}
#[test]
fn plaintext_packet_never_decrypts_as_authenticated_body() {
let key = crypto::random_32();
+225
View File
@@ -19,6 +19,199 @@ fn release_scripts_skip_stale_artifacts_when_auto_discovering() {
assert!(publish.contains("actual=\"$(artifact_version \"$artifact\" || true)\""));
}
#[test]
fn release_upload_refuses_partial_platform_sets_by_default() {
let upload = include_str!("../scripts/upload-gitea-release.sh");
assert!(upload.contains("require_complete_release_artifacts \"$@\""));
assert!(upload.contains("DOSH_RELEASE_ALLOW_PARTIAL=1"));
assert!(upload.contains("refusing partial release upload"));
for name in [
"dosh-linux-x86_64.tar.gz",
"dosh-macos-aarch64.tar.gz",
"dosh-macos-x86_64.tar.gz",
"dosh-windows-x86_64.zip",
] {
assert!(
upload.contains(name),
"release upload completeness check must require {name}"
);
}
}
#[test]
fn release_upload_marks_prerelease_tags_as_prereleases() {
let upload = include_str!("../scripts/upload-gitea-release.sh");
assert!(upload.contains("release_prerelease=false"));
assert!(upload.contains("*-*) release_prerelease=true"));
assert!(upload.contains("\"prerelease\":%s"));
assert!(upload.contains("metadata_payload="));
assert!(
upload.contains("-X PATCH"),
"existing Gitea releases must be corrected when prerelease metadata changes"
);
}
#[test]
fn release_gates_test_all_targets() {
let makefile = include_str!("../Makefile");
let ci = include_str!("../.github/workflows/ci.yml");
assert!(makefile.contains("test:\n\tcargo test --all-targets"));
assert!(makefile.contains("cargo test --all-targets\n\t$(MAKE) tui-harness"));
assert!(ci.contains("run: sh -n install.sh scripts/*.sh"));
assert!(ci.contains("run: cargo clippy --all-targets -- -D warnings"));
assert!(ci.contains("run: cargo test --all-targets"));
assert!(ci.contains("run: sh scripts/tui-harness.sh"));
}
#[test]
fn one_dot_zero_gates_default_to_full_length_soaks() {
let makefile = include_str!("../Makefile");
let reconnect_check = makefile
.split("reconnect-check:")
.nth(1)
.and_then(|tail| tail.split("\nhostile-network-check:").next())
.expect("reconnect-check target");
assert!(reconnect_check.contains("DOSH_SOAK_SECONDS=$${DOSH_SOAK_SECONDS:-1800}"));
assert!(!reconnect_check.contains("DOSH_SOAK_SECONDS=$${DOSH_SOAK_SECONDS:-300}"));
let hostile_check = makefile
.split("hostile-network-check:")
.nth(1)
.and_then(|tail| tail.split("\npersistence-check:").next())
.expect("hostile-network-check target");
assert!(hostile_check.contains("DOSH_BADNET_SOAK_SECONDS=$${DOSH_BADNET_SOAK_SECONDS:-1800}"));
assert!(!hostile_check.contains("DOSH_BADNET_SOAK_SECONDS=$${DOSH_BADNET_SOAK_SECONDS:-300}"));
}
#[test]
fn installers_skip_stale_latest_release_prebuilts() {
let install = include_str!("../install.sh");
assert!(install.contains("latest_release_is_stale"));
assert!(install.contains("current_source_version"));
assert!(install.contains("latest release $latest is older than source $current"));
assert!(install.contains("version_prerelease"));
assert!(install.contains("prerelease_less_than"));
assert!(
install.contains("if latest_release_is_stale; then"),
"unix installer must skip stale latest before downloading a prebuilt"
);
let ps1 = include_str!("../install.ps1");
assert!(ps1.contains("Latest-ReleaseIsStale"));
assert!(ps1.contains("Current-SourceVersion"));
assert!(ps1.contains("latest release $latestVersion is older than source $current"));
assert!(ps1.contains("Version-Prerelease"));
assert!(ps1.contains("Compare-Prerelease"));
assert!(
ps1.contains("if (Latest-ReleaseIsStale)"),
"windows installer must skip stale latest before downloading a prebuilt"
);
}
#[test]
fn installers_refuse_prebuilts_without_checksums() {
let install = include_str!("../install.sh");
assert!(install.contains("verify_archive_checksum"));
assert!(install.contains("refusing unverified binary for $url"));
assert!(
!install.contains("continuing without sidecar verification"),
"unix installer must not silently install an unverifiable prebuilt"
);
let ps1 = include_str!("../install.ps1");
assert!(ps1.contains("Verify-ArchiveChecksum"));
assert!(ps1.contains("refusing unverified binary for $Url"));
assert!(
!ps1.contains("continuing without sidecar verification"),
"windows installer must not silently install an unverifiable prebuilt"
);
}
#[test]
fn windows_installer_reuses_persistent_source_update_cache() {
let ps1 = include_str!("../install.ps1");
assert!(ps1.contains("DOSH_UPDATE_CACHE"));
assert!(ps1.contains("Assert-NoRelativePathSegments($Path)"));
assert!(ps1.contains("Assert-NoRelativePathSegments $Path"));
assert!(ps1.contains("$segment -eq \".\" -or $segment -eq \"..\""));
assert!(ps1.contains("$sourceCache = Assert-SafeUpdateCache $UpdateCache"));
assert!(ps1.contains("git -C $sourceCache fetch --depth 1 origin main"));
assert!(ps1.contains("git -C $sourceCache checkout -q -B main FETCH_HEAD"));
assert!(ps1.contains("git clone --depth 1 --branch main $Repo $sourceCache"));
assert!(
!ps1.contains("git clone --depth 1 $Repo $tmp"),
"Windows source updates should reuse a persistent cache instead of recloning into temp"
);
}
#[test]
fn unix_installer_rejects_unsafe_source_update_cache_paths() {
let install = include_str!("../install.sh");
assert!(install.contains("normalize_update_cache_path()"));
assert!(install.contains("safe_update_cache_path()"));
assert!(install.contains("update_cache=\"$(safe_update_cache_path \"$update_cache\")\""));
for pattern in [
"\"\"|\"/\"|\"$home_norm\"|\"$home_cache_norm\"",
"\".\"|\"..\"|./*|../*|*/.|*/..|*/./*|*/../*",
] {
assert!(
install.contains(pattern),
"Unix installer must reject unsafe update cache pattern {pattern}"
);
}
assert!(
install.contains("rm -rf \"$update_cache\""),
"source cache replacement remains the destructive operation guarded by safe_update_cache_path"
);
}
#[test]
fn installers_generate_same_native_auth_client_defaults() {
let install = include_str!("../install.sh");
let ps1 = include_str!("../install.ps1");
for setting in [
"auth_preference = \"native,ssh\"",
"trust_on_first_use = false",
"native_auth_timeout_ms = 700",
"known_hosts = \"~/.config/dosh/known_hosts\"",
"identity_files = [\"~/.ssh/id_ed25519\"]",
"use_ssh_agent = true",
"forward_agent = false",
] {
assert!(
install.contains(setting),
"Unix installer missing client default {setting}"
);
assert!(
ps1.contains(setting),
"Windows installer missing client default {setting}"
);
}
}
#[test]
fn windows_installer_generates_hosts_config_like_unix() {
let install = include_str!("../install.sh");
let ps1 = include_str!("../install.ps1");
for setting in [
"hosts.toml",
"# default_command = \"tm\"",
"[default]",
"predict = true",
] {
assert!(
install.contains(setting),
"Unix installer missing host config setting {setting}"
);
assert!(
ps1.contains(setting),
"Windows installer missing host config setting {setting}"
);
}
assert!(ps1.contains("$hostUdp = if ($DoshHost) { $DoshHost } else { $defaultServer }"));
assert!(ps1.contains("Set-Content -NoNewline -Encoding utf8 $hostsConfig"));
}
#[test]
fn package_check_verifies_only_artifacts_it_builds() {
let makefile = include_str!("../Makefile");
@@ -42,6 +235,38 @@ fn package_check_verifies_only_artifacts_it_builds() {
);
}
#[test]
fn complete_release_verifier_requires_both_macos_architectures() {
let verify = include_str!("../scripts/verify-release-artifacts.sh");
assert!(verify.contains("dosh-linux-x86_64.tar.gz"));
assert!(verify.contains("dosh-macos-aarch64.tar.gz"));
assert!(verify.contains("dosh-macos-x86_64.tar.gz"));
assert!(verify.contains("dosh-windows-x86_64.zip"));
}
#[test]
fn release_verifier_checks_checksums_and_expected_binaries() {
let verify = include_str!("../scripts/verify-release-artifacts.sh");
assert!(verify.contains("verify_checksum()"));
assert!(verify.contains("release checksum mismatch"));
for member in [
"dosh/bin/dosh",
"dosh/bin/dosh-client",
"dosh/bin/dosh-server",
"dosh/bin/dosh-auth",
"dosh/bin/dosh-bench",
"dosh/bin/dosh.exe",
"dosh/bin/dosh-client.exe",
"dosh/bin/dosh-bench.exe",
] {
assert!(
verify.contains(member),
"release verifier must require archive member {member}"
);
}
assert!(verify.contains("artifact missing expected member"));
}
#[test]
fn package_release_stamps_git_build_info() {
let package = include_str!("../scripts/package-release.sh");