diff --git a/Cargo.lock b/Cargo.lock index e594473ad9..deadf4f763 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -218,7 +218,7 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time 0.3.36", ] @@ -314,7 +314,7 @@ dependencies = [ "pin-utils", "self_cell", "stop-token", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -334,7 +334,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9343dc5acf07e79ff82d0c37899f079db3534d99f189a1837c8e549c99405bec" dependencies = [ "native-tls", - "thiserror", + "thiserror 1.0.69", "tokio", "url", ] @@ -362,7 +362,7 @@ dependencies = [ "log", "nom", "pin-project", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -387,7 +387,7 @@ dependencies = [ "crc32fast", "futures-lite 2.5.0", "pin-project", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-util", ] @@ -445,7 +445,7 @@ dependencies = [ "sha1", "sync_wrapper 1.0.0", "tokio", - "tokio-tungstenite", + "tokio-tungstenite 0.21.0", "tower", "tower-layer", "tower-service", @@ -880,6 +880,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", + "clap_derive", ] [[package]] @@ -888,8 +889,22 @@ version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ + "anstream", "anstyle", "clap_lex", + "strsim 0.10.0", +] + +[[package]] +name = "clap_derive" +version = "4.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.90", ] [[package]] @@ -1260,7 +1275,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.11.1", "syn 2.0.90", ] @@ -1277,11 +1292,12 @@ dependencies = [ [[package]] name = "dashmap" -version = "5.5.3" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ "cfg-if", + "crossbeam-utils", "hashbrown", "lock_api", "once_cell", @@ -1337,8 +1353,9 @@ dependencies = [ "hyper", "hyper-util", "image", + "iroh", + "iroh-base", "iroh-gossip", - "iroh-net", "kamadak-exif", "lettre_email", "libc", @@ -1380,7 +1397,7 @@ dependencies = [ "tempfile", "testdir", "textwrap", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-io-timeout", "tokio-rustls", @@ -1487,7 +1504,7 @@ dependencies = [ "once_cell", "rand 0.8.5", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", "yerpc", ] @@ -1698,18 +1715,6 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" -[[package]] -name = "duct" -version = "0.13.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ab5718d1224b63252cd0c6f74f6480f9ffeb117438a2e0f5cf6d9a4798929c" -dependencies = [ - "libc", - "once_cell", - "os_pipe", - "shared_child", -] - [[package]] name = "dyn-clone" version = "1.0.17" @@ -1838,7 +1843,7 @@ dependencies = [ "hex", "lazy_static", "regex", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1998,9 +2003,9 @@ dependencies = [ [[package]] name = "erased_set" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a5aa24577083f8190ad401e376b55887c7cd9083ae95d83ceec5d28ea78125" +checksum = "a02a5d186d7bf1cb21f1f95e1a9cfa5c1f2dcd803a47aad454423ceec13525c5" [[package]] name = "errno" @@ -2086,7 +2091,7 @@ dependencies = [ "anyhow", "async-trait", "log", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-stream", ] @@ -2381,37 +2386,6 @@ dependencies = [ "slab", ] -[[package]] -name = "genawaiter" -version = "0.99.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c86bd0361bcbde39b13475e6e36cb24c329964aa2611be285289d1e4b751c1a0" -dependencies = [ - "futures-core", - "genawaiter-macro", - "genawaiter-proc-macro", - "proc-macro-hack", -] - -[[package]] -name = "genawaiter-macro" -version = "0.99.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b32dfe1fdfc0bbde1f22a5da25355514b5e450c33a6af6770884c8750aedfbc" - -[[package]] -name = "genawaiter-proc-macro" -version = "0.99.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784f84eebc366e15251c4a8c3acee82a6a6f427949776ecb88377362a9621738" -dependencies = [ - "proc-macro-error", - "proc-macro-hack", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "generator" version = "0.7.5" @@ -2494,14 +2468,15 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "governor" -version = "0.6.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" +checksum = "0746aa765db78b521451ef74221663b57ba595bf83f75d0ce23cc09447c8139f" dependencies = [ "cfg-if", "dashmap", - "futures", + "futures-sink", "futures-timer", + "futures-util", "no-std-compat", "nonzero_ext", "parking_lot", @@ -2606,7 +2581,7 @@ dependencies = [ "ipnet", "once_cell", "rand 0.8.5", - "thiserror", + "thiserror 1.0.69", "time 0.3.36", "tinyvec", "tokio", @@ -2630,7 +2605,7 @@ dependencies = [ "rand 0.8.5", "resolv-conf", "smallvec", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -2689,6 +2664,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "hostname" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9c7c7c8ac16c798734b8a24560c1362120597c40d5e1459f09498f8f6c8f2ba" +dependencies = [ + "cfg-if", + "libc", + "windows 0.52.0", +] + [[package]] name = "hostname-validator" version = "1.1.1" @@ -3125,15 +3111,95 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" + +[[package]] +name = "iroh" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80b15215aea8d0367fefb9264521e4a251dc4e113896a3d765f530378518188f" +dependencies = [ + "anyhow", + "backoff", + "base64 0.22.1", + "bytes", + "der", + "derive_more", + "futures-buffered", + "futures-concurrency", + "futures-lite 2.5.0", + "futures-sink", + "futures-util", + "governor", + "hex", + "hickory-proto", + "hickory-resolver", + "hostname 0.4.0", + "http 1.1.0", + "http-body-util", + "hyper", + "hyper-util", + "igd-next", + "iroh-base", + "iroh-metrics", + "iroh-net-report", + "iroh-quinn", + "iroh-quinn-proto", + "iroh-quinn-udp", + "iroh-relay", + "libc", + "netdev", + "netlink-packet-core", + "netlink-packet-route 0.19.0", + "netlink-packet-route 0.21.0", + "netlink-sys", + "netwatch", + "num_enum 0.7.3", + "once_cell", + "parking_lot", + "pin-project", + "pkarr", + "portmapper", + "postcard", + "rand 0.8.5", + "rcgen", + "reqwest", + "ring", + "rtnetlink 0.13.1", + "rtnetlink 0.14.1", + "rustls", + "rustls-webpki", + "serde", + "smallvec", + "socket2", + "strum", + "stun-rs", + "surge-ping", + "thiserror 2.0.4", + "time 0.3.36", + "tokio", + "tokio-rustls", + "tokio-stream", + "tokio-tungstenite 0.24.0", + "tokio-tungstenite-wasm", + "tokio-util", + "tracing", + "url", + "watchable", + "webpki-roots", + "windows 0.58.0", + "wmi", + "x509-parser", + "z32", +] [[package]] name = "iroh-base" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c21fd8eb71f166a172a9779c2244db992218e9a9bd929b9df6fc355d2b630c9" +checksum = "3fd98293ce8e85e6b4f0ce09af7c6bb860f2fece8fcf9238d6e628f1e163e27a" dependencies = [ "aead", "anyhow", @@ -3150,7 +3216,7 @@ dependencies = [ "rand_core 0.6.4", "serde", "ssh-key", - "thiserror", + "thiserror 2.0.4", "ttl_cache", "url", "zeroize", @@ -3171,9 +3237,9 @@ dependencies = [ [[package]] name = "iroh-gossip" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c078057037f0e741c5ef285c67fd9cfdb928163dd046fb547089898bdb02990e" +checksum = "e5688dded24660d9d64ab444768b969f8d4c06aae5221d9e2ef619f12873acee" dependencies = [ "anyhow", "async-channel 2.3.1", @@ -3183,12 +3249,11 @@ dependencies = [ "futures-concurrency", "futures-lite 2.5.0", "futures-util", + "hex", "indexmap", - "iroh-base", + "iroh", "iroh-blake3", "iroh-metrics", - "iroh-net", - "iroh-router", "postcard", "rand 0.8.5", "rand_core 0.6.4", @@ -3201,9 +3266,9 @@ dependencies = [ [[package]] name = "iroh-metrics" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0d40f2ee3997489d47403d204a06514ed65373d224b5b43a8ea133f543e5db1" +checksum = "a242381d5da20bb4a6cc7482b5cc687a739da8371aff0ea8c12aaf499801886b" dependencies = [ "anyhow", "erased_set", @@ -3221,82 +3286,31 @@ dependencies = [ ] [[package]] -name = "iroh-net" -version = "0.28.1" +name = "iroh-net-report" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b40e1f1f9029e198c6d05bd232d3239814b0a66ac4668978729b709aeb6a44e2" +checksum = "b82dc449d537176fc90749ae0711c6f81479053086928a2f2bb87cb52646ba74" dependencies = [ "anyhow", - "backoff", - "base64 0.22.1", "bytes", - "der", "derive_more", - "duct", "futures-buffered", - "futures-concurrency", "futures-lite 2.5.0", - "futures-sink", - "futures-util", - "genawaiter", - "governor", - "hex", - "hickory-proto", "hickory-resolver", - "hostname", - "http 1.1.0", - "http-body-util", - "hyper", - "hyper-util", - "igd-next", "iroh-base", "iroh-metrics", - "iroh-quinn", - "iroh-quinn-proto", - "iroh-quinn-udp", - "libc", - "netdev", - "netlink-packet-core", - "netlink-packet-route", - "netlink-sys", + "iroh-relay", "netwatch", - "num_enum 0.7.3", - "once_cell", - "parking_lot", - "pin-project", - "pkarr", "portmapper", - "postcard", "rand 0.8.5", - "rcgen", "reqwest", - "ring", - "rtnetlink", "rustls", - "rustls-webpki", - "serde", - "smallvec", - "socket2", - "strum", - "stun-rs", "surge-ping", - "thiserror", - "time 0.3.36", + "thiserror 1.0.69", "tokio", - "tokio-rustls", - "tokio-stream", - "tokio-tungstenite", - "tokio-tungstenite-wasm", "tokio-util", "tracing", - "tungstenite", "url", - "watchable", - "webpki-roots", - "windows 0.51.1", - "wmi", - "x509-parser", - "z32", ] [[package]] @@ -3312,7 +3326,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls", "socket2", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -3330,7 +3344,7 @@ dependencies = [ "rustls", "rustls-platform-verifier", "slab", - "thiserror", + "thiserror 1.0.69", "tinyvec", "tracing", ] @@ -3349,19 +3363,64 @@ dependencies = [ ] [[package]] -name = "iroh-router" -version = "0.28.0" +name = "iroh-relay" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd18ec6325dd3f01625f12c01acff50a4374ee1ab708e7b2078885fd63ad30" +checksum = "28a0d0d7317795a01caa47ffdaeec84211d1b394530bdb31dbe15f642e58bcff" dependencies = [ "anyhow", + "base64 0.22.1", + "bytes", + "clap", + "derive_more", "futures-buffered", "futures-lite 2.5.0", + "futures-sink", "futures-util", - "iroh-net", + "governor", + "hex", + "hickory-proto", + "hickory-resolver", + "hostname 0.4.0", + "http 1.1.0", + "http-body-util", + "hyper", + "hyper-util", + "iroh-base", + "iroh-metrics", + "iroh-quinn", + "iroh-quinn-proto", + "libc", + "num_enum 0.7.3", + "once_cell", + "parking_lot", + "pin-project", + "postcard", + "rand 0.8.5", + "rcgen", + "regex", + "reqwest", + "ring", + "rustls", + "rustls-pemfile", + "rustls-webpki", + "serde", + "smallvec", + "socket2", + "stun-rs", + "thiserror 2.0.4", + "time 0.3.36", "tokio", + "tokio-rustls", + "tokio-rustls-acme", + "tokio-tungstenite 0.24.0", + "tokio-tungstenite-wasm", "tokio-util", + "toml", "tracing", + "tracing-subscriber", + "url", + "webpki-roots", ] [[package]] @@ -3406,7 +3465,7 @@ dependencies = [ "combine", "jni-sys", "log", - "thiserror", + "thiserror 1.0.69", "walkdir", ] @@ -3610,26 +3669,6 @@ dependencies = [ "quoted_printable", ] -[[package]] -name = "mainline" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b751ffb57303217bcae8f490eee6044a5b40eadf6ca05ff476cad37e7b7970d" -dependencies = [ - "bytes", - "crc", - "ed25519-dalek", - "flume", - "lru", - "rand 0.8.5", - "serde", - "serde_bencode", - "serde_bytes", - "sha1_smol", - "thiserror", - "tracing", -] - [[package]] name = "match_cfg" version = "0.1.0" @@ -3667,12 +3706,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" -[[package]] -name = "memalloc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df39d232f5c40b0891c10216992c2f250c054105cb1e56f0fc9032db6203ecc1" - [[package]] name = "memchr" version = "2.7.1" @@ -3748,15 +3781,15 @@ dependencies = [ [[package]] name = "netdev" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7516ad2c46cc25da098ed7d6b9a0cbe9e1fbffbd04b1596148b95f2841179c83" +checksum = "f901362e84cd407be6f8cd9d3a46bccf09136b095792785401ea7d283c79b91d" dependencies = [ "dlopen2", + "ipnet", "libc", - "memalloc", "netlink-packet-core", - "netlink-packet-route", + "netlink-packet-route 0.17.1", "netlink-sys", "once_cell", "system-configuration", @@ -3788,6 +3821,35 @@ dependencies = [ "netlink-packet-utils", ] +[[package]] +name = "netlink-packet-route" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74c171cd77b4ee8c7708da746ce392440cb7bcf618d122ec9ecc607b12938bf4" +dependencies = [ + "anyhow", + "byteorder", + "libc", + "log", + "netlink-packet-core", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-route" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "483325d4bfef65699214858f097d504eb812c38ce7077d165f301ec406c3066e" +dependencies = [ + "anyhow", + "bitflags 2.6.0", + "byteorder", + "libc", + "log", + "netlink-packet-core", + "netlink-packet-utils", +] + [[package]] name = "netlink-packet-utils" version = "0.5.2" @@ -3797,7 +3859,7 @@ dependencies = [ "anyhow", "byteorder", "paste", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3811,15 +3873,15 @@ dependencies = [ "log", "netlink-packet-core", "netlink-sys", - "thiserror", + "thiserror 1.0.69", "tokio", ] [[package]] name = "netlink-sys" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" +checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" dependencies = [ "bytes", "futures", @@ -3830,30 +3892,34 @@ dependencies = [ [[package]] name = "netwatch" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a639d52c0996ac640e2a7052a5265c8f71efdbdadc83188435ffc358b7ca931" +checksum = "304c0c1b348830b016039f2cb1c5ac8217084a78875262c5594925dd08aa77fc" dependencies = [ "anyhow", + "atomic-waker", "bytes", "derive_more", "futures-lite 2.5.0", "futures-sink", "futures-util", + "iroh-quinn-udp", "libc", "netdev", "netlink-packet-core", - "netlink-packet-route", + "netlink-packet-route 0.19.0", "netlink-sys", "once_cell", - "rtnetlink", + "rtnetlink 0.13.1", + "rtnetlink 0.14.1", "serde", "socket2", - "thiserror", + "thiserror 2.0.4", "time 0.3.36", "tokio", + "tokio-util", "tracing", - "windows 0.51.1", + "windows 0.58.0", "wmi", ] @@ -3877,6 +3943,17 @@ dependencies = [ "libc", ] +[[package]] +name = "nix" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "libc", +] + [[package]] name = "nix" version = "0.28.0" @@ -4182,16 +4259,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "os_pipe" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57119c3b893986491ec9aa85056780d3a0f3cf4da7cc09dd3650dbd6c6738fb9" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "overload" version = "0.1.1" @@ -4314,7 +4381,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" dependencies = [ "memchr", - "thiserror", + "thiserror 1.0.69", "ucd-trie", ] @@ -4412,7 +4479,7 @@ dependencies = [ "sha3", "signature", "smallvec", - "thiserror", + "thiserror 1.0.69", "twofish", "x25519-dalek", "x448", @@ -4459,16 +4526,14 @@ checksum = "89f9e12544b00f5561253bbd3cb72a85ff3bc398483dc1bf82bdf095c774136b" dependencies = [ "bytes", "document-features", - "dyn-clone", "ed25519-dalek", "flume", "futures", "js-sys", "lru", - "mainline", "self_cell", "simple-dns", - "thiserror", + "thiserror 1.0.69", "tracing", "ureq", "wasm-bindgen", @@ -4618,9 +4683,9 @@ checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" [[package]] name = "portmapper" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d60045fdcfe8ff6b781cf1027fdbb08ed319d93aff7da4bedc018e3bc92226" +checksum = "68ea24e7552a28ee4a3478ae116c89080957d6816526d0a533bee6cd67048279" dependencies = [ "anyhow", "base64 0.22.1", @@ -4637,7 +4702,7 @@ dependencies = [ "serde", "smallvec", "socket2", - "thiserror", + "thiserror 2.0.4", "time 0.3.36", "tokio", "tokio-util", @@ -4753,32 +4818,6 @@ dependencies = [ "toml_edit 0.22.20", ] -[[package]] -name = "proc-macro-error" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18f33027081eba0a6d8aba6d1b1c3a3be58cbb12106341c2d5759fcd9b5277e7" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a5b4b77fdb63c1eca72173d68d24501c54ab1269409f6b672c85deb18af69de" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "syn-mid", - "version_check", -] - [[package]] name = "proc-macro-error-attr2" version = "2.0.0" @@ -4801,12 +4840,6 @@ dependencies = [ "syn 2.0.90", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - [[package]] name = "proc-macro2" version = "1.0.92" @@ -4925,7 +4958,7 @@ dependencies = [ "quinn-udp", "rustc-hash 1.1.0", "rustls", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -4942,7 +4975,7 @@ dependencies = [ "rustc-hash 2.0.0", "rustls", "slab", - "thiserror", + "thiserror 1.0.69", "tinyvec", "tracing", ] @@ -5110,12 +5143,13 @@ dependencies = [ [[package]] name = "rcgen" -version = "0.12.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48406db8ac1f3cbc7dcdb56ec355343817958a356ff430259bb07baf7607e1e1" +checksum = "54077e1872c46788540de1ea3d7f4ccb1983d12f9aa909b234468676c1a36779" dependencies = [ "pem", "ring", + "rustls-pki-types", "time 0.3.36", "yasna", ] @@ -5146,7 +5180,7 @@ checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ "getrandom 0.2.12", "libredox", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -5247,7 +5281,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" dependencies = [ - "hostname", + "hostname 0.3.1", "quick-error 1.2.3", ] @@ -5334,12 +5368,30 @@ dependencies = [ "futures", "log", "netlink-packet-core", - "netlink-packet-route", + "netlink-packet-route 0.17.1", "netlink-packet-utils", "netlink-proto", "netlink-sys", "nix 0.26.4", - "thiserror", + "thiserror 1.0.69", + "tokio", +] + +[[package]] +name = "rtnetlink" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b684475344d8df1859ddb2d395dd3dac4f8f3422a1aa0725993cb375fc5caba5" +dependencies = [ + "futures", + "log", + "netlink-packet-core", + "netlink-packet-route 0.19.0", + "netlink-packet-utils", + "netlink-proto", + "netlink-sys", + "nix 0.27.1", + "thiserror 1.0.69", "tokio", ] @@ -5682,25 +5734,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_bencode" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a70dfc7b7438b99896e7f8992363ab8e2c4ba26aa5ec675d32d1c3c2c33d413e" -dependencies = [ - "serde", - "serde_bytes", -] - -[[package]] -name = "serde_bytes" -version = "0.11.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" -dependencies = [ - "serde", -] - [[package]] name = "serde_derive" version = "1.0.215" @@ -5808,12 +5841,6 @@ dependencies = [ "sha1", ] -[[package]] -name = "sha1_smol" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" - [[package]] name = "sha2" version = "0.10.8" @@ -5863,7 +5890,7 @@ dependencies = [ "shadowsocks-crypto", "socket2", "spin", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-tfo", "url", @@ -5898,16 +5925,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "shared_child" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "shlex" version = "1.3.0" @@ -6067,6 +6084,12 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strsim" version = "0.11.1" @@ -6165,7 +6188,7 @@ dependencies = [ "pnet_packet", "rand 0.8.5", "socket2", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -6192,17 +6215,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "syn-mid" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea305d57546cc8cd04feb14b62ec84bf17f50e3f7b12560d7bfa9265f39d9ed" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "sync_wrapper" version = "0.1.2" @@ -6311,7 +6323,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" +dependencies = [ + "thiserror-impl 2.0.4", ] [[package]] @@ -6325,6 +6346,17 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "thiserror-impl" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "thread_local" version = "1.1.8" @@ -6462,6 +6494,34 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls-acme" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3184e8e292a828dd4bca5b2a60aba830ec5ed873a66c9ebb6e65038fa649e827" +dependencies = [ + "async-trait", + "base64 0.22.1", + "chrono", + "futures", + "log", + "num-bigint", + "pem", + "proc-macro2", + "rcgen", + "reqwest", + "ring", + "rustls", + "serde", + "serde_json", + "thiserror 2.0.4", + "time 0.3.36", + "tokio", + "tokio-rustls", + "webpki-roots", + "x509-parser", +] + [[package]] name = "tokio-stream" version = "0.1.16" @@ -6514,7 +6574,19 @@ dependencies = [ "futures-util", "log", "tokio", - "tungstenite", + "tungstenite 0.21.0", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edc5f74e248dc973e0dbb7b74c7e0d6fcc301c694ff50049504004ef4d0cdcd9" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite 0.24.0", ] [[package]] @@ -6528,9 +6600,9 @@ dependencies = [ "http 1.1.0", "httparse", "js-sys", - "thiserror", + "thiserror 1.0.69", "tokio", - "tokio-tungstenite", + "tokio-tungstenite 0.21.0", "wasm-bindgen", "web-sys", ] @@ -6715,11 +6787,29 @@ dependencies = [ "log", "rand 0.8.5", "sha1", - "thiserror", + "thiserror 1.0.69", "url", "utf-8", ] +[[package]] +name = "tungstenite" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18e5b8366ee7a95b16d32197d0b2604b43a0be89dc5fac9f8e96ccafbaedda8a" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 1.1.0", + "httparse", + "log", + "rand 0.8.5", + "sha1", + "thiserror 1.0.69", + "utf-8", +] + [[package]] name = "twofish" version = "0.7.1" @@ -7044,7 +7134,7 @@ dependencies = [ "event-listener 4.0.3", "futures-util", "parking_lot", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -7131,49 +7221,51 @@ dependencies = [ [[package]] name = "windows" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-core 0.51.1", - "windows-targets 0.48.5", + "windows-core 0.52.0", + "windows-targets 0.52.6", ] [[package]] name = "windows" -version = "0.52.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" dependencies = [ - "windows-core 0.52.0", - "windows-implement", - "windows-interface", + "windows-core 0.58.0", "windows-targets 0.52.6", ] [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] name = "windows-core" -version = "0.52.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-strings", "windows-targets 0.52.6", ] [[package]] name = "windows-implement" -version = "0.52.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12168c33176773b86799be25e2a2ba07c7aab9968b37541f1094dbd7a60c8946" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" dependencies = [ "proc-macro2", "quote", @@ -7182,15 +7274,34 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.52.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d8dc32e0095a7eeccebd0e3f09e9509365ecb3fc6ac4d6f5f14a3f6392942d1" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" dependencies = [ "proc-macro2", "quote", "syn 2.0.90", ] +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -7379,16 +7490,17 @@ dependencies = [ [[package]] name = "wmi" -version = "0.13.3" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f0a4062ca522aad4705a2948fd4061b3857537990202a8ddd5af21607f79a" +checksum = "dc47c0776cc6c00d2f7a874a0c846d94d45535936e5a1187693a24f23b4dd701" dependencies = [ "chrono", "futures", "log", "serde", - "thiserror", - "windows 0.52.0", + "thiserror 2.0.4", + "windows 0.58.0", + "windows-core 0.58.0", ] [[package]] @@ -7439,7 +7551,7 @@ dependencies = [ "nom", "oid-registry", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time 0.3.36", ] diff --git a/Cargo.toml b/Cargo.toml index c60c5a677c..0bd8cb562b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,8 +63,9 @@ humansize = "2" hyper = "1" hyper-util = "0.1.10" image = { version = "0.25.5", default-features=false, features = ["gif", "jpeg", "ico", "png", "pnm", "webp", "bmp"] } -iroh-gossip = { version = "0.28.1", default-features = false, features = ["net"] } -iroh-net = { version = "0.28.1", default-features = false } +iroh-gossip = { version = "0.29", default-features = false, features = ["net"] } +iroh = { version = "0.29", default-features = false } +iroh-base = { version = "0.29", features = ["base32"] } kamadak-exif = "0.6.1" lettre_email = { git = "https://github.com/deltachat/lettre", branch = "master" } libc = { workspace = true } diff --git a/src/imex/transfer.rs b/src/imex/transfer.rs index 7298834a2b..67188e2ad0 100644 --- a/src/imex/transfer.rs +++ b/src/imex/transfer.rs @@ -33,8 +33,7 @@ use std::task::Poll; use anyhow::{bail, format_err, Context as _, Result}; use futures_lite::FutureExt; -use iroh_net::relay::RelayMode; -use iroh_net::Endpoint; +use iroh::{Endpoint, RelayMode}; use tokio::fs; use tokio::task::JoinHandle; use tokio_util::sync::CancellationToken; @@ -65,11 +64,11 @@ const BACKUP_ALPN: &[u8] = b"/deltachat/backup"; /// task use the [`Context::stop_ongoing`] mechanism. #[derive(Debug)] pub struct BackupProvider { - /// iroh-net endpoint. + /// iroh endpoint. _endpoint: Endpoint, - /// iroh-net address. - node_addr: iroh_net::NodeAddr, + /// iroh address. + node_addr: iroh::NodeAddr, /// Authentication token that should be submitted /// to retrieve the backup. @@ -162,7 +161,7 @@ impl BackupProvider { async fn handle_connection( context: Context, - conn: iroh_net::endpoint::Connecting, + conn: iroh::endpoint::Connecting, auth_token: String, dbfile: Arc, ) -> Result<()> { @@ -291,7 +290,7 @@ impl Future for BackupProvider { pub async fn get_backup2( context: &Context, - node_addr: iroh_net::NodeAddr, + node_addr: iroh::NodeAddr, auth_token: String, ) -> Result<()> { let relay_mode = RelayMode::Disabled; @@ -337,7 +336,7 @@ pub async fn get_backup2( /// This is a long running operation which will return only when completed. /// /// Using [`Qr`] as argument is a bit odd as it only accepts specific variant of it. It -/// does avoid having [`iroh_net::NodeAddr`] in the primary API however, without +/// does avoid having [`iroh::NodeAddr`] in the primary API however, without /// having to revert to untyped bytes. pub async fn get_backup(context: &Context, qr: Qr) -> Result<()> { match qr { diff --git a/src/peer_channels.rs b/src/peer_channels.rs index feccc73880..c073b60b48 100644 --- a/src/peer_channels.rs +++ b/src/peer_channels.rs @@ -26,15 +26,14 @@ use anyhow::{anyhow, bail, Context as _, Result}; use email::Header; use futures_lite::StreamExt; +use iroh::key::{PublicKey, SecretKey}; +use iroh::{Endpoint, NodeAddr, NodeId, RelayMap, RelayMode, RelayUrl}; use iroh_gossip::net::{Event, Gossip, GossipEvent, JoinOptions, GOSSIP_ALPN}; use iroh_gossip::proto::TopicId; -use iroh_net::key::{PublicKey, SecretKey}; -use iroh_net::relay::{RelayMap, RelayUrl}; -use iroh_net::{relay::RelayMode, Endpoint}; -use iroh_net::{NodeAddr, NodeId}; use parking_lot::Mutex; use std::collections::{BTreeSet, HashMap}; use std::env; +use std::sync::Arc; use tokio::sync::{oneshot, RwLock}; use tokio::task::JoinHandle; use url::Url; @@ -54,11 +53,11 @@ const PUBLIC_KEY_STUB: &[u8] = "static_string".as_bytes(); /// Store iroh peer channels for the context. #[derive(Debug)] pub struct Iroh { - /// [Endpoint] needed for iroh peer channels. - pub(crate) endpoint: Endpoint, + /// iroh router needed for iroh peer channels. + pub(crate) router: iroh::protocol::Router, /// [Gossip] needed for iroh peer channels. - pub(crate) gossip: Gossip, + pub(crate) gossip: Arc, /// Sequence numbers for gossip channels. pub(crate) sequence_numbers: Mutex>, @@ -75,15 +74,12 @@ pub struct Iroh { impl Iroh { /// Notify the endpoint that the network has changed. pub(crate) async fn network_change(&self) { - self.endpoint.network_change().await + self.router.endpoint().network_change().await } /// Closes the QUIC endpoint. pub(crate) async fn close(self) -> Result<()> { - self.endpoint - .close(0u32.into(), b"") - .await - .context("Closing iroh endpoint failed") + self.router.shutdown().await.context("Closing iroh failed") } /// Join a topic and create the subscriber loop for it. @@ -121,7 +117,7 @@ impl Iroh { // Inform iroh of potentially new node addresses for node_addr in &peers { if !node_addr.info.is_empty() { - self.endpoint.add_node_addr(node_addr.clone())?; + self.router.endpoint().add_node_addr(node_addr.clone())?; } } @@ -148,7 +144,7 @@ impl Iroh { pub async fn maybe_add_gossip_peers(&self, topic: TopicId, peers: Vec) -> Result<()> { if self.iroh_channels.read().await.get(&topic).is_some() { for peer in &peers { - self.endpoint.add_node_addr(peer.clone())?; + self.router.endpoint().add_node_addr(peer.clone())?; } self.gossip.join_with_opts( @@ -198,7 +194,7 @@ impl Iroh { /// Get the iroh [NodeAddr] without direct IP addresses. pub(crate) async fn get_node_addr(&self) -> Result { - let mut addr = self.endpoint.node_addr().await?; + let mut addr = self.router.endpoint().node_addr().await?; addr.info.direct_addresses = BTreeSet::new(); Ok(addr) } @@ -275,16 +271,19 @@ impl Context { max_message_size: 128 * 1024, ..Default::default() }; - let gossip = Gossip::from_endpoint(endpoint.clone(), gossip_config, &my_addr.info); - - // spawn endpoint loop that forwards incoming connections to the gossiper - let context = self.clone(); - - // Shuts down on deltachat shutdown - tokio::spawn(endpoint_loop(context, endpoint.clone(), gossip.clone())); + let gossip = Arc::new(Gossip::from_endpoint( + endpoint.clone(), + gossip_config, + &my_addr.info, + )); + + let router = iroh::protocol::Router::builder(endpoint) + .accept(GOSSIP_ALPN, gossip.clone()) + .spawn() + .await?; Ok(Iroh { - endpoint, + router, gossip, sequence_numbers: Mutex::new(HashMap::new()), iroh_channels: RwLock::new(HashMap::new()), @@ -507,54 +506,13 @@ fn create_random_topic() -> TopicId { pub(crate) async fn create_iroh_header(ctx: &Context, msg_id: MsgId) -> Result
{ let topic = create_random_topic(); insert_topic_stub(ctx, msg_id, topic).await?; + let topic_string = iroh_base::base32::fmt(topic.as_bytes()); Ok(Header::new( HeaderDef::IrohGossipTopic.get_headername().to_string(), - topic.to_string(), + topic_string, )) } -async fn endpoint_loop(context: Context, endpoint: Endpoint, gossip: Gossip) { - while let Some(conn) = endpoint.accept().await { - let conn = match conn.accept() { - Ok(conn) => conn, - Err(err) => { - warn!(context, "Failed to accept iroh connection: {err:#}."); - continue; - } - }; - info!(context, "IROH_REALTIME: accepting iroh connection"); - let gossip = gossip.clone(); - let context = context.clone(); - tokio::spawn(async move { - if let Err(err) = handle_connection(&context, conn, gossip).await { - warn!(context, "IROH_REALTIME: iroh connection error: {err}"); - } - }); - } -} - -async fn handle_connection( - context: &Context, - mut conn: iroh_net::endpoint::Connecting, - gossip: Gossip, -) -> anyhow::Result<()> { - let alpn = conn.alpn().await?; - let conn = conn.await?; - let peer_id = iroh_net::endpoint::get_remote_node_id(&conn)?; - - match alpn.as_slice() { - GOSSIP_ALPN => gossip - .handle_connection(conn) - .await - .context(format!("Gossip connection to {peer_id} failed"))?, - _ => warn!( - context, - "Ignoring connection from {peer_id}: unsupported ALPN protocol" - ), - } - Ok(()) -} - async fn subscribe_loop( context: &Context, mut stream: iroh_gossip::net::GossipReceiver, @@ -971,6 +929,7 @@ mod tests { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_parallel_connect() { + eprintln!("START-----"); let mut tcm = TestContextManager::new(); let alice = &mut tcm.alice().await; let bob = &mut tcm.bob().await; diff --git a/src/qr.rs b/src/qr.rs index 4d2ab4ea24..f9ef653e95 100644 --- a/src/qr.rs +++ b/src/qr.rs @@ -112,7 +112,7 @@ pub enum Qr { /// Provides a backup that can be retrieved using iroh-net based backup transfer protocol. Backup2 { /// Iroh node address. - node_addr: iroh_net::NodeAddr, + node_addr: iroh::NodeAddr, /// Authentication token. auth_token: String, @@ -644,7 +644,7 @@ fn decode_backup2(qr: &str) -> Result { .split_once('&') .context("Backup QR code has no separator")?; let auth_token = auth_token.to_string(); - let node_addr = serde_json::from_str::(node_addr) + let node_addr = serde_json::from_str::(node_addr) .context("Invalid node addr in backup QR code")?; Ok(Qr::Backup2 { diff --git a/src/receive_imf.rs b/src/receive_imf.rs index f837dcdd9d..bda318071e 100644 --- a/src/receive_imf.rs +++ b/src/receive_imf.rs @@ -1,7 +1,6 @@ //! Internet Message Format reception pipeline. use std::collections::HashSet; -use std::str::FromStr; use anyhow::{Context as _, Result}; use deltachat_contact_tools::{addr_cmp, may_be_valid_addr, sanitize_single_line, ContactAddress}; @@ -1558,8 +1557,8 @@ INSERT INTO msgs ( id, rfc724_mid, chat_id, - from_id, to_id, timestamp, timestamp_sent, - timestamp_rcvd, type, state, msgrmsg, + from_id, to_id, timestamp, timestamp_sent, + timestamp_rcvd, type, state, msgrmsg, txt, txt_normalized, subject, txt_raw, param, hidden, bytes, mime_headers, mime_compressed, mime_in_reply_to, mime_references, mime_modified, error, ephemeral_timer, @@ -1652,7 +1651,10 @@ RETURNING id // check if any part contains a webxdc topic id if part.typ == Viewtype::Webxdc { if let Some(topic) = mime_parser.get_header(HeaderDef::IrohGossipTopic) { - let topic = TopicId::from_str(topic).context("wrong gossip topic header")?; + // default encoding of topic ids is `hex`. + let topic_raw: [u8; 32] = + iroh_base::base32::parse_array(topic).context("wrong gossip topic header")?; + let topic = TopicId::from_bytes(topic_raw); insert_topic_stub(context, *msg_id, topic).await?; } else { warn!(context, "webxdc doesn't have a gossip topic")