From 67449ea6e9bc32af6c6d109294bdacee5b11077d Mon Sep 17 00:00:00 2001 From: link2xt Date: Thu, 20 Mar 2025 12:58:37 +0000 Subject: [PATCH 1/3] chore: update iroh from 0.33.0 to 0.34.0 --- Cargo.toml | 2 ++ deny.toml | 3 --- src/imex/transfer.rs | 7 ++++++- src/peer_channels.rs | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9442ae6e1a..4ce6fa9f95 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,6 +64,8 @@ hyper-util = "0.1.11" image = { version = "0.25.6", default-features=false, features = ["gif", "jpeg", "ico", "png", "pnm", "webp", "bmp"] } iroh-gossip = { version = "0.33", default-features = false, features = ["net"] } iroh = { version = "0.33", default-features = false } +iroh-gossip = { version = "0.34", default-features = false, features = ["net"] } +iroh = { version = "0.34", default-features = false } kamadak-exif = "0.6.1" libc = { workspace = true } mail-builder = { version = "0.4.2", default-features = false } diff --git a/deny.toml b/deny.toml index c52f270fff..3c1131ac10 100644 --- a/deny.toml +++ b/deny.toml @@ -10,9 +10,6 @@ ignore = [ # Unmaintained instant "RUSTSEC-2024-0384", - # Unmaintained backoff - "RUSTSEC-2025-0012", - # Unmaintained paste "RUSTSEC-2024-0436", ] diff --git a/src/imex/transfer.rs b/src/imex/transfer.rs index 1d4f8d596f..69673cd299 100644 --- a/src/imex/transfer.rs +++ b/src/imex/transfer.rs @@ -95,6 +95,7 @@ impl BackupProvider { pub async fn prepare(context: &Context) -> Result { let relay_mode = RelayMode::Disabled; let endpoint = Endpoint::builder() + .tls_x509() // For compatibility with iroh <0.34.0 .alpns(vec![BACKUP_ALPN.to_vec()]) .relay_mode(relay_mode) .bind() @@ -301,7 +302,11 @@ pub async fn get_backup2( ) -> Result<()> { let relay_mode = RelayMode::Disabled; - let endpoint = Endpoint::builder().relay_mode(relay_mode).bind().await?; + let endpoint = Endpoint::builder() + .tls_x509() // For compatibility with iroh <0.34.0 + .relay_mode(relay_mode) + .bind() + .await?; let conn = endpoint.connect(node_addr, BACKUP_ALPN).await?; let (mut send_stream, mut recv_stream) = conn.open_bi().await?; diff --git a/src/peer_channels.rs b/src/peer_channels.rs index ecb384b81b..bb4c7c0ddb 100644 --- a/src/peer_channels.rs +++ b/src/peer_channels.rs @@ -253,6 +253,7 @@ impl Context { }; let endpoint = Endpoint::builder() + .tls_x509() // For compatibility with iroh <0.34.0 .secret_key(secret_key) .alpns(vec![GOSSIP_ALPN.to_vec()]) .relay_mode(relay_mode) From ae3bdbdc78f3eb21d851345e12ba81cd8b38871e Mon Sep 17 00:00:00 2001 From: link2xt Date: Fri, 2 May 2025 14:25:24 +0000 Subject: [PATCH 2/3] Cargo.lock update --- Cargo.lock | 103 ++++++++++++++++++++++++++++++++--------------------- Cargo.toml | 2 -- 2 files changed, 63 insertions(+), 42 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c1b536446a..49222bdb07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "aead" version = "0.5.2" @@ -376,16 +382,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] -name = "backoff" -version = "0.4.0" +name = "backon" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" +checksum = "fd0b50b1b78dbadd44ab18b3c794e496f3a139abb9fbc27d9c94c4eebbb96496" dependencies = [ - "futures-core", - "getrandom 0.2.12", - "instant", - "pin-project-lite", - "rand 0.8.5", + "fastrand", + "gloo-timers", + "tokio", ] [[package]] @@ -398,7 +402,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.7.4", "object", "rustc-demangle", ] @@ -639,9 +643,9 @@ checksum = "11aade7a05aa8c3a351cedc44c3fc45806430543382fcc4743a9b757a2a0b4ed" [[package]] name = "bytemuck" -version = "1.21.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" +checksum = "9134a6ef01ce4b366b50689c94f82c14bc72bc5d0386829828a2e2752ef7958c" [[package]] name = "byteorder" @@ -1983,7 +1987,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.7.4", ] [[package]] @@ -2255,6 +2259,18 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" +[[package]] +name = "gloo-timers" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "group" version = "0.13.0" @@ -2868,14 +2884,14 @@ checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "iroh" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4ffd6af2e000f04972068c0318e0d8fa90ee9cfcb2bc6124db38591500e0278" +checksum = "6b7224d4eeec6c8b5b1a9b2347a4dff3588834a7fb17233044bff3e90e7b293d" dependencies = [ "aead", "anyhow", "atomic-waker", - "backoff", + "backon", "bytes", "cfg_aliases", "concurrent-queue", @@ -2927,15 +2943,14 @@ dependencies = [ [[package]] name = "iroh-base" -version = "0.33.0" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "011d271a95b41218d22bdaf3352f29ef1dd7d6be644ca8543941655bec5f3d35" +checksum = "3cd952d9e25e521d6aeb5b79f2fe32a0245da36aae3569e50f6010b38a5f0923" dependencies = [ "curve25519-dalek", "data-encoding", "derive_more", "ed25519-dalek", - "getrandom 0.2.12", "rand_core 0.6.4", "serde", "thiserror 2.0.12", @@ -2957,9 +2972,9 @@ dependencies = [ [[package]] name = "iroh-gossip" -version = "0.33.0" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d4c7e330bf3d29576d443003e31a2d30d97b29ee13521af2634926d831c01d" +checksum = "71a9d638618fb6a4dac68d59cb694774478ea039bc9afca4709e242726591be1" dependencies = [ "anyhow", "async-channel 2.3.1", @@ -2988,9 +3003,9 @@ dependencies = [ [[package]] name = "iroh-metrics" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571d177e20f0848a643a2c0f662be0e08968f8743b0776941f83a2152b87a180" +checksum = "c0f7cd1ffe3b152a5f4f4c1880e01e07d96001f20e02cc143cb7842987c616b3" dependencies = [ "erased_set", "serde", @@ -3001,9 +3016,9 @@ dependencies = [ [[package]] name = "iroh-net-report" -version = "0.33.0" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d2652f42eadc63458e36c0a422569f338639dc0b5bb469db0eb4a382b4e295c" +checksum = "a6a8487336e7d1fca0998d452ae4716e61994a9aa8847f8721399c873f2bedad" dependencies = [ "anyhow", "bytes", @@ -3085,9 +3100,9 @@ dependencies = [ [[package]] name = "iroh-relay" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c930ccc4dfd0196b531344e3d0f83a0f82c45b170406e04a2491cba571faec5b" +checksum = "21d282c04a71a83a90b8fe6872ba30ae341853255aa908375a3e6181f7215d7b" dependencies = [ "anyhow", "bytes", @@ -3414,6 +3429,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" +dependencies = [ + "adler2", "simd-adler32", ] @@ -3597,24 +3621,22 @@ dependencies = [ [[package]] name = "netwatch" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64da82edf903649e6cb6a77b5a6f7fe01387d8865065d411d139018510880302" +checksum = "0b7879c2cfdf30d92f2be89efa3169b3d78107e3ab7f7b9a37157782569314e1" dependencies = [ - "anyhow", "atomic-waker", "bytes", + "cfg_aliases", "derive_more", - "futures-lite", - "futures-sink", - "futures-util", "iroh-quinn-udp", + "js-sys", "libc", + "n0-future", "netdev", "netlink-packet-core", "netlink-packet-route 0.19.0", "netlink-sys", - "once_cell", "rtnetlink 0.13.1", "rtnetlink 0.14.1", "serde", @@ -3624,7 +3646,9 @@ dependencies = [ "tokio", "tokio-util", "tracing", - "windows 0.58.0", + "web-sys", + "windows 0.59.0", + "windows-result 0.3.0", "wmi", ] @@ -4312,15 +4336,15 @@ dependencies = [ [[package]] name = "png" -version = "0.17.13" +version = "0.17.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" dependencies = [ "bitflags 1.3.2", "crc32fast", "fdeflate", "flate2", - "miniz_oxide", + "miniz_oxide 0.8.8", ] [[package]] @@ -4354,11 +4378,10 @@ checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" [[package]] name = "portmapper" -version = "0.3.1" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5469b29e6ce2a27bfc9382720b5f0768993afec9e53b133d8248c8b09406156a" +checksum = "247dcb75747c53cc433d6d8963a064187eec4a676ba13ea33143f1c9100e754f" dependencies = [ - "anyhow", "base64", "bytes", "derive_more", diff --git a/Cargo.toml b/Cargo.toml index 4ce6fa9f95..9427f142d4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,8 +62,6 @@ humansize = "2" hyper = "1" hyper-util = "0.1.11" image = { version = "0.25.6", default-features=false, features = ["gif", "jpeg", "ico", "png", "pnm", "webp", "bmp"] } -iroh-gossip = { version = "0.33", default-features = false, features = ["net"] } -iroh = { version = "0.33", default-features = false } iroh-gossip = { version = "0.34", default-features = false, features = ["net"] } iroh = { version = "0.34", default-features = false } kamadak-exif = "0.6.1" From 447b5e68985d0b8c29600bac3f440d53eb23967d Mon Sep 17 00:00:00 2001 From: link2xt Date: Wed, 26 Mar 2025 00:53:35 +0000 Subject: [PATCH 3/3] build: patch netwatch to compile on Android in debug mode --- Cargo.lock | 86 +++++++++--------------------------------------------- Cargo.toml | 3 ++ 2 files changed, 17 insertions(+), 72 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 49222bdb07..bbb25c785a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2053,14 +2053,15 @@ dependencies = [ [[package]] name = "futures-buffered" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34acda8ae8b63fbe0b2195c998b180cff89a8212fb2622a78b572a9f1c6f7684" +checksum = "fe940397c8b744b9c2c974791c2c08bca2c3242ce0290393249e98f215a00472" dependencies = [ "cordyceps", "diatomic-waker", "futures-core", "pin-project-lite", + "spin", ] [[package]] @@ -3479,9 +3480,9 @@ checksum = "16cf681a23b4d0a43fc35024c176437f9dcd818db34e0f42ab456a0ee5ad497b" [[package]] name = "n0-future" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "399e11dc3b0e8d9d65b27170d22f5d779d52d9bed888db70d7e0c2c7ce3dfc52" +checksum = "7bb0e5d99e681ab3c938842b96fcb41bf8a7bb4bfdb11ccbd653a7e83e06c794" dependencies = [ "cfg_aliases", "derive_more", @@ -3568,11 +3569,12 @@ dependencies = [ [[package]] name = "netlink-packet-route" -version = "0.19.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c171cd77b4ee8c7708da746ce392440cb7bcf618d122ec9ecc607b12938bf4" +checksum = "0800eae8638a299eaa67476e1c6b6692922273e0f7939fd188fc861c837b9cd2" dependencies = [ "anyhow", + "bitflags 2.8.0", "byteorder", "libc", "log", @@ -3622,8 +3624,7 @@ dependencies = [ [[package]] name = "netwatch" version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7879c2cfdf30d92f2be89efa3169b3d78107e3ab7f7b9a37157782569314e1" +source = "git+https://github.com/n0-computer/net-tools.git?branch=minimal-versions#0d2ef1fa066ffae461cf81a218943d07ddc1c137" dependencies = [ "atomic-waker", "bytes", @@ -3635,10 +3636,9 @@ dependencies = [ "n0-future", "netdev", "netlink-packet-core", - "netlink-packet-route 0.19.0", + "netlink-packet-route 0.23.0", + "netlink-proto", "netlink-sys", - "rtnetlink 0.13.1", - "rtnetlink 0.14.1", "serde", "socket2", "thiserror 2.0.12", @@ -3661,28 +3661,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "nix" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", -] - -[[package]] -name = "nix" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" -dependencies = [ - "bitflags 2.8.0", - "cfg-if", - "libc", -] - [[package]] name = "nix" version = "0.29.0" @@ -4992,42 +4970,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rtnetlink" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a552eb82d19f38c3beed3f786bd23aa434ceb9ac43ab44419ca6d67a7e186c0" -dependencies = [ - "futures", - "log", - "netlink-packet-core", - "netlink-packet-route 0.17.1", - "netlink-packet-utils", - "netlink-proto", - "netlink-sys", - "nix 0.26.4", - "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", -] - [[package]] name = "rusqlite" version = "0.32.1" @@ -5207,7 +5149,7 @@ dependencies = [ "libc", "log", "memchr", - "nix 0.29.0", + "nix", "radix_trie", "unicode-segmentation", "unicode-width", @@ -6646,9 +6588,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index 9427f142d4..926f062bf1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,9 @@ opt-level = "z" codegen-units = 1 strip = true +[patch.crates-io] +netwatch = { git = "https://github.com/n0-computer/net-tools.git", branch = "minimal-versions" } + [dependencies] deltachat_derive = { path = "./deltachat_derive" } deltachat-time = { path = "./deltachat-time" }