From 77bb2c665c29bc3f9a1f647f78d4cbb5749472c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cramfox=E2=80=9D?= <“kasey@n0.computer”> Date: Mon, 20 Oct 2025 19:34:14 -0400 Subject: [PATCH 1/3] chore: add patch for `iroh` dependencies Updates the following dependencies to use their main branches: - `iroh` from `https://github.com/n0-computer/iroh.git` - `iroh-base` from `https://github.com/n0-computer/iroh.git` --- Cargo.lock | 682 ++++++++++++++++++++++++----------------------------- Cargo.toml | 4 + 2 files changed, 309 insertions(+), 377 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 145cc6c..4173ae8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -24,7 +24,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac8202ab55fcbf46ca829833f347a82a2a4ce0596f0304ac322c2d100030cd56" dependencies = [ "bytes", - "crypto-common 0.2.0-rc.4", + "crypto-common", "inout", ] @@ -265,15 +265,6 @@ dependencies = [ "constant_time_eq", ] -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - [[package]] name = "block-buffer" version = "0.11.0-rc.5" @@ -284,12 +275,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "bounded-integer" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "102dbef1187b1893e6dfe05a774e79fd52265f49f214f6879c8ff49f52c8188b" - [[package]] name = "btparse" version = "0.2.0" @@ -363,7 +348,7 @@ dependencies = [ "iana-time-zone", "num-traits", "serde", - "windows-link", + "windows-link 0.1.3", ] [[package]] @@ -372,8 +357,8 @@ version = "0.5.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e12a13eb01ded5d32ee9658d94f553a19e804204f2dc811df69ab4d9e0cb8c7" dependencies = [ - "block-buffer 0.11.0-rc.5", - "crypto-common 0.2.0-rc.4", + "block-buffer", + "crypto-common", "inout", "zeroize", ] @@ -511,21 +496,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crc" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" - [[package]] name = "critical-section" version = "1.2.0" @@ -556,16 +526,6 @@ version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - [[package]] name = "crypto-common" version = "0.2.0-rc.4" @@ -617,7 +577,7 @@ dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", - "digest 0.11.0-rc.3", + "digest", "fiat-crypto", "rand_core 0.9.3", "rustc_version", @@ -723,25 +683,15 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab03c107fafeb3ee9f5925686dbb7a73bc76e3932abb0d2b365cb64b169cf04c" -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer 0.10.4", - "crypto-common 0.1.6", - "subtle", -] - [[package]] name = "digest" version = "0.11.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dac89f8a64533a9b0eaa73a68e424db0fb1fd6271c74cc0125336a05f090568d" dependencies = [ - "block-buffer 0.11.0-rc.5", - "crypto-common 0.2.0-rc.4", + "block-buffer", + "const-oid", + "crypto-common", ] [[package]] @@ -836,7 +786,7 @@ dependencies = [ "ed25519", "rand_core 0.9.3", "serde", - "sha2 0.11.0-rc.2", + "sha2", "signature", "subtle", "zeroize", @@ -866,26 +816,6 @@ dependencies = [ "syn 2.0.104", ] -[[package]] -name = "enumflags2" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef" -dependencies = [ - "enumflags2_derive", -] - -[[package]] -name = "enumflags2_derive" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", -] - [[package]] name = "equivalent" version = "1.0.2" @@ -902,12 +832,6 @@ dependencies = [ "windows-sys 0.60.2", ] -[[package]] -name = "fallible-iterator" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" - [[package]] name = "fastrand" version = "2.3.0" @@ -958,15 +882,15 @@ dependencies = [ [[package]] name = "futures-buffered" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe940397c8b744b9c2c974791c2c08bca2c3242ce0290393249e98f215a00472" +checksum = "a8e0e1f38ec07ba4abbde21eed377082f17ccb988be9d988a5adbf4bafc118fd" dependencies = [ "cordyceps", "diatomic-waker", "futures-core", "pin-project-lite", - "spin", + "spin 0.10.0", ] [[package]] @@ -1067,17 +991,7 @@ dependencies = [ "libc", "log", "rustversion", - "windows", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", + "windows 0.61.3", ] [[package]] @@ -1180,7 +1094,7 @@ dependencies = [ "hash32", "rustc_version", "serde", - "spin", + "spin 0.9.8", "stable_deref_trait", ] @@ -1249,37 +1163,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "hmac-sha1" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b05da5b9e5d4720bfb691eebb2b9d42da3570745da71eac8a1f5bb7e59aab88" -dependencies = [ - "hmac", - "sha1", -] - -[[package]] -name = "hmac-sha256" -version = "1.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad6880c8d4a9ebf39c6e8b77007ce223f646a4d21ce29d99f70cb16420545425" - -[[package]] -name = "hostname-validator" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f558a64ac9af88b5ba400d99b579451af0d39c6d360980045b91aac966d705e2" - [[package]] name = "http" version = "0.2.12" @@ -1382,7 +1265,7 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", - "webpki-roots 1.0.1", + "webpki-roots", ] [[package]] @@ -1421,7 +1304,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core", + "windows-core 0.61.2", ] [[package]] @@ -1622,9 +1505,8 @@ dependencies = [ [[package]] name = "iroh" -version = "0.93.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50369f3db3f3fbc2cc14fc1baab2f3ee16e0abd89eca0b814258d02a6a13040c" +version = "0.93.2" +source = "git+https://github.com/n0-computer/iroh.git?branch=main#3ec554c8422fb7e0dfd806f89772c9449111d317" dependencies = [ "aead", "backon", @@ -1648,12 +1530,12 @@ dependencies = [ "iroh-quinn-proto", "iroh-quinn-udp", "iroh-relay", - "n0-future", + "n0-future 0.3.0", "n0-snafu", "n0-watcher", "nested_enum_utils", - "netdev 0.36.0", - "netwatch", + "netdev 0.38.2", + "netwatch 0.10.0", "pin-project", "pkarr", "pkcs8", @@ -1663,12 +1545,12 @@ dependencies = [ "ring", "rustls", "rustls-pki-types", + "rustls-platform-verifier", "rustls-webpki", "serde", "smallvec", "snafu", "strum", - "stun-rs", "surge-ping", "time", "tokio", @@ -1677,15 +1559,14 @@ dependencies = [ "tracing", "url", "wasm-bindgen-futures", - "webpki-roots 0.26.11", + "webpki-roots", "z32", ] [[package]] name = "iroh-base" -version = "0.93.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "929fbe14046dfb01b41ccccaa5b476549924daa54438518bda11a9ab1598b2a9" +version = "0.93.2" +source = "git+https://github.com/n0-computer/iroh.git?branch=main#3ec554c8422fb7e0dfd806f89772c9449111d317" dependencies = [ "curve25519-dalek", "data-encoding", @@ -1698,6 +1579,8 @@ dependencies = [ "serde", "snafu", "url", + "zeroize", + "zeroize_derive", ] [[package]] @@ -1784,9 +1667,8 @@ dependencies = [ [[package]] name = "iroh-relay" -version = "0.93.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbc49e535c2cf410d19f82d46dac2b3d0bff1763759a28cd1c67870085f2fc4" +version = "0.93.2" +source = "git+https://github.com/n0-computer/iroh.git?branch=main#3ec554c8422fb7e0dfd806f89772c9449111d317" dependencies = [ "blake3", "bytes", @@ -1804,7 +1686,7 @@ dependencies = [ "iroh-quinn", "iroh-quinn-proto", "lru 0.16.1", - "n0-future", + "n0-future 0.3.0", "n0-snafu", "nested_enum_utils", "num_enum", @@ -1827,7 +1709,7 @@ dependencies = [ "tokio-websockets", "tracing", "url", - "webpki-roots 0.26.11", + "webpki-roots", "ws_stream_wasm", "z32", ] @@ -1965,12 +1847,6 @@ dependencies = [ "regex-automata", ] -[[package]] -name = "md5" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" - [[package]] name = "memchr" version = "2.7.5" @@ -2037,6 +1913,48 @@ dependencies = [ "web-time", ] +[[package]] +name = "n0-future" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89d7dd42bd0114c9daa9c4f2255d692a73bba45767ec32cf62892af6fe5d31f6" +dependencies = [ + "cfg_aliases", + "derive_more 1.0.0", + "futures-buffered", + "futures-lite", + "futures-util", + "js-sys", + "pin-project", + "send_wrapper", + "tokio", + "tokio-util", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-time", +] + +[[package]] +name = "n0-future" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439e746b307c1fd0c08771c3cafcd1746c3ccdb0d9c7b859d3caded366b6da76" +dependencies = [ + "cfg_aliases", + "derive_more 1.0.0", + "futures-buffered", + "futures-lite", + "futures-util", + "js-sys", + "pin-project", + "send_wrapper", + "tokio", + "tokio-util", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-time", +] + [[package]] name = "n0-snafu" version = "0.2.2" @@ -2057,7 +1975,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c31462392a10d5ada4b945e840cbec2d5f3fee752b96c4b33eb41414d8f45c2a" dependencies = [ "derive_more 1.0.0", - "n0-future", + "n0-future 0.1.3", "snafu", ] @@ -2075,14 +1993,14 @@ dependencies = [ [[package]] name = "netdev" -version = "0.36.0" +version = "0.37.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "862209dce034f82a44c95ce2b5183730d616f2a68746b9c1959aa2572e77c0a1" +checksum = "daa1e3eaf125c54c21e6221df12dd2a0a682784a068782dd564c836c0f281b6d" dependencies = [ "dlopen2", "ipnet", "libc", - "netlink-packet-core", + "netlink-packet-core 0.7.0", "netlink-packet-route 0.22.0", "netlink-sys", "once_cell", @@ -2092,15 +2010,15 @@ dependencies = [ [[package]] name = "netdev" -version = "0.37.3" +version = "0.38.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa1e3eaf125c54c21e6221df12dd2a0a682784a068782dd564c836c0f281b6d" +checksum = "67ab878b4c90faf36dab10ea51d48c69ae9019bcca47c048a7c9b273d5d7a823" dependencies = [ "dlopen2", "ipnet", "libc", - "netlink-packet-core", - "netlink-packet-route 0.22.0", + "netlink-packet-core 0.8.1", + "netlink-packet-route 0.25.1", "netlink-sys", "once_cell", "system-configuration", @@ -2118,6 +2036,15 @@ dependencies = [ "netlink-packet-utils", ] +[[package]] +name = "netlink-packet-core" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3463cbb78394cb0141e2c926b93fc2197e473394b761986eca3b9da2c63ae0f4" +dependencies = [ + "paste", +] + [[package]] name = "netlink-packet-route" version = "0.22.0" @@ -2129,7 +2056,7 @@ dependencies = [ "byteorder", "libc", "log", - "netlink-packet-core", + "netlink-packet-core 0.7.0", "netlink-packet-utils", ] @@ -2144,10 +2071,22 @@ dependencies = [ "byteorder", "libc", "log", - "netlink-packet-core", + "netlink-packet-core 0.7.0", "netlink-packet-utils", ] +[[package]] +name = "netlink-packet-route" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ec2f5b6839be2a19d7fa5aab5bc444380f6311c2b693551cb80f45caaa7b5ef" +dependencies = [ + "bitflags", + "libc", + "log", + "netlink-packet-core 0.8.1", +] + [[package]] name = "netlink-packet-utils" version = "0.5.2" @@ -2169,7 +2108,21 @@ dependencies = [ "bytes", "futures", "log", - "netlink-packet-core", + "netlink-packet-core 0.7.0", + "netlink-sys", + "thiserror 2.0.12", +] + +[[package]] +name = "netlink-proto" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b65d130ee111430e47eed7896ea43ca693c387f097dd97376bffafbf25812128" +dependencies = [ + "bytes", + "futures", + "log", + "netlink-packet-core 0.8.1", "netlink-sys", "thiserror 2.0.12", ] @@ -2200,13 +2153,48 @@ dependencies = [ "iroh-quinn-udp", "js-sys", "libc", - "n0-future", + "n0-future 0.1.3", "n0-watcher", "nested_enum_utils", "netdev 0.37.3", - "netlink-packet-core", + "netlink-packet-core 0.7.0", "netlink-packet-route 0.24.0", - "netlink-proto", + "netlink-proto 0.11.5", + "netlink-sys", + "pin-project-lite", + "serde", + "snafu", + "socket2 0.6.0", + "time", + "tokio", + "tokio-util", + "tracing", + "web-sys", + "windows 0.61.3", + "windows-result 0.3.4", + "wmi", +] + +[[package]] +name = "netwatch" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29acc9361df4a91bde6d2ec1ce110de7c826e574eeb3662ec1f574af00b96c48" +dependencies = [ + "atomic-waker", + "bytes", + "cfg_aliases", + "derive_more 2.0.1", + "iroh-quinn-udp", + "js-sys", + "libc", + "n0-future 0.2.0", + "n0-watcher", + "nested_enum_utils", + "netdev 0.38.2", + "netlink-packet-core 0.8.1", + "netlink-packet-route 0.25.1", + "netlink-proto 0.12.0", "netlink-sys", "pin-project-lite", "serde", @@ -2217,8 +2205,8 @@ dependencies = [ "tokio-util", "tracing", "web-sys", - "windows", - "windows-result", + "windows 0.62.2", + "windows-result 0.4.1", "wmi", ] @@ -2392,50 +2380,6 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "pest" -version = "2.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1db05f56d34358a8b1066f67cbb203ee3e7ed2ba674a6263a1d5ec6db2204323" -dependencies = [ - "memchr", - "thiserror 2.0.12", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb056d9e8ea77922845ec74a1c4e8fb17e7c218cc4fc11a15c5d25e189aa40bc" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87e404e638f781eb3202dc82db6760c8ae8a1eeef7fb3fa8264b2ef280504966" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn 2.0.104", -] - -[[package]] -name = "pest_meta" -version = "2.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd1101f170f5903fde0914f899bb503d9ff5271d7ba76bbb70bea63690cc0d5" -dependencies = [ - "pest", - "sha2 0.10.9", -] - [[package]] name = "pharos" version = "0.5.3" @@ -2593,7 +2537,7 @@ dependencies = [ "iroh-metrics", "libc", "nested_enum_utils", - "netwatch", + "netwatch 0.9.0", "num_enum", "rand 0.9.2", "serde", @@ -2657,40 +2601,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "precis-core" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2e7b31f132e0c6f8682cfb7bf4a5340dbe925b7986618d0826a56dfe0c8e56" -dependencies = [ - "precis-tools", - "ucd-parse", - "unicode-normalization", -] - -[[package]] -name = "precis-profiles" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4f67f78f50388f03494794766ba824a704db16fb5d400fe8d545fa7bc0d3f1" -dependencies = [ - "lazy_static", - "precis-core", - "precis-tools", - "unicode-normalization", -] - -[[package]] -name = "precis-tools" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cc1eb2d5887ac7bfd2c0b745764db89edb84b856e4214e204ef48ef96d10c4a" -dependencies = [ - "lazy_static", - "regex", - "ucd-parse", -] - [[package]] name = "proc-macro-crate" version = "3.3.0" @@ -2773,16 +2683,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "quoted-string-parser" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc75379cdb451d001f1cb667a9f74e8b355e9df84cc5193513cbe62b96fc5e9" -dependencies = [ - "pest", - "pest_derive", -] - [[package]] name = "r-efi" version = "5.3.0" @@ -2880,12 +2780,6 @@ dependencies = [ "regex-syntax", ] -[[package]] -name = "regex-lite" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53a49587ad06b26609c52e423de037e7f57f20d53535d66e08c695f347df952a" - [[package]] name = "regex-syntax" version = "0.8.5" @@ -2930,7 +2824,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 1.0.1", + "webpki-roots", ] [[package]] @@ -2989,9 +2883,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.28" +version = "0.23.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7160e3e10bf4535308537f3c4e1641468cd0e485175d6163087c0393c7d46643" +checksum = "751e04a496ca00bb97a5e043158d23d66b5aabf2e1d5aa2a0aaebb1aafe6f82c" dependencies = [ "log", "once_cell", @@ -3053,9 +2947,9 @@ checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" [[package]] name = "rustls-webpki" -version = "0.103.3" +version = "0.103.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435" +checksum = "e10b3f4191e8a80e6b43eebabfac91e5dcecebb27a71f04e820c47ec41d314bf" dependencies = [ "ring", "rustls-pki-types", @@ -3220,13 +3114,13 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.6" +version = "0.11.0-rc.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +checksum = "c5e046edf639aa2e7afb285589e5405de2ef7e61d4b0ac1e30256e3eab911af9" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] @@ -3235,17 +3129,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" -[[package]] -name = "sha2" -version = "0.10.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - [[package]] name = "sha2" version = "0.11.0-rc.2" @@ -3254,7 +3137,7 @@ checksum = "d1e3878ab0f98e35b2df35fe53201d088299b41a6bb63e3e34dada2ac4abd924" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.11.0-rc.3", + "digest", ] [[package]] @@ -3397,6 +3280,12 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spin" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe4ccb98d9c292d56fec89a5e07da7fc4cf0dc11e156b41793132775d3e591" + [[package]] name = "spki" version = "0.8.0-rc.4" @@ -3440,30 +3329,6 @@ dependencies = [ "syn 2.0.104", ] -[[package]] -name = "stun-rs" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb921f10397d5669e1af6455e9e2d367bf1f9cebcd6b1dd1dc50e19f6a9ac2ac" -dependencies = [ - "base64", - "bounded-integer", - "byteorder", - "crc", - "enumflags2", - "fallible-iterator", - "hmac-sha1", - "hmac-sha256", - "hostname-validator", - "lazy_static", - "md5", - "paste", - "precis-core", - "precis-profiles", - "quoted-string-parser", - "rand 0.9.2", -] - [[package]] name = "subtle" version = "2.6.1" @@ -3905,36 +3770,12 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" -[[package]] -name = "ucd-parse" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06ff81122fcbf4df4c1660b15f7e3336058e7aec14437c9f85c6b31a0f279b9" -dependencies = [ - "regex-lite", -] - -[[package]] -name = "ucd-trie" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" - [[package]] name = "unicode-ident" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" -[[package]] -name = "unicode-normalization" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-xid" version = "0.2.6" @@ -3947,7 +3788,7 @@ version = "0.6.0-rc.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a55be643b40a21558f44806b53ee9319595bc7ca6896372e4e08e5d7d83c9cd6" dependencies = [ - "crypto-common 0.2.0-rc.4", + "crypto-common", "subtle", ] @@ -3998,12 +3839,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - [[package]] name = "walkdir" version = "2.5.0" @@ -4162,18 +3997,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" -dependencies = [ - "webpki-roots 1.0.1", -] - -[[package]] -name = "webpki-roots" -version = "1.0.1" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8782dd5a41a24eed3a4f40b606249b3e236ca61adf1f25ea4d45c73de122b502" +checksum = "32b130c0d2d49f8b6889abc456e795e82525204f27c42cf767cf0d7734e089b8" dependencies = [ "rustls-pki-types", ] @@ -4221,11 +4047,23 @@ version = "0.61.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" dependencies = [ - "windows-collections", - "windows-core", - "windows-future", - "windows-link", - "windows-numerics", + "windows-collections 0.2.0", + "windows-core 0.61.2", + "windows-future 0.2.1", + "windows-link 0.1.3", + "windows-numerics 0.2.0", +] + +[[package]] +name = "windows" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" +dependencies = [ + "windows-collections 0.3.2", + "windows-core 0.62.2", + "windows-future 0.3.2", + "windows-numerics 0.3.1", ] [[package]] @@ -4234,7 +4072,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" dependencies = [ - "windows-core", + "windows-core 0.61.2", +] + +[[package]] +name = "windows-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +dependencies = [ + "windows-core 0.62.2", ] [[package]] @@ -4245,9 +4092,22 @@ checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ "windows-implement", "windows-interface", - "windows-link", - "windows-result", - "windows-strings", + "windows-link 0.1.3", + "windows-result 0.3.4", + "windows-strings 0.4.2", +] + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link 0.2.1", + "windows-result 0.4.1", + "windows-strings 0.5.1", ] [[package]] @@ -4256,16 +4116,27 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" dependencies = [ - "windows-core", - "windows-link", - "windows-threading", + "windows-core 0.61.2", + "windows-link 0.1.3", + "windows-threading 0.1.0", +] + +[[package]] +name = "windows-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +dependencies = [ + "windows-core 0.62.2", + "windows-link 0.2.1", + "windows-threading 0.2.1", ] [[package]] name = "windows-implement" -version = "0.60.0" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", @@ -4274,9 +4145,9 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.59.1" +version = "0.59.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", @@ -4289,14 +4160,30 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + [[package]] name = "windows-numerics" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" dependencies = [ - "windows-core", - "windows-link", + "windows-core 0.61.2", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-numerics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +dependencies = [ + "windows-core 0.62.2", + "windows-link 0.2.1", ] [[package]] @@ -4305,7 +4192,16 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ - "windows-link", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link 0.2.1", ] [[package]] @@ -4314,7 +4210,16 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" dependencies = [ - "windows-link", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link 0.2.1", ] [[package]] @@ -4430,7 +4335,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" dependencies = [ - "windows-link", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link 0.2.1", ] [[package]] @@ -4652,8 +4566,8 @@ dependencies = [ "log", "serde", "thiserror 2.0.12", - "windows", - "windows-core", + "windows 0.61.3", + "windows-core 0.61.2", ] [[package]] @@ -4769,9 +4683,23 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.8.1" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] [[package]] name = "zerotrie" diff --git a/Cargo.toml b/Cargo.toml index 31c95b4..b1f7128 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,3 +40,7 @@ codegen-units = 1 lto = true debug = "none" strip = true + +[patch.crates-io] +iroh = { git = "https://github.com/n0-computer/iroh.git", branch = "main" } +iroh-base = { git = "https://github.com/n0-computer/iroh.git", branch = "main" } From a2d96868c13823f843aff907070d136e05168dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cramfox=E2=80=9D?= <“kasey@n0.computer”> Date: Tue, 21 Oct 2025 15:20:29 -0400 Subject: [PATCH 2/3] chore: update to latest `iroh` and new dep on `iroh-tickets` --- Cargo.lock | 368 ++++++++++----------------------------------------- Cargo.toml | 8 +- README.md | 4 +- src/lib.rs | 2 +- src/main.rs | 127 +++++++++--------- tests/cli.rs | 14 +- 6 files changed, 145 insertions(+), 378 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4173ae8..ff95bf0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -610,22 +610,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9d8dd2f26c86b27a2a8ea2767ec7f9df7a89516e4794e54ac01ee618dda3aa4" dependencies = [ "const-oid", - "der_derive", "pem-rfc7468", "zeroize", ] -[[package]] -name = "der_derive" -version = "0.8.0-rc.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be645fee2afe89d293b96c19e4456e6ac69520fc9c6b8a58298550138e361ffe" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", -] - [[package]] name = "deranged" version = "0.4.0" @@ -746,8 +734,8 @@ dependencies = [ "duct", "hex", "iroh", - "iroh-base", "iroh-quinn", + "iroh-tickets", "n0-snafu", "nix", "rand 0.9.2", @@ -1027,12 +1015,6 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" -[[package]] -name = "glob" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" - [[package]] name = "gloo-timers" version = "0.3.0" @@ -1505,8 +1487,9 @@ dependencies = [ [[package]] name = "iroh" -version = "0.93.2" -source = "git+https://github.com/n0-computer/iroh.git?branch=main#3ec554c8422fb7e0dfd806f89772c9449111d317" +version = "0.94.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9428cef1eafd2eac584269986d1949e693877ac12065b401dfde69f664b07ac" dependencies = [ "aead", "backon", @@ -1514,10 +1497,8 @@ dependencies = [ "cfg_aliases", "crypto_box", "data-encoding", - "der", "derive_more 2.0.1", "ed25519-dalek", - "futures-buffered", "futures-util", "getrandom 0.3.3", "hickory-resolver", @@ -1530,19 +1511,18 @@ dependencies = [ "iroh-quinn-proto", "iroh-quinn-udp", "iroh-relay", - "n0-future 0.3.0", + "n0-future", "n0-snafu", "n0-watcher", "nested_enum_utils", - "netdev 0.38.2", - "netwatch 0.10.0", + "netdev", + "netwatch", "pin-project", "pkarr", "pkcs8", "portmapper", "rand 0.9.2", "reqwest", - "ring", "rustls", "rustls-pki-types", "rustls-platform-verifier", @@ -1551,7 +1531,6 @@ dependencies = [ "smallvec", "snafu", "strum", - "surge-ping", "time", "tokio", "tokio-stream", @@ -1565,8 +1544,9 @@ dependencies = [ [[package]] name = "iroh-base" -version = "0.93.2" -source = "git+https://github.com/n0-computer/iroh.git?branch=main#3ec554c8422fb7e0dfd806f89772c9449111d317" +version = "0.94.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db942f6f3d6fa9b475690c6e8e6684d60591dd886bf1bdfef4c60d89d502215c" dependencies = [ "curve25519-dalek", "data-encoding", @@ -1574,7 +1554,6 @@ dependencies = [ "ed25519-dalek", "n0-snafu", "nested_enum_utils", - "postcard", "rand_core 0.9.3", "serde", "snafu", @@ -1667,8 +1646,9 @@ dependencies = [ [[package]] name = "iroh-relay" -version = "0.93.2" -source = "git+https://github.com/n0-computer/iroh.git?branch=main#3ec554c8422fb7e0dfd806f89772c9449111d317" +version = "0.94.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "360e201ab1803201de9a125dd838f7a4d13e6ba3a79aeb46c7fbf023266c062e" dependencies = [ "blake3", "bytes", @@ -1686,7 +1666,7 @@ dependencies = [ "iroh-quinn", "iroh-quinn-proto", "lru 0.16.1", - "n0-future 0.3.0", + "n0-future", "n0-snafu", "nested_enum_utils", "num_enum", @@ -1697,7 +1677,6 @@ dependencies = [ "reqwest", "rustls", "rustls-pki-types", - "rustls-webpki", "serde", "serde_bytes", "sha1", @@ -1714,6 +1693,22 @@ dependencies = [ "z32", ] +[[package]] +name = "iroh-tickets" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7683c7819693eb8b3d61d1d45ffa92e2faeb07762eb0c3debb50ad795538d221" +dependencies = [ + "data-encoding", + "derive_more 2.0.1", + "iroh-base", + "n0-snafu", + "nested_enum_utils", + "postcard", + "serde", + "snafu", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -1892,48 +1887,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "n0-future" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bb0e5d99e681ab3c938842b96fcb41bf8a7bb4bfdb11ccbd653a7e83e06c794" -dependencies = [ - "cfg_aliases", - "derive_more 1.0.0", - "futures-buffered", - "futures-lite", - "futures-util", - "js-sys", - "pin-project", - "send_wrapper", - "tokio", - "tokio-util", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-time", -] - -[[package]] -name = "n0-future" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d7dd42bd0114c9daa9c4f2255d692a73bba45767ec32cf62892af6fe5d31f6" -dependencies = [ - "cfg_aliases", - "derive_more 1.0.0", - "futures-buffered", - "futures-lite", - "futures-util", - "js-sys", - "pin-project", - "send_wrapper", - "tokio", - "tokio-util", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-time", -] - [[package]] name = "n0-future" version = "0.3.0" @@ -1970,12 +1923,12 @@ dependencies = [ [[package]] name = "n0-watcher" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31462392a10d5ada4b945e840cbec2d5f3fee752b96c4b33eb41414d8f45c2a" +checksum = "34c65e127e06e5a2781b28df6a33ea474a7bddc0ac0cfea888bd20c79a1b6516" dependencies = [ - "derive_more 1.0.0", - "n0-future 0.1.3", + "derive_more 2.0.1", + "n0-future", "snafu", ] @@ -1991,23 +1944,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "netdev" -version = "0.37.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa1e3eaf125c54c21e6221df12dd2a0a682784a068782dd564c836c0f281b6d" -dependencies = [ - "dlopen2", - "ipnet", - "libc", - "netlink-packet-core 0.7.0", - "netlink-packet-route 0.22.0", - "netlink-sys", - "once_cell", - "system-configuration", - "windows-sys 0.59.0", -] - [[package]] name = "netdev" version = "0.38.2" @@ -2017,25 +1953,14 @@ dependencies = [ "dlopen2", "ipnet", "libc", - "netlink-packet-core 0.8.1", - "netlink-packet-route 0.25.1", + "netlink-packet-core", + "netlink-packet-route", "netlink-sys", "once_cell", "system-configuration", "windows-sys 0.59.0", ] -[[package]] -name = "netlink-packet-core" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72724faf704479d67b388da142b186f916188505e7e0b26719019c525882eda4" -dependencies = [ - "anyhow", - "byteorder", - "netlink-packet-utils", -] - [[package]] name = "netlink-packet-core" version = "0.8.1" @@ -2045,36 +1970,6 @@ dependencies = [ "paste", ] -[[package]] -name = "netlink-packet-route" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0e7987b28514adf555dc1f9a5c30dfc3e50750bbaffb1aec41ca7b23dcd8e4" -dependencies = [ - "anyhow", - "bitflags", - "byteorder", - "libc", - "log", - "netlink-packet-core 0.7.0", - "netlink-packet-utils", -] - -[[package]] -name = "netlink-packet-route" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56d83370a96813d7c977f8b63054f1162df6e5784f1c598d689236564fb5a6f2" -dependencies = [ - "anyhow", - "bitflags", - "byteorder", - "libc", - "log", - "netlink-packet-core 0.7.0", - "netlink-packet-utils", -] - [[package]] name = "netlink-packet-route" version = "0.25.1" @@ -2084,33 +1979,7 @@ dependencies = [ "bitflags", "libc", "log", - "netlink-packet-core 0.8.1", -] - -[[package]] -name = "netlink-packet-utils" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34" -dependencies = [ - "anyhow", - "byteorder", - "paste", - "thiserror 1.0.69", -] - -[[package]] -name = "netlink-proto" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72452e012c2f8d612410d89eea01e2d9b56205274abb35d53f60200b2ec41d60" -dependencies = [ - "bytes", - "futures", - "log", - "netlink-packet-core 0.7.0", - "netlink-sys", - "thiserror 2.0.12", + "netlink-packet-core", ] [[package]] @@ -2122,7 +1991,7 @@ dependencies = [ "bytes", "futures", "log", - "netlink-packet-core 0.8.1", + "netlink-packet-core", "netlink-sys", "thiserror 2.0.12", ] @@ -2142,9 +2011,9 @@ dependencies = [ [[package]] name = "netwatch" -version = "0.9.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a63d76f52f3f15ebde3ca751a2ab73a33ae156662bc04383bac8e824f84e9bb" +checksum = "98d7ec7abdbfe67ee70af3f2002326491178419caea22254b9070e6ff0c83491" dependencies = [ "atomic-waker", "bytes", @@ -2153,48 +2022,13 @@ dependencies = [ "iroh-quinn-udp", "js-sys", "libc", - "n0-future 0.1.3", + "n0-future", "n0-watcher", "nested_enum_utils", - "netdev 0.37.3", - "netlink-packet-core 0.7.0", - "netlink-packet-route 0.24.0", - "netlink-proto 0.11.5", - "netlink-sys", - "pin-project-lite", - "serde", - "snafu", - "socket2 0.6.0", - "time", - "tokio", - "tokio-util", - "tracing", - "web-sys", - "windows 0.61.3", - "windows-result 0.3.4", - "wmi", -] - -[[package]] -name = "netwatch" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29acc9361df4a91bde6d2ec1ce110de7c826e574eeb3662ec1f574af00b96c48" -dependencies = [ - "atomic-waker", - "bytes", - "cfg_aliases", - "derive_more 2.0.1", - "iroh-quinn-udp", - "js-sys", - "libc", - "n0-future 0.2.0", - "n0-watcher", - "nested_enum_utils", - "netdev 0.38.2", - "netlink-packet-core 0.8.1", - "netlink-packet-route 0.25.1", - "netlink-proto 0.12.0", + "netdev", + "netlink-packet-core", + "netlink-packet-route", + "netlink-proto", "netlink-sys", "pin-project-lite", "serde", @@ -2222,12 +2056,6 @@ dependencies = [ "libc", ] -[[package]] -name = "no-std-net" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" - [[package]] name = "ntimestamp" version = "1.0.0" @@ -2463,48 +2291,6 @@ dependencies = [ "spki", ] -[[package]] -name = "pnet_base" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4cf6fb3ab38b68d01ab2aea03ed3d1132b4868fa4e06285f29f16da01c5f4c" -dependencies = [ - "no-std-net", -] - -[[package]] -name = "pnet_macros" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688b17499eee04a0408aca0aa5cba5fc86401d7216de8a63fdf7a4c227871804" -dependencies = [ - "proc-macro2", - "quote", - "regex", - "syn 2.0.104", -] - -[[package]] -name = "pnet_macros_support" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eea925b72f4bd37f8eab0f221bbe4c78b63498350c983ffa9dd4bcde7e030f56" -dependencies = [ - "pnet_base", -] - -[[package]] -name = "pnet_packet" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a005825396b7fe7a38a8e288dbc342d5034dac80c15212436424fef8ea90ba" -dependencies = [ - "glob", - "pnet_base", - "pnet_macros", - "pnet_macros_support", -] - [[package]] name = "poly1305" version = "0.9.0-rc.2" @@ -2523,9 +2309,9 @@ checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" [[package]] name = "portmapper" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f7313cafd74e95e6a358c1d0a495112f175502cc2e69870d0a5b12b6553059" +checksum = "d73aa9bd141e0ff6060fea89a5437883f3b9ceea1cda71c790b90e17d072a3b3" dependencies = [ "base64", "bytes", @@ -2537,7 +2323,7 @@ dependencies = [ "iroh-metrics", "libc", "nested_enum_utils", - "netwatch 0.9.0", + "netwatch", "num_enum", "rand 0.9.2", "serde", @@ -2554,9 +2340,9 @@ dependencies = [ [[package]] name = "postcard" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c1de96e20f51df24ca73cafcc4690e044854d803259db27a00a461cb3b9d17a" +checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" dependencies = [ "cobs", "embedded-io 0.4.0", @@ -2757,18 +2543,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - [[package]] name = "regex-automata" version = "0.4.9" @@ -3051,10 +2825,11 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ + "serde_core", "serde_derive", ] @@ -3067,11 +2842,20 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -3231,9 +3015,9 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "snafu" -version = "0.8.6" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320b01e011bf8d5d7a4a4a4be966d9160968935849c83b918827f6a435e7f627" +checksum = "6e84b3f4eacbf3a1ce05eac6763b4d629d60cbc94d632e4092c54ade71f1e1a2" dependencies = [ "backtrace", "snafu-derive", @@ -3241,9 +3025,9 @@ dependencies = [ [[package]] name = "snafu-derive" -version = "0.8.6" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1961e2ef424c1424204d3a5d6975f934f56b6d50ff5732382d84ebf460e147f7" +checksum = "c1c97747dbf44bb1ca44a561ece23508e99cb592e862f22222dcf42f51d1e451" dependencies = [ "heck", "proc-macro2", @@ -3335,22 +3119,6 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" -[[package]] -name = "surge-ping" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fda78103d8016bb25c331ddc54af634e801806463682cc3e549d335df644d95" -dependencies = [ - "hex", - "parking_lot", - "pnet_packet", - "rand 0.9.2", - "socket2 0.5.10", - "thiserror 1.0.69", - "tokio", - "tracing", -] - [[package]] name = "syn" version = "1.0.109" diff --git a/Cargo.toml b/Cargo.toml index b1f7128..32af7cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,8 +17,8 @@ rust-version = "1.81" snafu = "0.8.6" clap = { version = "4.4.10", features = ["derive"] } hex = "0.4.3" -iroh = { version = "0.93", default-features = false } -iroh-base = { version = "0.93", features = ["ticket"] } +iroh = { version = "0.94", default-features = false } +iroh-tickets= { version = "0.1" } quinn = { version = "0.14", package = "iroh-quinn" } rand = "0.9.2" tokio = { version = "1.34.0", features = ["full"] } @@ -40,7 +40,3 @@ codegen-units = 1 lto = true debug = "none" strip = true - -[patch.crates-io] -iroh = { git = "https://github.com/n0-computer/iroh.git", branch = "main" } -iroh-base = { git = "https://github.com/n0-computer/iroh.git", branch = "main" } diff --git a/README.md b/README.md index 5dd6db9..56b7d35 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ relay if hole punching does not succeed. It is also useful as a standalone tool for quick copy jobs. This is inspired by the unix tool [netcat](https://en.wikipedia.org/wiki/Netcat). While netcat -works with IP addresses, dumbpipe works with 256 bit node ids and therefore is somewhat location transparent. In addition, connections are encrypted using TLS. +works with IP addresses, dumbpipe works with 256 bit endpoint ids and therefore is somewhat location transparent. In addition, connections are encrypted using TLS. # Installation @@ -44,7 +44,7 @@ outputs ticket ### Receiver side ``` -dumbpipe connect nodeealvvv4nwa522qhznqrblv6jxcrgnvpapvakxw5i6mwltmm6ps2r4aicamaakdu5wtjasadei2qdfuqjadakqk3t2ieq | ffplay -f mpegts -fflags nobuffer -framedrop - +dumbpipe connect endpointealvvv4nwa522qhznqrblv6jxcrgnvpapvakxw5i6mwltmm6ps2r4aicamaakdu5wtjasadei2qdfuqjadakqk3t2ieq | ffplay -f mpegts -fflags nobuffer -framedrop - ``` - Adjust the ffmpeg options according to your local platform and video capture devices. diff --git a/src/lib.rs b/src/lib.rs index 12242e7..e0c519d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,4 +10,4 @@ pub const ALPN: &[u8] = b"DUMBPIPEV0"; /// calls accept_bi() must consume it. pub const HANDSHAKE: [u8; 5] = *b"hello"; -pub use iroh_base::ticket::NodeTicket; +pub use iroh_tickets::endpoint::EndpointTicket; diff --git a/src/main.rs b/src/main.rs index 70ac10c..a96ef84 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ //! Command line arguments. use clap::{Parser, Subcommand}; -use dumbpipe::NodeTicket; -use iroh::{endpoint::Connecting, Endpoint, NodeAddr, SecretKey}; +use dumbpipe::EndpointTicket; +use iroh::{endpoint::Connecting, Endpoint, EndpointAddr, SecretKey}; use n0_snafu::{Result, ResultExt}; use std::{ io, @@ -23,9 +23,9 @@ use { /// Create a dumb pipe between two machines, using an iroh endpoint. /// /// One side listens, the other side connects. Both sides are identified by a -/// 32 byte node id. +/// 32 byte endpoint id. /// -/// Connecting to a node id is independent of its IP address. Dumbpipe will try +/// Connecting to a endpoint id is independent of its IP address. Dumbpipe will try /// to establish a direct connection even through NATs and firewalls. If that /// fails, it will fall back to using a relay server. /// @@ -45,13 +45,13 @@ pub enum Commands { /// Listen on an endpoint and forward stdin/stdout to the first incoming /// bidi stream. /// - /// Will print a node ticket on stderr that can be used to connect. + /// Will print a endpoint ticket on stderr that can be used to connect. Listen(ListenArgs), /// Listen on an endpoint and forward incoming connections to the specified /// host and port. Every incoming bidi stream is forwarded to a new connection. /// - /// Will print a node ticket on stderr that can be used to connect. + /// Will print a endpoint ticket on stderr that can be used to connect. /// /// As far as the endpoint is concerned, this is listening. But it is /// connecting to a TCP socket for which you have to specify the host and port. @@ -59,13 +59,13 @@ pub enum Commands { /// Connect to an endpoint, open a bidi stream, and forward stdin/stdout. /// - /// A node ticket is required to connect. + /// A endpoint ticket is required to connect. Connect(ConnectArgs), /// Connect to an endpoint, open a bidi stream, and forward stdin/stdout /// to it. /// - /// A node ticket is required to connect. + /// A endpoint ticket is required to connect. /// /// As far as the endpoint is concerned, this is connecting. But it is /// listening on a TCP socket for which you have to specify the interface and port. @@ -75,7 +75,7 @@ pub enum Commands { /// Listen on an endpoint and forward incoming connections to the specified /// Unix socket path. Every incoming bidi stream is forwarded to a new connection. /// - /// Will print a node ticket on stderr that can be used to connect. + /// Will print a endpoint ticket on stderr that can be used to connect. /// /// As far as the endpoint is concerned, this is listening. But it is /// connecting to a Unix socket for which you have to specify the path. @@ -85,7 +85,7 @@ pub enum Commands { /// Connect to an endpoint, open a bidi stream, and forward connections /// from the specified Unix socket path. /// - /// A node ticket is required to connect. + /// A endpoint ticket is required to connect. /// /// As far as the endpoint is concerned, this is connecting. But it is /// listening on a Unix socket for which you have to specify the path. @@ -175,8 +175,8 @@ pub struct ConnectTcpArgs { #[clap(long)] pub addr: String, - /// The node to connect to - pub ticket: NodeTicket, + /// The endpoint to connect to + pub ticket: EndpointTicket, #[clap(flatten)] pub common: CommonArgs, @@ -184,8 +184,8 @@ pub struct ConnectTcpArgs { #[derive(Parser, Debug)] pub struct ConnectArgs { - /// The node to connect to - pub ticket: NodeTicket, + /// The endpoint to connect to + pub ticket: EndpointTicket, /// Immediately close our sending side, indicating that we will not transmit any data #[clap(long)] @@ -213,8 +213,8 @@ pub struct ConnectUnixArgs { #[clap(long)] pub socket_path: PathBuf, - /// The node to connect to - pub ticket: NodeTicket, + /// The endpoint to connect to + pub ticket: EndpointTicket, #[clap(flatten)] pub common: CommonArgs, @@ -346,11 +346,9 @@ async fn listen_stdio(args: ListenArgs) -> Result<()> { let endpoint = create_endpoint(secret_key, &args.common, vec![args.common.alpn()?]).await?; // wait for the endpoint to figure out its home relay and addresses before making a ticket endpoint.online().await; - let node = endpoint.node_addr(); - let mut short = node.clone(); - let ticket = NodeTicket::new(node); - short.direct_addresses.clear(); - let short = NodeTicket::new(short); + let addr = endpoint.addr(); + let short = create_short_ticket(&addr); + let ticket = EndpointTicket::new(addr); // print the ticket on stderr so it doesn't interfere with the data itself // @@ -372,8 +370,8 @@ async fn listen_stdio(args: ListenArgs) -> Result<()> { continue; } }; - let remote_node_id = &connection.remote_node_id()?; - tracing::info!("got connection from {}", remote_node_id); + let remote_endpoint_id = &connection.remote_id()?; + tracing::info!("got connection from {}", remote_endpoint_id); let (s, mut r) = match connection.accept_bi().await { Ok(x) => x, Err(cause) => { @@ -382,7 +380,7 @@ async fn listen_stdio(args: ListenArgs) -> Result<()> { continue; } }; - tracing::info!("accepted bidi stream from {}", remote_node_id); + tracing::info!("accepted bidi stream from {}", remote_endpoint_id); if !args.common.is_custom_alpn() { // read the handshake and verify it let mut buf = [0u8; dumbpipe::HANDSHAKE.len()]; @@ -390,10 +388,10 @@ async fn listen_stdio(args: ListenArgs) -> Result<()> { snafu::ensure_whatever!(buf == dumbpipe::HANDSHAKE, "invalid handshake"); } if args.recv_only { - tracing::info!("forwarding stdout to {} (ignoring stdin)", remote_node_id); + tracing::info!("forwarding stdout to {} (ignoring stdin)", remote_endpoint_id); forward_bidi(tokio::io::empty(), tokio::io::stdout(), r, s).await?; } else { - tracing::info!("forwarding stdin/stdout to {}", remote_node_id); + tracing::info!("forwarding stdin/stdout to {}", remote_endpoint_id); forward_bidi(tokio::io::stdin(), tokio::io::stdout(), r, s).await?; } // stop accepting connections after the first successful one @@ -405,14 +403,14 @@ async fn listen_stdio(args: ListenArgs) -> Result<()> { async fn connect_stdio(args: ConnectArgs) -> Result<()> { let secret_key = get_or_create_secret()?; let endpoint = create_endpoint(secret_key, &args.common, vec![]).await?; - let addr = args.ticket.node_addr(); - let remote_node_id = addr.node_id; - // connect to the node, try only once + let addr = args.ticket.endpoint_addr(); + let remote_endpoint_id = addr.id; + // connect to the remote, try only once let connection = endpoint.connect(addr.clone(), &args.common.alpn()?).await?; - tracing::info!("connected to {}", remote_node_id); + tracing::info!("connected to {}", remote_endpoint_id); // open a bidi stream, try only once let (mut s, r) = connection.open_bi().await.e()?; - tracing::info!("opened bidi stream to {}", remote_node_id); + tracing::info!("opened bidi stream to {}", remote_endpoint_id); // send the handshake unless we are using a custom alpn // when using a custom alpn, evertyhing is up to the user if !args.common.is_custom_alpn() { @@ -421,10 +419,10 @@ async fn connect_stdio(args: ConnectArgs) -> Result<()> { s.write_all(&dumbpipe::HANDSHAKE).await.e()?; } if args.recv_only { - tracing::info!("forwarding stdout to {} (ignoring stdin)", remote_node_id); + tracing::info!("forwarding stdout to {} (ignoring stdin)", remote_endpoint_id); forward_bidi(tokio::io::empty(), tokio::io::stdout(), r, s).await?; } else { - tracing::info!("forwarding stdin/stdout to {}", remote_node_id); + tracing::info!("forwarding stdin/stdout to {}", remote_endpoint_id); forward_bidi(tokio::io::stdin(), tokio::io::stdout(), r, s).await?; } tokio::io::stdout().flush().await.e()?; @@ -455,7 +453,7 @@ async fn connect_tcp(args: ConnectTcpArgs) -> Result<()> { }; async fn handle_tcp_accept( next: io::Result<(tokio::net::TcpStream, SocketAddr)>, - addr: NodeAddr, + addr: EndpointAddr, endpoint: Endpoint, handshake: bool, alpn: &[u8], @@ -463,15 +461,15 @@ async fn connect_tcp(args: ConnectTcpArgs) -> Result<()> { let (tcp_stream, tcp_addr) = next.context("error accepting tcp connection")?; let (tcp_recv, tcp_send) = tcp_stream.into_split(); tracing::info!("got tcp connection from {}", tcp_addr); - let remote_node_id = addr.node_id; + let remote_endpoint_id = addr.id; let connection = endpoint .connect(addr, alpn) .await - .context(format!("error connecting to {remote_node_id}"))?; + .context(format!("error connecting to {remote_endpoint_id}"))?; let (mut endpoint_send, endpoint_recv) = connection .open_bi() .await - .context(format!("error opening bidi stream to {remote_node_id}"))?; + .context(format!("error opening bidi stream to {remote_endpoint_id}"))?; // send the handshake unless we are using a custom alpn // when using a custom alpn, evertyhing is up to the user if handshake { @@ -482,7 +480,7 @@ async fn connect_tcp(args: ConnectTcpArgs) -> Result<()> { forward_bidi(tcp_recv, tcp_send, endpoint_recv, endpoint_send).await?; Ok::<_, n0_snafu::Error>(()) } - let addr = args.ticket.node_addr(); + let addr = args.ticket.endpoint_addr(); loop { // also wait for ctrl-c here so we can use it before accepting a connection let next = tokio::select! { @@ -518,11 +516,9 @@ async fn listen_tcp(args: ListenTcpArgs) -> Result<()> { let endpoint = create_endpoint(secret_key, &args.common, vec![args.common.alpn()?]).await?; // wait for the endpoint to figure out its address before making a ticket endpoint.online().await; - let node_addr = endpoint.node_addr(); - let mut short = node_addr.clone(); - let ticket = NodeTicket::new(node_addr); - short.direct_addresses.clear(); - let short = NodeTicket::new(short); + let addr = endpoint.addr(); + let short = create_short_ticket(&addr); + let ticket = EndpointTicket::new(addr); // print the ticket on stderr so it doesn't interfere with the data itself // @@ -533,8 +529,8 @@ async fn listen_tcp(args: ListenTcpArgs) -> Result<()> { if args.common.verbose > 0 { eprintln!("or:\ndumbpipe connect-tcp {short}"); } - tracing::info!("node id is {}", ticket.node_addr().node_id); - tracing::info!("derp url is {:?}", ticket.node_addr().relay_url); + tracing::info!("endpoint id is {}", ticket.endpoint_addr().id); + tracing::info!("relay url is {:?}", ticket.endpoint_addr().relay_urls().next().map_or("None".to_string(), |url| url.to_string())); // handle a new incoming connection on the endpoint async fn handle_endpoint_accept( @@ -543,13 +539,13 @@ async fn listen_tcp(args: ListenTcpArgs) -> Result<()> { handshake: bool, ) -> Result<()> { let connection = connecting.await.context("error accepting connection")?; - let remote_node_id = &connection.remote_node_id()?; - tracing::info!("got connection from {}", remote_node_id); + let remote_endpoint_id = &connection.remote_id()?; + tracing::info!("got connection from {}", remote_endpoint_id); let (s, mut r) = connection .accept_bi() .await .context("error accepting stream")?; - tracing::info!("accepted bidi stream from {}", remote_node_id); + tracing::info!("accepted bidi stream from {}", remote_endpoint_id); if handshake { // read the handshake and verify it let mut buf = [0u8; dumbpipe::HANDSHAKE.len()]; @@ -592,6 +588,15 @@ async fn listen_tcp(args: ListenTcpArgs) -> Result<()> { Ok(()) } +/// Creates a ticket that only includes the id and any relay urls +fn create_short_ticket(addr: &EndpointAddr) -> EndpointTicket { + let mut short = EndpointAddr::new(addr.id); + for relay_url in addr.relay_urls() { + short = short.with_relay_url(relay_url.clone()); + } + short.into() +} + #[cfg(unix)] /// Listen on an endpoint and forward incoming connections to a Unix socket. async fn listen_unix(args: ListenUnixArgs) -> Result<()> { @@ -600,11 +605,9 @@ async fn listen_unix(args: ListenUnixArgs) -> Result<()> { let endpoint = create_endpoint(secret_key, &args.common, vec![args.common.alpn()?]).await?; // wait for the endpoint to figure out its address before making a ticket endpoint.online().await; - let node_addr = endpoint.node_addr(); - let mut short = node_addr.clone(); - let ticket = NodeTicket::new(node_addr); - short.direct_addresses.clear(); - let short = NodeTicket::new(short); + let addr = endpoint.addr(); + let short = create_short_ticket(&addr); + let ticket = EndpointTicket::new(addr); // print the ticket on stderr so it doesn't interfere with the data itself // @@ -620,8 +623,8 @@ async fn listen_unix(args: ListenUnixArgs) -> Result<()> { eprintln!("or:\ndumbpipe connect-unix --socket-path /path/to/client.sock {short}"); eprintln!("dumbpipe connect-tcp --addr 127.0.0.1:8080 {short}"); } - tracing::info!("node id is {}", ticket.node_addr().node_id); - tracing::info!("derp url is {:?}", ticket.node_addr().relay_url); + tracing::info!("endpoint id is {}", ticket.endpoint_addr().id); + tracing::info!("relay url is {:?}", ticket.endpoint_addr().relay_urls().next().map_or("None".to_string(), |url| url.to_string())); // handle a new incoming connection on the endpoint async fn handle_endpoint_accept( @@ -631,13 +634,13 @@ async fn listen_unix(args: ListenUnixArgs) -> Result<()> { ) -> Result<()> { tracing::trace!("accepting connection"); let connection = connecting.await.context("error accepting connection")?; - let remote_node_id = &connection.remote_node_id()?; - tracing::info!("got connection from {}", remote_node_id); + let remote_endpoint_id = &connection.remote_id()?; + tracing::info!("got connection from {}", remote_endpoint_id); let (s, mut r) = connection .accept_bi() .await .context("error accepting stream")?; - tracing::info!("accepted bidi stream from {}", remote_node_id); + tracing::info!("accepted bidi stream from {}", remote_endpoint_id); if handshake { // read the handshake and verify it tracing::trace!("reading handshake"); @@ -723,13 +726,13 @@ async fn connect_unix(args: ConnectUnixArgs) -> Result<()> { } } - let addr = args.ticket.node_addr(); - tracing::info!("connecting to remote node: {:?}", addr); + let addr = args.ticket.endpoint_addr(); + tracing::info!("connecting to remote endpoint: {:?}", addr); let connection = endpoint .connect(addr.clone(), &args.common.alpn()?) .await - .context("failed to connect to remote node")?; - tracing::info!("connected to remote node successfully"); + .context("failed to connect to remote endpoint")?; + tracing::info!("connected to remote endpoint successfully"); let unix_listener = UnixListener::bind(&socket_path) .with_context(|| format!("failed to bind Unix socket at {socket_path:?}"))?; diff --git a/tests/cli.rs b/tests/cli.rs index afe4441..d63e0ef 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -1,5 +1,5 @@ #![cfg_attr(target_os = "windows", allow(unused_imports, dead_code))] -use dumbpipe::NodeTicket; +use dumbpipe::EndpointTicket; use rand::Rng; use std::{ @@ -68,7 +68,7 @@ fn connect_listen_happy() { let header = read_ascii_lines(3, &mut listen).unwrap(); let header = String::from_utf8(header).unwrap(); let ticket = header.split_ascii_whitespace().last().unwrap(); - let ticket = NodeTicket::from_str(ticket).unwrap(); + let ticket = EndpointTicket::from_str(ticket).unwrap(); let connect = duct::cmd(dumbpipe_bin(), ["connect", &ticket.to_string()]) .env_remove("RUST_LOG") // disable tracing @@ -109,7 +109,7 @@ fn connect_listen_custom_alpn_happy() { let header = read_ascii_lines(3, &mut listen).unwrap(); let header = String::from_utf8(header).unwrap(); let ticket = header.split_ascii_whitespace().last().unwrap(); - let ticket = NodeTicket::from_str(ticket).unwrap(); + let ticket = EndpointTicket::from_str(ticket).unwrap(); let connect = duct::cmd( dumbpipe_bin(), @@ -153,7 +153,7 @@ fn connect_listen_ctrlc_connect() { let header = read_ascii_lines(3, &mut listen).unwrap(); let header = String::from_utf8(header).unwrap(); let ticket = header.split_ascii_whitespace().last().unwrap(); - let ticket = NodeTicket::from_str(ticket).unwrap(); + let ticket = EndpointTicket::from_str(ticket).unwrap(); let mut connect = duct::cmd(dumbpipe_bin(), ["connect", &ticket.to_string()]) .env_remove("RUST_LOG") // disable tracing @@ -193,7 +193,7 @@ fn connect_listen_ctrlc_listen() { let header = read_ascii_lines(3, &mut listen).unwrap(); let header = String::from_utf8(header).unwrap(); let ticket = header.split_ascii_whitespace().last().unwrap(); - let ticket = NodeTicket::from_str(ticket).unwrap(); + let ticket = EndpointTicket::from_str(ticket).unwrap(); let mut connect = duct::cmd(dumbpipe_bin(), ["connect", &ticket.to_string()]) .env_remove("RUST_LOG") // disable tracing @@ -243,7 +243,7 @@ fn listen_tcp_happy() { let header = read_ascii_lines(4, &mut listen_tcp).unwrap(); let header = String::from_utf8(header).unwrap(); let ticket = header.split_ascii_whitespace().last().unwrap(); - let ticket = NodeTicket::from_str(ticket).unwrap(); + let ticket = EndpointTicket::from_str(ticket).unwrap(); // poke the listen-tcp process with a connect command let connect = duct::cmd(dumbpipe_bin(), ["connect", &ticket.to_string()]) .env_remove("RUST_LOG") // disable tracing @@ -270,7 +270,7 @@ fn connect_tcp_happy() { let header = read_ascii_lines(3, &mut listen).unwrap(); let header = String::from_utf8(header).unwrap(); let ticket = header.split_ascii_whitespace().last().unwrap(); - let ticket = NodeTicket::from_str(ticket).unwrap(); + let ticket = EndpointTicket::from_str(ticket).unwrap(); let ticket = ticket.to_string(); // start a dumbpipe connect-tcp process From 7ee6f7521a625a28a88397388b0a6b5f780c2338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cramfox=E2=80=9D?= <“kasey@n0.computer”> Date: Tue, 21 Oct 2025 16:26:31 -0400 Subject: [PATCH 3/3] fmt --- src/main.rs | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index a96ef84..e51c357 100644 --- a/src/main.rs +++ b/src/main.rs @@ -388,7 +388,10 @@ async fn listen_stdio(args: ListenArgs) -> Result<()> { snafu::ensure_whatever!(buf == dumbpipe::HANDSHAKE, "invalid handshake"); } if args.recv_only { - tracing::info!("forwarding stdout to {} (ignoring stdin)", remote_endpoint_id); + tracing::info!( + "forwarding stdout to {} (ignoring stdin)", + remote_endpoint_id + ); forward_bidi(tokio::io::empty(), tokio::io::stdout(), r, s).await?; } else { tracing::info!("forwarding stdin/stdout to {}", remote_endpoint_id); @@ -419,7 +422,10 @@ async fn connect_stdio(args: ConnectArgs) -> Result<()> { s.write_all(&dumbpipe::HANDSHAKE).await.e()?; } if args.recv_only { - tracing::info!("forwarding stdout to {} (ignoring stdin)", remote_endpoint_id); + tracing::info!( + "forwarding stdout to {} (ignoring stdin)", + remote_endpoint_id + ); forward_bidi(tokio::io::empty(), tokio::io::stdout(), r, s).await?; } else { tracing::info!("forwarding stdin/stdout to {}", remote_endpoint_id); @@ -530,7 +536,14 @@ async fn listen_tcp(args: ListenTcpArgs) -> Result<()> { eprintln!("or:\ndumbpipe connect-tcp {short}"); } tracing::info!("endpoint id is {}", ticket.endpoint_addr().id); - tracing::info!("relay url is {:?}", ticket.endpoint_addr().relay_urls().next().map_or("None".to_string(), |url| url.to_string())); + tracing::info!( + "relay url is {:?}", + ticket + .endpoint_addr() + .relay_urls() + .next() + .map_or("None".to_string(), |url| url.to_string()) + ); // handle a new incoming connection on the endpoint async fn handle_endpoint_accept( @@ -624,7 +637,14 @@ async fn listen_unix(args: ListenUnixArgs) -> Result<()> { eprintln!("dumbpipe connect-tcp --addr 127.0.0.1:8080 {short}"); } tracing::info!("endpoint id is {}", ticket.endpoint_addr().id); - tracing::info!("relay url is {:?}", ticket.endpoint_addr().relay_urls().next().map_or("None".to_string(), |url| url.to_string())); + tracing::info!( + "relay url is {:?}", + ticket + .endpoint_addr() + .relay_urls() + .next() + .map_or("None".to_string(), |url| url.to_string()) + ); // handle a new incoming connection on the endpoint async fn handle_endpoint_accept(