From 87c3e311608b44b18c5bb35bc80b3f0b94788f7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Wed, 5 Feb 2025 23:13:32 +0100 Subject: [PATCH 01/59] wip: add Ipv6Prefix::with_client_id impl --- src/main.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/main.rs b/src/main.rs index cf37707..b7f27f5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -291,6 +291,29 @@ struct Ipv6Prefix { length: u32, } +impl Ipv6Prefix { + /// Create an [`Ipv6Addr`] from a prefix and a client id + pub fn with_client_id(self, client_id: Ipv6Addr) -> Ipv6Addr { + let Self { prefix, length } = self; + // Clear the last `length` bits + let prefix_mask = u128::MAX << length; + let client_mask = !prefix_mask; + let prefix = prefix.to_bits(); + let client = client_id.to_bits(); + debug_assert_eq!( + prefix & client_mask, + 0, + "prefix contains bits in client id part" + ); + debug_assert_eq!( + client & prefix_mask, + 0, + "client id contains bits in prefix part" + ); + Ipv6Addr::from_bits((prefix & prefix_mask) | (client & client_mask)) + } +} + impl std::fmt::Display for Ipv6Prefix { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let Self { prefix, length } = self; From 738fa8accfbaee220b44f50d9ce739d85b0f6d62 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 5 Feb 2025 23:30:28 +0100 Subject: [PATCH 02/59] chore(deps): lock file maintenance --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 31c94b6..10a4609 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1738546358, - "narHash": "sha256-nLivjIygCiqLp5QcL7l56Tca/elVqM9FG1hGd9ZSsrg=", + "lastModified": 1738680400, + "narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c6e957d81b96751a3d5967a0fd73694f303cc914", + "rev": "799ba5bffed04ced7067a91798353d360788b30d", "type": "github" }, "original": { From 29f7315f67f1a1a73377b4e05c73b304cae08e50 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 6 Feb 2025 23:00:24 +0100 Subject: [PATCH 03/59] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 32cf25c..97a263a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -610,9 +610,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" [[package]] name = "overload" From 338e2966838c85b44d40fbdc25ad24f09e9d73be Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 10 Feb 2025 09:20:41 +0100 Subject: [PATCH 04/59] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- flake.lock | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 97a263a..003e667 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,9 +185,9 @@ checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" [[package]] name = "cc" -version = "1.2.12" +version = "1.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "755717a7de9ec452bf7f3f1a3099085deabd7f2962b861dae91ecd7a365903d2" +checksum = "c7777341816418c02e033934a09f20dc0ccaf65a5201ef8a450ae0105a573fda" dependencies = [ "shlex", ] diff --git a/flake.lock b/flake.lock index 10a4609..633e59a 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1738652123, - "narHash": "sha256-zdZek5FXK/k95J0vnLF0AMnYuZl4AjARq83blKuJBYY=", + "lastModified": 1739053031, + "narHash": "sha256-LrMDRuwAlRFD2T4MgBSRd1s2VtOE+Vl1oMCNu3RpPE0=", "owner": "ipetkov", "repo": "crane", - "rev": "c7e015a5fcefb070778c7d91734768680188a9cd", + "rev": "112e6591b2d6313b1bd05a80a754a8ee42432a7e", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1738680400, - "narHash": "sha256-ooLh+XW8jfa+91F1nhf9OF7qhuA/y1ChLx6lXDNeY5U=", + "lastModified": 1739020877, + "narHash": "sha256-mIvECo/NNdJJ/bXjNqIh8yeoSjVLAuDuTUzAo7dzs8Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "799ba5bffed04ced7067a91798353d360788b30d", + "rev": "a79cfe0ebd24952b580b1cf08cd906354996d547", "type": "github" }, "original": { @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1738680491, - "narHash": "sha256-8X7tR3kFGkE7WEF5EXVkt4apgaN85oHZdoTGutCFs6I=", + "lastModified": 1738953846, + "narHash": "sha256-yrK3Hjcr8F7qS/j2F+r7C7o010eVWWlm4T1PrbKBOxQ=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "64dbb922d51a42c0ced6a7668ca008dded61c483", + "rev": "4f09b473c936d41582dd744e19f34ec27592c5fd", "type": "github" }, "original": { From e99bc52de229d715fdaac45711ad070cc7f41360 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 11 Feb 2025 21:20:45 +0100 Subject: [PATCH 05/59] fix(deps): update rust crate clap to v4.5.29 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | clap | 4.5.28 | 4.5.29 | --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 003e667..82ecbee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,9 +200,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.28" +version = "4.5.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e77c3243bd94243c03672cb5154667347c457ca271254724f9f393aee1c05ff" +checksum = "8acebd8ad879283633b343856142139f2da2317c96b05b4dd6181c61e2480184" dependencies = [ "clap_builder", "clap_derive", @@ -220,9 +220,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.27" +version = "4.5.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" +checksum = "f6ba32cbda51c7e1dfd49acc1457ba1a7dec5b64fe360e828acb13ca8dc9c2f9" dependencies = [ "anstream", "anstyle", @@ -279,7 +279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -757,7 +757,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] From 41c30372fb1d24d7bb3f130fed2aa7e1e732bc44 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 11 Feb 2025 21:40:30 +0100 Subject: [PATCH 06/59] chore(deps): lock file maintenance --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 82ecbee..6adbfd4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -565,9 +565,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" dependencies = [ "adler2", ] @@ -757,7 +757,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] From bdb27d7cb165a84efacbda0b6523aa37851f4f17 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 12 Feb 2025 23:00:37 +0100 Subject: [PATCH 07/59] chore(deps): lock file maintenance --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 633e59a..89038b7 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1739020877, - "narHash": "sha256-mIvECo/NNdJJ/bXjNqIh8yeoSjVLAuDuTUzAo7dzs8Y=", + "lastModified": 1739214665, + "narHash": "sha256-26L8VAu3/1YRxS8MHgBOyOM8xALdo6N0I04PgorE7UM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a79cfe0ebd24952b580b1cf08cd906354996d547", + "rev": "64e75cd44acf21c7933d61d7721e812eac1b5a0a", "type": "github" }, "original": { From 0a5348097d211a1b4f5b04d82cbe373796c17df9 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 14 Feb 2025 02:00:26 +0100 Subject: [PATCH 08/59] fix(deps): update rust crate ring to v0.17.9 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | ring | 0.17.8 | 0.17.9 | --- Cargo.lock | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6adbfd4..02a922d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -728,15 +728,14 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "ring" -version = "0.17.8" +version = "0.17.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "e75ec5e92c4d8aede845126adc388046234541629e76029599ed35a003c7ed24" dependencies = [ "cc", "cfg-if", "getrandom", "libc", - "spin", "untrusted", "windows-sys 0.52.0", ] @@ -872,12 +871,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - [[package]] name = "strsim" version = "0.11.1" From 3c18f07a2abd33a355a5de47ba0322b6fa06b380 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 14 Feb 2025 02:10:35 +0100 Subject: [PATCH 09/59] chore(deps): lock file maintenance --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 89038b7..6be5c49 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1739214665, - "narHash": "sha256-26L8VAu3/1YRxS8MHgBOyOM8xALdo6N0I04PgorE7UM=", + "lastModified": 1739446958, + "narHash": "sha256-+/bYK3DbPxMIvSL4zArkMX0LQvS7rzBKXnDXLfKyRVc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "64e75cd44acf21c7933d61d7721e812eac1b5a0a", + "rev": "2ff53fe64443980e139eaa286017f53f88336dd0", "type": "github" }, "original": { From c41008f800a34e28241a142264c7f4da2c337ad0 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 15 Feb 2025 23:00:22 +0100 Subject: [PATCH 10/59] chore(deps): lock file maintenance --- Cargo.lock | 8 ++++---- flake.lock | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 02a922d..ea964a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,9 +185,9 @@ checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" [[package]] name = "cc" -version = "1.2.13" +version = "1.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7777341816418c02e033934a09f20dc0ccaf65a5201ef8a450ae0105a573fda" +checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9" dependencies = [ "shlex", ] @@ -857,9 +857,9 @@ checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" [[package]] name = "smallvec" -version = "1.13.2" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" [[package]] name = "socket2" diff --git a/flake.lock b/flake.lock index 6be5c49..15457e7 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1739053031, - "narHash": "sha256-LrMDRuwAlRFD2T4MgBSRd1s2VtOE+Vl1oMCNu3RpPE0=", + "lastModified": 1739638817, + "narHash": "sha256-pPiI27T416xAAUETorkLAgHQMiLT92moOrf0ItHhtPA=", "owner": "ipetkov", "repo": "crane", - "rev": "112e6591b2d6313b1bd05a80a754a8ee42432a7e", + "rev": "bef2b45cd1273a9e621fb5292de89f4ed59ad812", "type": "github" }, "original": { From 1a88dbaeb22213beaed8b68df5c056baaa6c1538 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 16 Feb 2025 20:30:52 +0100 Subject: [PATCH 11/59] chore(deps): lock file maintenance --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 15457e7..1f74854 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1739446958, - "narHash": "sha256-+/bYK3DbPxMIvSL4zArkMX0LQvS7rzBKXnDXLfKyRVc=", + "lastModified": 1739580444, + "narHash": "sha256-+/bSz4EAVbqz8/HsIGLroF8aNaO8bLRL7WfACN+24g4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2ff53fe64443980e139eaa286017f53f88336dd0", + "rev": "8bb37161a0488b89830168b81c48aed11569cb93", "type": "github" }, "original": { From 8a04c2726fcc62cd7fd1747b629d7bb617064b8e Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 17 Feb 2025 20:20:29 +0100 Subject: [PATCH 12/59] fix(deps): update rust crate clap to v4.5.30 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | clap | 4.5.29 | 4.5.30 | --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ea964a1..f18ff48 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,9 +200,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.29" +version = "4.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acebd8ad879283633b343856142139f2da2317c96b05b4dd6181c61e2480184" +checksum = "92b7b18d71fad5313a1e320fa9897994228ce274b60faa4d694fe0ea89cd9e6d" dependencies = [ "clap_builder", "clap_derive", @@ -220,9 +220,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.29" +version = "4.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ba32cbda51c7e1dfd49acc1457ba1a7dec5b64fe360e828acb13ca8dc9c2f9" +checksum = "a35db2071778a7344791a4fb4f95308b5673d219dee3ae348b86642574ecc90c" dependencies = [ "anstream", "anstyle", @@ -279,7 +279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -756,7 +756,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] From eaed7b230228ad23bebec570372b4c59f19fab44 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 17 Feb 2025 23:00:41 +0100 Subject: [PATCH 13/59] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- flake.lock | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f18ff48..fefd609 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -756,7 +756,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] diff --git a/flake.lock b/flake.lock index 1f74854..44078d6 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1739638817, - "narHash": "sha256-pPiI27T416xAAUETorkLAgHQMiLT92moOrf0ItHhtPA=", + "lastModified": 1739815359, + "narHash": "sha256-mjB72/7Fgk5bsIIKA4G9LkIb/u0Ci+VdOyQSgBuQtjo=", "owner": "ipetkov", "repo": "crane", - "rev": "bef2b45cd1273a9e621fb5292de89f4ed59ad812", + "rev": "282159b2b0588b87a9dbcc40decc91dd5bed5c89", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1739580444, - "narHash": "sha256-+/bSz4EAVbqz8/HsIGLroF8aNaO8bLRL7WfACN+24g4=", + "lastModified": 1739736696, + "narHash": "sha256-zON2GNBkzsIyALlOCFiEBcIjI4w38GYOb+P+R4S8Jsw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8bb37161a0488b89830168b81c48aed11569cb93", + "rev": "d74a2335ac9c133d6bbec9fc98d91a77f1604c1f", "type": "github" }, "original": { From 60662ff1f09f3bf856e746ef702d9a1661fc9b95 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 19 Feb 2025 17:41:04 +0100 Subject: [PATCH 14/59] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- flake.lock | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fefd609..4b59be6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1100,9 +1100,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" [[package]] name = "unicode-linebreak" diff --git a/flake.lock b/flake.lock index 44078d6..64b7f63 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1739815359, - "narHash": "sha256-mjB72/7Fgk5bsIIKA4G9LkIb/u0Ci+VdOyQSgBuQtjo=", + "lastModified": 1739936662, + "narHash": "sha256-x4syUjNUuRblR07nDPeLDP7DpphaBVbUaSoeZkFbGSk=", "owner": "ipetkov", "repo": "crane", - "rev": "282159b2b0588b87a9dbcc40decc91dd5bed5c89", + "rev": "19de14aaeb869287647d9461cbd389187d8ecdb7", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1739736696, - "narHash": "sha256-zON2GNBkzsIyALlOCFiEBcIjI4w38GYOb+P+R4S8Jsw=", + "lastModified": 1739866667, + "narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d74a2335ac9c133d6bbec9fc98d91a77f1604c1f", + "rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680", "type": "github" }, "original": { @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1738953846, - "narHash": "sha256-yrK3Hjcr8F7qS/j2F+r7C7o010eVWWlm4T1PrbKBOxQ=", + "lastModified": 1739829690, + "narHash": "sha256-mL1szCeIsjh6Khn3nH2cYtwO5YXG6gBiTw1A30iGeDU=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "4f09b473c936d41582dd744e19f34ec27592c5fd", + "rev": "3d0579f5cc93436052d94b73925b48973a104204", "type": "github" }, "original": { From 01f53b2bf039fbb28329332d921b005ebc42f4db Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 20 Feb 2025 04:10:23 +0100 Subject: [PATCH 15/59] fix(deps): update rust crate serde_json to v1.0.139 | datasource | package | from | to | | ---------- | ---------- | ------- | ------- | | crate | serde_json | 1.0.138 | 1.0.139 | --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4b59be6..42c396f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -793,9 +793,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.138" +version = "1.0.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" dependencies = [ "itoa", "memchr", From cb7e4d554b60e42bc292a10e56a30c3572f1074b Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 20 Feb 2025 06:30:30 +0100 Subject: [PATCH 16/59] fix(deps): update rust crate serde to v1.0.218 | datasource | package | from | to | | ---------- | ------- | ------- | ------- | | crate | serde | 1.0.217 | 1.0.218 | --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 42c396f..ffe777c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -773,18 +773,18 @@ checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" dependencies = [ "proc-macro2", "quote", From 528aad1d8e2d028cb4d1b136dba0438af324e962 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 21 Feb 2025 18:30:23 +0100 Subject: [PATCH 17/59] fix(deps): update rust crate ring to v0.17.10 | datasource | package | from | to | | ---------- | ------- | ------ | ------- | | crate | ring | 0.17.9 | 0.17.10 | --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ffe777c..8b45e84 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -728,9 +728,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "ring" -version = "0.17.9" +version = "0.17.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e75ec5e92c4d8aede845126adc388046234541629e76029599ed35a003c7ed24" +checksum = "d34b5020fcdea098ef7d95e9f89ec15952123a4a039badd09fabebe9e963e839" dependencies = [ "cc", "cfg-if", From 71d1e43ef24c343d041ba39f763277221baf219e Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 21 Feb 2025 23:00:24 +0100 Subject: [PATCH 18/59] chore(deps): lock file maintenance --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8b45e84..cde95aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,9 +185,9 @@ checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" [[package]] name = "cc" -version = "1.2.14" +version = "1.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9" +checksum = "c736e259eea577f443d5c86c304f9f4ae0295c43f3ba05c21f1d66b5f06001af" dependencies = [ "shlex", ] @@ -501,9 +501,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "log" -version = "0.4.25" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "matchers" @@ -565,9 +565,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" dependencies = [ "adler2", ] From 09345f21931d76a6ea6cb30291e2c1a8449e5971 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 22 Feb 2025 19:50:25 +0100 Subject: [PATCH 19/59] fix(deps): update rust crate ring to v0.17.11 | datasource | package | from | to | | ---------- | ------- | ------- | ------- | | crate | ring | 0.17.10 | 0.17.11 | --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cde95aa..840a173 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -728,9 +728,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "ring" -version = "0.17.10" +version = "0.17.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34b5020fcdea098ef7d95e9f89ec15952123a4a039badd09fabebe9e963e839" +checksum = "da5349ae27d3887ca812fb375b45a4fbb36d8d12d2df394968cd86e35683fe73" dependencies = [ "cc", "cfg-if", From 593bee9024a44460dbabb1a1df96f1c9438d5368 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 23 Feb 2025 00:10:23 +0100 Subject: [PATCH 20/59] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 840a173..c99f6e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -622,9 +622,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owo-colors" -version = "4.1.0" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" +checksum = "c1338d6deb23bc10a7767b72185570dd73cb3616188eec1088e19b5835f8cabb" [[package]] name = "percent-encoding" From 48034ec6e568c84e22b0a6dcce6a0d93a123fdfa Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 23 Feb 2025 23:00:42 +0100 Subject: [PATCH 21/59] chore(deps): lock file maintenance --- Cargo.lock | 8 ++++---- flake.lock | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c99f6e2..38c8b53 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -483,9 +483,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.169" +version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" [[package]] name = "linked-hash-map" @@ -622,9 +622,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owo-colors" -version = "4.1.1" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1338d6deb23bc10a7767b72185570dd73cb3616188eec1088e19b5835f8cabb" +checksum = "1036865bb9422d3300cf723f657c2851d0e9ab12567854b1f4eba3d77decf564" [[package]] name = "percent-encoding" diff --git a/flake.lock b/flake.lock index 64b7f63..f566014 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1739866667, - "narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=", + "lastModified": 1740126099, + "narHash": "sha256-ozoOtE2hGsqh4XkTJFsrTkNxkRgShxpQxDynaPZUGxk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680", + "rev": "32fb99ba93fea2798be0e997ea331dd78167f814", "type": "github" }, "original": { From b581e2adf12d7c98d65ea1e5d01a253da72e5810 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 24 Feb 2025 16:50:22 +0100 Subject: [PATCH 22/59] fix(deps): update rust crate clap to v4.5.31 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | clap | 4.5.30 | 4.5.31 | --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 38c8b53..3825b0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,9 +200,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.30" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92b7b18d71fad5313a1e320fa9897994228ce274b60faa4d694fe0ea89cd9e6d" +checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" dependencies = [ "clap_builder", "clap_derive", @@ -220,9 +220,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.30" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35db2071778a7344791a4fb4f95308b5673d219dee3ae348b86642574ecc90c" +checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" dependencies = [ "anstream", "anstyle", @@ -279,7 +279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -756,7 +756,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] From ef6e955b9099fffd6042c169aaa992cfcf6a437e Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 24 Feb 2025 17:00:45 +0100 Subject: [PATCH 23/59] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- flake.lock | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3825b0c..db5b63a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -756,7 +756,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] diff --git a/flake.lock b/flake.lock index f566014..d999128 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1740126099, - "narHash": "sha256-ozoOtE2hGsqh4XkTJFsrTkNxkRgShxpQxDynaPZUGxk=", + "lastModified": 1740367490, + "narHash": "sha256-WGaHVAjcrv+Cun7zPlI41SerRtfknGQap281+AakSAw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "32fb99ba93fea2798be0e997ea331dd78167f814", + "rev": "0196c0175e9191c474c26ab5548db27ef5d34b05", "type": "github" }, "original": { From 2a2f9ef06c29cfb93c7f651046577353d10ce981 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 27 Feb 2025 23:00:49 +0100 Subject: [PATCH 24/59] chore(deps): lock file maintenance --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index d999128..117d105 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1740367490, - "narHash": "sha256-WGaHVAjcrv+Cun7zPlI41SerRtfknGQap281+AakSAw=", + "lastModified": 1740560979, + "narHash": "sha256-Vr3Qi346M+8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0196c0175e9191c474c26ab5548db27ef5d34b05", + "rev": "5135c59491985879812717f4c9fea69604e7f26f", "type": "github" }, "original": { From 5d4c0fdb703d7d9cd1e36d9c4b62b9e5eed6bdaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Fri, 28 Feb 2025 23:47:18 +0100 Subject: [PATCH 25/59] ci(renovate): don't overlap schedules Branch creation schedule and automerge schedule should not overlap, or we'll get PRs that don't contain updates, which stop renovate from creating further PRs. --- .renovaterc.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.renovaterc.json b/.renovaterc.json index 83d8eaf..d15282c 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -35,10 +35,10 @@ "branchTopic": "lock-file-maintenance", "commitMessageAction": "Lock file maintenance", "schedule": [ - "* 23 * * *" + "* 22 * * *" ] }, "automergeSchedule": [ - "* 0-1 * * *" + "* 23 * * *" ] } From a6f0785dc3f5caa0c470afe6e36ddfc3260eb231 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 1 Mar 2025 00:00:35 +0100 Subject: [PATCH 26/59] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index db5b63a..c551d0b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,9 +185,9 @@ checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" [[package]] name = "cc" -version = "1.2.15" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c736e259eea577f443d5c86c304f9f4ae0295c43f3ba05c21f1d66b5f06001af" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "shlex", ] From cdef8078cc2855bf4d02c874fe18f3031cd56ab1 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 1 Mar 2025 22:00:54 +0100 Subject: [PATCH 27/59] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- flake.lock | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c551d0b..a5a299f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -173,9 +173,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "bytes" diff --git a/flake.lock b/flake.lock index 117d105..6f53ba6 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1740560979, - "narHash": "sha256-Vr3Qi346M+8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic=", + "lastModified": 1740695751, + "narHash": "sha256-D+R+kFxy1KsheiIzkkx/6L63wEHBYX21OIwlFV8JvDs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5135c59491985879812717f4c9fea69604e7f26f", + "rev": "6313551cd05425cd5b3e63fe47dbc324eabb15e4", "type": "github" }, "original": { From bc62fd7c1d3317cc9664ad78b365154bddc48525 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 2 Mar 2025 02:00:39 +0100 Subject: [PATCH 28/59] chore(deps): update rust crate insta to v1.42.2 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | insta | 1.42.1 | 1.42.2 | --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a5a299f..562dc30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -446,9 +446,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.42.1" +version = "1.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71c1b125e30d93896b365e156c33dadfffab45ee8400afcbba4752f59de08a86" +checksum = "50259abbaa67d11d2bcafc7ba1d094ed7a0c70e3ce893f0d0997f73558cb3084" dependencies = [ "console", "linked-hash-map", @@ -756,7 +756,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] From 7cc182b23e2284e168de886695de32fb98105047 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 2 Mar 2025 02:10:30 +0100 Subject: [PATCH 29/59] chore(deps): lock file maintenance --- Cargo.lock | 8 ++++---- flake.lock | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 562dc30..a112dfb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -256,9 +256,9 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "console" -version = "0.15.10" +version = "0.15.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" +checksum = "054ccb5b10f9f2cbf51eb355ca1d05c2d279ce1804688d0db74b4733a5aeafd8" dependencies = [ "encode_unicode", "libc", @@ -279,7 +279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -756,7 +756,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] diff --git a/flake.lock b/flake.lock index 6f53ba6..380d598 100644 --- a/flake.lock +++ b/flake.lock @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1738453229, - "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=", + "lastModified": 1740872218, + "narHash": "sha256-ZaMw0pdoUKigLpv9HiNDH2Pjnosg7NBYMJlHTIsHEUo=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd", + "rev": "3876f6b87db82f33775b1ef5ea343986105db764", "type": "github" }, "original": { From 855963bc850c1e9df223eb4fb17b35ae074d3af5 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 3 Mar 2025 10:20:22 +0100 Subject: [PATCH 30/59] fix(deps): update rust crate serde_json to v1.0.140 | datasource | package | from | to | | ---------- | ---------- | ------- | ------- | | crate | serde_json | 1.0.139 | 1.0.140 | --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a112dfb..921090a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -793,9 +793,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.139" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", From 42482574ac3d9cbb05e818f4a18e951b3d903416 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 3 Mar 2025 22:00:50 +0100 Subject: [PATCH 31/59] chore(deps): lock file maintenance --- Cargo.lock | 42 ++++++++++++++++++++++++------------------ flake.lock | 12 ++++++------ 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 921090a..1fc9ed8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -399,9 +399,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -543,7 +543,7 @@ dependencies = [ "terminal_size", "textwrap", "thiserror", - "unicode-width", + "unicode-width 0.1.14", ] [[package]] @@ -634,18 +634,18 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfe2e71e1471fe07709406bf725f710b02927c9c54b2b5b2ec0e8087d97c327d" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e859e6e5bd50440ab63c47e3ebabc90f26251f7c73c3d3e837b74a1cc3fa67" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", @@ -666,18 +666,18 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" dependencies = [ "proc-macro2", ] @@ -805,9 +805,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +checksum = "59fab13f937fa393d08645bf3a84bdfe86e296747b506ada67bb15f10f218b2a" dependencies = [ "itoa", "serde", @@ -900,9 +900,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.98" +version = "2.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "e02e925281e18ffd9d640e234264753c43edc62d64b2d4cf898f1bc5e75f3fc2" dependencies = [ "proc-macro2", "quote", @@ -927,12 +927,12 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" dependencies = [ "unicode-linebreak", - "unicode-width", + "unicode-width 0.2.0", ] [[package]] @@ -1116,6 +1116,12 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + [[package]] name = "untrusted" version = "0.9.0" diff --git a/flake.lock b/flake.lock index 380d598..5ab64dc 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1739936662, - "narHash": "sha256-x4syUjNUuRblR07nDPeLDP7DpphaBVbUaSoeZkFbGSk=", + "lastModified": 1741021986, + "narHash": "sha256-VX8M6arxQU05mipDmLjk0TJVRNzu+VQx3w1gVmyPkO4=", "owner": "ipetkov", "repo": "crane", - "rev": "19de14aaeb869287647d9461cbd389187d8ecdb7", + "rev": "5245473d6638a96da540e44372da96eebb97735a", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1740695751, - "narHash": "sha256-D+R+kFxy1KsheiIzkkx/6L63wEHBYX21OIwlFV8JvDs=", + "lastModified": 1741010256, + "narHash": "sha256-WZNlK/KX7Sni0RyqLSqLPbK8k08Kq7H7RijPJbq9KHM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6313551cd05425cd5b3e63fe47dbc324eabb15e4", + "rev": "ba487dbc9d04e0634c64e3b1f0d25839a0a68246", "type": "github" }, "original": { From f16c3b913802313c0032317ed48f1204dbb0f7ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Tue, 4 Mar 2025 09:44:23 +0100 Subject: [PATCH 32/59] fix(typo): typos corrected typ to typo This is wrong for us (we use typ instead of type, not typo, because type is a rust keyword). --- src/nsupdate.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nsupdate.rs b/src/nsupdate.rs index 74397fa..eb0610c 100644 --- a/src/nsupdate.rs +++ b/src/nsupdate.rs @@ -37,14 +37,14 @@ impl std::fmt::Display for Action<'_> { match self { Action::Reassign { domain, to, ttl } => { let ttl = ttl.as_secs(); - let typ = match to { + let kind = match to { IpAddr::V4(_) => "A", IpAddr::V6(_) => "AAAA", }; - // Delete previous record of type `typ` - writeln!(f, "update delete {domain} {ttl} IN {typ}")?; + // Delete previous record of type `kind` + writeln!(f, "update delete {domain} {ttl} IN {kind}")?; // Add record with new IP - writeln!(f, "update add {domain} {ttl} IN {typ} {to}") + writeln!(f, "update add {domain} {ttl} IN {kind} {to}") } } } From 3ed76c094c6641b53d64bae926c0f19094ab9c50 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 6 Mar 2025 02:10:27 +0100 Subject: [PATCH 33/59] fix(deps): update rust crate ring to v0.17.12 | datasource | package | from | to | | ---------- | ------- | ------- | ------- | | crate | ring | 0.17.11 | 0.17.12 | --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1fc9ed8..ccb51e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -728,9 +728,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "ring" -version = "0.17.11" +version = "0.17.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da5349ae27d3887ca812fb375b45a4fbb36d8d12d2df394968cd86e35683fe73" +checksum = "ed9b823fa29b721a59671b41d6b06e66b29e0628e207e8b1c3ceeda701ec928d" dependencies = [ "cc", "cfg-if", From 6c78e8d78e7e6114827025487745d9398c89fedf Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 6 Mar 2025 02:20:27 +0100 Subject: [PATCH 34/59] chore(deps): lock file maintenance --- Cargo.lock | 20 ++++++++++---------- flake.lock | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ccb51e6..4867696 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -179,9 +179,9 @@ checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "bytes" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" @@ -471,9 +471,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "lazy_static" @@ -761,15 +761,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "serde" @@ -1100,9 +1100,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-linebreak" diff --git a/flake.lock b/flake.lock index 5ab64dc..6308dfd 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1741021986, - "narHash": "sha256-VX8M6arxQU05mipDmLjk0TJVRNzu+VQx3w1gVmyPkO4=", + "lastModified": 1741148495, + "narHash": "sha256-EV8KUaIZ2/CdBXlutXrHoZYbWPeB65p5kKZk71gvDRI=", "owner": "ipetkov", "repo": "crane", - "rev": "5245473d6638a96da540e44372da96eebb97735a", + "rev": "75390a36cd0c2cdd5f1aafd8a9f827d7107f2e53", "type": "github" }, "original": { From 3e1140ffe5a0d44802de4a35cc9d520ecfcb2afe Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 7 Mar 2025 01:40:27 +0100 Subject: [PATCH 35/59] fix(deps): update rust crate ring to v0.17.13 | datasource | package | from | to | | ---------- | ------- | ------- | ------- | | crate | ring | 0.17.12 | 0.17.13 | --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4867696..2aebce4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -728,9 +728,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "ring" -version = "0.17.12" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9b823fa29b721a59671b41d6b06e66b29e0628e207e8b1c3ceeda701ec928d" +checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" dependencies = [ "cc", "cfg-if", From 873dd980ff9ef10b30cd5db2ad3a15723248eb86 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 7 Mar 2025 21:20:23 +0100 Subject: [PATCH 36/59] fix(deps): update rust crate tokio to v1.44.0 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | tokio | 1.43.0 | 1.44.0 | --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2aebce4..1fa6ff5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -967,9 +967,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.43.0" +version = "1.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +checksum = "9975ea0f48b5aa3972bf2d888c238182458437cc2a19374b81b25cdf1023fb3a" dependencies = [ "backtrace", "bytes", From c71a8b418c6f65d1f7c06a39bc089b8a34180c13 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 7 Mar 2025 22:00:42 +0100 Subject: [PATCH 37/59] chore(deps): lock file maintenance --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 6308dfd..3999461 100644 --- a/flake.lock +++ b/flake.lock @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1740872218, - "narHash": "sha256-ZaMw0pdoUKigLpv9HiNDH2Pjnosg7NBYMJlHTIsHEUo=", + "lastModified": 1741352980, + "narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "3876f6b87db82f33775b1ef5ea343986105db764", + "rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1741010256, - "narHash": "sha256-WZNlK/KX7Sni0RyqLSqLPbK8k08Kq7H7RijPJbq9KHM=", + "lastModified": 1741246872, + "narHash": "sha256-Q6pMP4a9ed636qilcYX8XUguvKl/0/LGXhHcRI91p0U=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ba487dbc9d04e0634c64e3b1f0d25839a0a68246", + "rev": "10069ef4cf863633f57238f179a0297de84bd8d3", "type": "github" }, "original": { From 632250d544e19319eaa389266cf132b3a8f0be9d Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 9 Mar 2025 20:20:28 +0100 Subject: [PATCH 38/59] fix(deps): update rust crate serde to v1.0.219 | datasource | package | from | to | | ---------- | ------- | ------- | ------- | | crate | serde | 1.0.218 | 1.0.219 | --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1fa6ff5..1ffe287 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -773,18 +773,18 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "serde" -version = "1.0.218" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.218" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", From 881983dd6c2c5a4ffae68597248a32582a7e532b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 9 Mar 2025 12:37:16 +0100 Subject: [PATCH 39/59] ci: validate renovaterc Also use config:best-practices --- .forgejo/workflows/check.yml | 8 ++++++++ .renovaterc.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml index 342bcef..882647e 100644 --- a/.forgejo/workflows/check.yml +++ b/.forgejo/workflows/check.yml @@ -1,5 +1,13 @@ on: [push] jobs: + check-renovaterc: + runs-on: nixos + steps: + - uses: https://git.salame.cl/actions/checkout@v4 + - name: Validate renovaterc + run: | + nix --version + nix shell nixpkgs#renovate --command renovate-config-validator build: runs-on: nixos steps: diff --git a/.renovaterc.json b/.renovaterc.json index d15282c..9882bed 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -9,7 +9,7 @@ "commitBodyTable": true, "dependencyDashboard": true, "extends": [ - "config:recommended" + "config:best-practices" ], "prCreation": "immediate", "cargo": { From 5fc53886f2a995309be4e9a2682233e53eb87f1a Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 9 Mar 2025 21:50:22 +0100 Subject: [PATCH 40/59] chore(deps): pin dependencies --- .forgejo/workflows/check.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml index 882647e..205358f 100644 --- a/.forgejo/workflows/check.yml +++ b/.forgejo/workflows/check.yml @@ -3,7 +3,7 @@ jobs: check-renovaterc: runs-on: nixos steps: - - uses: https://git.salame.cl/actions/checkout@v4 + - uses: https://git.salame.cl/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Validate renovaterc run: | nix --version @@ -11,7 +11,7 @@ jobs: build: runs-on: nixos steps: - - uses: https://git.salame.cl/actions/checkout@v4 + - uses: https://git.salame.cl/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Build Package run: | nix --version @@ -31,7 +31,7 @@ jobs: - module-ipv4-only-test - module-ipv6-only-test steps: - - uses: https://git.salame.cl/actions/checkout@v4 + - uses: https://git.salame.cl/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Check run: | set -x @@ -42,7 +42,7 @@ jobs: runs-on: nixos needs: build steps: - - uses: https://git.salame.cl/actions/checkout@v4 + - uses: https://git.salame.cl/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - run: nix --version - name: Generate size report uses: https://git.salame.cl/jalil/nix-flake-outputs-size@main From cf66c7713619dc13b2a8ebe68373edbf2c0bd056 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 9 Mar 2025 22:00:32 +0100 Subject: [PATCH 41/59] chore(deps): lock file maintenance --- Cargo.lock | 12 ++++++------ flake.lock | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1ffe287..ae4a041 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -495,9 +495,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.15" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9" [[package]] name = "log" @@ -748,9 +748,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "0.38.44" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +checksum = "dade4812df5c384711475be5fcd8c162555352945401aed22a35bffeab61f657" dependencies = [ "bitflags", "errno", @@ -917,9 +917,9 @@ checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" [[package]] name = "terminal_size" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9" +checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" dependencies = [ "rustix", "windows-sys 0.59.0", diff --git a/flake.lock b/flake.lock index 3999461..e2e3e9d 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1741148495, - "narHash": "sha256-EV8KUaIZ2/CdBXlutXrHoZYbWPeB65p5kKZk71gvDRI=", + "lastModified": 1741481578, + "narHash": "sha256-JBTSyJFQdO3V8cgcL08VaBUByEU6P5kXbTJN6R0PFQo=", "owner": "ipetkov", "repo": "crane", - "rev": "75390a36cd0c2cdd5f1aafd8a9f827d7107f2e53", + "rev": "bb1c9567c43e4434f54e9481eb4b8e8e0d50f0b5", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1741246872, - "narHash": "sha256-Q6pMP4a9ed636qilcYX8XUguvKl/0/LGXhHcRI91p0U=", + "lastModified": 1741379970, + "narHash": "sha256-Wh7esNh7G24qYleLvgOSY/7HlDUzWaL/n4qzlBePpiw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "10069ef4cf863633f57238f179a0297de84bd8d3", + "rev": "36fd87baa9083f34f7f5027900b62ee6d09b1f2f", "type": "github" }, "original": { From 4cdffc20bcbe7a38f474098167add563a231cb35 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 9 Mar 2025 21:50:25 +0100 Subject: [PATCH 42/59] chore(config): migrate config .renovaterc.json --- .renovaterc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.renovaterc.json b/.renovaterc.json index 9882bed..2a15a88 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -31,7 +31,7 @@ "lockFileMaintenance": { "enabled": true, "recreateWhen": "always", - "rebaseStalePrs": true, + "rebaseWhen": "behind-base-branch", "branchTopic": "lock-file-maintenance", "commitMessageAction": "Lock file maintenance", "schedule": [ From 72843b8f522fb6ff6d68931606aeb5c82c2a4c7e Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 10 Mar 2025 21:50:28 +0100 Subject: [PATCH 43/59] fix(deps): update rust crate clap to v4.5.32 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | clap | 4.5.31 | 4.5.32 | --- Cargo.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ae4a041..cce8588 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,9 +200,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.31" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" +checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" dependencies = [ "clap_builder", "clap_derive", @@ -220,9 +220,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.31" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" +checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" dependencies = [ "anstream", "anstyle", @@ -232,9 +232,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.28" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" +checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" dependencies = [ "heck", "proc-macro2", @@ -279,7 +279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -756,7 +756,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] From f8848e669ef1423c8e78298ada13ba47eb26e567 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 10 Mar 2025 22:00:53 +0100 Subject: [PATCH 44/59] chore(deps): lock file maintenance --- Cargo.lock | 16 ++++++++-------- flake.lock | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cce8588..29ddc16 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -610,9 +610,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.3" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" +checksum = "cde51589ab56b20a6f686b2c68f7a0bd6add753d697abf720d63f8db3ab7b1ad" [[package]] name = "overload" @@ -748,15 +748,15 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dade4812df5c384711475be5fcd8c162555352945401aed22a35bffeab61f657" +checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -900,9 +900,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.99" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e02e925281e18ffd9d640e234264753c43edc62d64b2d4cf898f1bc5e75f3fc2" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", diff --git a/flake.lock b/flake.lock index e2e3e9d..276f183 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1741379970, - "narHash": "sha256-Wh7esNh7G24qYleLvgOSY/7HlDUzWaL/n4qzlBePpiw=", + "lastModified": 1741513245, + "narHash": "sha256-7rTAMNTY1xoBwz0h7ZMtEcd8LELk9R5TzBPoHuhNSCk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "36fd87baa9083f34f7f5027900b62ee6d09b1f2f", + "rev": "e3e32b642a31e6714ec1b712de8c91a3352ce7e1", "type": "github" }, "original": { From 06995416d2d85c05c4badf0122fab261953ad68b Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 11 Mar 2025 18:00:26 +0100 Subject: [PATCH 45/59] fix(deps): update rust crate http to v1.3.0 | datasource | package | from | to | | ---------- | ------- | ----- | ----- | | crate | http | 1.2.0 | 1.3.0 | --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 29ddc16..d5c822c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -365,9 +365,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "http" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +checksum = "0a761d192fbf18bdef69f5ceedd0d1333afcbda0ee23840373b8317570d23c65" dependencies = [ "bytes", "fnv", From 33f8b1570ddfed95b7414c802477c6184f0b5654 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 11 Mar 2025 21:20:24 +0100 Subject: [PATCH 46/59] fix(deps): update rust crate ring to v0.17.14 | datasource | package | from | to | | ---------- | ------- | ------- | ------- | | crate | ring | 0.17.13 | 0.17.14 | --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d5c822c..fb7e161 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -728,9 +728,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "ring" -version = "0.17.13" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", From 9b41d7d2a5a5bfec9b476acc316a34a81a4a34d9 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 11 Mar 2025 21:50:30 +0100 Subject: [PATCH 47/59] fix(deps): update rust crate http to v1.3.1 | datasource | package | from | to | | ---------- | ------- | ----- | ----- | | crate | http | 1.3.0 | 1.3.1 | --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fb7e161..e074c49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -365,9 +365,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "http" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a761d192fbf18bdef69f5ceedd0d1333afcbda0ee23840373b8317570d23c65" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ "bytes", "fnv", From baeb98a2e6fc32fa99c84a753b1ecabf5fb4f404 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 12 Mar 2025 01:00:32 +0100 Subject: [PATCH 48/59] chore(deps): lock file maintenance --- Cargo.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e074c49..8d38cf2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -386,12 +386,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", - "futures-util", + "futures-core", "http", "http-body", "pin-project-lite", @@ -483,9 +483,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.170" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "linked-hash-map" @@ -675,9 +675,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] From e236aa424b22f38b345d1b37310770d5b4cc3568 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 13 Mar 2025 09:40:24 +0100 Subject: [PATCH 49/59] fix(deps): update rust crate tokio to v1.44.1 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | tokio | 1.44.0 | 1.44.1 | --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8d38cf2..7d38bdd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -967,9 +967,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.44.0" +version = "1.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9975ea0f48b5aa3972bf2d888c238182458437cc2a19374b81b25cdf1023fb3a" +checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" dependencies = [ "backtrace", "bytes", From 130c9497234c82ddca4f9e0043992a2a65bb34e1 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 13 Mar 2025 22:00:46 +0100 Subject: [PATCH 50/59] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- flake.lock | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7d38bdd..01726da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -610,9 +610,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.0" +version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde51589ab56b20a6f686b2c68f7a0bd6add753d697abf720d63f8db3ab7b1ad" +checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" [[package]] name = "overload" diff --git a/flake.lock b/flake.lock index 276f183..b8717c3 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1741513245, - "narHash": "sha256-7rTAMNTY1xoBwz0h7ZMtEcd8LELk9R5TzBPoHuhNSCk=", + "lastModified": 1741851582, + "narHash": "sha256-cPfs8qMccim2RBgtKGF+x9IBCduRvd/N5F4nYpU0TVE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e3e32b642a31e6714ec1b712de8c91a3352ce7e1", + "rev": "6607cf789e541e7873d40d3a8f7815ea92204f32", "type": "github" }, "original": { From 8787adae3071673bdcd1adfe5fed09382bd9a5ae Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 14 Mar 2025 22:00:31 +0100 Subject: [PATCH 51/59] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 01726da..7285af4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -495,9 +495,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9" +checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" [[package]] name = "log" From 08ea3271c1d552a397fd86db8e3e496e61f364b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 16 Mar 2025 19:25:48 +0100 Subject: [PATCH 52/59] ci: use nix-fast-build to speedup checks Should be a noticeable improvement c: --- .forgejo/workflows/check.yml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml index 205358f..a207161 100644 --- a/.forgejo/workflows/check.yml +++ b/.forgejo/workflows/check.yml @@ -16,28 +16,16 @@ jobs: run: | nix --version nix build --print-build-logs .# - check: + test: needs: build # we use the built binaries in the checks runs-on: nixos - strategy: - matrix: - check: - - treefmt - - clippy - - nextest - - module-ipv4-test - - module-ipv6-test - - module-nginx-test - - module-ipv4-only-test - - module-ipv6-only-test steps: - uses: https://git.salame.cl/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - - name: Check + - name: Run tests run: | - set -x nix --version - # shellcheck disable=SC2016 - nix build --print-build-logs '.#checks.x86_64-linux.${{ matrix.check }}' + nix-fast-build --max-jobs 2 --no-nom --skip-cached --no-link \ + --flake ".#checks.$(nix eval --raw --impure --expr builtins.currentSystem)" report-size: runs-on: nixos needs: build From c589fb40c3c8de9d5bb3bbe11b6404b11ca321f5 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 16 Mar 2025 22:00:43 +0100 Subject: [PATCH 53/59] chore(deps): lock file maintenance --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index b8717c3..f766d24 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1741481578, - "narHash": "sha256-JBTSyJFQdO3V8cgcL08VaBUByEU6P5kXbTJN6R0PFQo=", + "lastModified": 1742143293, + "narHash": "sha256-8oKPsMlqlOQ7qnTWvhBEcfVFY1WqHIcSilGVtaLAquw=", "owner": "ipetkov", "repo": "crane", - "rev": "bb1c9567c43e4434f54e9481eb4b8e8e0d50f0b5", + "rev": "de3bb0155823298161c1c0a7805f10d4b4074bbb", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1741851582, - "narHash": "sha256-cPfs8qMccim2RBgtKGF+x9IBCduRvd/N5F4nYpU0TVE=", + "lastModified": 1742069588, + "narHash": "sha256-C7jVfohcGzdZRF6DO+ybyG/sqpo1h6bZi9T56sxLy+k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6607cf789e541e7873d40d3a8f7815ea92204f32", + "rev": "c80f6a7e10b39afcc1894e02ef785b1ad0b0d7e5", "type": "github" }, "original": { From f207cbe859a275b309962dac39995abff364b3b5 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 18 Mar 2025 22:00:32 +0100 Subject: [PATCH 54/59] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- flake.lock | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7285af4..b695306 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -748,9 +748,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825" +checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" dependencies = [ "bitflags", "errno", diff --git a/flake.lock b/flake.lock index f766d24..1054085 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1742143293, - "narHash": "sha256-8oKPsMlqlOQ7qnTWvhBEcfVFY1WqHIcSilGVtaLAquw=", + "lastModified": 1742317686, + "narHash": "sha256-ScJYnUykEDhYeCepoAWBbZWx2fpQ8ottyvOyGry7HqE=", "owner": "ipetkov", "repo": "crane", - "rev": "de3bb0155823298161c1c0a7805f10d4b4074bbb", + "rev": "66cb0013f9a99d710b167ad13cbd8cc4e64f2ddb", "type": "github" }, "original": { @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1739829690, - "narHash": "sha256-mL1szCeIsjh6Khn3nH2cYtwO5YXG6gBiTw1A30iGeDU=", + "lastModified": 1742303424, + "narHash": "sha256-2R7cGdcA2npQQcIWu2cTlU63veTzwVZe78BliIuJT00=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "3d0579f5cc93436052d94b73925b48973a104204", + "rev": "b3b938ab8ba2e8a0ce9ee9b30ccfa5e903ae5753", "type": "github" }, "original": { From 3d660314cf695de9dffae722e7dacf0a2d25a6d0 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 19 Mar 2025 22:00:49 +0100 Subject: [PATCH 55/59] chore(deps): lock file maintenance --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index 1054085..4c2f403 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1742317686, - "narHash": "sha256-ScJYnUykEDhYeCepoAWBbZWx2fpQ8ottyvOyGry7HqE=", + "lastModified": 1742394900, + "narHash": "sha256-vVOAp9ahvnU+fQoKd4SEXB2JG2wbENkpqcwlkIXgUC0=", "owner": "ipetkov", "repo": "crane", - "rev": "66cb0013f9a99d710b167ad13cbd8cc4e64f2ddb", + "rev": "70947c1908108c0c551ddfd73d4f750ff2ea67cd", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1742069588, - "narHash": "sha256-C7jVfohcGzdZRF6DO+ybyG/sqpo1h6bZi9T56sxLy+k=", + "lastModified": 1742288794, + "narHash": "sha256-Txwa5uO+qpQXrNG4eumPSD+hHzzYi/CdaM80M9XRLCo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c80f6a7e10b39afcc1894e02ef785b1ad0b0d7e5", + "rev": "b6eaf97c6960d97350c584de1b6dcff03c9daf42", "type": "github" }, "original": { @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1742303424, - "narHash": "sha256-2R7cGdcA2npQQcIWu2cTlU63veTzwVZe78BliIuJT00=", + "lastModified": 1742370146, + "narHash": "sha256-XRE8hL4vKIQyVMDXykFh4ceo3KSpuJF3ts8GKwh5bIU=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "b3b938ab8ba2e8a0ce9ee9b30ccfa5e903ae5753", + "rev": "adc195eef5da3606891cedf80c0d9ce2d3190808", "type": "github" }, "original": { From 316f2bf5762491c14b0752c8706f7dcfd411cf7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Wed, 5 Feb 2025 23:59:58 +0100 Subject: [PATCH 56/59] feat: add config file to webnsupdate Move flags to config file, and add more options. Mirror some in the module. --- Cargo.lock | 35 ++- Cargo.toml | 7 +- flake-modules/default.nix | 10 +- flake-modules/module.nix | 208 -------------- flake-modules/tests.nix | 53 ++-- module.nix | 162 +++++++++++ src/config.rs | 253 ++++++++++++++++++ src/main.rs | 243 +++++++---------- src/nsupdate.rs | 4 +- src/password.rs | 26 +- src/records.rs | 136 ++-------- ...bnsupdate__records__test__empty_label.snap | 6 +- ...ate__records__test__hostname_too_long.snap | 6 +- ...supdate__records__test__invalid_ascii.snap | 6 +- ...supdate__records__test__invalid_octet.snap | 6 +- ...update__records__test__label_too_long.snap | 6 +- .../webnsupdate__records__test__not_fqd.snap | 6 +- 17 files changed, 641 insertions(+), 532 deletions(-) delete mode 100644 flake-modules/module.nix create mode 100644 module.nix create mode 100644 src/config.rs diff --git a/Cargo.lock b/Cargo.lock index b695306..5967e09 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -304,7 +304,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835f84f38484cc86f110a805655697908257fb9a7af005234060891557198e9" dependencies = [ "nonempty", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -409,6 +409,12 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "humantime" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" + [[package]] name = "hyper" version = "1.6.0" @@ -454,6 +460,7 @@ dependencies = [ "linked-hash-map", "once_cell", "pin-project", + "serde", "similar", ] @@ -542,7 +549,7 @@ dependencies = [ "supports-unicode", "terminal_size", "textwrap", - "thiserror", + "thiserror 1.0.69", "unicode-width 0.1.14", ] @@ -941,7 +948,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.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -955,6 +971,17 @@ dependencies = [ "syn", ] +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "thread_local" version = "1.1.8" @@ -1156,11 +1183,13 @@ dependencies = [ "clap", "clap-verbosity-flag", "http", + "humantime", "insta", "miette", "ring", "serde", "serde_json", + "thiserror 2.0.12", "tokio", "tower-http", "tracing", diff --git a/Cargo.toml b/Cargo.toml index dd4bde5..afbafbf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,3 @@ -cargo-features = ["codegen-backend"] - [package] description = "An HTTP server using HTTP basic auth to make secure calls to nsupdate" name = "webnsupdate" @@ -25,17 +23,19 @@ clap-verbosity-flag = { version = "3", default-features = false, features = [ "tracing", ] } http = "1" +humantime = "2.2.0" miette = { version = "7", features = ["fancy"] } ring = { version = "0.17", features = ["std"] } serde = { version = "1", features = ["derive"] } serde_json = "1" +thiserror = "2" tokio = { version = "1", features = ["macros", "rt", "process", "io-util"] } tower-http = { version = "0.6", features = ["validate-request"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } [dev-dependencies] -insta = "1" +insta = { version = "1", features = ["json"] } [profile.release] opt-level = "s" @@ -46,4 +46,3 @@ codegen-units = 1 [profile.dev] debug = 0 -codegen-backend = "cranelift" diff --git a/flake-modules/default.nix b/flake-modules/default.nix index 27ecc50..6736a16 100644 --- a/flake-modules/default.nix +++ b/flake-modules/default.nix @@ -3,10 +3,18 @@ imports = [ inputs.treefmt-nix.flakeModule ./package.nix - ./module.nix ./tests.nix ]; + flake.nixosModules = + let + webnsupdate = ../module.nix; + in + { + default = webnsupdate; + inherit webnsupdate; + }; + perSystem = { pkgs, ... }: { diff --git a/flake-modules/module.nix b/flake-modules/module.nix deleted file mode 100644 index e70ae35..0000000 --- a/flake-modules/module.nix +++ /dev/null @@ -1,208 +0,0 @@ -let - module = - { - lib, - pkgs, - config, - ... - }: - let - cfg = config.services.webnsupdate; - inherit (lib) - mkOption - mkEnableOption - mkPackageOption - types - ; - in - { - options.services.webnsupdate = mkOption { - description = "An HTTP server for nsupdate."; - default = { }; - type = types.submodule { - options = { - enable = mkEnableOption "webnsupdate"; - extraArgs = mkOption { - description = '' - Extra arguments to be passed to the webnsupdate server command. - ''; - type = types.listOf types.str; - default = [ ]; - example = [ "--ip-source" ]; - }; - package = mkPackageOption pkgs "webnsupdate" { }; - bindIp = mkOption { - description = '' - IP address to bind to. - - Setting it to anything other than localhost is very insecure as - `webnsupdate` only supports plain HTTP and should always be behind a - reverse proxy. - ''; - type = types.str; - default = "localhost"; - example = "0.0.0.0"; - }; - bindPort = mkOption { - description = "Port to bind to."; - type = types.port; - default = 5353; - }; - allowedIPVersion = mkOption { - description = ''The allowed IP versions to accept updates from.''; - type = types.enum [ - "both" - "ipv4-only" - "ipv6-only" - ]; - default = "both"; - example = "ipv4-only"; - }; - passwordFile = mkOption { - description = '' - The file where the password is stored. - - This file can be created by running `webnsupdate mkpasswd $USERNAME $PASSWORD`. - ''; - type = types.path; - example = "/secrets/webnsupdate.pass"; - }; - keyFile = mkOption { - description = '' - The TSIG key that `nsupdate` should use. - - This file will be passed to `nsupdate` through the `-k` option, so look - at `man 8 nsupdate` for information on the key's format. - ''; - type = types.path; - example = "/secrets/webnsupdate.key"; - }; - ttl = mkOption { - description = "The TTL that should be set on the zone records created by `nsupdate`."; - type = types.ints.positive; - default = 60; - example = 3600; - }; - records = mkOption { - description = '' - The fqdn of records that should be updated. - - Empty lines will be ignored, but whitespace will not be. - ''; - type = types.nullOr types.lines; - default = null; - example = '' - example.com. - - example.org. - ci.example.org. - ''; - }; - recordsFile = mkOption { - description = '' - The fqdn of records that should be updated. - - Empty lines will be ignored, but whitespace will not be. - ''; - type = types.nullOr types.path; - default = null; - example = "/secrets/webnsupdate.records"; - }; - user = mkOption { - description = "The user to run as."; - type = types.str; - default = "named"; - }; - group = mkOption { - description = "The group to run as."; - type = types.str; - default = "named"; - }; - }; - }; - }; - - config = - let - recordsFile = - if cfg.recordsFile != null then cfg.recordsFile else pkgs.writeText "webnsrecords" cfg.records; - args = lib.strings.escapeShellArgs ( - [ - "--records" - recordsFile - "--key-file" - cfg.keyFile - "--password-file" - cfg.passwordFile - "--address" - cfg.bindIp - "--ip-type" - cfg.allowedIPVersion - "--port" - (builtins.toString cfg.bindPort) - "--ttl" - (builtins.toString cfg.ttl) - "--data-dir=%S/webnsupdate" - ] - ++ cfg.extraArgs - ); - cmd = "${lib.getExe cfg.package} ${args}"; - in - lib.mkIf cfg.enable { - # warnings = - # lib.optional (!config.services.bind.enable) "`webnsupdate` is expected to be used alongside `bind`. This is an unsupported configuration."; - assertions = [ - { - assertion = - (cfg.records != null || cfg.recordsFile != null) - && !(cfg.records != null && cfg.recordsFile != null); - message = "Exactly one of `services.webnsupdate.records` and `services.webnsupdate.recordsFile` must be set."; - } - ]; - - systemd.services.webnsupdate = { - description = "Web interface for nsupdate."; - wantedBy = [ "multi-user.target" ]; - after = [ - "network.target" - "bind.service" - ]; - preStart = "${cmd} verify"; - path = [ pkgs.dig ]; - startLimitIntervalSec = 60; - serviceConfig = { - ExecStart = [ cmd ]; - Type = "exec"; - Restart = "on-failure"; - RestartSec = "10s"; - # User and group - User = cfg.user; - Group = cfg.group; - # Runtime directory and mode - RuntimeDirectory = "webnsupdate"; - RuntimeDirectoryMode = "0750"; - # Cache directory and mode - CacheDirectory = "webnsupdate"; - CacheDirectoryMode = "0750"; - # Logs directory and mode - LogsDirectory = "webnsupdate"; - LogsDirectoryMode = "0750"; - # State directory and mode - StateDirectory = "webnsupdate"; - StateDirectoryMode = "0750"; - # New file permissions - UMask = "0027"; - # Security - NoNewPrivileges = true; - ProtectHome = true; - }; - }; - }; - }; -in -{ - flake.nixosModules = { - default = module; - webnsupdate = module; - }; -} diff --git a/flake-modules/tests.nix b/flake-modules/tests.nix index 45fc5ff..8257326 100644 --- a/flake-modules/tests.nix +++ b/flake-modules/tests.nix @@ -9,7 +9,7 @@ lastIPPath = "/var/lib/webnsupdate/last-ip.json"; zoneFile = pkgs.writeText "${testDomain}.zoneinfo" '' - $TTL 60 ; 1 minute + $TTL 600 ; 10 minutes $ORIGIN ${testDomain}. @ IN SOA ns1.${testDomain}. admin.${testDomain}. ( 1 ; serial @@ -73,20 +73,19 @@ webnsupdate = { enable = true; - bindIp = lib.mkDefault "127.0.0.1"; - keyFile = "/etc/bind/rndc.key"; - # test:test (user:password) - passwordFile = pkgs.writeText "webnsupdate.pass" "FQoNmuU1BKfg8qsU96F6bK5ykp2b0SLe3ZpB3nbtfZA"; package = self'.packages.webnsupdate; - extraArgs = [ - "-vvv" # debug messages - "--ip-source=ConnectInfo" - ]; - records = '' - test1.${testDomain}. - test2.${testDomain}. - test3.${testDomain}. - ''; + extraArgs = [ "-vvv" ]; # debug messages + settings = { + address = lib.mkDefault "127.0.0.1:5353"; + key_file = "/etc/bind/rndc.key"; + password_file = pkgs.writeText "webnsupdate.pass" "FQoNmuU1BKfg8qsU96F6bK5ykp2b0SLe3ZpB3nbtfZA"; # test:test + ip_source = lib.mkDefault "ConnectInfo"; + records = [ + "test1.${testDomain}." + "test2.${testDomain}." + "test3.${testDomain}." + ]; + }; }; }; }; @@ -97,7 +96,7 @@ webnsupdate-ipv4-machine ]; - config.services.webnsupdate.bindIp = "::1"; + config.services.webnsupdate.settings.address = "[::1]:5353"; }; webnsupdate-nginx-machine = @@ -109,26 +108,26 @@ config.services = { # Use default IP Source - webnsupdate.extraArgs = lib.mkForce [ "-vvv" ]; # debug messages + webnsupdate.settings.ip_source = "RightmostXForwardedFor"; nginx = { enable = true; recommendedProxySettings = true; virtualHosts.webnsupdate.locations."/".proxyPass = - "http://${config.services.webnsupdate.bindIp}:${builtins.toString config.services.webnsupdate.bindPort}"; + "http://${config.services.webnsupdate.settings.address}"; }; }; }; webnsupdate-ipv4-only-machine = { imports = [ webnsupdate-nginx-machine ]; - config.services.webnsupdate.allowedIPVersion = "ipv4-only"; + config.services.webnsupdate.settings.ip_type = "Ipv4Only"; }; webnsupdate-ipv6-only-machine = { imports = [ webnsupdate-nginx-machine ]; - config.services.webnsupdate.allowedIPVersion = "ipv6-only"; + config.services.webnsupdate.settings.ip_type = "Ipv6Only"; }; # "A" for IPv4, "AAAA" for IPv6, "ANY" for any @@ -158,9 +157,9 @@ STATIC_DOMAINS: list[str] = ["${testDomain}", "ns1.${testDomain}", "nsupdate.${testDomain}"] DYNAMIC_DOMAINS: list[str] = ["test1.${testDomain}", "test2.${testDomain}", "test3.${testDomain}"] - def dig_cmd(domain: str, record: str, ip: str | None) -> str: - match_ip = "" if ip is None else f"\\s\\+60\\s\\+IN\\s\\+{record}\\s\\+{ip}$" - return f"dig @localhost {record} {domain} +noall +answer | grep '^{domain}.{match_ip}'" + def dig_cmd(domain: str, record: str, ip: str | None) -> tuple[str, str]: + match_ip = "" if ip is None else f"\\s\\+600\\s\\+IN\\s\\+{record}\\s\\+{ip}$" + return f"dig @localhost {record} {domain} +noall +answer", f"grep '^{domain}.{match_ip}'" def curl_cmd(domain: str, identity: str, path: str, query: dict[str, str]) -> str: from urllib.parse import urlencode @@ -168,10 +167,16 @@ return f"{CURL} -u {identity} -X GET 'http://{domain}{"" if NGINX else ":5353"}/{path}{q}'" def domain_available(domain: str, record: str, ip: str | None=None): - machine.succeed(dig_cmd(domain, record, ip)) + dig, grep = dig_cmd(domain, record, ip) + rc, output = machine.execute(dig) + print(f"{dig}[{rc}]: {output}") + machine.succeed(f"{dig} | {grep}") def domain_missing(domain: str, record: str, ip: str | None=None): - machine.fail(dig_cmd(domain, record, ip)) + dig, grep = dig_cmd(domain, record, ip) + rc, output = machine.execute(dig) + print(f"{dig}[{rc}]: {output}") + machine.fail(f"{dig} | {grep}") def update_records(domain: str="localhost", /, *, path: str="update", **kwargs): machine.succeed(curl_cmd(domain, "test:test", path, kwargs)) diff --git a/module.nix b/module.nix new file mode 100644 index 0000000..8bdfced --- /dev/null +++ b/module.nix @@ -0,0 +1,162 @@ +{ lib, pkgs, ... }@args: +let + cfg = args.config.services.webnsupdate; + inherit (lib) + mkOption + mkEnableOption + mkPackageOption + types + ; + format = pkgs.formats.json { }; +in +{ + options.services.webnsupdate = mkOption { + description = "An HTTP server for nsupdate."; + default = { }; + type = types.submodule { + options = { + enable = mkEnableOption "webnsupdate"; + extraArgs = mkOption { + description = '' + Extra arguments to be passed to the webnsupdate server command. + ''; + type = types.listOf types.str; + default = [ ]; + example = [ "--ip-source" ]; + }; + package = mkPackageOption pkgs "webnsupdate" { }; + settings = mkOption { + description = "The webnsupdate JSON configuration"; + default = { }; + type = types.submodule { + freeformType = format.type; + options = { + address = mkOption { + description = '' + IP address and port to bind to. + + Setting it to anything other than localhost is very + insecure as `webnsupdate` only supports plain HTTP and + should always be behind a reverse proxy. + ''; + type = types.str; + default = "127.0.0.1:5353"; + example = "[::1]:5353"; + }; + ip_type = mkOption { + description = ''The allowed IP versions to accept updates from.''; + type = types.enum [ + "Both" + "Ipv4Only" + "Ipv6Only" + ]; + default = "Both"; + example = "Ipv4Only"; + }; + password_file = mkOption { + description = '' + The file where the password is stored. + + This file can be created by running `webnsupdate mkpasswd $USERNAME $PASSWORD`. + ''; + type = types.path; + example = "/secrets/webnsupdate.pass"; + }; + key_file = mkOption { + description = '' + The TSIG key that `nsupdate` should use. + + This file will be passed to `nsupdate` through the `-k` option, so look + at `man 8 nsupdate` for information on the key's format. + ''; + type = types.path; + example = "/secrets/webnsupdate.key"; + }; + ttl = mkOption { + description = "The TTL that should be set on the zone records created by `nsupdate`."; + default = "10m"; + example = "60s"; + type = types.str; + }; + records = mkOption { + description = '' + The fqdn of records that should be updated. + + Empty lines will be ignored, but whitespace will not be. + ''; + type = types.listOf types.str; + default = [ ]; + example = [ + "example.com." + "example.org." + "ci.example.org." + ]; + }; + }; + }; + }; + user = mkOption { + description = "The user to run as."; + type = types.str; + default = "named"; + }; + group = mkOption { + description = "The group to run as."; + type = types.str; + default = "named"; + }; + }; + }; + }; + + config = + let + configFile = format.generate "webnsupdate.json" cfg.settings; + args = lib.strings.escapeShellArgs ([ "--config=${configFile}" ] ++ cfg.extraArgs); + cmd = "${lib.getExe cfg.package} ${args}"; + in + lib.mkIf cfg.enable { + # FIXME: re-enable once I stop using the patched version of bind + # warnings = + # lib.optional (!config.services.bind.enable) "`webnsupdate` is expected to be used alongside `bind`. This is an unsupported configuration."; + + systemd.services.webnsupdate = { + description = "Web interface for nsupdate."; + wantedBy = [ "multi-user.target" ]; + after = [ + "network.target" + "bind.service" + ]; + preStart = "${lib.getExe cfg.package} verify ${configFile}"; + path = [ pkgs.dig ]; + startLimitIntervalSec = 60; + environment.DATA_DIR = "%S/webnsupdate"; + serviceConfig = { + ExecStart = [ cmd ]; + Type = "exec"; + Restart = "on-failure"; + RestartSec = "10s"; + # User and group + User = cfg.user; + Group = cfg.group; + # Runtime directory and mode + RuntimeDirectory = "webnsupdate"; + RuntimeDirectoryMode = "0750"; + # Cache directory and mode + CacheDirectory = "webnsupdate"; + CacheDirectoryMode = "0750"; + # Logs directory and mode + LogsDirectory = "webnsupdate"; + LogsDirectoryMode = "0750"; + # State directory and mode + StateDirectory = "webnsupdate"; + StateDirectoryMode = "0750"; + # New file permissions + UMask = "0027"; + # Security + NoNewPrivileges = true; + ProtectHome = true; + }; + }; + }; +} diff --git a/src/config.rs b/src/config.rs new file mode 100644 index 0000000..6e4af7f --- /dev/null +++ b/src/config.rs @@ -0,0 +1,253 @@ +use std::{ + fs::File, + net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr}, + path::PathBuf, +}; + +use axum_client_ip::SecureClientIpSource; +use miette::{Context, IntoDiagnostic}; + +#[derive(Debug, Default, Clone, Copy, serde::Deserialize, serde::Serialize)] +pub enum IpType { + #[default] + Both, + Ipv4Only, + Ipv6Only, +} + +impl IpType { + pub fn valid_for_type(self, ip: IpAddr) -> bool { + match self { + IpType::Both => true, + IpType::Ipv4Only => ip.is_ipv4(), + IpType::Ipv6Only => ip.is_ipv6(), + } + } +} + +impl std::fmt::Display for IpType { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + IpType::Both => f.write_str("both"), + IpType::Ipv4Only => f.write_str("ipv4-only"), + IpType::Ipv6Only => f.write_str("ipv6-only"), + } + } +} + +impl std::str::FromStr for IpType { + type Err = miette::Error; + + fn from_str(s: &str) -> std::result::Result { + match s { + "both" => Ok(Self::Both), + "ipv4-only" => Ok(Self::Ipv4Only), + "ipv6-only" => Ok(Self::Ipv6Only), + _ => miette::bail!("expected one of 'ipv4-only', 'ipv6-only' or 'both', got '{s}'"), + } + } +} + +/// Webserver settings +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct Server { + /// Ip address and port of the server + #[serde(default = "default_address")] + pub address: SocketAddr, +} + +/// Password settings +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct Password { + /// File containing password to match against + /// + /// Should be of the format `username:password` and contain a single password + #[serde(default, skip_serializing_if = "Option::is_none")] + pub password_file: Option, + + /// Salt to get more unique hashed passwords and prevent table based attacks + #[serde(default = "default_salt")] + pub salt: Box, +} + +/// Records settings +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct Records { + /// Time To Live (in seconds) to set on the DNS records + #[serde( + default = "default_ttl", + serialize_with = "humantime_ser", + deserialize_with = "humantime_de" + )] + pub ttl: humantime::Duration, + + /// List of domain names for which to update the IP when an update is requested + #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[allow(clippy::struct_field_names)] + pub records: Vec>, + + /// If provided, when an IPv6 prefix is provided with an update, this will be used to derive + /// the full IPv6 address of the client + #[serde(default, skip_serializing_if = "Option::is_none")] + pub client_id: Option, + + /// If a client id is provided the ipv6 update will be ignored (only the prefix will be used). + /// This domain will point to the ipv6 address instead of the address derived from the client + /// id (usually this is the router). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub router_domain: Option>, + + /// Set client IP source + /// + /// see: + #[serde(default = "default_ip_source")] + pub ip_source: SecureClientIpSource, + + /// Set which IPs to allow updating (ipv4, ipv6 or both) + #[serde(default = "default_ip_type")] + pub ip_type: IpType, + + /// Keyfile `nsupdate` should use + /// + /// If specified, then `webnsupdate` must have read access to the file + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key_file: Option, +} + +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct Config { + /// Server Configuration + #[serde(flatten)] + pub server: Server, + + /// Password Configuration + #[serde(flatten)] + pub password: Password, + + /// Records Configuration + #[serde(flatten)] + pub records: Records, + + /// The config schema (used for lsp completions) + #[serde(default, rename = "$schema", skip_serializing)] + pub _schema: serde::de::IgnoredAny, +} + +impl Config { + /// Load the configuration without verifying it + pub fn load(path: &std::path::Path) -> miette::Result { + serde_json::from_reader::( + File::open(path) + .into_diagnostic() + .wrap_err_with(|| format!("failed open {}", path.display()))?, + ) + .into_diagnostic() + .wrap_err_with(|| format!("failed to load configuration from {}", path.display())) + } + + /// Ensure only a verified configuration is returned + pub fn verified(self) -> miette::Result { + self.verify()?; + Ok(self) + } + + /// Verify the configuration + pub fn verify(&self) -> Result<(), Invalid> { + let mut invalid_records: Vec = self + .records + .records + .iter() + .filter_map(|record| crate::records::validate_record_str(record).err()) + .collect(); + + invalid_records.extend( + self.records + .router_domain + .as_ref() + .and_then(|domain| crate::records::validate_record_str(domain).err()), + ); + + let err = Invalid { invalid_records }; + + if err.invalid_records.is_empty() { + Ok(()) + } else { + Err(err) + } + } +} + +#[derive(Debug, miette::Diagnostic, thiserror::Error)] +#[error("the configuration was invalid")] +pub struct Invalid { + #[related] + pub invalid_records: Vec, +} + +// --- Default Values (sadly serde doesn't have a way to specify a constant as a default value) --- + +fn default_ttl() -> humantime::Duration { + super::DEFAULT_TTL.into() +} + +fn default_salt() -> Box { + super::DEFAULT_SALT.into() +} + +fn default_address() -> SocketAddr { + SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 5353) +} + +fn default_ip_source() -> SecureClientIpSource { + SecureClientIpSource::RightmostXForwardedFor +} + +fn default_ip_type() -> IpType { + IpType::Both +} + +fn humantime_de<'de, D>(de: D) -> Result +where + D: serde::Deserializer<'de>, +{ + struct Visitor; + impl serde::de::Visitor<'_> for Visitor { + type Value = humantime::Duration; + + fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { + write!(formatter, "a duration (e.g. 5s)") + } + + fn visit_str(self, v: &str) -> Result + where + E: serde::de::Error, + { + v.parse().map_err(E::custom) + } + } + de.deserialize_str(Visitor) +} + +fn humantime_ser(duration: &humantime::Duration, ser: S) -> Result +where + S: serde::Serializer, +{ + ser.serialize_str(&duration.to_string()) +} + +#[test] +fn default_values_config_snapshot() { + let config: Config = serde_json::from_str("{}").unwrap(); + insta::assert_json_snapshot!(config, @r#" + { + "address": "127.0.0.1:5353", + "salt": "UpdateMyDNS", + "ttl": { + "secs": 60, + "nanos": 0 + }, + "ip_source": "RightmostXForwardedFor", + "ip_type": "Both" + } + "#); +} diff --git a/src/main.rs b/src/main.rs index cf37707..aa44bc6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,16 +10,18 @@ use axum::{ routing::get, Router, }; -use axum_client_ip::{SecureClientIp, SecureClientIpSource}; +use axum_client_ip::SecureClientIp; use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; use clap::{Parser, Subcommand}; use clap_verbosity_flag::Verbosity; +use config::Config; use http::StatusCode; use miette::{bail, ensure, Context, IntoDiagnostic, Result}; use tracing::{debug, error, info}; use tracing_subscriber::EnvFilter; mod auth; +mod config; mod nsupdate; mod password; mod records; @@ -32,120 +34,52 @@ struct Opts { #[command(flatten)] verbosity: Verbosity, - /// Ip address of the server - #[arg(long, default_value = "127.0.0.1")] - address: IpAddr, - - /// Port of the server - #[arg(long, default_value_t = 5353)] - port: u16, - - /// File containing password to match against - /// - /// Should be of the format `username:password` and contain a single password - #[arg(long)] - password_file: Option, - - /// Salt to get more unique hashed passwords and prevent table based attacks - #[arg(long, default_value = DEFAULT_SALT)] - salt: String, - - /// Time To Live (in seconds) to set on the DNS records - #[arg(long, default_value_t = DEFAULT_TTL.as_secs())] - ttl: u64, - /// Data directory - #[arg(long, default_value = ".")] + #[arg(long, env, default_value = ".")] data_dir: PathBuf, - /// File containing the records that should be updated when an update request is made - /// - /// There should be one record per line: - /// - /// ```text - /// example.com. - /// mail.example.com. - /// ``` - #[arg(long)] - records: PathBuf, - - /// Keyfile `nsupdate` should use - /// - /// If specified, then `webnsupdate` must have read access to the file - #[arg(long)] - key_file: Option, - /// Allow not setting a password #[arg(long)] insecure: bool, - /// Set client IP source - /// - /// see: - #[clap(long, default_value = "RightmostXForwardedFor")] - ip_source: SecureClientIpSource, + #[clap(flatten)] + config_or_command: ConfigOrCommand, +} - /// Set which IPs to allow updating - #[clap(long, default_value_t = IpType::Both)] - ip_type: IpType, +#[derive(clap::Args, Debug)] +#[group(multiple = false)] +struct ConfigOrCommand { + /// Path to the configuration file + #[arg(long, short)] + config: Option, #[clap(subcommand)] subcommand: Option, } -#[derive(Debug, Default, Clone, Copy)] -enum IpType { - #[default] - Both, - IPv4Only, - IPv6Only, -} - -impl IpType { - fn valid_for_type(self, ip: IpAddr) -> bool { - match self { - IpType::Both => true, - IpType::IPv4Only => ip.is_ipv4(), - IpType::IPv6Only => ip.is_ipv6(), - } - } -} - -impl std::fmt::Display for IpType { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - IpType::Both => f.write_str("both"), - IpType::IPv4Only => f.write_str("ipv4-only"), - IpType::IPv6Only => f.write_str("ipv6-only"), - } - } -} - -impl std::str::FromStr for IpType { - type Err = miette::Error; - - fn from_str(s: &str) -> std::result::Result { - match s { - "both" => Ok(Self::Both), - "ipv4-only" => Ok(Self::IPv4Only), - "ipv6-only" => Ok(Self::IPv6Only), - _ => bail!("expected one of 'ipv4-only', 'ipv6-only' or 'both', got '{s}'"), - } +impl ConfigOrCommand { + pub fn take(&mut self) -> (Option, Option) { + (self.config.take(), self.subcommand.take()) } } #[derive(Debug, Subcommand)] enum Cmd { Mkpasswd(password::Mkpasswd), - /// Verify the records file - Verify, + /// Verify the configuration file + Verify { + /// Path to the configuration file + config: PathBuf, + }, } impl Cmd { pub fn process(self, args: &Opts) -> Result<()> { match self { Cmd::Mkpasswd(mkpasswd) => mkpasswd.process(args), - Cmd::Verify => records::load(&args.records).map(drop), + Cmd::Verify { config } => config::Config::load(&config) // load config + .and_then(Config::verified) // verify config + .map(drop), // ignore config data } } } @@ -168,7 +102,7 @@ struct AppState<'a> { last_ips: std::sync::Arc>, /// The IP type for which to allow updates - ip_type: IpType, + ip_type: config::IpType, } #[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)] @@ -211,33 +145,38 @@ impl SavedIPs { } impl AppState<'static> { - fn from_args(args: &Opts) -> miette::Result { + fn from_args(args: &Opts, config: &config::Config) -> miette::Result { let Opts { verbosity: _, - address: _, - port: _, - password_file: _, data_dir, - key_file, insecure, - subcommand: _, - records, - salt: _, - ttl, - ip_source: _, - ip_type, + config_or_command: _, } = args; - // Set state - let ttl = Duration::from_secs(*ttl); + let config::Records { + ttl, + records, + client_id: _, + router_domain: _, + ip_source: _, + ip_type, + key_file, + } = &config.records; // Use last registered IP address if available let ip_file = Box::leak(data_dir.join("last-ip.json").into_boxed_path()); + // Leak DNS records + let records: &[&str] = &*Vec::leak( + records + .iter() + .map(|record| &*Box::leak(record.clone())) + .collect(), + ); + let state = AppState { - ttl, - // Load DNS records - records: records::load_no_verify(records)?, + ttl: **ttl, + records, // Load keyfile key_file: key_file .as_deref() @@ -340,34 +279,37 @@ fn main() -> Result<()> { debug!("{args:?}"); - // process subcommand - if let Some(cmd) = args.subcommand.take() { - return cmd.process(&args); - } + let config = match args.config_or_command.take() { + // process subcommand + (None, Some(cmd)) => return cmd.process(&args), + (Some(path), None) => { + let config = config::Config::load(&path)?; + if let Err(err) = config.verify() { + error!("failed to verify configuration: {err}"); + } + config + } + (None, None) | (Some(_), Some(_)) => unreachable!( + "bad state, one of config or subcommand should be available (clap should enforce this)" + ), + }; // Initialize state - let state = AppState::from_args(&args)?; + let state = AppState::from_args(&args, &config)?; let Opts { verbosity: _, - address: ip, - port, - password_file, data_dir: _, - key_file: _, insecure, - subcommand: _, - records: _, - salt, - ttl: _, - ip_source, - ip_type, + config_or_command: _, } = args; info!("checking environment"); // Load password hash - let password_hash = password_file + let password_hash = config + .password + .password_file .map(|path| -> miette::Result<_> { let path = path.as_path(); let pass = std::fs::read_to_string(path).into_diagnostic()?; @@ -398,23 +340,26 @@ fn main() -> Result<()> { // Update DNS record with previous IPs (if available) let ips = state.last_ips.lock().await.clone(); - let actions = ips + let mut actions = ips .ips() - .filter(|ip| ip_type.valid_for_type(*ip)) - .flat_map(|ip| nsupdate::Action::from_records(ip, state.ttl, state.records)); + .filter(|ip| config.records.ip_type.valid_for_type(*ip)) + .flat_map(|ip| nsupdate::Action::from_records(ip, state.ttl, state.records)) + .peekable(); - match nsupdate::nsupdate(state.key_file, actions).await { - Ok(status) => { - if !status.success() { - error!("nsupdate failed: code {status}"); - bail!("nsupdate returned with code {status}"); + if actions.peek().is_some() { + match nsupdate::nsupdate(state.key_file, actions).await { + Ok(status) => { + if !status.success() { + error!("nsupdate failed: code {status}"); + bail!("nsupdate returned with code {status}"); + } + } + Err(err) => { + error!("Failed to update records with previous IP: {err}"); + return Err(err) + .into_diagnostic() + .wrap_err("failed to update records with previous IP"); } - } - Err(err) => { - error!("Failed to update records with previous IP: {err}"); - return Err(err) - .into_diagnostic() - .wrap_err("failed to update records with previous IP"); } } @@ -422,19 +367,24 @@ fn main() -> Result<()> { let app = Router::new().route("/update", get(update_records)); // if a password is provided, validate it let app = if let Some(pass) = password_hash { - app.layer(auth::layer(Box::leak(pass), String::leak(salt))) + app.layer(auth::layer( + Box::leak(pass), + Box::leak(config.password.salt), + )) } else { app } - .layer(ip_source.into_extension()) + .layer(config.records.ip_source.into_extension()) .with_state(state); + let config::Server { address } = config.server; + // Start services - info!("starting listener on {ip}:{port}"); - let listener = tokio::net::TcpListener::bind(SocketAddr::new(ip, port)) + info!("starting listener on {address}"); + let listener = tokio::net::TcpListener::bind(address) .await .into_diagnostic()?; - info!("listening on {ip}:{port}"); + info!("listening on {address}"); axum::serve( listener, app.into_make_service_with_connect_info::(), @@ -573,6 +523,15 @@ async fn trigger_update( state: &AppState<'static>, ) -> axum::response::Result<&'static str> { let actions = nsupdate::Action::from_records(ip, state.ttl, state.records); + + if actions.len() == 0 { + return Err(( + StatusCode::INTERNAL_SERVER_ERROR, + "Nothing to do (e.g. we are ipv4-only but an ipv6 update was requested)", + ) + .into()); + } + match nsupdate::nsupdate(state.key_file, actions).await { Ok(status) if status.success() => { let ips = { diff --git a/src/nsupdate.rs b/src/nsupdate.rs index eb0610c..5d266b9 100644 --- a/src/nsupdate.rs +++ b/src/nsupdate.rs @@ -25,7 +25,7 @@ impl<'a> Action<'a> { to: IpAddr, ttl: Duration, records: &'a [&'a str], - ) -> impl IntoIterator + 'a { + ) -> impl IntoIterator + std::iter::ExactSizeIterator + 'a { records .iter() .map(move |&domain| Action::Reassign { domain, to, ttl }) @@ -91,7 +91,7 @@ fn update_ns_records<'a>( ) -> std::io::Result<()> { writeln!(buf, "server 127.0.0.1")?; for action in actions { - writeln!(buf, "{action}")?; + write!(buf, "{action}")?; } writeln!(buf, "send")?; writeln!(buf, "quit") diff --git a/src/password.rs b/src/password.rs index 8d965ba..d99a93b 100644 --- a/src/password.rs +++ b/src/password.rs @@ -4,7 +4,7 @@ //! records use std::io::Write; use std::os::unix::fs::OpenOptionsExt; -use std::path::Path; +use std::path::PathBuf; use base64::prelude::*; use miette::{Context, IntoDiagnostic, Result}; @@ -20,11 +20,18 @@ pub struct Mkpasswd { /// The password password: String, + + /// An application specific value + #[arg(long, default_value = crate::DEFAULT_SALT)] + salt: String, + + /// The file to write the password to + password_file: Option, } impl Mkpasswd { - pub fn process(self, args: &crate::Opts) -> Result<()> { - mkpasswd(self, args.password_file.as_deref(), &args.salt) + pub fn process(self, _args: &crate::Opts) -> Result<()> { + mkpasswd(self) } } @@ -45,13 +52,16 @@ pub fn hash_identity(username: &str, password: &str, salt: &str) -> Digest { } pub fn mkpasswd( - Mkpasswd { username, password }: Mkpasswd, - password_file: Option<&Path>, - salt: &str, + Mkpasswd { + username, + password, + salt, + password_file, + }: Mkpasswd, ) -> miette::Result<()> { - let hash = hash_identity(&username, &password, salt); + let hash = hash_identity(&username, &password, &salt); let encoded = BASE64_URL_SAFE_NO_PAD.encode(hash.as_ref()); - let Some(path) = password_file else { + let Some(path) = password_file.as_deref() else { println!("{encoded}"); return Ok(()); }; diff --git a/src/records.rs b/src/records.rs index 860f719..9c5158c 100644 --- a/src/records.rs +++ b/src/records.rs @@ -1,52 +1,9 @@ //! Deal with the DNS records -use std::path::Path; +use miette::{ensure, miette, LabeledSpan, Result}; -use miette::{ensure, miette, Context, IntoDiagnostic, LabeledSpan, NamedSource, Result}; - -/// Loads and verifies the records from a file -pub fn load(path: &Path) -> Result<()> { - let records = std::fs::read_to_string(path) - .into_diagnostic() - .wrap_err_with(|| format!("failed to read records from {}", path.display()))?; - - verify(&records, path)?; - - Ok(()) -} - -/// Load records without verifying them -pub fn load_no_verify(path: &Path) -> Result<&'static [&'static str]> { - let records = std::fs::read_to_string(path) - .into_diagnostic() - .wrap_err_with(|| format!("failed to read records from {}", path.display()))?; - - if let Err(err) = verify(&records, path) { - tracing::error!("Failed to verify records: {err}"); - } - - // leak memory: we only do this here and it prevents a bunch of allocations - let records: &str = records.leak(); - let records: Box<[&str]> = records.lines().collect(); - - Ok(Box::leak(records)) -} - -/// Verifies that a list of records is valid -pub fn verify(data: &str, path: &Path) -> Result<()> { - let mut offset = 0usize; - for line in data.lines() { - validate_line(offset, line).map_err(|err| { - err.with_source_code(NamedSource::new( - path.display().to_string(), - data.to_string(), - )) - })?; - - offset += line.len() + 1; - } - - Ok(()) +pub fn validate_record_str(record: &str) -> Result<()> { + validate_line(0, record).map_err(|err| err.with_source_code(String::from(record))) } fn validate_line(offset: usize, line: &str) -> Result<()> { @@ -156,7 +113,7 @@ fn validate_octet(offset: usize, octet: u8) -> Result<()> { #[cfg(test)] mod test { - use crate::records::verify; + use crate::records::validate_record_str; macro_rules! assert_miette_snapshot { ($diag:expr) => {{ @@ -180,104 +137,51 @@ mod test { #[test] fn valid_records() -> miette::Result<()> { - verify( - "\ - example.com.\n\ - example.org.\n\ - example.net.\n\ - subdomain.example.com.\n\ - ", - std::path::Path::new("test_records_valid"), - ) + for record in [ + "example.com.", + "example.org.", + "example.net.", + "subdomain.example.com.", + ] { + validate_record_str(record)?; + } + Ok(()) } #[test] fn hostname_too_long() { - let err = verify( - "\ - example.com.\n\ - example.org.\n\ - example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.net.\n\ - subdomain.example.com.\n\ - ", - std::path::Path::new("test_records_invalid"), - ) - .unwrap_err(); + let err = validate_record_str("example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.net.").unwrap_err(); assert_miette_snapshot!(err); } #[test] fn not_fqd() { - let err = verify( - "\ - example.com.\n\ - example.org.\n\ - example.net\n\ - subdomain.example.com.\n\ - ", - std::path::Path::new("test_records_invalid"), - ) - .unwrap_err(); + let err = validate_record_str("example.net").unwrap_err(); assert_miette_snapshot!(err); } #[test] fn empty_label() { - let err = verify( - "\ - example.com.\n\ - name..example.org.\n\ - example.net.\n\ - subdomain.example.com.\n\ - ", - std::path::Path::new("test_records_invalid"), - ) - .unwrap_err(); + let err = validate_record_str("name..example.org.").unwrap_err(); assert_miette_snapshot!(err); } #[test] fn label_too_long() { - let err = verify( - "\ - example.com.\n\ - name.an-entremely-long-label-that-should-not-exist-because-it-goes-against-the-spec.example.org.\n\ - example.net.\n\ - subdomain.example.com.\n\ - ", - std::path::Path::new("test_records_invalid"), - ) - .unwrap_err(); + let err = validate_record_str("name.an-entremely-long-label-that-should-not-exist-because-it-goes-against-the-spec.example.org.").unwrap_err(); assert_miette_snapshot!(err); } #[test] fn invalid_ascii() { - let err = verify( - "\ - example.com.\n\ - name.this-is-not-ascii-ß.example.org.\n\ - example.net.\n\ - subdomain.example.com.\n\ - ", - std::path::Path::new("test_records_invalid"), - ) - .unwrap_err(); + let err = validate_record_str("name.this-is-not-ascii-ß.example.org.").unwrap_err(); assert_miette_snapshot!(err); } #[test] fn invalid_octet() { - let err = verify( - "\ - example.com.\n\ - name.this-character:-is-not-allowed.example.org.\n\ - example.net.\n\ - subdomain.example.com.\n\ - ", - std::path::Path::new("test_records_invalid"), - ) - .unwrap_err(); + let err = + validate_record_str("name.this-character:-is-not-allowed.example.org.").unwrap_err(); assert_miette_snapshot!(err); } } diff --git a/src/snapshots/webnsupdate__records__test__empty_label.snap b/src/snapshots/webnsupdate__records__test__empty_label.snap index e4d227b..d6fb7fa 100644 --- a/src/snapshots/webnsupdate__records__test__empty_label.snap +++ b/src/snapshots/webnsupdate__records__test__empty_label.snap @@ -6,11 +6,9 @@ expression: out ]8;;https://en.wikipedia.org/wiki/Fully_qualified_domain_name\(link)]8;;\ × empty label - ╭─[test_records_invalid:2:6] - 1 │ example.com. - 2 │ name..example.org. + ╭──── + 1 │ name..example.org. · ▲ · ╰── label - 3 │ example.net. ╰──── help: each label should have at least one character diff --git a/src/snapshots/webnsupdate__records__test__hostname_too_long.snap b/src/snapshots/webnsupdate__records__test__hostname_too_long.snap index 051d8ce..5c48b16 100644 --- a/src/snapshots/webnsupdate__records__test__hostname_too_long.snap +++ b/src/snapshots/webnsupdate__records__test__hostname_too_long.snap @@ -6,11 +6,9 @@ expression: out ]8;;https://en.wikipedia.org/wiki/Fully_qualified_domain_name\(link)]8;;\ × hostname too long (260 octets) - ╭─[test_records_invalid:3:1] - 2 │ example.org. - 3 │ example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.net. + ╭──── + 1 │ example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.example.net. · ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── · ╰── this line - 4 │ subdomain.example.com. ╰──── help: fully qualified domain names can be at most 255 characters long diff --git a/src/snapshots/webnsupdate__records__test__invalid_ascii.snap b/src/snapshots/webnsupdate__records__test__invalid_ascii.snap index eb8102b..6ef64e3 100644 --- a/src/snapshots/webnsupdate__records__test__invalid_ascii.snap +++ b/src/snapshots/webnsupdate__records__test__invalid_ascii.snap @@ -6,11 +6,9 @@ expression: out ]8;;https://en.wikipedia.org/wiki/Hostname#Syntax\(link)]8;;\ × invalid octet: '\xc3' - ╭─[test_records_invalid:2:24] - 1 │ example.com. - 2 │ name.this-is-not-ascii-ß.example.org. + ╭──── + 1 │ name.this-is-not-ascii-ß.example.org. · ┬ · ╰── octet - 3 │ example.net. ╰──── help: we only accept ascii characters diff --git a/src/snapshots/webnsupdate__records__test__invalid_octet.snap b/src/snapshots/webnsupdate__records__test__invalid_octet.snap index 2da284e..ed8a44c 100644 --- a/src/snapshots/webnsupdate__records__test__invalid_octet.snap +++ b/src/snapshots/webnsupdate__records__test__invalid_octet.snap @@ -6,11 +6,9 @@ expression: out ]8;;https://en.wikipedia.org/wiki/Hostname#Syntax\(link)]8;;\ × invalid octet: ':' - ╭─[test_records_invalid:2:20] - 1 │ example.com. - 2 │ name.this-character:-is-not-allowed.example.org. + ╭──── + 1 │ name.this-character:-is-not-allowed.example.org. · ┬ · ╰── octet - 3 │ example.net. ╰──── help: hostnames are only allowed to contain characters in [a-zA-Z0-9_-] diff --git a/src/snapshots/webnsupdate__records__test__label_too_long.snap b/src/snapshots/webnsupdate__records__test__label_too_long.snap index b529a1f..f1561ae 100644 --- a/src/snapshots/webnsupdate__records__test__label_too_long.snap +++ b/src/snapshots/webnsupdate__records__test__label_too_long.snap @@ -6,11 +6,9 @@ expression: out ]8;;https://en.wikipedia.org/wiki/Fully_qualified_domain_name\(link)]8;;\ × label too long (78 octets) - ╭─[test_records_invalid:2:6] - 1 │ example.com. - 2 │ name.an-entremely-long-label-that-should-not-exist-because-it-goes-against-the-spec.example.org. + ╭──── + 1 │ name.an-entremely-long-label-that-should-not-exist-because-it-goes-against-the-spec.example.org. · ───────────────────────────────────────┬────────────────────────────────────── · ╰── label - 3 │ example.net. ╰──── help: labels should be at most 63 octets diff --git a/src/snapshots/webnsupdate__records__test__not_fqd.snap b/src/snapshots/webnsupdate__records__test__not_fqd.snap index bc8270d..ccf6746 100644 --- a/src/snapshots/webnsupdate__records__test__not_fqd.snap +++ b/src/snapshots/webnsupdate__records__test__not_fqd.snap @@ -6,11 +6,9 @@ expression: out ]8;;https://en.wikipedia.org/wiki/Fully_qualified_domain_name\(link)]8;;\ × not a fully qualified domain name - ╭─[test_records_invalid:3:11] - 2 │ example.org. - 3 │ example.net + ╭──── + 1 │ example.net · ┬ · ╰── last character - 4 │ subdomain.example.com. ╰──── help: hostname should be a fully qualified domain name (end with a '.') From 2daf620a4aa51e40e54b02789befbae31f730b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Wed, 19 Mar 2025 23:09:45 +0100 Subject: [PATCH 57/59] chore: pin nix-flake-outputs-size Renovate seems to be erroring out when trying to do it. --- .forgejo/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml index a207161..80adea4 100644 --- a/.forgejo/workflows/check.yml +++ b/.forgejo/workflows/check.yml @@ -33,7 +33,7 @@ jobs: - uses: https://git.salame.cl/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - run: nix --version - name: Generate size report - uses: https://git.salame.cl/jalil/nix-flake-outputs-size@main + uses: "https://git.salame.cl/jalil/nix-flake-outputs-size@5c40a31e3e2ed0ea28f8ba68deca41d05fdf2e71" # main with: comment-on-pr: ${{ github.ref_name != 'main' }} generate-artifact: ${{ github.ref_name == 'main' }} From 2d00dd38186f3c9a2ddeb5b32c60beeb7ac066cf Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 19 Mar 2025 23:20:34 +0100 Subject: [PATCH 58/59] chore(deps): pin rust crate insta to =1.42.2 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | insta | 1.42.2 | 1.42.2 | --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5967e09..cad88f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -763,7 +763,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index afbafbf..ee5cfbf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } [dev-dependencies] -insta = { version = "1", features = ["json"] } +insta = { version = "=1.42.2", features = ["json"] } [profile.release] opt-level = "s" From c64be28e9a57f44743c6cbcfa902c349ebf11123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Wed, 5 Feb 2025 23:13:32 +0100 Subject: [PATCH 59/59] wip: add Ipv6Prefix::with_client_id impl --- src/main.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/main.rs b/src/main.rs index aa44bc6..210b481 100644 --- a/src/main.rs +++ b/src/main.rs @@ -230,6 +230,29 @@ struct Ipv6Prefix { length: u32, } +impl Ipv6Prefix { + /// Create an [`Ipv6Addr`] from a prefix and a client id + pub fn with_client_id(self, client_id: Ipv6Addr) -> Ipv6Addr { + let Self { prefix, length } = self; + // Clear the last `length` bits + let prefix_mask = u128::MAX << length; + let client_mask = !prefix_mask; + let prefix = prefix.to_bits(); + let client = client_id.to_bits(); + debug_assert_eq!( + prefix & client_mask, + 0, + "prefix contains bits in client id part" + ); + debug_assert_eq!( + client & prefix_mask, + 0, + "client id contains bits in prefix part" + ); + Ipv6Addr::from_bits((prefix & prefix_mask) | (client & client_mask)) + } +} + impl std::fmt::Display for Ipv6Prefix { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let Self { prefix, length } = self;