From 5a9b09bc7e95b2baebd1b2edc605d6fdf26ba037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Mon, 28 Oct 2024 22:42:15 +0100 Subject: [PATCH 001/178] chore: bump version New dev version --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3f1ae0a..4b581b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1162,7 +1162,7 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "webnsupdate" -version = "0.3.1" +version = "0.3.2-dev" dependencies = [ "axum", "axum-auth", diff --git a/Cargo.toml b/Cargo.toml index 3f5944e..3e60cac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ cargo-features = ["codegen-backend"] [package] description = "An HTTP server using HTTP basic auth to make secure calls to nsupdate" name = "webnsupdate" -version = "0.3.1" +version = "0.3.2-dev" edition = "2021" [dependencies] From 82b1078a94700562bd51216b214d26f192f4b03a Mon Sep 17 00:00:00 2001 From: forgejo-actions Date: Sat, 23 Nov 2024 04:43:18 +0100 Subject: [PATCH 002/178] chore: cargo update Locking 25 packages to latest compatible versions Updating anstream v0.6.17 -> v0.6.18 Updating anstyle v1.0.9 -> v1.0.10 Updating axum v0.7.7 -> v0.7.9 Updating cc v1.1.31 -> v1.2.1 Updating clap v4.5.20 -> v4.5.21 Updating clap-verbosity-flag v2.2.2 -> v2.2.3 (latest: v3.0.0) Updating clap_builder v4.5.20 -> v4.5.21 Updating clap_lex v0.7.2 -> v0.7.3 Updating hyper v1.5.0 -> v1.5.1 Updating hyper-util v0.1.9 -> v0.1.10 Updating insta v1.40.0 -> v1.41.1 Updating itoa v1.0.11 -> v1.0.13 Updating libc v0.2.161 -> v0.2.164 Updating proc-macro2 v1.0.89 -> v1.0.92 Updating regex-automata v0.4.8 -> v0.4.9 Updating rustix v0.38.37 -> v0.38.41 Updating serde v1.0.213 -> v1.0.215 Updating serde_derive v1.0.213 -> v1.0.215 Updating serde_json v1.0.132 -> v1.0.133 Updating syn v2.0.85 -> v2.0.89 Updating sync_wrapper v1.0.1 -> v1.0.2 Updating thiserror v1.0.65 -> v1.0.69 (latest: v2.0.3) Updating thiserror-impl v1.0.65 -> v1.0.69 (latest: v2.0.3) Updating tokio v1.41.0 -> v1.41.1 Updating unicode-ident v1.0.13 -> v1.0.14 --- Cargo.lock | 106 ++++++++++++++++++++++++++--------------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4b581b0..fe80d43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,9 +28,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.17" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -43,9 +43,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" @@ -88,9 +88,9 @@ dependencies = [ [[package]] name = "axum" -version = "0.7.7" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" dependencies = [ "async-trait", "axum-core", @@ -112,7 +112,7 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper 1.0.1", + "sync_wrapper 1.0.2", "tokio", "tower", "tower-layer", @@ -158,7 +158,7 @@ dependencies = [ "mime", "pin-project-lite", "rustversion", - "sync_wrapper 1.0.1", + "sync_wrapper 1.0.2", "tower-layer", "tower-service", "tracing", @@ -214,9 +214,9 @@ checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "cc" -version = "1.1.31" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" dependencies = [ "shlex", ] @@ -229,9 +229,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" dependencies = [ "clap_builder", "clap_derive", @@ -239,9 +239,9 @@ dependencies = [ [[package]] name = "clap-verbosity-flag" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e099138e1807662ff75e2cebe4ae2287add879245574489f9b1588eb5e5564ed" +checksum = "34c77f67047557f62582784fd7482884697731b2932c7d37ced54bce2312e1e2" dependencies = [ "clap", "log", @@ -249,9 +249,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" dependencies = [ "anstream", "anstyle", @@ -273,9 +273,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" [[package]] name = "colorchoice" @@ -446,9 +446,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" +checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" dependencies = [ "bytes", "futures-channel", @@ -465,9 +465,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-util", @@ -481,9 +481,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.40.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6593a41c7a73841868772495db7dc1e8ecab43bb5c0b6da2059246c4b506ab60" +checksum = "7e9ffc4d4892617c50a928c52b2961cb5174b6fc6ebf252b2fac9d21955c48b8" dependencies = [ "console", "lazy_static", @@ -505,9 +505,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "540654e97a3f4470a492cd30ff187bc95d89557a903a2bbf112e2fae98104ef2" [[package]] name = "lazy_static" @@ -517,9 +517,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.161" +version = "0.2.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" [[package]] name = "linked-hash-map" @@ -681,9 +681,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -705,7 +705,7 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -720,9 +720,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -764,9 +764,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags", "errno", @@ -789,18 +789,18 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "serde" -version = "1.0.213" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.213" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", @@ -809,9 +809,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", "memchr", @@ -928,9 +928,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.85" +version = "2.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" +checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" dependencies = [ "proc-macro2", "quote", @@ -945,9 +945,9 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "sync_wrapper" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" [[package]] name = "terminal_size" @@ -972,18 +972,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.65" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.65" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", @@ -1002,9 +1002,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.41.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", @@ -1120,9 +1120,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-linebreak" From 68cf43c539336f443390fe41052e0ddfc5d2c62b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 23 Nov 2024 12:56:36 +0100 Subject: [PATCH 003/178] chore: update flake inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Updated input 'crane': 'github:ipetkov/crane/498d9f122c413ee1154e8131ace5a35a80d8fa76' (2024-10-27) → 'github:ipetkov/crane/3cb338ce81076ce5e461cf77f7824476addb0e1c' (2024-11-19) • Updated input 'flake-parts': 'github:hercules-ci/flake-parts/3d04084d54bedc3d6b8b736c70ef449225c361b1' (2024-10-01) → 'github:hercules-ci/flake-parts/506278e768c2a08bec68eb62932193e341f55c90' (2024-11-01) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/5633bcff0c6162b9e4b5f1264264611e950c8ec7' (2024-10-09) → 'github:NixOS/nixpkgs/23e89b7da85c3640bbc2173fe04f4bd114342367' (2024-11-19) • Updated input 'treefmt-nix': 'github:numtide/treefmt-nix/aac86347fb5063960eccb19493e0cadcdb4205ca' (2024-10-22) → 'github:numtide/treefmt-nix/705df92694af7093dfbb27109ce16d828a79155f' (2024-11-22) --- flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 2987e17..fa44d48 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1730060262, - "narHash": "sha256-RMgSVkZ9H03sxC+Vh4jxtLTCzSjPq18UWpiM0gq6shQ=", + "lastModified": 1731974733, + "narHash": "sha256-enYSSZVVl15FI5p+0Y5/Ckf5DZAvXe6fBrHxyhA/njc=", "owner": "ipetkov", "repo": "crane", - "rev": "498d9f122c413ee1154e8131ace5a35a80d8fa76", + "rev": "3cb338ce81076ce5e461cf77f7824476addb0e1c", "type": "github" }, "original": { @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1727826117, - "narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=", + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1728492678, - "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", + "lastModified": 1732014248, + "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", + "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", "type": "github" }, "original": { @@ -81,11 +81,11 @@ ] }, "locked": { - "lastModified": 1729613947, - "narHash": "sha256-XGOvuIPW1XRfPgHtGYXd5MAmJzZtOuwlfKDgxX5KT3s=", + "lastModified": 1732292307, + "narHash": "sha256-5WSng844vXt8uytT5djmqBCkopyle6ciFgteuA9bJpw=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "aac86347fb5063960eccb19493e0cadcdb4205ca", + "rev": "705df92694af7093dfbb27109ce16d828a79155f", "type": "github" }, "original": { From d98c4202f42b304112073be94242f3abaf9e69b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 23 Nov 2024 13:00:57 +0100 Subject: [PATCH 004/178] feat(ci): check depends on build Because it depends on build, if build runs afterward, nix uses the cache and no valuable logs are produced. --- .forgejo/workflows/check.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml index ab33bfa..2912a0c 100644 --- a/.forgejo/workflows/check.yml +++ b/.forgejo/workflows/check.yml @@ -1,14 +1,15 @@ on: [push] jobs: - check: - runs-on: nixos - steps: - - uses: https://git.salame.cl/actions/checkout@v4 - - run: nix --version - - run: nix flake check --keep-going --verbose --print-build-logs build: runs-on: nixos steps: - uses: https://git.salame.cl/actions/checkout@v4 - run: nix --version - run: nix build --print-build-logs .# + check: + needs: build # we use the built binaries in the checks + runs-on: nixos + steps: + - uses: https://git.salame.cl/actions/checkout@v4 + - run: nix --version + - run: nix flake check --keep-going --verbose --print-build-logs From 60aed649b15ebc95f8bc3d7c1539e7d150b1c478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 23 Nov 2024 13:09:26 +0100 Subject: [PATCH 005/178] feat: upgrade clap_verbosity_flag Adds tracing support which simplyfies code. --- Cargo.lock | 6 +++--- Cargo.toml | 11 ++++------- src/main.rs | 23 +++++------------------ 3 files changed, 12 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fe80d43..2b8f45e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -239,12 +239,12 @@ dependencies = [ [[package]] name = "clap-verbosity-flag" -version = "2.2.3" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34c77f67047557f62582784fd7482884697731b2932c7d37ced54bce2312e1e2" +checksum = "42dcf89bb9d98abb02e9a4a8ef1cce429e547a803460a8245c399860985d5281" dependencies = [ "clap", - "log", + "tracing-core", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 3e60cac..d977c4e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,16 +14,13 @@ axum-auth = { version = "0.7", default-features = false, features = [ axum-client-ip = "0.6" base64 = "0.22" clap = { version = "4", features = ["derive", "env"] } -clap-verbosity-flag = "2" +clap-verbosity-flag = { version = "3", default-features = false, features = [ + "tracing", +] } http = "1" miette = { version = "7", features = ["fancy"] } ring = { version = "0.17", features = ["std"] } -tokio = { version = "1", features = [ - "macros", - "rt", - "process", - "io-util", -] } +tokio = { version = "1", features = ["macros", "rt", "process", "io-util"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/src/main.rs b/src/main.rs index 7e2ffae..e216b58 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ use clap_verbosity_flag::Verbosity; use http::StatusCode; use miette::{bail, ensure, Context, IntoDiagnostic, Result}; use tokio::io::AsyncWriteExt; -use tracing::{debug, error, info, level_filters::LevelFilter, trace, warn}; +use tracing::{debug, error, info, trace, warn}; use tracing_subscriber::EnvFilter; mod password; @@ -28,7 +28,7 @@ const DEFAULT_SALT: &str = "UpdateMyDNS"; #[derive(Debug, Parser)] struct Opts { #[command(flatten)] - verbosity: Verbosity, + verbosity: Verbosity, /// Ip address of the server #[arg(long, default_value = "127.0.0.1")] @@ -151,28 +151,13 @@ fn main() -> Result<()> { // parse cli arguments let mut args = Opts::parse(); - debug!("{args:?}"); // configure logger let subscriber = tracing_subscriber::FmtSubscriber::builder() .without_time() .with_env_filter( EnvFilter::builder() - .with_default_directive( - if args.verbosity.is_present() { - match args.verbosity.log_level_filter() { - clap_verbosity_flag::LevelFilter::Off => LevelFilter::OFF, - clap_verbosity_flag::LevelFilter::Error => LevelFilter::ERROR, - clap_verbosity_flag::LevelFilter::Warn => LevelFilter::WARN, - clap_verbosity_flag::LevelFilter::Info => LevelFilter::INFO, - clap_verbosity_flag::LevelFilter::Debug => LevelFilter::DEBUG, - clap_verbosity_flag::LevelFilter::Trace => LevelFilter::TRACE, - } - } else { - LevelFilter::WARN - } - .into(), - ) + .with_default_directive(args.verbosity.tracing_level_filter().into()) .from_env_lossy(), ) .finish(); @@ -180,6 +165,8 @@ fn main() -> Result<()> { .into_diagnostic() .wrap_err("setting global tracing subscriber")?; + debug!("{args:?}"); + // process subcommand if let Some(cmd) = args.subcommand.take() { return cmd.process(&args); From 750cbbff935aa3d02d55c09064eedfdc943dd666 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 23 Nov 2024 20:36:38 +0100 Subject: [PATCH 006/178] feat: replace axum-auth with tower_http Slightly more involde in the auth code, but it makes the rest of the application more straight forward. Fixes #10 --- Cargo.lock | 37 ++++++++--------- Cargo.toml | 4 +- src/auth.rs | 104 ++++++++++++++++++++++++++++++++++++++++++++++++ src/main.rs | 80 +++++++++++++++---------------------- src/password.rs | 16 ++++++-- 5 files changed, 166 insertions(+), 75 deletions(-) create mode 100644 src/auth.rs diff --git a/Cargo.lock b/Cargo.lock index 2b8f45e..333b083 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -120,18 +120,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "axum-auth" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8169113a185f54f68614fcfc3581df585d30bf8542bcb99496990e1025e4120a" -dependencies = [ - "async-trait", - "axum-core", - "base64 0.21.7", - "http", -] - [[package]] name = "axum-client-ip" version = "0.6.1" @@ -188,12 +176,6 @@ dependencies = [ "backtrace", ] -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - [[package]] name = "base64" version = "0.22.1" @@ -1044,6 +1026,21 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower-http" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" +dependencies = [ + "bitflags", + "bytes", + "http", + "mime", + "pin-project-lite", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.3" @@ -1165,9 +1162,8 @@ name = "webnsupdate" version = "0.3.2-dev" dependencies = [ "axum", - "axum-auth", "axum-client-ip", - "base64 0.22.1", + "base64", "clap", "clap-verbosity-flag", "http", @@ -1175,6 +1171,7 @@ dependencies = [ "miette", "ring", "tokio", + "tower-http", "tracing", "tracing-subscriber", ] diff --git a/Cargo.toml b/Cargo.toml index d977c4e..cf93cf8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,9 +8,6 @@ edition = "2021" [dependencies] axum = "0.7" -axum-auth = { version = "0.7", default-features = false, features = [ - "auth-basic", -] } axum-client-ip = "0.6" base64 = "0.22" clap = { version = "4", features = ["derive", "env"] } @@ -21,6 +18,7 @@ http = "1" miette = { version = "7", features = ["fancy"] } ring = { version = "0.17", features = ["std"] } tokio = { version = "1", features = ["macros", "rt", "process", "io-util"] } +tower-http = { version = "0.6.2", features = ["validate-request"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/src/auth.rs b/src/auth.rs new file mode 100644 index 0000000..846b3ff --- /dev/null +++ b/src/auth.rs @@ -0,0 +1,104 @@ +use base64::engine::general_purpose::URL_SAFE_NO_PAD; +use base64::Engine; +use tower_http::validate_request::ValidateRequestHeaderLayer; +use tracing::{trace, warn}; + +use crate::password; + +pub fn auth_layer<'a, ResBody>( + user_pass_hash: &'a [u8], + salt: &'a str, +) -> ValidateRequestHeaderLayer> { + ValidateRequestHeaderLayer::custom(BasicAuth::new(user_pass_hash, salt)) +} + +#[derive(Copy)] +pub struct BasicAuth<'a, ResBody> { + pass: &'a [u8], + salt: &'a str, + _ty: std::marker::PhantomData ResBody>, +} + +impl std::fmt::Debug for BasicAuth<'_, ResBody> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("BasicAuth") + .field("pass", &self.pass) + .field("salt", &self.salt) + .field("_ty", &self._ty) + .finish() + } +} + +impl Clone for BasicAuth<'_, ResBody> { + fn clone(&self) -> Self { + Self { + pass: self.pass, + salt: self.salt, + _ty: std::marker::PhantomData, + } + } +} + +impl<'a, ResBody> BasicAuth<'a, ResBody> { + pub fn new(pass: &'a [u8], salt: &'a str) -> Self { + Self { + pass, + salt, + _ty: std::marker::PhantomData, + } + } + + fn check_headers(&self, headers: &http::HeaderMap) -> bool { + let Some(auth) = headers.get(http::header::AUTHORIZATION) else { + return false; + }; + + // Poor man's split once: https://doc.rust-lang.org/std/primitive.slice.html#method.split_once + let Some(index) = auth.as_bytes().iter().position(|&c| c == b' ') else { + return false; + }; + let user_pass = &auth.as_bytes()[index + 1..]; + + match base64::engine::general_purpose::URL_SAFE.decode(user_pass) { + Ok(user_pass) => { + let hashed = password::hash_basic_auth(&user_pass, self.salt); + if hashed.as_ref() == self.pass { + return true; + } + warn!("rejected update"); + trace!( + "mismatched hashes:\nprovided: {}\nstored: {}", + URL_SAFE_NO_PAD.encode(hashed.as_ref()), + URL_SAFE_NO_PAD.encode(self.pass), + ); + false + } + Err(err) => { + warn!("received invalid base64 when decoding Basic header: {err}"); + false + } + } + } +} + +impl tower_http::validate_request::ValidateRequest for BasicAuth<'_, ResBody> +where + ResBody: Default, +{ + type ResponseBody = ResBody; + + fn validate( + &mut self, + request: &mut http::Request, + ) -> std::result::Result<(), http::Response> { + if self.check_headers(request.headers()) { + return Ok(()); + } + + let mut res = http::Response::new(ResBody::default()); + *res.status_mut() = http::status::StatusCode::UNAUTHORIZED; + res.headers_mut() + .insert(http::header::WWW_AUTHENTICATE, "Basic".parse().unwrap()); + Err(res) + } +} diff --git a/src/main.rs b/src/main.rs index e216b58..b850e02 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,8 +7,7 @@ use std::{ time::Duration, }; -use axum::{extract::State, routing::get, Json, Router}; -use axum_auth::AuthBasic; +use axum::{extract::State, routing::get, Router}; use axum_client_ip::{SecureClientIp, SecureClientIpSource}; use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; use clap::{Parser, Subcommand}; @@ -16,9 +15,10 @@ use clap_verbosity_flag::Verbosity; use http::StatusCode; use miette::{bail, ensure, Context, IntoDiagnostic, Result}; use tokio::io::AsyncWriteExt; -use tracing::{debug, error, info, trace, warn}; +use tracing::{debug, error, info, warn}; use tracing_subscriber::EnvFilter; +mod auth; mod password; mod records; @@ -108,18 +108,12 @@ struct AppState<'a> { /// TTL set on the Zonefile ttl: Duration, - /// Salt added to the password - salt: &'a str, - /// The IN A/AAAA records that should have their IPs updated records: &'a [&'a str], /// The TSIG key file key_file: Option<&'a Path>, - /// The password hash - password_hash: Option<&'a [u8]>, - /// The file where the last IP is stored ip_file: &'a Path, } @@ -195,9 +189,23 @@ fn main() -> Result<()> { // Use last registered IP address if available let ip_file = data_dir.join("last-ip"); + // Load password hash + let password_hash = password_file + .map(|path| -> miette::Result<_> { + let pass = std::fs::read_to_string(path.as_path()).into_diagnostic()?; + + let pass: Box<[u8]> = URL_SAFE_NO_PAD + .decode(pass.trim().as_bytes()) + .into_diagnostic() + .wrap_err_with(|| format!("failed to decode password from {}", path.display()))? + .into(); + + Ok(pass) + }) + .transpose()?; + let state = AppState { ttl, - salt: salt.leak(), // Load DNS records records: records::load_no_verify(&records)?, // Load keyfile @@ -212,25 +220,11 @@ fn main() -> Result<()> { Ok(&*Box::leak(key_file.into_boxed_path())) }) .transpose()?, - // Load password hash - password_hash: password_file - .map(|path| -> miette::Result<_> { - let pass = std::fs::read_to_string(path.as_path()).into_diagnostic()?; - - let pass: Box<[u8]> = URL_SAFE_NO_PAD - .decode(pass.trim().as_bytes()) - .into_diagnostic() - .wrap_err_with(|| format!("failed to decode password from {}", path.display()))? - .into(); - - Ok(&*Box::leak(pass)) - }) - .transpose()?, ip_file: Box::leak(ip_file.into_boxed_path()), }; ensure!( - state.password_hash.is_some() || insecure, + password_hash.is_some() || insecure, "a password must be used" ); @@ -270,11 +264,18 @@ fn main() -> Result<()> { } }; + // Create services + 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::auth_layer(Box::leak(pass), String::leak(salt))) + } else { + app + } + .layer(ip_source.into_extension()) + .with_state(state); + // Start services - let app = Router::new() - .route("/update", get(update_records)) - .layer(ip_source.into_extension()) - .with_state(state); info!("starting listener on {ip}:{port}"); let listener = tokio::net::TcpListener::bind(SocketAddr::new(ip, port)) .await @@ -289,31 +290,12 @@ fn main() -> Result<()> { }) } -#[tracing::instrument(skip(state, pass), level = "trace", ret(level = "info"))] +#[tracing::instrument(skip(state), level = "trace", ret(level = "info"))] async fn update_records( State(state): State>, - AuthBasic((username, pass)): AuthBasic, SecureClientIp(ip): SecureClientIp, ) -> axum::response::Result<&'static str> { debug!("received update request from {ip}"); - let Some(pass) = pass else { - return Err((StatusCode::UNAUTHORIZED, Json::from("no password provided")).into()); - }; - - if let Some(stored_pass) = state.password_hash { - let password = pass.trim().to_string(); - let pass_hash = password::hash_identity(&username, &password, state.salt); - if pass_hash.as_ref() != stored_pass { - warn!("rejected update"); - trace!( - "mismatched hashes:\n{}\n{}", - URL_SAFE_NO_PAD.encode(pass_hash.as_ref()), - URL_SAFE_NO_PAD.encode(stored_pass), - ); - return Err((StatusCode::UNAUTHORIZED, "invalid identity").into()); - } - } - info!("accepted update"); match nsupdate(ip, state.ttl, state.key_file, state.records).await { Ok(status) if status.success() => { diff --git a/src/password.rs b/src/password.rs index 84574a2..8d965ba 100644 --- a/src/password.rs +++ b/src/password.rs @@ -28,10 +28,20 @@ impl Mkpasswd { } } +pub fn hash_basic_auth(user_pass: &[u8], salt: &str) -> Digest { + let mut context = ring::digest::Context::new(&ring::digest::SHA256); + context.update(user_pass); + context.update(salt.as_bytes()); + context.finish() +} + pub fn hash_identity(username: &str, password: &str, salt: &str) -> Digest { - let mut data = Vec::with_capacity(username.len() + password.len() + salt.len() + 1); - write!(data, "{username}:{password}{salt}").unwrap(); - ring::digest::digest(&ring::digest::SHA256, &data) + let mut context = ring::digest::Context::new(&ring::digest::SHA256); + context.update(username.as_bytes()); + context.update(b":"); + context.update(password.as_bytes()); + context.update(salt.as_bytes()); + context.finish() } pub fn mkpasswd( From 846a0675d1769fad4d559c66734255c636c390f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 23 Nov 2024 20:56:03 +0100 Subject: [PATCH 007/178] refactor: reorganize main.rs --- src/main.rs | 232 ++++++++++++++++-------------------------------- src/nsupdate.rs | 111 +++++++++++++++++++++++ 2 files changed, 189 insertions(+), 154 deletions(-) create mode 100644 src/nsupdate.rs diff --git a/src/main.rs b/src/main.rs index b850e02..07c06f5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,7 @@ use std::{ - ffi::OsStr, io::ErrorKind, net::{IpAddr, SocketAddr}, path::{Path, PathBuf}, - process::{ExitStatus, Stdio}, time::Duration, }; @@ -14,11 +12,11 @@ use clap::{Parser, Subcommand}; use clap_verbosity_flag::Verbosity; use http::StatusCode; use miette::{bail, ensure, Context, IntoDiagnostic, Result}; -use tokio::io::AsyncWriteExt; -use tracing::{debug, error, info, warn}; +use tracing::{debug, error, info}; use tracing_subscriber::EnvFilter; mod auth; +mod nsupdate; mod password; mod records; @@ -118,6 +116,57 @@ struct AppState<'a> { ip_file: &'a Path, } +impl AppState<'static> { + fn from_args(args: &Opts) -> miette::Result { + let Opts { + verbosity: _, + address: _, + port: _, + password_file: _, + data_dir, + key_file, + insecure, + subcommand: _, + records, + salt: _, + ttl, + ip_source: _, + } = args; + + // Set state + let ttl = Duration::from_secs(*ttl); + + // Use last registered IP address if available + let ip_file = data_dir.join("last-ip"); + + let state = AppState { + ttl, + // Load DNS records + records: records::load_no_verify(records)?, + // Load keyfile + key_file: key_file + .as_deref() + .map(|path| -> miette::Result<_> { + std::fs::File::open(path) + .into_diagnostic() + .wrap_err_with(|| { + format!("{} is not readable by the current user", path.display()) + })?; + Ok(&*Box::leak(path.into())) + }) + .transpose()?, + ip_file: Box::leak(ip_file.into_boxed_path()), + }; + + ensure!( + state.key_file.is_some() || *insecure, + "a key file must be used" + ); + + Ok(state) + } +} + fn load_ip(path: &Path) -> Result> { debug!("loading last IP from {}", path.display()); let data = match std::fs::read_to_string(path) { @@ -166,33 +215,31 @@ fn main() -> Result<()> { return cmd.process(&args); } + // Initialize state + let state = AppState::from_args(&args)?; + let Opts { verbosity: _, address: ip, port, password_file, - data_dir, - key_file, + data_dir: _, + key_file: _, insecure, subcommand: _, - records, + records: _, salt, - ttl, + ttl: _, ip_source, } = args; info!("checking environment"); - // Set state - let ttl = Duration::from_secs(ttl); - - // Use last registered IP address if available - let ip_file = data_dir.join("last-ip"); - // Load password hash let password_hash = password_file .map(|path| -> miette::Result<_> { - let pass = std::fs::read_to_string(path.as_path()).into_diagnostic()?; + let path = path.as_path(); + let pass = std::fs::read_to_string(path).into_diagnostic()?; let pass: Box<[u8]> = URL_SAFE_NO_PAD .decode(pass.trim().as_bytes()) @@ -204,35 +251,11 @@ fn main() -> Result<()> { }) .transpose()?; - let state = AppState { - ttl, - // Load DNS records - records: records::load_no_verify(&records)?, - // Load keyfile - key_file: key_file - .map(|key_file| -> miette::Result<_> { - let path = key_file.as_path(); - std::fs::File::open(path) - .into_diagnostic() - .wrap_err_with(|| { - format!("{} is not readable by the current user", path.display()) - })?; - Ok(&*Box::leak(key_file.into_boxed_path())) - }) - .transpose()?, - ip_file: Box::leak(ip_file.into_boxed_path()), - }; - ensure!( password_hash.is_some() || insecure, "a password must be used" ); - ensure!( - state.key_file.is_some() || insecure, - "a key file must be used" - ); - let rt = tokio::runtime::Builder::new_current_thread() .enable_all() .build() @@ -242,20 +265,22 @@ fn main() -> Result<()> { rt.block_on(async { // Load previous IP and update DNS record to point to it (if available) match load_ip(state.ip_file) { - Ok(Some(ip)) => match nsupdate(ip, ttl, state.key_file, state.records).await { - Ok(status) => { - if !status.success() { - error!("nsupdate failed: code {status}"); - bail!("nsupdate returned with code {status}"); + Ok(Some(ip)) => { + match nsupdate::nsupdate(ip, state.ttl, state.key_file, state.records).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"); - } - }, + } Ok(None) => { info!("No previous IP address set"); } @@ -295,9 +320,8 @@ async fn update_records( State(state): State>, SecureClientIp(ip): SecureClientIp, ) -> axum::response::Result<&'static str> { - debug!("received update request from {ip}"); - info!("accepted update"); - match nsupdate(ip, state.ttl, state.key_file, state.records).await { + info!("accepted update from {ip}"); + match nsupdate::nsupdate(ip, state.ttl, state.key_file, state.records).await { Ok(status) if status.success() => { tokio::task::spawn_blocking(move || { info!("updating last ip to {ip}"); @@ -323,103 +347,3 @@ async fn update_records( .into()), } } - -#[tracing::instrument(level = "trace", ret(level = "warn"))] -async fn nsupdate( - ip: IpAddr, - ttl: Duration, - key_file: Option<&Path>, - records: &[&str], -) -> std::io::Result { - let mut cmd = tokio::process::Command::new("nsupdate"); - if let Some(key_file) = key_file { - cmd.args([OsStr::new("-k"), key_file.as_os_str()]); - } - debug!("spawning new process"); - let mut child = cmd - .stdin(Stdio::piped()) - .spawn() - .inspect_err(|err| warn!("failed to spawn child: {err}"))?; - let mut stdin = child.stdin.take().expect("stdin not present"); - debug!("sending update request"); - stdin - .write_all(update_ns_records(ip, ttl, records).as_bytes()) - .await - .inspect_err(|err| warn!("failed to write to the stdin of nsupdate: {err}"))?; - debug!("closing stdin"); - stdin - .shutdown() - .await - .inspect_err(|err| warn!("failed to close stdin to nsupdate: {err}"))?; - debug!("waiting for nsupdate to exit"); - child - .wait() - .await - .inspect_err(|err| warn!("failed to wait for child: {err}")) -} - -fn update_ns_records(ip: IpAddr, ttl: Duration, records: &[&str]) -> String { - use std::fmt::Write; - let ttl_s: u64 = ttl.as_secs(); - - let rec_type = match ip { - IpAddr::V4(_) => "A", - IpAddr::V6(_) => "AAAA", - }; - let mut cmds = String::from("server 127.0.0.1\n"); - for &record in records { - writeln!(cmds, "update delete {record} {ttl_s} IN {rec_type}").unwrap(); - writeln!(cmds, "update add {record} {ttl_s} IN {rec_type} {ip}").unwrap(); - } - writeln!(cmds, "send\nquit").unwrap(); - cmds -} - -#[cfg(test)] -mod test { - use insta::assert_snapshot; - - use crate::{update_ns_records, DEFAULT_TTL}; - - use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; - - #[test] - #[allow(non_snake_case)] - fn expected_update_string_A() { - assert_snapshot!(update_ns_records( - IpAddr::V4(Ipv4Addr::LOCALHOST), - DEFAULT_TTL, - &["example.com.", "example.org.", "example.net."], - ), @r###" - server 127.0.0.1 - update delete example.com. 60 IN A - update add example.com. 60 IN A 127.0.0.1 - update delete example.org. 60 IN A - update add example.org. 60 IN A 127.0.0.1 - update delete example.net. 60 IN A - update add example.net. 60 IN A 127.0.0.1 - send - quit - "###); - } - - #[test] - #[allow(non_snake_case)] - fn expected_update_string_AAAA() { - assert_snapshot!(update_ns_records( - IpAddr::V6(Ipv6Addr::LOCALHOST), - DEFAULT_TTL, - &["example.com.", "example.org.", "example.net."], - ), @r###" - server 127.0.0.1 - update delete example.com. 60 IN AAAA - update add example.com. 60 IN AAAA ::1 - update delete example.org. 60 IN AAAA - update add example.org. 60 IN AAAA ::1 - update delete example.net. 60 IN AAAA - update add example.net. 60 IN AAAA ::1 - send - quit - "###); - } -} diff --git a/src/nsupdate.rs b/src/nsupdate.rs new file mode 100644 index 0000000..62395b7 --- /dev/null +++ b/src/nsupdate.rs @@ -0,0 +1,111 @@ +use std::{ + ffi::OsStr, + net::IpAddr, + path::Path, + process::{ExitStatus, Stdio}, + time::Duration, +}; + +use tokio::io::AsyncWriteExt; +use tracing::{debug, warn}; + +#[tracing::instrument(level = "trace", ret(level = "warn"))] +pub async fn nsupdate( + ip: IpAddr, + ttl: Duration, + key_file: Option<&Path>, + records: &[&str], +) -> std::io::Result { + let mut cmd = tokio::process::Command::new("nsupdate"); + if let Some(key_file) = key_file { + cmd.args([OsStr::new("-k"), key_file.as_os_str()]); + } + debug!("spawning new process"); + let mut child = cmd + .stdin(Stdio::piped()) + .spawn() + .inspect_err(|err| warn!("failed to spawn child: {err}"))?; + let mut stdin = child.stdin.take().expect("stdin not present"); + debug!("sending update request"); + stdin + .write_all(update_ns_records(ip, ttl, records).as_bytes()) + .await + .inspect_err(|err| warn!("failed to write to the stdin of nsupdate: {err}"))?; + debug!("closing stdin"); + stdin + .shutdown() + .await + .inspect_err(|err| warn!("failed to close stdin to nsupdate: {err}"))?; + debug!("waiting for nsupdate to exit"); + child + .wait() + .await + .inspect_err(|err| warn!("failed to wait for child: {err}")) +} + +fn update_ns_records(ip: IpAddr, ttl: Duration, records: &[&str]) -> String { + use std::fmt::Write; + let ttl_s: u64 = ttl.as_secs(); + + let rec_type = match ip { + IpAddr::V4(_) => "A", + IpAddr::V6(_) => "AAAA", + }; + let mut cmds = String::from("server 127.0.0.1\n"); + for &record in records { + writeln!(cmds, "update delete {record} {ttl_s} IN {rec_type}").unwrap(); + writeln!(cmds, "update add {record} {ttl_s} IN {rec_type} {ip}").unwrap(); + } + writeln!(cmds, "send\nquit").unwrap(); + cmds +} + +#[cfg(test)] +mod test { + use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; + + use insta::assert_snapshot; + + use super::update_ns_records; + use crate::DEFAULT_TTL; + + #[test] + #[allow(non_snake_case)] + fn expected_update_string_A() { + assert_snapshot!(update_ns_records( + IpAddr::V4(Ipv4Addr::LOCALHOST), + DEFAULT_TTL, + &["example.com.", "example.org.", "example.net."], + ), @r###" + server 127.0.0.1 + update delete example.com. 60 IN A + update add example.com. 60 IN A 127.0.0.1 + update delete example.org. 60 IN A + update add example.org. 60 IN A 127.0.0.1 + update delete example.net. 60 IN A + update add example.net. 60 IN A 127.0.0.1 + send + quit + "###); + } + + #[test] + #[allow(non_snake_case)] + fn expected_update_string_AAAA() { + assert_snapshot!(update_ns_records( + IpAddr::V6(Ipv6Addr::LOCALHOST), + DEFAULT_TTL, + &["example.com.", "example.org.", "example.net."], + ), @r###" + server 127.0.0.1 + update delete example.com. 60 IN AAAA + update add example.com. 60 IN AAAA ::1 + update delete example.org. 60 IN AAAA + update add example.org. 60 IN AAAA ::1 + update delete example.net. 60 IN AAAA + update add example.net. 60 IN AAAA ::1 + send + quit + "###); + } +} From bea38bc445e6e314c56236076668fe5a8fdfce3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 23 Nov 2024 20:58:40 +0100 Subject: [PATCH 008/178] fix(clippy): enable more lints and fix issues We also add some more metadata to the Cargo.toml manifest --- Cargo.toml | 10 ++++++++++ src/auth.rs | 16 ++++++++-------- src/main.rs | 13 +++++-------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cf93cf8..4067e58 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,16 @@ description = "An HTTP server using HTTP basic auth to make secure calls to nsup name = "webnsupdate" version = "0.3.2-dev" edition = "2021" +license-file = "LICENSE" +readme = "README.md" +keywords = ["dns", "dyndns", "dynamic-ip"] +categories = ["networking", "dns", "dyndns"] +repository = "https://github.com/jalil-salame/webnsupdate" + +[lints.clippy] +cargo = { level = "warn", priority = -2 } +multiple_crate_versions = "allow" +pedantic = { level = "warn", priority = -1 } [dependencies] axum = "0.7" diff --git a/src/auth.rs b/src/auth.rs index 846b3ff..c0156d0 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -5,21 +5,21 @@ use tracing::{trace, warn}; use crate::password; -pub fn auth_layer<'a, ResBody>( +pub fn layer<'a, ResBody>( user_pass_hash: &'a [u8], salt: &'a str, -) -> ValidateRequestHeaderLayer> { - ValidateRequestHeaderLayer::custom(BasicAuth::new(user_pass_hash, salt)) +) -> ValidateRequestHeaderLayer> { + ValidateRequestHeaderLayer::custom(Basic::new(user_pass_hash, salt)) } #[derive(Copy)] -pub struct BasicAuth<'a, ResBody> { +pub struct Basic<'a, ResBody> { pass: &'a [u8], salt: &'a str, _ty: std::marker::PhantomData ResBody>, } -impl std::fmt::Debug for BasicAuth<'_, ResBody> { +impl std::fmt::Debug for Basic<'_, ResBody> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("BasicAuth") .field("pass", &self.pass) @@ -29,7 +29,7 @@ impl std::fmt::Debug for BasicAuth<'_, ResBody> { } } -impl Clone for BasicAuth<'_, ResBody> { +impl Clone for Basic<'_, ResBody> { fn clone(&self) -> Self { Self { pass: self.pass, @@ -39,7 +39,7 @@ impl Clone for BasicAuth<'_, ResBody> { } } -impl<'a, ResBody> BasicAuth<'a, ResBody> { +impl<'a, ResBody> Basic<'a, ResBody> { pub fn new(pass: &'a [u8], salt: &'a str) -> Self { Self { pass, @@ -81,7 +81,7 @@ impl<'a, ResBody> BasicAuth<'a, ResBody> { } } -impl tower_http::validate_request::ValidateRequest for BasicAuth<'_, ResBody> +impl tower_http::validate_request::ValidateRequest for Basic<'_, ResBody> where ResBody: Default, { diff --git a/src/main.rs b/src/main.rs index 07c06f5..b612c38 100644 --- a/src/main.rs +++ b/src/main.rs @@ -77,7 +77,7 @@ struct Opts { /// Set client IP source /// - /// see: https://docs.rs/axum-client-ip/latest/axum_client_ip/enum.SecureClientIpSource.html + /// see: #[clap(long, default_value = "RightmostXForwardedFor")] ip_source: SecureClientIpSource, @@ -281,19 +281,16 @@ fn main() -> Result<()> { } } } - Ok(None) => { - info!("No previous IP address set"); - } - Err(err) => { - error!("Failed to load last ip address: {err}") - } + Ok(None) => info!("No previous IP address set"), + + Err(err) => error!("Failed to load last ip address: {err}"), }; // Create services 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::auth_layer(Box::leak(pass), String::leak(salt))) + app.layer(auth::layer(Box::leak(pass), String::leak(salt))) } else { app } From ce2692f66d4499e81ea567aecc8b6dbb20e857b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 23 Nov 2024 21:15:47 +0100 Subject: [PATCH 009/178] feat: release new version --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 333b083..3e40c4f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1159,7 +1159,7 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "webnsupdate" -version = "0.3.2-dev" +version = "0.3.2" dependencies = [ "axum", "axum-client-ip", diff --git a/Cargo.toml b/Cargo.toml index 4067e58..834ec5b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ cargo-features = ["codegen-backend"] [package] description = "An HTTP server using HTTP basic auth to make secure calls to nsupdate" name = "webnsupdate" -version = "0.3.2-dev" +version = "0.3.2" edition = "2021" license-file = "LICENSE" readme = "README.md" From 657a8771685f720984676ced8a43dfcc345421b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 23 Nov 2024 21:23:48 +0100 Subject: [PATCH 010/178] chore: bump version to dev preparing for the next dev cycle --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3e40c4f..660031a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1159,7 +1159,7 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "webnsupdate" -version = "0.3.2" +version = "0.3.3-dev" dependencies = [ "axum", "axum-client-ip", diff --git a/Cargo.toml b/Cargo.toml index 834ec5b..c2308b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ cargo-features = ["codegen-backend"] [package] description = "An HTTP server using HTTP basic auth to make secure calls to nsupdate" name = "webnsupdate" -version = "0.3.2" +version = "0.3.3-dev" edition = "2021" license-file = "LICENSE" readme = "README.md" From faf09c7de1ea6c9274ccdba7469bf927e92ebaa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 22 Dec 2024 00:40:18 +0100 Subject: [PATCH 011/178] feat(ci): generate package size report We should keep it lean c: --- .forgejo/workflows/check.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml index 2912a0c..f4e299e 100644 --- a/.forgejo/workflows/check.yml +++ b/.forgejo/workflows/check.yml @@ -13,3 +13,16 @@ jobs: - uses: https://git.salame.cl/actions/checkout@v4 - run: nix --version - run: nix flake check --keep-going --verbose --print-build-logs + report-size: + runs-on: nixos + needs: build + steps: + - uses: https://git.salame.cl/actions/checkout@v4 + - run: nix --version + - name: Generate size report + uses: https://git.salame.cl/jalil/nix-flake-outputs-size@main + with: + comment-on-pr: ${{ github.ref_name != 'main' }} + generate-artifact: ${{ github.ref_name == 'main' }} + do-comparison: true + job-name: report-size From 9f40444846ec168f8091bb04f26343b07c251f43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 22 Dec 2024 00:43:41 +0100 Subject: [PATCH 012/178] chore(flake.lock): update inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'crane': 'github:ipetkov/crane/3cb338ce81076ce5e461cf77f7824476addb0e1c' (2024-11-19) → 'github:ipetkov/crane/72e2d02dbac80c8c86bf6bf3e785536acf8ee926' (2024-12-21) • Updated input 'flake-parts': 'github:hercules-ci/flake-parts/506278e768c2a08bec68eb62932193e341f55c90' (2024-11-01) → 'github:hercules-ci/flake-parts/205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9' (2024-12-04) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/23e89b7da85c3640bbc2173fe04f4bd114342367' (2024-11-19) → 'github:NixOS/nixpkgs/d3c42f187194c26d9f0309a8ecc469d6c878ce33' (2024-12-17) • Updated input 'treefmt-nix': 'github:numtide/treefmt-nix/705df92694af7093dfbb27109ce16d828a79155f' (2024-11-22) → 'github:numtide/treefmt-nix/65712f5af67234dad91a5a4baee986a8b62dbf8f' (2024-12-20) --- flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index fa44d48..b4bb41d 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1731974733, - "narHash": "sha256-enYSSZVVl15FI5p+0Y5/Ckf5DZAvXe6fBrHxyhA/njc=", + "lastModified": 1734808813, + "narHash": "sha256-3aH/0Y6ajIlfy7j52FGZ+s4icVX0oHhqBzRdlOeztqg=", "owner": "ipetkov", "repo": "crane", - "rev": "3cb338ce81076ce5e461cf77f7824476addb0e1c", + "rev": "72e2d02dbac80c8c86bf6bf3e785536acf8ee926", "type": "github" }, "original": { @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1730504689, - "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "506278e768c2a08bec68eb62932193e341f55c90", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1732014248, - "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", + "lastModified": 1734424634, + "narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", + "rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33", "type": "github" }, "original": { @@ -81,11 +81,11 @@ ] }, "locked": { - "lastModified": 1732292307, - "narHash": "sha256-5WSng844vXt8uytT5djmqBCkopyle6ciFgteuA9bJpw=", + "lastModified": 1734704479, + "narHash": "sha256-MMi74+WckoyEWBRcg/oaGRvXC9BVVxDZNRMpL+72wBI=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "705df92694af7093dfbb27109ce16d828a79155f", + "rev": "65712f5af67234dad91a5a4baee986a8b62dbf8f", "type": "github" }, "original": { From 6b4c0c486530ceb062ac56e45ebc6bf13bffa5e8 Mon Sep 17 00:00:00 2001 From: forgejo-actions Date: Sat, 21 Dec 2024 04:42:43 +0100 Subject: [PATCH 013/178] chore: cargo update Locking 31 packages to latest compatible versions Updating bytes v1.8.0 -> v1.9.0 Updating cc v1.2.1 -> v1.2.5 Updating clap v4.5.21 -> v4.5.23 Updating clap-verbosity-flag v3.0.0 -> v3.0.2 Updating clap_builder v4.5.21 -> v4.5.23 Updating clap_lex v0.7.3 -> v0.7.4 Updating console v0.15.8 -> v0.15.10 Updating encode_unicode v0.3.6 -> v1.0.0 Updating errno v0.3.9 -> v0.3.10 Removing hermit-abi v0.3.9 Updating http v1.1.0 -> v1.2.0 Updating hyper v1.5.1 -> v1.5.2 Updating itoa v1.0.13 -> v1.0.14 Updating libc v0.2.164 -> v0.2.169 Updating miette v7.2.0 -> v7.4.0 Updating miette-derive v7.2.0 -> v7.4.0 Updating miniz_oxide v0.8.0 -> v0.8.2 Updating mio v1.0.2 -> v1.0.3 Updating rustix v0.38.41 -> v0.38.42 Updating serde v1.0.215 -> v1.0.216 Updating serde_derive v1.0.215 -> v1.0.216 Removing smawk v0.3.2 Updating socket2 v0.5.7 -> v0.5.8 Updating supports-color v3.0.1 -> v3.0.2 Updating supports-hyperlinks v3.0.0 -> v3.1.0 Updating syn v2.0.89 -> v2.0.90 Removing sync_wrapper v0.1.2 Updating terminal_size v0.3.0 -> v0.4.1 Updating tokio v1.41.1 -> v1.42.0 Updating tower v0.5.1 -> v0.5.2 Updating tracing v0.1.40 -> v0.1.41 Updating tracing-attributes v0.1.27 -> v0.1.28 Updating tracing-core v0.1.32 -> v0.1.33 Updating tracing-subscriber v0.3.18 -> v0.3.19 Removing windows-sys v0.48.0 Removing windows-targets v0.48.5 Removing windows_aarch64_gnullvm v0.48.5 Removing windows_aarch64_msvc v0.48.5 Removing windows_i686_gnu v0.48.5 Removing windows_i686_msvc v0.48.5 Removing windows_x86_64_gnu v0.48.5 Removing windows_x86_64_gnullvm v0.48.5 Removing windows_x86_64_msvc v0.48.5 note: pass `--verbose` to see 12 unchanged dependencies behind latest --- Cargo.lock | 246 +++++++++++++++++------------------------------------ 1 file changed, 80 insertions(+), 166 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 660031a..c5cf915 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -112,7 +112,7 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper 1.0.2", + "sync_wrapper", "tokio", "tower", "tower-layer", @@ -146,7 +146,7 @@ dependencies = [ "mime", "pin-project-lite", "rustversion", - "sync_wrapper 1.0.2", + "sync_wrapper", "tower-layer", "tower-service", "tracing", @@ -164,7 +164,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -190,15 +190,15 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bytes" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cc" -version = "1.2.1" +version = "1.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" +checksum = "c31a0499c1dc64f458ad13872de75c0eb7e3fdb0e67964610c914b034fc5956e" dependencies = [ "shlex", ] @@ -211,9 +211,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.21" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" +checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" dependencies = [ "clap_builder", "clap_derive", @@ -221,9 +221,9 @@ dependencies = [ [[package]] name = "clap-verbosity-flag" -version = "3.0.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42dcf89bb9d98abb02e9a4a8ef1cce429e547a803460a8245c399860985d5281" +checksum = "2678fade3b77aa3a8ff3aae87e9c008d3fb00473a41c71fbf74e91c8c7b37e84" dependencies = [ "clap", "tracing-core", @@ -231,9 +231,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.21" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" +checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" dependencies = [ "anstream", "anstyle", @@ -255,9 +255,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "colorchoice" @@ -267,30 +267,30 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "console" -version = "0.15.8" +version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +checksum = "ea3c6ecd8059b57859df5c69830340ed3c41d30e3da0c1cbed90a96ac853041b" dependencies = [ "encode_unicode", - "lazy_static", "libc", - "windows-sys 0.52.0", + "once_cell", + "windows-sys 0.59.0", ] [[package]] name = "encode_unicode" -version = "0.3.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -374,17 +374,11 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -428,9 +422,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", "futures-channel", @@ -487,9 +481,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itoa" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "540654e97a3f4470a492cd30ff187bc95d89557a903a2bbf112e2fae98104ef2" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "lazy_static" @@ -499,9 +493,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.164" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "linked-hash-map" @@ -544,9 +538,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" -version = "7.2.0" +version = "7.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" +checksum = "317f146e2eb7021892722af37cf1b971f0a70c8406f487e24952667616192c64" dependencies = [ "backtrace", "backtrace-ext", @@ -564,9 +558,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "7.2.0" +version = "7.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" +checksum = "23c9b935fbe1d6cbd1dac857b54a688145e2d93f48db36010514d0f612d0ad67" dependencies = [ "proc-macro2", "quote", @@ -581,20 +575,19 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi", "libc", "wasi", "windows-sys 0.52.0", @@ -746,15 +739,15 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "0.38.41" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -771,18 +764,18 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "serde" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", @@ -859,17 +852,11 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[package]] -name = "smawk" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" - [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -889,18 +876,18 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "supports-color" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8775305acf21c96926c900ad056abeef436701108518cf890020387236ac5a77" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" dependencies = [ "is_ci", ] [[package]] name = "supports-hyperlinks" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c0a1e5168041f5f3ff68ff7d95dcb9c8749df29f6e7e89ada40dd4c9de404ee" +checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b" [[package]] name = "supports-unicode" @@ -910,21 +897,15 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.89" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - [[package]] name = "sync_wrapper" version = "1.0.2" @@ -933,12 +914,12 @@ checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" [[package]] name = "terminal_size" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9" dependencies = [ "rustix", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -947,7 +928,6 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" dependencies = [ - "smawk", "unicode-linebreak", "unicode-width", ] @@ -984,9 +964,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.41.1" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", @@ -1012,14 +992,14 @@ dependencies = [ [[package]] name = "tower" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", "pin-project-lite", - "sync_wrapper 0.1.2", + "sync_wrapper", "tokio", "tower-layer", "tower-service", @@ -1055,9 +1035,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -1067,9 +1047,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", @@ -1078,9 +1058,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", @@ -1099,9 +1079,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -1198,22 +1178,13 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -1222,22 +1193,7 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] @@ -1246,46 +1202,28 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -1298,48 +1236,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" From bd8badac2317997f6220d90be57148a00af7f66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 22 Dec 2024 00:39:35 +0100 Subject: [PATCH 014/178] fix(webnsupdate): reduce binary size There is no need to compile for speed of execution, this is not a contested component. --- Cargo.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index c2308b8..d3ffd44 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,6 +35,12 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] } [dev-dependencies] insta = "1" +[profile.release] +opt-level = "s" +panic = "abort" +lto = true +strip = true + [profile.dev] debug = 0 codegen-backend = "cranelift" From 2a52e66bc0229b67d6303d7175f72603bc9547df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 22 Dec 2024 12:47:55 +0100 Subject: [PATCH 015/178] feat: add git-cliff to generate changelogs This should make the project a bit more "official" c: --- cliff.toml | 85 +++++++++++++++++++++++++++++++++++++++ flake-modules/default.nix | 9 +++-- flake-modules/package.nix | 1 + 3 files changed, 91 insertions(+), 4 deletions(-) create mode 100644 cliff.toml diff --git a/cliff.toml b/cliff.toml new file mode 100644 index 0000000..1502859 --- /dev/null +++ b/cliff.toml @@ -0,0 +1,85 @@ +# git-cliff ~ default configuration file +# https://git-cliff.org/docs/configuration +# +# Lines starting with "#" are comments. +# Configuration options are organized into tables and keys. +# See documentation for more information on available options. + +[changelog] +# template for the changelog header +header = """ +# Changelog\n +All notable changes to this project will be documented in this file.\n +""" +# template for the changelog body +# https://keats.github.io/tera/docs/#introduction +body = """ +{% if version %}\ + ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} +{% else %}\ + ## [unreleased] +{% endif %}\ +{% for group, commits in commits | group_by(attribute="group") %} + ### {{ group | striptags | trim | upper_first }} + {% for commit in commits %} + - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ + {% if commit.breaking %}[**breaking**] {% endif %}\ + {{ commit.message | upper_first }}\ + {% endfor %} +{% endfor %}\n +""" +# template for the changelog footer +footer = """ + +""" +# remove the leading and trailing s +trim = true +# postprocessors +postprocessors = [ + # { pattern = '', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL +] +# render body even when there are no releases to process +# render_always = true +# output file path +# output = "test.md" + +[git] +# parse the commits based on https://www.conventionalcommits.org +conventional_commits = true +# filter out the commits that are not conventional +filter_unconventional = true +# process each line of a commit as an individual commit +split_commits = false +# regex for preprocessing the commit messages +commit_preprocessors = [ + # Replace issue numbers + #{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](/issues/${2}))"}, + # Check spelling of the commit with https://github.com/crate-ci/typos + # If the spelling is incorrect, it will be automatically fixed. + #{ pattern = '.*', replace_command = 'typos --write-changes -' }, +] +# regex for parsing and grouping commits +commit_parsers = [ + { message = "^feat", group = "🚀 Features" }, + { message = "^fix", group = "🐛 Bug Fixes" }, + { message = "^doc", group = "📚 Documentation" }, + { message = "^perf", group = "⚡ Performance" }, + { message = "^refactor", group = "🚜 Refactor" }, + { message = "^style", group = "🎨 Styling" }, + { message = "^test", group = "🧪 Testing" }, + { message = "^chore\\(release\\): prepare for", skip = true }, + { message = "^chore\\(deps.*\\)", skip = true }, + { message = "^chore\\(pr\\)", skip = true }, + { message = "^chore\\(pull\\)", skip = true }, + { message = "^chore: bump version", skip = true }, + { message = "^chore|^ci", group = "⚙️ Miscellaneous Tasks" }, + { body = ".*security", group = "🛡️ Security" }, + { message = "^revert", group = "◀️ Revert" }, + { message = ".*", group = "💼 Other" }, +] +# filter out the commits that are not matched by commit parsers +filter_commits = false +# sort the tags topologically +topo_order = false +# sort the commits inside sections by oldest/newest order +sort_commits = "oldest" diff --git a/flake-modules/default.nix b/flake-modules/default.nix index f4d7398..27ecc50 100644 --- a/flake-modules/default.nix +++ b/flake-modules/default.nix @@ -22,10 +22,11 @@ }; devShells.default = pkgs.mkShellNoCC { - packages = [ - pkgs.cargo-insta - pkgs.cargo-udeps - pkgs.mold + packages = with pkgs; [ + cargo-insta + cargo-udeps + mold + git-cliff ]; }; }; diff --git a/flake-modules/package.nix b/flake-modules/package.nix index 86fc8b0..7e8bd52 100644 --- a/flake-modules/package.nix +++ b/flake-modules/package.nix @@ -62,6 +62,7 @@ packages = { inherit webnsupdate; + inherit (pkgs) git-cliff; default = webnsupdate; cargo-update = pkgs.writeShellApplication { name = "cargo-update-lockfile"; From 7bc103e861cc1251bc52791c025540df11a37884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 22 Dec 2024 13:17:16 +0100 Subject: [PATCH 016/178] chore: generate base changelog --- CHANGELOG.md | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b7d9e2f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,88 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [unreleased] + +### 🚀 Features + +- *(ci)* Generate package size report +- Add git-cliff to generate changelogs + +### 🐛 Bug Fixes + +- *(webnsupdate)* Reduce binary size + +### ⚙️ Miscellaneous Tasks + +- *(flake.lock)* Update inputs +- Cargo update + +## [0.3.2] - 2024-11-23 + +### 🚀 Features + +- *(ci)* Check depends on build +- Upgrade clap_verbosity_flag +- Replace axum-auth with tower_http +- Release new version + +### 🐛 Bug Fixes + +- *(clippy)* Enable more lints and fix issues + +### 🚜 Refactor + +- Reorganize main.rs + +### ⚙️ Miscellaneous Tasks + +- Cargo update +- Update flake inputs + +## [0.3.1] - 2024-10-28 + +### 🐛 Bug Fixes + +- Overlay was broken T-T + +### ⚙️ Miscellaneous Tasks + +- Next dev version + +## [0.3.0] - 2024-10-28 + +### 🚀 Features + +- *(ci)* Auto-update rust deps +- Refactor and add ip saving +- Add -v verbosity flag +- Use treefmt-nix and split up flake.nix +- Add NixOS VM tests +- Switch to crane + +### 🐛 Bug Fixes + +- *(fmt)* Use nixfmt-rfc-style +- *(default.nix)* Small issues here and there +- *(ci)* Do not use a name when logging in + +### 🚜 Refactor + +- *(flake)* Use flake-parts + +### ⚙️ Miscellaneous Tasks + +- Updarte deps +- *(flake.lock)* Update inputs +- Cargo update +- Cargo update +- Cargo update + +## [0.2.0] - 2024-06-02 + +### 💼 Other + +- Init at version 0.1.0 + + From 502f7cbcdf6125dd2f7fb85dc084bd14751e4304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 22 Dec 2024 13:40:05 +0100 Subject: [PATCH 017/178] fix(ci): remove tea `tea` doesn't like the forgejo GITHUB_TOKENs and doesn't work. --- .forgejo/workflows/update.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/update.yml b/.forgejo/workflows/update.yml index 59f1214..8992715 100644 --- a/.forgejo/workflows/update.yml +++ b/.forgejo/workflows/update.yml @@ -9,7 +9,7 @@ env: Automation to keep dependencies in `Cargo.lock` current. The following is the output from `cargo update`: - COMMIT_MESSAGE: "chore: cargo update \n\n" + COMMIT_MESSAGE: "chore(deps): cargo update" jobs: update-cargo: runs-on: nixos @@ -24,6 +24,7 @@ jobs: set -xeuo pipefail echo "${COMMIT_MESSAGE}" > commit.txt + printf '\n\n' >> commit.txt cat cargo_update.log >> commit.txt echo "${PR_MESSAGE}" > body.md @@ -54,9 +55,17 @@ jobs: # PRs opened from a workflow using the standard `GITHUB_TOKEN` in GitHub Actions # do not automatically trigger more workflows: # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow - # GITHUB_TOKEN: ${{ secrets.DEPS_UPDATER_GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - set -xeuo pipefail - tea login add --token "$GITHUB_TOKEN" - tea pr create --title "${PR_TITLE}" --description "$(cat body.md)" --repo "$GITHUB_REPOSITORY" + set -euo pipefail + curl -X POST \ + -H "Authorization: token $GITHUB_TOKEN" \ + -H 'Content-Type: application/json' \ + -d "$( + echo '{}' | + jq --arg body "$(cat body.md)" \ + --arg title "$COMMIT_MESSAGE" \ + --arg head "$BRANCH_NAME" \ + '{"body": $body, "title": $title, "head": $head, "base": "main"}' + )" \ + "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls" From 63a7505724ad58b3d99497afa2b6463b04531861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 22 Dec 2024 14:06:57 +0100 Subject: [PATCH 018/178] chore(release): prepare for v0.3.3 --- CHANGELOG.md | 4 +++- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7d9e2f..579ac5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -## [unreleased] +## [0.3.3] - 2024-12-22 ### 🚀 Features @@ -12,11 +12,13 @@ All notable changes to this project will be documented in this file. ### 🐛 Bug Fixes - *(webnsupdate)* Reduce binary size +- *(ci)* Remove tea ### ⚙️ Miscellaneous Tasks - *(flake.lock)* Update inputs - Cargo update +- Generate base changelog ## [0.3.2] - 2024-11-23 diff --git a/Cargo.lock b/Cargo.lock index c5cf915..65afa01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1139,7 +1139,7 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "webnsupdate" -version = "0.3.3-dev" +version = "0.3.3" dependencies = [ "axum", "axum-client-ip", diff --git a/Cargo.toml b/Cargo.toml index d3ffd44..bc20a94 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ cargo-features = ["codegen-backend"] [package] description = "An HTTP server using HTTP basic auth to make secure calls to nsupdate" name = "webnsupdate" -version = "0.3.3-dev" +version = "0.3.3" edition = "2021" license-file = "LICENSE" readme = "README.md" From e9d5b87ecc275fcbb37468772913bfc43943920c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Thu, 26 Dec 2024 17:11:26 +0100 Subject: [PATCH 019/178] fix(main): add more logging and default to info `leo` fails to run with v0.3.3 so we are adding a bit more logging to debug the case. As part of this, change default log level to `info`. --- CHANGELOG.md | 6 ++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 12 ++++++++---- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 579ac5b..64cc1c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [0.3.4] - 2024-12-26 + +### 🐛 Bug Fixes + +- *(main)* Add more logging and default to info + ## [0.3.3] - 2024-12-22 ### 🚀 Features diff --git a/Cargo.lock b/Cargo.lock index 65afa01..c399cae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1139,7 +1139,7 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "webnsupdate" -version = "0.3.3" +version = "0.3.4" dependencies = [ "axum", "axum-client-ip", diff --git a/Cargo.toml b/Cargo.toml index bc20a94..34a2ca2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ cargo-features = ["codegen-backend"] [package] description = "An HTTP server using HTTP basic auth to make secure calls to nsupdate" name = "webnsupdate" -version = "0.3.3" +version = "0.3.4" edition = "2021" license-file = "LICENSE" readme = "README.md" diff --git a/src/main.rs b/src/main.rs index b612c38..d2b9136 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,7 +26,7 @@ const DEFAULT_SALT: &str = "UpdateMyDNS"; #[derive(Debug, Parser)] struct Opts { #[command(flatten)] - verbosity: Verbosity, + verbosity: Verbosity, /// Ip address of the server #[arg(long, default_value = "127.0.0.1")] @@ -188,6 +188,7 @@ fn load_ip(path: &Path) -> Result> { )) } +#[tracing::instrument(err)] fn main() -> Result<()> { // set panic hook to pretty print with miette's formatter miette::set_panic_hook(); @@ -204,9 +205,10 @@ fn main() -> Result<()> { .from_env_lossy(), ) .finish(); + tracing::subscriber::set_global_default(subscriber) .into_diagnostic() - .wrap_err("setting global tracing subscriber")?; + .wrap_err("failed to set global tracing subscriber")?; debug!("{args:?}"); @@ -249,7 +251,8 @@ fn main() -> Result<()> { Ok(pass) }) - .transpose()?; + .transpose() + .wrap_err("failed to load password hash")?; ensure!( password_hash.is_some() || insecure, @@ -283,7 +286,7 @@ fn main() -> Result<()> { } Ok(None) => info!("No previous IP address set"), - Err(err) => error!("Failed to load last ip address: {err}"), + Err(err) => error!("Ignoring previous IP due to: {err}"), }; // Create services @@ -310,6 +313,7 @@ fn main() -> Result<()> { .await .into_diagnostic() }) + .wrap_err("failed to run main loop") } #[tracing::instrument(skip(state), level = "trace", ret(level = "info"))] From f6084449fa6a14efbad95f00e3a43ab87c4412af Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 28 Dec 2024 01:07:06 +0100 Subject: [PATCH 020/178] Add renovate.json --- renovate.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..7190a60 --- /dev/null +++ b/renovate.json @@ -0,0 +1,3 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json" +} From 69fde96f6741536d6fe6e1fe3efdca4f61703373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 28 Dec 2024 09:58:26 +0100 Subject: [PATCH 021/178] refactor: setup renovate to manage dependencies This should make it easier to keep the repo up to date. --- .editorconfig | 14 ++++++++++++++ .renovaterc.json | 34 ++++++++++++++++++++++++++++++++++ renovate.json | 3 --- 3 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 .editorconfig create mode 100644 .renovaterc.json delete mode 100644 renovate.json diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..28bde6a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true + +[*.{nix,toml,json}] +indent_style = space +indent_size = 2 + +[*.rs] +indent_style = space +indent_size = 4 diff --git a/.renovaterc.json b/.renovaterc.json new file mode 100644 index 0000000..bdcce88 --- /dev/null +++ b/.renovaterc.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "assignees": [ + "jalil" + ], + "automerge": true, + "automergeStrategy": "fast-forward", + "automergeType": "pr", + "commitBodyTable": true, + "dependencyDashboard": true, + "extends": [ + "config:recommended" + ], + "prCreation": "immediate", + "cargo": { + "commitMessageTopic": "Rust crate {{depName}}", + "fileMatch": [ + "(^|/)Cargo\\.toml$" + ], + "versioning": "cargo", + "enabled": true + }, + "nix": { + "fileMatch": [ + "(^|/)flake\\.nix$" + ], + "commitMessageTopic": "flake inputs", + "commitMessageExtra": "to {{newValue}}", + "enabled": true + }, + "automergeSchedule": [ + "* 0-1 * * *" + ] +} diff --git a/renovate.json b/renovate.json deleted file mode 100644 index 7190a60..0000000 --- a/renovate.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json" -} From 2ba6277778c2402922e98f785f05681fe4a993f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 29 Dec 2024 17:41:25 +0100 Subject: [PATCH 022/178] feat(renovate): enable lockFileMaintenance This allows it to update the flake.lock and Cargo.lock files. --- flake-modules/tests.nix | 100 +++++++++++++++++++++------------------- flake.lock | 11 +++-- flake.nix | 2 +- 3 files changed, 60 insertions(+), 53 deletions(-) diff --git a/flake-modules/tests.nix b/flake-modules/tests.nix index 7ec61ab..c214710 100644 --- a/flake-modules/tests.nix +++ b/flake-modules/tests.nix @@ -6,7 +6,6 @@ checks = let testDomain = "webnstest.example"; - dynamicZonesDir = "/var/lib/named/zones"; zoneFile = pkgs.writeText "${testDomain}.zoneinfo" '' $ORIGIN . $TTL 60 ; 1 minute @@ -27,59 +26,65 @@ nsupdate IN AAAA ::1 ''; - webnsupdate-machine = { - imports = [ self.nixosModules.webnsupdate ]; + webnsupdate-machine = + { config, ... }: + let + bindCfg = config.services.bind; + bindData = bindCfg.directory; + dynamicZonesDir = "${bindData}/zones"; + in + { + imports = [ self.nixosModules.webnsupdate ]; - config = { - environment.systemPackages = [ - pkgs.dig - pkgs.curl - ]; + config = { + environment.systemPackages = [ + pkgs.dig + pkgs.curl + ]; - services = { - webnsupdate = { - enable = true; - bindIp = "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}. - ''; - }; - - bind = { - enable = true; - zones.${testDomain} = { - master = true; - file = "${dynamicZonesDir}/${testDomain}"; - extraConfig = '' - allow-update { key rndc-key; }; + services = { + webnsupdate = { + enable = true; + bindIp = "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}. ''; }; + + bind = { + enable = true; + zones.${testDomain} = { + master = true; + file = "${dynamicZonesDir}/${testDomain}"; + extraConfig = '' + allow-update { key rndc-key; }; + ''; + }; + }; }; + + systemd.services.bind.preStart = '' + # shellcheck disable=SC2211,SC1127 + rm -f ${dynamicZonesDir}/* # reset dynamic zones + + mkdir -m 0755 -p ${dynamicZonesDir} + chown named ${dynamicZonesDir} + + # copy dynamic zone's file to the dynamic zones dir + cp ${zoneFile} ${dynamicZonesDir}/${testDomain} + ''; }; - - systemd.services.bind.preStart = '' - # shellcheck disable=SC2211,SC1127 - rm -f ${dynamicZonesDir}/* # reset dynamic zones - - ${pkgs.coreutils}/bin/mkdir -m 0755 -p ${dynamicZonesDir} - chown "named" ${dynamicZonesDir} - chown "named" /var/lib/named - - # copy dynamic zone's file to the dynamic zones dir - cp ${zoneFile} ${dynamicZonesDir}/${testDomain} - ''; }; - }; in { module-test = pkgs.testers.runNixOSTest { @@ -87,6 +92,7 @@ nodes.machine = webnsupdate-machine; testScript = '' machine.start(allow_reboot=True) + machine.wait_for_unit("bind.service") machine.wait_for_unit("webnsupdate.service") # ensure base DNS records area available diff --git a/flake.lock b/flake.lock index b4bb41d..5d0749c 100644 --- a/flake.lock +++ b/flake.lock @@ -37,17 +37,18 @@ }, "nixpkgs": { "locked": { - "lastModified": 1734424634, - "narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=", + "lastModified": 1735291276, + "narHash": "sha256-NYVcA06+blsLG6wpAbSPTCyLvxD/92Hy4vlY9WxFI1M=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33", + "rev": "634fd46801442d760e09493a794c4f15db2d0cbb", "type": "github" }, "original": { - "id": "nixpkgs", + "owner": "NixOS", "ref": "nixos-unstable", - "type": "indirect" + "repo": "nixpkgs", + "type": "github" } }, "root": { diff --git a/flake.nix b/flake.nix index 3e7f04f..f93aaca 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs"; }; - nixpkgs.url = "nixpkgs/nixos-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; systems.url = "github:nix-systems/default"; treefmt-nix = { url = "github:numtide/treefmt-nix"; From 6a1feb26127e0a18d9ab399f91fdd88e797286b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 29 Dec 2024 17:41:25 +0100 Subject: [PATCH 023/178] fix(flake): switch to github ref Switch from a flake ref to a github ref as renovate cannot resolve flake refs, and they are slightly impure. This shows some issues with the previous patch to the bind module which we fix. --- .renovaterc.json | 12 ++++- flake-modules/tests.nix | 102 +++++++++++++++++++++------------------- 2 files changed, 64 insertions(+), 50 deletions(-) diff --git a/.renovaterc.json b/.renovaterc.json index bdcce88..556cabc 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -24,10 +24,20 @@ "fileMatch": [ "(^|/)flake\\.nix$" ], - "commitMessageTopic": "flake inputs", + "commitMessageTopic": "nixpkgs", "commitMessageExtra": "to {{newValue}}", "enabled": true }, + "lockFileMaintenance": { + "enabled": true, + "recreateWhen": "always", + "rebaseStalePrs": true, + "branchTopic": "lock-file-maintenance", + "commitMessageAction": "Lock file maintenance", + "schedule": [ + "* 0-1 * * *" + ] + }, "automergeSchedule": [ "* 0-1 * * *" ] diff --git a/flake-modules/tests.nix b/flake-modules/tests.nix index c214710..4cdac8b 100644 --- a/flake-modules/tests.nix +++ b/flake-modules/tests.nix @@ -6,6 +6,7 @@ checks = let testDomain = "webnstest.example"; + zoneFile = pkgs.writeText "${testDomain}.zoneinfo" '' $ORIGIN . $TTL 60 ; 1 minute @@ -26,7 +27,7 @@ nsupdate IN AAAA ::1 ''; - webnsupdate-machine = + bindDynamicZone = { config, ... }: let bindCfg = config.services.bind; @@ -34,57 +35,60 @@ dynamicZonesDir = "${bindData}/zones"; in { - imports = [ self.nixosModules.webnsupdate ]; - - config = { - environment.systemPackages = [ - pkgs.dig - pkgs.curl - ]; - - services = { - webnsupdate = { - enable = true; - bindIp = "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}. - ''; - }; - - bind = { - enable = true; - zones.${testDomain} = { - master = true; - file = "${dynamicZonesDir}/${testDomain}"; - extraConfig = '' - allow-update { key rndc-key; }; - ''; - }; - }; - }; - - systemd.services.bind.preStart = '' - # shellcheck disable=SC2211,SC1127 - rm -f ${dynamicZonesDir}/* # reset dynamic zones - - mkdir -m 0755 -p ${dynamicZonesDir} - chown named ${dynamicZonesDir} - - # copy dynamic zone's file to the dynamic zones dir - cp ${zoneFile} ${dynamicZonesDir}/${testDomain} + services.bind.zones.${testDomain} = { + master = true; + file = "${dynamicZonesDir}/${testDomain}"; + extraConfig = '' + allow-update { key rndc-key; }; ''; }; + + systemd.services.bind.preStart = '' + # shellcheck disable=SC2211,SC1127 + rm -f ${dynamicZonesDir}/* # reset dynamic zones + + # create a dynamic zones dir + mkdir -m 0755 -p ${dynamicZonesDir} + # copy dynamic zone's file to the dynamic zones dir + cp ${zoneFile} ${dynamicZonesDir}/${testDomain} + ''; }; + + webnsupdate-machine = { + imports = [ + bindDynamicZone + self.nixosModules.webnsupdate + ]; + + config = { + environment.systemPackages = [ + pkgs.dig + pkgs.curl + ]; + + services = { + bind.enable = true; + + webnsupdate = { + enable = true; + bindIp = "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}. + ''; + }; + }; + }; + }; in { module-test = pkgs.testers.runNixOSTest { From e4451beebfa2c04c81eb7f83487ed8d293eee0ee Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 1 Jan 2025 00:00:28 +0100 Subject: [PATCH 024/178] chore(deps): lock file maintenance --- Cargo.lock | 32 ++++++++++++++++---------------- flake.lock | 12 ++++++------ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c399cae..5e5fe0d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -196,9 +196,9 @@ checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cc" -version = "1.2.5" +version = "1.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31a0499c1dc64f458ad13872de75c0eb7e3fdb0e67964610c914b034fc5956e" +checksum = "8d6dbb628b8f8555f86d0323c2eb39e3ec81901f4b83e091db8a6a76d316a333" dependencies = [ "shlex", ] @@ -611,9 +611,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -665,9 +665,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -752,9 +752,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "ryu" @@ -764,18 +764,18 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "serde" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", @@ -784,9 +784,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" dependencies = [ "itoa", "memchr", @@ -897,9 +897,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.90" +version = "2.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" dependencies = [ "proc-macro2", "quote", diff --git a/flake.lock b/flake.lock index 5d0749c..63979fc 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1735291276, - "narHash": "sha256-NYVcA06+blsLG6wpAbSPTCyLvxD/92Hy4vlY9WxFI1M=", + "lastModified": 1735471104, + "narHash": "sha256-0q9NGQySwDQc7RhAV2ukfnu7Gxa5/ybJ2ANT8DQrQrs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "634fd46801442d760e09493a794c4f15db2d0cbb", + "rev": "88195a94f390381c6afcdaa933c2f6ff93959cb4", "type": "github" }, "original": { @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1734704479, - "narHash": "sha256-MMi74+WckoyEWBRcg/oaGRvXC9BVVxDZNRMpL+72wBI=", + "lastModified": 1735653038, + "narHash": "sha256-Q6xAmciTXDtZfUxf6c15QqtRR8BvX4edYPstF/uoqMk=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "65712f5af67234dad91a5a4baee986a8b62dbf8f", + "rev": "56c0ecd79f7ba01a0ec027da015df751d6ca3ae7", "type": "github" }, "original": { From 22ab037b6ff61489dc2f36cc9d3a7463b6b964ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Wed, 1 Jan 2025 10:44:19 +0100 Subject: [PATCH 025/178] fix(renovate): switch automergeStrategy to auto fast-forward triggers a rebase which is not allowed in this repo. --- .renovaterc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.renovaterc.json b/.renovaterc.json index 556cabc..5d1d8db 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -4,7 +4,7 @@ "jalil" ], "automerge": true, - "automergeStrategy": "fast-forward", + "automergeStrategy": "auto", "automergeType": "pr", "commitBodyTable": true, "dependencyDashboard": true, From 4490dfac053ec66e3e4c9bffa964ed63b844bcb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Wed, 1 Jan 2025 19:30:45 +0100 Subject: [PATCH 026/178] chore: update to axum 0.8 This requires updating axum-client-ip too as it depends on axum. --- Cargo.lock | 30 +++++++++--------------------- Cargo.toml | 4 ++-- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5e5fe0d..2dd79b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,26 +75,15 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "async-trait" -version = "0.1.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "axum" -version = "0.7.9" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +checksum = "6d6fd624c75e18b3b4c6b9caf42b1afe24437daaee904069137d8bab077be8b8" dependencies = [ - "async-trait", "axum-core", "bytes", + "form_urlencoded", "futures-util", "http", "http-body", @@ -122,9 +111,9 @@ dependencies = [ [[package]] name = "axum-client-ip" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eefda7e2b27e1bda4d6fa8a06b50803b8793769045918bc37ad062d48a6efac" +checksum = "dff8ee1869817523c8f91c20bf17fd932707f66c2e7e0b0f811b29a227289562" dependencies = [ "axum", "forwarded-header-value", @@ -133,11 +122,10 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.4.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +checksum = "df1362f362fd16024ae199c1970ce98f9661bf5ef94b9808fee734bc3698b733" dependencies = [ - "async-trait", "bytes", "futures-util", "http", @@ -526,9 +514,9 @@ dependencies = [ [[package]] name = "matchit" -version = "0.7.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" [[package]] name = "memchr" diff --git a/Cargo.toml b/Cargo.toml index 34a2ca2..0bafe90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,8 +17,8 @@ multiple_crate_versions = "allow" pedantic = { level = "warn", priority = -1 } [dependencies] -axum = "0.7" -axum-client-ip = "0.6" +axum = "0.8" +axum-client-ip = "0.7" base64 = "0.22" clap = { version = "4", features = ["derive", "env"] } clap-verbosity-flag = { version = "3", default-features = false, features = [ From 99e887513d1e8ecd7d65e17d334c296cf785cee6 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 2 Jan 2025 00:00:25 +0100 Subject: [PATCH 027/178] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2dd79b6..28442ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -885,9 +885,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.93" +version = "2.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c786062daee0d6db1132800e623df74274a0a87322d8e183338e01b3d98d058" +checksum = "987bc0be1cdea8b10216bd06e2ca407d40b9543468fafd3ddfb02f36e77f71f3" dependencies = [ "proc-macro2", "quote", From dcba690961010fe60cbb394183c5df28847941f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 4 Jan 2025 13:08:22 +0100 Subject: [PATCH 028/178] fix(ci): remove update workflow Not needed as renovate fulfills this purpose. --- .forgejo/workflows/update.yml | 71 ----------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 .forgejo/workflows/update.yml diff --git a/.forgejo/workflows/update.yml b/.forgejo/workflows/update.yml deleted file mode 100644 index 8992715..0000000 --- a/.forgejo/workflows/update.yml +++ /dev/null @@ -1,71 +0,0 @@ -on: - workflow_dispatch: - schedule: - # 03:42 on Saturdays - - cron: '42 3 * * 6' -env: - PR_TITLE: Weekly `cargo update` of dependencies - PR_MESSAGE: | - Automation to keep dependencies in `Cargo.lock` current. - - The following is the output from `cargo update`: - COMMIT_MESSAGE: "chore(deps): cargo update" -jobs: - update-cargo: - runs-on: nixos - env: - BRANCH_NAME: cargo-update - steps: - - uses: https://git.salame.cl/actions/checkout@v4 - - run: nix --version - - run: nix run .#cargo-update - - name: craft PR body and commit message - run: | - set -xeuo pipefail - - echo "${COMMIT_MESSAGE}" > commit.txt - printf '\n\n' >> commit.txt - cat cargo_update.log >> commit.txt - - echo "${PR_MESSAGE}" > body.md - echo '```txt' >> body.md - cat cargo_update.log >> body.md - echo '```' >> body.md - - name: commit - run: | - set -xeuo pipefail - - git config user.name forgejo-actions - git config user.email forgejo-actions@salame.cl - git switch --force-create "$BRANCH_NAME" - git add ./Cargo.lock - DIFF="$(git diff --staged)" - if [[ "$DIFF" == "" ]]; then - echo "Cargo.lock was not changed, bailing out and not making a PR" - exit 1 - fi - git commit --no-verify --file=commit.txt - - name: push - run: | - set -xeuo pipefail - git push --no-verify --force --set-upstream origin "$BRANCH_NAME" - - name: open new pull request - env: - # We have to use a Personal Access Token (PAT) here. - # PRs opened from a workflow using the standard `GITHUB_TOKEN` in GitHub Actions - # do not automatically trigger more workflows: - # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -euo pipefail - curl -X POST \ - -H "Authorization: token $GITHUB_TOKEN" \ - -H 'Content-Type: application/json' \ - -d "$( - echo '{}' | - jq --arg body "$(cat body.md)" \ - --arg title "$COMMIT_MESSAGE" \ - --arg head "$BRANCH_NAME" \ - '{"body": $body, "title": $title, "head": $head, "base": "main"}' - )" \ - "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls" From c038b68ecb48b9570aaf17d9248819c2edbbc1bf Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 4 Jan 2025 13:20:20 +0100 Subject: [PATCH 029/178] 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 28442ee..7bb308f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -184,9 +184,9 @@ checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cc" -version = "1.2.6" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d6dbb628b8f8555f86d0323c2eb39e3ec81901f4b83e091db8a6a76d316a333" +checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" dependencies = [ "shlex", ] diff --git a/flake.lock b/flake.lock index 63979fc..f7a11d2 100644 --- a/flake.lock +++ b/flake.lock @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1733312601, - "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "lastModified": 1735774679, + "narHash": "sha256-soePLBazJk0qQdDVhdbM98vYdssfs3WFedcq+raipRI=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "rev": "f2f7418ce0ab4a5309a4596161d154cfc877af66", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1735471104, - "narHash": "sha256-0q9NGQySwDQc7RhAV2ukfnu7Gxa5/ybJ2ANT8DQrQrs=", + "lastModified": 1735834308, + "narHash": "sha256-dklw3AXr3OGO4/XT1Tu3Xz9n/we8GctZZ75ZWVqAVhk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "88195a94f390381c6afcdaa933c2f6ff93959cb4", + "rev": "6df24922a1400241dae323af55f30e4318a6ca65", "type": "github" }, "original": { @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1735653038, - "narHash": "sha256-Q6xAmciTXDtZfUxf6c15QqtRR8BvX4edYPstF/uoqMk=", + "lastModified": 1735905407, + "narHash": "sha256-1hKMRIT+QZNWX46e4gIovoQ7H8QRb7803ZH4qSKI45o=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "56c0ecd79f7ba01a0ec027da015df751d6ca3ae7", + "rev": "29806abab803e498df96d82dd6f34b32eb8dd2c8", "type": "github" }, "original": { From 2b953c4b75c5f711ac219b69da41b85279489efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sat, 4 Jan 2025 13:41:24 +0100 Subject: [PATCH 030/178] fix(typos): typos caught more typos :3 Some typos where not a typo tho, just a test T-T. This fixes it. --- flake-modules/module.nix | 2 +- src/records.rs | 2 +- .../webnsupdate__records__test__invalid_ascii.snap | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/flake-modules/module.nix b/flake-modules/module.nix index 6ffbba6..fc52da7 100644 --- a/flake-modules/module.nix +++ b/flake-modules/module.nix @@ -138,7 +138,7 @@ let in lib.mkIf cfg.enable { # warnings = - # lib.optional (!config.services.bind.enable) "`webnsupdate` is expected to be used alongside `bind`. This is an unsopported configuration."; + # lib.optional (!config.services.bind.enable) "`webnsupdate` is expected to be used alongside `bind`. This is an unsupported configuration."; assertions = [ { assertion = diff --git a/src/records.rs b/src/records.rs index 5ca6528..860f719 100644 --- a/src/records.rs +++ b/src/records.rs @@ -256,7 +256,7 @@ mod test { let err = verify( "\ example.com.\n\ - name.this-is-not-aßcii.example.org.\n\ + name.this-is-not-ascii-ß.example.org.\n\ example.net.\n\ subdomain.example.com.\n\ ", diff --git a/src/snapshots/webnsupdate__records__test__invalid_ascii.snap b/src/snapshots/webnsupdate__records__test__invalid_ascii.snap index a777b6d..eb8102b 100644 --- a/src/snapshots/webnsupdate__records__test__invalid_ascii.snap +++ b/src/snapshots/webnsupdate__records__test__invalid_ascii.snap @@ -6,11 +6,11 @@ expression: out ]8;;https://en.wikipedia.org/wiki/Hostname#Syntax\(link)]8;;\ × invalid octet: '\xc3' - ╭─[test_records_invalid:2:19] + ╭─[test_records_invalid:2:24] 1 │ example.com. - 2 │ name.this-is-not-aßcii.example.org. - · ┬ - · ╰── octet + 2 │ name.this-is-not-ascii-ß.example.org. + · ┬ + · ╰── octet 3 │ example.net. ╰──── help: we only accept ascii characters From 5d6fd054ee8d92d4bcc8e4d372cd91d9893e23e2 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 5 Jan 2025 01:40:22 +0100 Subject: [PATCH 031/178] chore(deps): update rust crate insta to v1.42.0 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | insta | 1.41.1 | 1.42.0 | --- Cargo.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7bb308f..8b454a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -278,7 +278,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]] @@ -445,13 +445,13 @@ dependencies = [ [[package]] name = "insta" -version = "1.41.1" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9ffc4d4892617c50a928c52b2961cb5174b6fc6ebf252b2fac9d21955c48b8" +checksum = "6513e4067e16e69ed1db5ab56048ed65db32d10ba5fc1217f5393f8f17d8b5a5" dependencies = [ "console", - "lazy_static", "linked-hash-map", + "once_cell", "similar", ] @@ -735,7 +735,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] From 7fdf322c7380124dfe4798de9ce0118ee1511cf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 5 Jan 2025 11:10:25 +0100 Subject: [PATCH 032/178] fix(renovate): branch creation before automerge Otherwise renovate might miss the merge window QAQ --- .renovaterc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.renovaterc.json b/.renovaterc.json index 5d1d8db..0c92e13 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -35,7 +35,7 @@ "branchTopic": "lock-file-maintenance", "commitMessageAction": "Lock file maintenance", "schedule": [ - "* 0-1 * * *" + "* 23-0 * * *" ] }, "automergeSchedule": [ From a515c5d8dfe64308be76ce61803d96052f9a003e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 5 Jan 2025 12:16:46 +0100 Subject: [PATCH 033/178] fix(renovaterc): invalid cron syntax There was a small mistake in the config. --- .renovaterc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.renovaterc.json b/.renovaterc.json index 0c92e13..83d8eaf 100644 --- a/.renovaterc.json +++ b/.renovaterc.json @@ -35,7 +35,7 @@ "branchTopic": "lock-file-maintenance", "commitMessageAction": "Lock file maintenance", "schedule": [ - "* 23-0 * * *" + "* 23 * * *" ] }, "automergeSchedule": [ From ccc1ccba97fae2864dff96747b20f55733b41147 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 5 Jan 2025 12:20:24 +0100 Subject: [PATCH 034/178] 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 8b454a3..4741405 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -278,7 +278,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]] @@ -735,7 +735,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -885,9 +885,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.94" +version = "2.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "987bc0be1cdea8b10216bd06e2ca407d40b9543468fafd3ddfb02f36e77f71f3" +checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" dependencies = [ "proc-macro2", "quote", diff --git a/flake.lock b/flake.lock index f7a11d2..6e8ec1d 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1734808813, - "narHash": "sha256-3aH/0Y6ajIlfy7j52FGZ+s4icVX0oHhqBzRdlOeztqg=", + "lastModified": 1736032295, + "narHash": "sha256-QNRlMxQTT3rdgsQb3QxljO14kE8xxdDXNJ/4jIm4u3Q=", "owner": "ipetkov", "repo": "crane", - "rev": "72e2d02dbac80c8c86bf6bf3e785536acf8ee926", + "rev": "9fa361afe873c740d5ca10ff526463d5807eab88", "type": "github" }, "original": { From 5e16700652d74cddf82998f580237ff2cba29460 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 6 Jan 2025 23:00:38 +0100 Subject: [PATCH 035/178] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- flake.lock | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4741405..0677470 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -632,9 +632,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" diff --git a/flake.lock b/flake.lock index 6e8ec1d..d0ae9f4 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1736032295, - "narHash": "sha256-QNRlMxQTT3rdgsQb3QxljO14kE8xxdDXNJ/4jIm4u3Q=", + "lastModified": 1736101677, + "narHash": "sha256-iKOPq86AOWCohuzxwFy/MtC8PcSVGnrxBOvxpjpzrAY=", "owner": "ipetkov", "repo": "crane", - "rev": "9fa361afe873c740d5ca10ff526463d5807eab88", + "rev": "61ba163d85e5adeddc7b3a69bb174034965965b2", "type": "github" }, "original": { @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1735774679, - "narHash": "sha256-soePLBazJk0qQdDVhdbM98vYdssfs3WFedcq+raipRI=", + "lastModified": 1736143030, + "narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "f2f7418ce0ab4a5309a4596161d154cfc877af66", + "rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1735834308, - "narHash": "sha256-dklw3AXr3OGO4/XT1Tu3Xz9n/we8GctZZ75ZWVqAVhk=", + "lastModified": 1736012469, + "narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6df24922a1400241dae323af55f30e4318a6ca65", + "rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d", "type": "github" }, "original": { @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1735905407, - "narHash": "sha256-1hKMRIT+QZNWX46e4gIovoQ7H8QRb7803ZH4qSKI45o=", + "lastModified": 1736154270, + "narHash": "sha256-p2r8xhQZ3TYIEKBoiEhllKWQqWNJNoT9v64Vmg4q8Zw=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "29806abab803e498df96d82dd6f34b32eb8dd2c8", + "rev": "13c913f5deb3a5c08bb810efd89dc8cb24dd968b", "type": "github" }, "original": { From 0685c2601a1c0f62f431201dc6da9a3eb935c649 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 7 Jan 2025 18:20:30 +0100 Subject: [PATCH 036/178] fix(deps): update rust crate clap to v4.5.24 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | clap | 4.5.23 | 4.5.24 | --- Cargo.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0677470..e280ff9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -199,9 +199,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.23" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" +checksum = "9560b07a799281c7e0958b9296854d6fafd4c5f31444a7e5bb1ad6dde5ccf1bd" dependencies = [ "clap_builder", "clap_derive", @@ -219,9 +219,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.23" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" +checksum = "874e0dd3eb68bf99058751ac9712f622e61e6f393a94f7128fa26e3f02f5c7cd" dependencies = [ "anstream", "anstyle", @@ -231,9 +231,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" dependencies = [ "heck", "proc-macro2", @@ -278,7 +278,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]] @@ -735,7 +735,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] From 9b2880c141e18b6d7b38733e32f19f0106f52fec Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 7 Jan 2025 18:30:25 +0100 Subject: [PATCH 037/178] chore(deps): lock file maintenance --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e280ff9..9940fb4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -278,7 +278,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]] @@ -735,7 +735,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -772,9 +772,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.134" +version = "1.0.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" +checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" dependencies = [ "itoa", "memchr", From faf1f637abf41d11700224171f1e5cc50c4e643f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 8 Jan 2025 17:10:21 +0100 Subject: [PATCH 038/178] fix(deps): update rust crate tokio to v1.43.0 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | tokio | 1.42.0 | 1.43.0 | --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9940fb4..4d3d5b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -952,9 +952,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.42.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "bytes", @@ -969,9 +969,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", From 36b4d55ea81bab32b3673119388d4c41a2a8be74 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 8 Jan 2025 23:00:22 +0100 Subject: [PATCH 039/178] chore(deps): lock file maintenance --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4d3d5b2..5279c32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -493,9 +493,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "log" @@ -727,9 +727,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "0.38.42" +version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ "bitflags", "errno", From 4863ebc6df05353ffe31f285fed2485d37d668b9 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 9 Jan 2025 16:40:31 +0100 Subject: [PATCH 040/178] fix(deps): update rust crate clap to v4.5.25 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | clap | 4.5.24 | 4.5.25 | --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5279c32..fd712e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -199,9 +199,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.24" +version = "4.5.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9560b07a799281c7e0958b9296854d6fafd4c5f31444a7e5bb1ad6dde5ccf1bd" +checksum = "b95dca1b68188a08ca6af9d96a6576150f598824bdb528c1190460c2940a0b48" dependencies = [ "clap_builder", "clap_derive", @@ -219,9 +219,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.24" +version = "4.5.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874e0dd3eb68bf99058751ac9712f622e61e6f393a94f7128fa26e3f02f5c7cd" +checksum = "9ab52925392148efd3f7562f2136a81ffb778076bcc85727c6e020d6dd57cf15" dependencies = [ "anstream", "anstyle", @@ -278,7 +278,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]] @@ -735,7 +735,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] From 883f6e6ae7ab68f0040464e13d6b9763f2f6c505 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 9 Jan 2025 19:30:24 +0100 Subject: [PATCH 041/178] fix(deps): update rust crate clap to v4.5.26 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | clap | 4.5.25 | 4.5.26 | --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fd712e3..9583c21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -199,9 +199,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.25" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b95dca1b68188a08ca6af9d96a6576150f598824bdb528c1190460c2940a0b48" +checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" dependencies = [ "clap_builder", "clap_derive", @@ -219,9 +219,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.25" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ab52925392148efd3f7562f2136a81ffb778076bcc85727c6e020d6dd57cf15" +checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" dependencies = [ "anstream", "anstyle", From 8bf62f3ce22153c9e105b497f70656fc40cb77e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Fri, 10 Jan 2025 23:39:46 +0100 Subject: [PATCH 042/178] fix(flake): switch overlay to callPackage This ensures it can be built for any architecture (supported by Rust). --- default.nix | 37 ++++++++++++++++++++++++++ flake-modules/package.nix | 55 +++++++++++++-------------------------- 2 files changed, 55 insertions(+), 37 deletions(-) create mode 100644 default.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..28e3808 --- /dev/null +++ b/default.nix @@ -0,0 +1,37 @@ +{ + pkgs ? + (builtins.getFlake (builtins.toString ./.)).inputs.nixpkgs.legacyPackages.${builtins.currentSystem}, + lib ? pkgs.lib, + crane ? (builtins.getFlake (builtins.toString ./.)).inputs.crane, + pkgSrc ? ./., + mold ? pkgs.mold, +}: +let + craneLib = crane.mkLib pkgs; + src = craneLib.cleanCargoSource pkgSrc; + + commonArgs = { + inherit src; + strictDeps = true; + + doCheck = false; # tests will be run in the `checks` derivation + NEXTEST_HIDE_PROGRESS_BAR = 1; + NEXTEST_FAILURE_OUTPUT = "immediate-final"; + + nativeBuildInputs = [ mold ]; + + meta = { + license = lib.licenses.mit; + homepage = "https://github.com/jalil-salame/webnsupdate"; + mainProgram = "webnsupdate"; + }; + }; + + cargoArtifacts = craneLib.buildDepsOnly commonArgs; +in +craneLib.buildPackage ( + lib.mergeAttrsList [ + commonArgs + { inherit cargoArtifacts; } + ] +) diff --git a/flake-modules/package.nix b/flake-modules/package.nix index 7e8bd52..740d0bb 100644 --- a/flake-modules/package.nix +++ b/flake-modules/package.nix @@ -1,13 +1,11 @@ -{ withSystem, inputs, ... }: +{ inputs, ... }: { - flake.overlays.default = - final: prev: - withSystem prev.stdenv.hostPlatform.system ( - { self', ... }: - { - inherit (self'.packages) webnsupdate; - } - ); + flake.overlays.default = final: prev: { + webnsupdate = prev.callPackage ../default.nix { + inherit (inputs) crane; + pkgSrc = inputs.self; + }; + }; perSystem = { pkgs, lib, ... }: @@ -33,29 +31,22 @@ }; cargoArtifacts = craneLib.buildDepsOnly commonArgs; - webnsupdate = craneLib.buildPackage ( - lib.mergeAttrsList [ - commonArgs - { inherit cargoArtifacts; } - ] - ); + withArtifacts = lib.mergeAttrsList [ + commonArgs + { inherit cargoArtifacts; } + ]; + webnsupdate = pkgs.callPackage ../default.nix { + inherit (inputs) crane; + pkgSrc = inputs.self; + }; in { checks = { + nextest = craneLib.cargoNextest withArtifacts; clippy = craneLib.cargoClippy ( lib.mergeAttrsList [ - commonArgs - { - inherit cargoArtifacts; - cargoClippyExtraArgs = "--all-targets -- --deny warnings"; - } - ] - ); - - nextest = craneLib.cargoNextest ( - lib.mergeAttrsList [ - commonArgs - { inherit cargoArtifacts; } + withArtifacts + { cargoClippyExtraArgs = "--all-targets -- --deny warnings"; } ] ); }; @@ -64,16 +55,6 @@ inherit webnsupdate; inherit (pkgs) git-cliff; default = webnsupdate; - cargo-update = pkgs.writeShellApplication { - name = "cargo-update-lockfile"; - runtimeInputs = with pkgs; [ - cargo - gnused - ]; - text = '' - CARGO_TERM_COLOR=never cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log - ''; - }; }; }; } From 40a9d600c938a385c908e9a1da9dd06688c68d97 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 20 Jan 2025 22:20:18 +0100 Subject: [PATCH 043/178] fix(deps): update rust crate clap to v4.5.27 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | clap | 4.5.26 | 4.5.27 | --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9583c21..4c6a75a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -199,9 +199,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.26" +version = "4.5.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" +checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" dependencies = [ "clap_builder", "clap_derive", @@ -219,9 +219,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.26" +version = "4.5.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" +checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" dependencies = [ "anstream", "anstyle", From 880d462e80858c7190046594467d86ce758a784f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 20 Jan 2025 22:30:26 +0100 Subject: [PATCH 044/178] chore(deps): lock file maintenance --- Cargo.lock | 45 +++++++++++++++++++++++---------------------- flake.lock | 18 +++++++++--------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4c6a75a..db9789a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,11 +67,12 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.6" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", + "once_cell", "windows-sys 0.59.0", ] @@ -172,9 +173,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bytes" @@ -184,9 +185,9 @@ checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cc" -version = "1.2.7" +version = "1.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" +checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" dependencies = [ "shlex", ] @@ -278,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]] @@ -499,9 +500,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "log" -version = "0.4.22" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" [[package]] name = "matchers" @@ -563,9 +564,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ "adler2", ] @@ -644,9 +645,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -735,7 +736,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -772,9 +773,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.135" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" +checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" dependencies = [ "itoa", "memchr", @@ -830,9 +831,9 @@ dependencies = [ [[package]] name = "similar" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de1d4f81173b03af4c0cbed3c898f6bff5b870e4a7f5d6f4057d62a7a4b686e" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" [[package]] name = "smallvec" @@ -885,9 +886,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.95" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -1115,9 +1116,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "wasi" diff --git a/flake.lock b/flake.lock index d0ae9f4..7077934 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1736101677, - "narHash": "sha256-iKOPq86AOWCohuzxwFy/MtC8PcSVGnrxBOvxpjpzrAY=", + "lastModified": 1737250794, + "narHash": "sha256-bdIPhvsAKyYQzqAIeay4kOxTHGwLGkhM+IlBIsmMYFI=", "owner": "ipetkov", "repo": "crane", - "rev": "61ba163d85e5adeddc7b3a69bb174034965965b2", + "rev": "c5b7075f4a6d523fe8204618aa9754e56478c0e0", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1736012469, - "narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=", + "lastModified": 1737062831, + "narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d", + "rev": "5df43628fdf08d642be8ba5b3625a6c70731c19c", "type": "github" }, "original": { @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1736154270, - "narHash": "sha256-p2r8xhQZ3TYIEKBoiEhllKWQqWNJNoT9v64Vmg4q8Zw=", + "lastModified": 1737103437, + "narHash": "sha256-uPNWcYbhY2fjY3HOfRCR5jsfzdzemhfxLSxwjXYXqNc=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "13c913f5deb3a5c08bb810efd89dc8cb24dd968b", + "rev": "d1ed3b385f8130e392870cfb1dbfaff8a63a1899", "type": "github" }, "original": { From 0fd9a8790706cd0495500e1ee53e8b39cadb4749 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 21 Jan 2025 14:20:22 +0100 Subject: [PATCH 045/178] fix(deps): update rust crate axum to v0.8.2 | datasource | package | from | to | | ---------- | ------- | ----- | ----- | | crate | axum | 0.8.1 | 0.8.2 | --- Cargo.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index db9789a..859dee6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -78,9 +78,9 @@ dependencies = [ [[package]] name = "axum" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d6fd624c75e18b3b4c6b9caf42b1afe24437daaee904069137d8bab077be8b8" +checksum = "efea76243612a2436fb4074ba0cf3ba9ea29efdeb72645d8fc63f116462be1de" dependencies = [ "axum-core", "bytes", @@ -123,12 +123,12 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df1362f362fd16024ae199c1970ce98f9661bf5ef94b9808fee734bc3698b733" +checksum = "eab1b0df7cded837c40dacaa2e1c33aa17c84fc3356ae67b5645f1e83190753e" dependencies = [ "bytes", - "futures-util", + "futures-core", "http", "http-body", "http-body-util", From 70162c83f655ce5c7b39e2b6b8af616185d0aa3d Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 21 Jan 2025 23:00:21 +0100 Subject: [PATCH 046/178] chore(deps): lock file maintenance --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 7077934..b9894b0 100644 --- a/flake.lock +++ b/flake.lock @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1737103437, - "narHash": "sha256-uPNWcYbhY2fjY3HOfRCR5jsfzdzemhfxLSxwjXYXqNc=", + "lastModified": 1737483750, + "narHash": "sha256-5An1wq5U8sNycOBBg3nsDDgpwBmR9liOpDGlhliA6Xo=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "d1ed3b385f8130e392870cfb1dbfaff8a63a1899", + "rev": "f2cc121df15418d028a59c9737d38e3a90fbaf8f", "type": "github" }, "original": { From 542336867a4d12cc59d70286af589fffecb204f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Thu, 23 Jan 2025 18:01:58 +0100 Subject: [PATCH 047/178] fix(module): test both IPv4 and IPv6 This ensures both work --- flake-modules/tests.nix | 187 ++++++++++++++++++++++------------------ 1 file changed, 102 insertions(+), 85 deletions(-) diff --git a/flake-modules/tests.nix b/flake-modules/tests.nix index 4cdac8b..36fc99c 100644 --- a/flake-modules/tests.nix +++ b/flake-modules/tests.nix @@ -54,100 +54,117 @@ ''; }; - webnsupdate-machine = { - imports = [ - bindDynamicZone - self.nixosModules.webnsupdate - ]; - - config = { - environment.systemPackages = [ - pkgs.dig - pkgs.curl + webnsupdate-ipv4-machine = + { lib, ... }: + { + imports = [ + bindDynamicZone + self.nixosModules.webnsupdate ]; - services = { - bind.enable = true; + config = { + environment.systemPackages = [ + pkgs.dig + pkgs.curl + ]; - webnsupdate = { - enable = true; - bindIp = "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}. - ''; + services = { + bind.enable = true; + + 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}. + ''; + }; }; }; }; + + webnsupdate-ipv6-machine = { + imports = [ + webnsupdate-ipv4-machine + ]; + + config.services.webnsupdate.bindIp = "::1"; }; + + testScript = '' + machine.start(allow_reboot=True) + machine.wait_for_unit("bind.service") + machine.wait_for_unit("webnsupdate.service") + + # ensure base DNS records area available + with subtest("query base DNS records"): + machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") + machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") + machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") + + # ensure webnsupdate managed records are missing + with subtest("query webnsupdate DNS records (fail)"): + machine.fail("dig @127.0.0.1 test1.${testDomain} A test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} A test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} A test3.${testDomain} AAAA | grep ^test3.${testDomain}") + + with subtest("update webnsupdate DNS records (invalid auth)"): + machine.fail("curl --fail --silent -u test1:test1 -X GET http://localhost:5353/update") + machine.fail("cat /var/lib/webnsupdate/last-ip") # no last-ip set yet + + # ensure webnsupdate managed records are missing + with subtest("query webnsupdate DNS records (fail)"): + machine.fail("dig @127.0.0.1 test1.${testDomain} A test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} A test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} A test3.${testDomain} AAAA | grep ^test3.${testDomain}") + + with subtest("update webnsupdate DNS records (valid auth)"): + machine.succeed("curl --fail --silent -u test:test -X GET http://localhost:5353/update") + machine.succeed("cat /var/lib/webnsupdate/last-ip") + + # ensure webnsupdate managed records are available + with subtest("query webnsupdate DNS records (succeed)"): + machine.succeed("dig @127.0.0.1 test1.${testDomain} A test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.succeed("dig @127.0.0.1 test2.${testDomain} A test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.succeed("dig @127.0.0.1 test3.${testDomain} A test3.${testDomain} AAAA | grep ^test3.${testDomain}") + + machine.reboot() + machine.succeed("cat /var/lib/webnsupdate/last-ip") + machine.wait_for_unit("webnsupdate.service") + machine.succeed("cat /var/lib/webnsupdate/last-ip") + + # ensure base DNS records area available after a reboot + with subtest("query base DNS records"): + machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") + machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") + machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") + + # ensure webnsupdate managed records are available after a reboot + with subtest("query webnsupdate DNS records (succeed)"): + machine.succeed("dig @127.0.0.1 test1.${testDomain} A test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.succeed("dig @127.0.0.1 test2.${testDomain} A test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.succeed("dig @127.0.0.1 test3.${testDomain} A test3.${testDomain} AAAA | grep ^test3.${testDomain}") + ''; in { - module-test = pkgs.testers.runNixOSTest { - name = "webnsupdate-module"; - nodes.machine = webnsupdate-machine; - testScript = '' - machine.start(allow_reboot=True) - machine.wait_for_unit("bind.service") - machine.wait_for_unit("webnsupdate.service") - - # ensure base DNS records area available - with subtest("query base DNS records"): - machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") - machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") - machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") - - # ensure webnsupdate managed records are missing - with subtest("query webnsupdate DNS records (fail)"): - machine.fail("dig @127.0.0.1 test1.${testDomain} | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} | grep ^test3.${testDomain}") - - with subtest("update webnsupdate DNS records (invalid auth)"): - machine.fail("curl --fail --silent -u test1:test1 -X GET http://localhost:5353/update") - machine.fail("cat /var/lib/webnsupdate/last-ip") # no last-ip set yet - - # ensure webnsupdate managed records are missing - with subtest("query webnsupdate DNS records (fail)"): - machine.fail("dig @127.0.0.1 test1.${testDomain} | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} | grep ^test3.${testDomain}") - - with subtest("update webnsupdate DNS records (valid auth)"): - machine.succeed("curl --fail --silent -u test:test -X GET http://localhost:5353/update") - machine.succeed("cat /var/lib/webnsupdate/last-ip") - - # ensure webnsupdate managed records are available - with subtest("query webnsupdate DNS records (succeed)"): - machine.succeed("dig @127.0.0.1 test1.${testDomain} | grep ^test1.${testDomain}") - machine.succeed("dig @127.0.0.1 test2.${testDomain} | grep ^test2.${testDomain}") - machine.succeed("dig @127.0.0.1 test3.${testDomain} | grep ^test3.${testDomain}") - - machine.reboot() - machine.succeed("cat /var/lib/webnsupdate/last-ip") - machine.wait_for_unit("webnsupdate.service") - machine.succeed("cat /var/lib/webnsupdate/last-ip") - - # ensure base DNS records area available after a reboot - with subtest("query base DNS records"): - machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") - machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") - machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") - - # ensure webnsupdate managed records are available after a reboot - with subtest("query webnsupdate DNS records (succeed)"): - machine.succeed("dig @127.0.0.1 test1.${testDomain} | grep ^test1.${testDomain}") - machine.succeed("dig @127.0.0.1 test2.${testDomain} | grep ^test2.${testDomain}") - machine.succeed("dig @127.0.0.1 test3.${testDomain} | grep ^test3.${testDomain}") - ''; + module-ipv4-test = pkgs.testers.runNixOSTest { + name = "webnsupdate-ipv4-module"; + nodes.machine = webnsupdate-ipv4-machine; + inherit testScript; + }; + module-ipv6-test = pkgs.testers.runNixOSTest { + name = "webnsupdate-ipv6-module"; + nodes.machine = webnsupdate-ipv6-machine; + inherit testScript; }; }; }; From a2735b46b5691b83a077ce3ee06ab55b623e6037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Thu, 23 Jan 2025 18:01:58 +0100 Subject: [PATCH 048/178] feat(webnsupdate): add handling for multiple IPs Specifically, for when both and IPv6 and and IPv4 addr is provided. This ensures we can forward both addrs to webnsupdate, instead of only allowing IPv4. --- Cargo.lock | 2 + Cargo.toml | 2 + src/main.rs | 110 +++++++++++++++++++++++++++++++++++++--------------- 3 files changed, 83 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 859dee6..a6267f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1139,6 +1139,8 @@ dependencies = [ "insta", "miette", "ring", + "serde", + "serde_json", "tokio", "tower-http", "tracing", diff --git a/Cargo.toml b/Cargo.toml index 0bafe90..89197a6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,8 @@ clap-verbosity-flag = { version = "3", default-features = false, features = [ http = "1" miette = { version = "7", features = ["fancy"] } ring = { version = "0.17", features = ["std"] } +serde = { version = "1.0.217", features = ["derive"] } +serde_json = "1.0.137" tokio = { version = "1", features = ["macros", "rt", "process", "io-util"] } tower-http = { version = "0.6.2", features = ["validate-request"] } tracing = "0.1" diff --git a/src/main.rs b/src/main.rs index d2b9136..d909d3c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ use std::{ io::ErrorKind, - net::{IpAddr, SocketAddr}, + net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr}, path::{Path, PathBuf}, time::Duration, }; @@ -114,6 +114,48 @@ struct AppState<'a> { /// The file where the last IP is stored ip_file: &'a Path, + + /// Last recorded IPs + last_ips: std::sync::Arc>, +} + +#[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)] +struct SavedIPs { + #[serde(skip_serializing_if = "Option::is_none")] + ipv4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + ipv6: Option, +} + +impl SavedIPs { + fn update(&mut self, ip: IpAddr) { + match ip { + IpAddr::V4(ipv4_addr) => self.ipv4 = Some(ipv4_addr), + IpAddr::V6(ipv6_addr) => self.ipv6 = Some(ipv6_addr), + } + } + + fn ips(&self) -> impl Iterator { + self.ipv4 + .map(IpAddr::V4) + .into_iter() + .chain(self.ipv6.map(IpAddr::V6)) + } + + fn from_str(data: &str) -> miette::Result { + match data.parse::() { + // Old format + Ok(IpAddr::V4(ipv4)) => Ok(Self { + ipv4: Some(ipv4), + ipv6: None, + }), + Ok(IpAddr::V6(ipv6)) => Ok(Self { + ipv4: None, + ipv6: Some(ipv6), + }), + Err(_) => serde_json::from_str(data).into_diagnostic(), + } + } } impl AppState<'static> { @@ -137,7 +179,7 @@ impl AppState<'static> { let ttl = Duration::from_secs(*ttl); // Use last registered IP address if available - let ip_file = data_dir.join("last-ip"); + let ip_file = Box::leak(data_dir.join("last-ip").into_boxed_path()); let state = AppState { ttl, @@ -155,7 +197,10 @@ impl AppState<'static> { Ok(&*Box::leak(path.into())) }) .transpose()?, - ip_file: Box::leak(ip_file.into_boxed_path()), + ip_file, + last_ips: std::sync::Arc::new(tokio::sync::Mutex::new( + load_ip(ip_file)?.unwrap_or_default(), + )), }; ensure!( @@ -167,7 +212,7 @@ impl AppState<'static> { } } -fn load_ip(path: &Path) -> Result> { +fn load_ip(path: &Path) -> Result> { debug!("loading last IP from {}", path.display()); let data = match std::fs::read_to_string(path) { Ok(ip) => ip, @@ -181,11 +226,9 @@ fn load_ip(path: &Path) -> Result> { } }; - Ok(Some( - data.parse() - .into_diagnostic() - .wrap_err("failed to parse last ip address")?, - )) + SavedIPs::from_str(&data) + .wrap_err_with(|| format!("failed to load last ip address from {}", path.display())) + .map(Some) } #[tracing::instrument(err)] @@ -266,28 +309,24 @@ fn main() -> Result<()> { .wrap_err("failed to start the tokio runtime")?; rt.block_on(async { - // Load previous IP and update DNS record to point to it (if available) - match load_ip(state.ip_file) { - Ok(Some(ip)) => { - match nsupdate::nsupdate(ip, state.ttl, state.key_file, state.records).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"); + // Update DNS record with previous IPs (if available) + let ips = state.last_ips.lock().await.clone(); + for ip in ips.ips() { + match nsupdate::nsupdate(ip, state.ttl, state.key_file, state.records).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"); + } } - Ok(None) => info!("No previous IP address set"), - - Err(err) => error!("Ignoring previous IP due to: {err}"), - }; + } // Create services let app = Router::new().route("/update", get(update_records)); @@ -324,13 +363,22 @@ async fn update_records( info!("accepted update from {ip}"); match nsupdate::nsupdate(ip, state.ttl, state.key_file, state.records).await { Ok(status) if status.success() => { + let ips = { + // Update state + let mut ips = state.last_ips.lock().await; + ips.update(ip); + ips.clone() + }; + tokio::task::spawn_blocking(move || { - info!("updating last ip to {ip}"); - if let Err(err) = std::fs::write(state.ip_file, format!("{ip}")) { + info!("updating last ips to {ips:?}"); + let data = serde_json::to_vec(&ips).expect("invalid serialization impl"); + if let Err(err) = std::fs::write(state.ip_file, data) { error!("Failed to update last IP: {err}"); } - info!("updated last ip to {ip}"); + info!("updated last ips to {ips:?}"); }); + Ok("successful update") } Ok(status) => { From e5f7d94f77026d2afbc35817f574d4c692212447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Thu, 23 Jan 2025 21:29:11 +0100 Subject: [PATCH 049/178] feat: tune compilation for size Reduce size by setting `codegen-units = 1` in release mode. --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 89197a6..0817c4c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,6 +42,7 @@ opt-level = "s" panic = "abort" lto = true strip = true +codegen-units = 1 [profile.dev] debug = 0 From ec27e3133648917e14769af03d93d1af1aa88a63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Thu, 23 Jan 2025 22:16:17 +0100 Subject: [PATCH 050/178] feat(tests): add nginx integration test This ensures we can handle IPv4 and IPv6 simultaneously --- flake-modules/tests.nix | 104 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/flake-modules/tests.nix b/flake-modules/tests.nix index 36fc99c..8c8a7d3 100644 --- a/flake-modules/tests.nix +++ b/flake-modules/tests.nix @@ -100,6 +100,27 @@ config.services.webnsupdate.bindIp = "::1"; }; + webnsupdate-nginx-machine = + { lib, config, ... }: + { + imports = [ + webnsupdate-ipv4-machine + ]; + + config.services = { + # Use default IP Source + webnsupdate.extraArgs = lib.mkForce [ "-vvv" ]; # debug messages + + nginx = { + enable = true; + recommendedProxySettings = true; + + virtualHosts.webnsupdate.locations."/".proxyPass = + "http://${config.services.webnsupdate.bindIp}:${builtins.toString config.services.webnsupdate.bindPort}"; + }; + }; + }; + testScript = '' machine.start(allow_reboot=True) machine.wait_for_unit("bind.service") @@ -166,6 +187,89 @@ nodes.machine = webnsupdate-ipv6-machine; inherit testScript; }; + module-nginx-test = pkgs.testers.runNixOSTest { + name = "webnsupdate-nginx-module"; + nodes.machine = webnsupdate-nginx-machine; + testScript = '' + machine.start(allow_reboot=True) + machine.wait_for_unit("bind.service") + machine.wait_for_unit("webnsupdate.service") + + # ensure base DNS records area available + with subtest("query base DNS records"): + machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") + machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") + machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") + + # ensure webnsupdate managed records are missing + with subtest("query webnsupdate DNS records (fail)"): + machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") + machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") + + with subtest("update webnsupdate DNS records (invalid auth)"): + machine.fail("curl --fail --silent -u test1:test1 -X GET http://127.0.0.1/update") + machine.fail("cat /var/lib/webnsupdate/last-ip") # no last-ip set yet + + # ensure webnsupdate managed records are missing + with subtest("query webnsupdate DNS records (fail)"): + machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") + machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") + + with subtest("update webnsupdate IPv4 DNS records (valid auth)"): + machine.succeed("curl --fail --silent -u test:test -X GET http://127.0.0.1/update") + machine.succeed("cat /var/lib/webnsupdate/last-ip") + + # ensure webnsupdate managed IPv4 records are available + with subtest("query webnsupdate IPv4 DNS records (succeed)"): + machine.succeed("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") + machine.succeed("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") + machine.succeed("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") + + # ensure webnsupdate managed IPv6 records are missing + with subtest("query webnsupdate IPv6 DNS records (fail)"): + machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") + + with subtest("update webnsupdate IPv6 DNS records (valid auth)"): + machine.succeed("curl --fail --silent -u test:test -X GET http://[::1]/update") + machine.succeed("cat /var/lib/webnsupdate/last-ip") + + # ensure webnsupdate managed IPv6 records are missing + with subtest("query webnsupdate IPv6 DNS records (fail)"): + machine.succeed("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.succeed("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.succeed("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") + + machine.reboot() + machine.succeed("cat /var/lib/webnsupdate/last-ip") + machine.wait_for_unit("webnsupdate.service") + machine.succeed("cat /var/lib/webnsupdate/last-ip") + + # ensure base DNS records area available after a reboot + with subtest("query base DNS records"): + machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") + machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") + machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") + + # ensure webnsupdate managed records are available after a reboot + with subtest("query webnsupdate DNS records (succeed)"): + machine.succeed("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") + machine.succeed("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") + machine.succeed("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") + machine.succeed("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.succeed("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.succeed("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") + ''; + }; }; }; } From 2e8d20f89dac9d0144345f56b630f7f03d3e330f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Thu, 23 Jan 2025 22:29:39 +0100 Subject: [PATCH 051/178] ci: parallelize checks If I ever get more runners, this will be a great speedup. --- .forgejo/workflows/check.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml index f4e299e..b61a4dc 100644 --- a/.forgejo/workflows/check.yml +++ b/.forgejo/workflows/check.yml @@ -4,15 +4,30 @@ jobs: runs-on: nixos steps: - uses: https://git.salame.cl/actions/checkout@v4 - - run: nix --version - - run: nix build --print-build-logs .# + - name: Build Package + run: | + nix --version + nix build --print-build-logs .# check: 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 steps: - uses: https://git.salame.cl/actions/checkout@v4 - - run: nix --version - - run: nix flake check --keep-going --verbose --print-build-logs + - name: Check + run: | + set -x + nix --version + # shellcheck disable=SC2016 + nix build --print-build-logs '.#checks.x86_64-linux.${{ matrix.check }}' report-size: runs-on: nixos needs: build From 989ed2a080acd9bb33b7eb7f58789e82c08a1067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Thu, 23 Jan 2025 22:35:01 +0100 Subject: [PATCH 052/178] chore(release): prepare for 0.3.5 (rust) Bump version --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a6267f2..f692d4e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1128,7 +1128,7 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "webnsupdate" -version = "0.3.4" +version = "0.3.5" dependencies = [ "axum", "axum-client-ip", diff --git a/Cargo.toml b/Cargo.toml index 0817c4c..79471c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ cargo-features = ["codegen-backend"] [package] description = "An HTTP server using HTTP basic auth to make secure calls to nsupdate" name = "webnsupdate" -version = "0.3.4" +version = "0.3.5" edition = "2021" license-file = "LICENSE" readme = "README.md" From 2473e6edbc9119b0ee03dd5c8110319c989982e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Thu, 23 Jan 2025 22:35:01 +0100 Subject: [PATCH 053/178] chore(release): prepare for 0.3.5 (docs) Generate changelog --- CHANGELOG.md | 35 +++++++++++++++++++++++++++++++++++ justfile | 2 ++ 2 files changed, 37 insertions(+) create mode 100644 justfile diff --git a/CHANGELOG.md b/CHANGELOG.md index 64cc1c5..fe32bf3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,41 @@ All notable changes to this project will be documented in this file. +## [0.3.5] - 2025-01-23 + +### 🚀 Features + +- *(renovate)* Enable lockFileMaintenance +- *(webnsupdate)* Add handling for multiple IPs +- Tune compilation for size +- *(tests)* Add nginx integration test + +### 🐛 Bug Fixes + +- *(flake)* Switch to github ref +- *(renovate)* Switch automergeStrategy to auto +- *(ci)* Remove update workflow +- *(typos)* Typos caught more typos :3 +- *(renovate)* Branch creation before automerge +- *(renovaterc)* Invalid cron syntax +- *(deps)* Update rust crate clap to v4.5.24 +- *(deps)* Update rust crate tokio to v1.43.0 +- *(deps)* Update rust crate clap to v4.5.25 +- *(deps)* Update rust crate clap to v4.5.26 +- *(flake)* Switch overlay to callPackage +- *(deps)* Update rust crate clap to v4.5.27 +- *(deps)* Update rust crate axum to v0.8.2 +- *(module)* Test both IPv4 and IPv6 + +### 🚜 Refactor + +- Setup renovate to manage dependencies + +### ⚙️ Miscellaneous Tasks + +- Update to axum 0.8 +- Parallelize checks + ## [0.3.4] - 2024-12-26 ### 🐛 Bug Fixes diff --git a/justfile b/justfile new file mode 100644 index 0000000..6cacc42 --- /dev/null +++ b/justfile @@ -0,0 +1,2 @@ +changelog version: + git cliff --unreleased --prepend=CHANGELOG.md --tag='{{ version }}' From e72e3777b8f39f20e34c8ed68e27f070df3c5d12 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 23 Jan 2025 23:00:21 +0100 Subject: [PATCH 054/178] chore(deps): lock file maintenance --- Cargo.lock | 18 +++++++++--------- flake.lock | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f692d4e..9d4cd5d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -78,9 +78,9 @@ dependencies = [ [[package]] name = "axum" -version = "0.8.2" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efea76243612a2436fb4074ba0cf3ba9ea29efdeb72645d8fc63f116462be1de" +checksum = "6d6fd624c75e18b3b4c6b9caf42b1afe24437daaee904069137d8bab077be8b8" dependencies = [ "axum-core", "bytes", @@ -123,12 +123,12 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eab1b0df7cded837c40dacaa2e1c33aa17c84fc3356ae67b5645f1e83190753e" +checksum = "df1362f362fd16024ae199c1970ce98f9661bf5ef94b9808fee734bc3698b733" dependencies = [ "bytes", - "futures-core", + "futures-util", "http", "http-body", "http-body-util", @@ -728,9 +728,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "0.38.43" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ "bitflags", "errno", @@ -1086,9 +1086,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "11cd88e12b17c6494200a9c1b683a04fcac9573ed74cd1b62aeb2727c5592243" [[package]] name = "unicode-linebreak" diff --git a/flake.lock b/flake.lock index b9894b0..38a7fc1 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1737250794, - "narHash": "sha256-bdIPhvsAKyYQzqAIeay4kOxTHGwLGkhM+IlBIsmMYFI=", + "lastModified": 1737563566, + "narHash": "sha256-GLJvkOG29XCynQm8XWPyykMRqIhxKcBARVu7Ydrz02M=", "owner": "ipetkov", "repo": "crane", - "rev": "c5b7075f4a6d523fe8204618aa9754e56478c0e0", + "rev": "849376434956794ebc7a6b487d31aace395392ba", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1737062831, - "narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=", + "lastModified": 1737469691, + "narHash": "sha256-nmKOgAU48S41dTPIXAq0AHZSehWUn6ZPrUKijHAMmIk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5df43628fdf08d642be8ba5b3625a6c70731c19c", + "rev": "9e4d5190a9482a1fb9d18adf0bdb83c6e506eaab", "type": "github" }, "original": { From 0fc17d91509e69f9ad1db21d525b77ec8423a2f7 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 24 Jan 2025 23:00:42 +0100 Subject: [PATCH 055/178] chore(deps): lock file maintenance --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 38a7fc1..cc541a7 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1737563566, - "narHash": "sha256-GLJvkOG29XCynQm8XWPyykMRqIhxKcBARVu7Ydrz02M=", + "lastModified": 1737689766, + "narHash": "sha256-ivVXYaYlShxYoKfSo5+y5930qMKKJ8CLcAoIBPQfJ6s=", "owner": "ipetkov", "repo": "crane", - "rev": "849376434956794ebc7a6b487d31aace395392ba", + "rev": "6fe74265bbb6d016d663b1091f015e2976c4a527", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1737469691, - "narHash": "sha256-nmKOgAU48S41dTPIXAq0AHZSehWUn6ZPrUKijHAMmIk=", + "lastModified": 1737632463, + "narHash": "sha256-38J9QfeGSej341ouwzqf77WIHAScihAKCt8PQJ+NH28=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9e4d5190a9482a1fb9d18adf0bdb83c6e506eaab", + "rev": "0aa475546ed21629c4f5bbf90e38c846a99ec9e9", "type": "github" }, "original": { From 98aa3c2a9759c5efb289925af77eb3404d7b87a3 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 25 Jan 2025 19:30:20 +0100 Subject: [PATCH 056/178] chore(deps): update rust crate insta to v1.42.1 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | insta | 1.42.0 | 1.42.1 | --- Cargo.lock | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9d4cd5d..b03e031 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,13 +446,14 @@ dependencies = [ [[package]] name = "insta" -version = "1.42.0" +version = "1.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513e4067e16e69ed1db5ab56048ed65db32d10ba5fc1217f5393f8f17d8b5a5" +checksum = "71c1b125e30d93896b365e156c33dadfffab45ee8400afcbba4752f59de08a86" dependencies = [ "console", "linked-hash-map", "once_cell", + "pin-project", "similar", ] @@ -631,6 +632,26 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "pin-project" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pin-project-lite" version = "0.2.16" @@ -736,7 +757,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] From ea428d1aefb0b1e11d04898a8006cc151636dae2 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 25 Jan 2025 19:40:22 +0100 Subject: [PATCH 057/178] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b03e031..5c0e918 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]] @@ -757,7 +757,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] From 34ce8a69f660ae208ffdd74af89f6d6d3051c063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 26 Jan 2025 22:04:42 +0100 Subject: [PATCH 058/178] feat(webnsupdate): allow running in IPv4/6 only mode This fixes issues when the IPv6/IPv4 is not working properly but updates are still happening (like rn) T-T. --- src/main.rs | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index d909d3c..922b00f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -81,10 +81,55 @@ struct Opts { #[clap(long, default_value = "RightmostXForwardedFor")] ip_source: SecureClientIpSource, + /// Set which IPs to allow updating + #[clap(long, default_value_t = IpType::Both)] + ip_type: IpType, + #[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}'"), + } + } +} + #[derive(Debug, Subcommand)] enum Cmd { Mkpasswd(password::Mkpasswd), @@ -117,6 +162,9 @@ struct AppState<'a> { /// Last recorded IPs last_ips: std::sync::Arc>, + + /// The IP type for which to allow updates + ip_type: IpType, } #[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)] @@ -173,13 +221,14 @@ impl AppState<'static> { salt: _, ttl, ip_source: _, + ip_type, } = args; // Set state let ttl = Duration::from_secs(*ttl); // Use last registered IP address if available - let ip_file = Box::leak(data_dir.join("last-ip").into_boxed_path()); + let ip_file = Box::leak(data_dir.join("last-ip.json").into_boxed_path()); let state = AppState { ttl, @@ -198,6 +247,7 @@ impl AppState<'static> { }) .transpose()?, ip_file, + ip_type: *ip_type, last_ips: std::sync::Arc::new(tokio::sync::Mutex::new( load_ip(ip_file)?.unwrap_or_default(), )), @@ -276,6 +326,7 @@ fn main() -> Result<()> { salt, ttl: _, ip_source, + ip_type, } = args; info!("checking environment"); @@ -312,6 +363,10 @@ fn main() -> Result<()> { // Update DNS record with previous IPs (if available) let ips = state.last_ips.lock().await.clone(); for ip in ips.ips() { + if !ip_type.valid_for_type(ip) { + continue; + } + match nsupdate::nsupdate(ip, state.ttl, state.key_file, state.records).await { Ok(status) => { if !status.success() { @@ -361,6 +416,13 @@ async fn update_records( SecureClientIp(ip): SecureClientIp, ) -> axum::response::Result<&'static str> { info!("accepted update from {ip}"); + + if !state.ip_type.valid_for_type(ip) { + let ip_type = state.ip_type; + tracing::warn!("rejecting update from {ip} as we are running a {ip_type} filter"); + return Err((StatusCode::CONFLICT, format!("running in {ip_type} mode")).into()); + } + match nsupdate::nsupdate(ip, state.ttl, state.key_file, state.records).await { Ok(status) if status.success() => { let ips = { From a47dd0bfacb6e82de7fa892de48de6155bec1ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 26 Jan 2025 22:08:46 +0100 Subject: [PATCH 059/178] feat(module): add option for setting --ip-type This makes it easy to set the server to ipv4-only mode. --- flake-modules/module.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/flake-modules/module.nix b/flake-modules/module.nix index fc52da7..e70ae35 100644 --- a/flake-modules/module.nix +++ b/flake-modules/module.nix @@ -48,6 +48,16 @@ let 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. @@ -126,6 +136,8 @@ let cfg.passwordFile "--address" cfg.bindIp + "--ip-type" + cfg.allowedIPVersion "--port" (builtins.toString cfg.bindPort) "--ttl" From 77cb03576d48bbdee17127f13815dc5b07e476f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 26 Jan 2025 22:25:41 +0100 Subject: [PATCH 060/178] feat(flake): add tests for new allowedIPVersion option This ensures we don't accidentally update records. --- flake-modules/tests.nix | 232 +++++++++++++++++++++++++++++++++++----- 1 file changed, 204 insertions(+), 28 deletions(-) diff --git a/flake-modules/tests.nix b/flake-modules/tests.nix index 8c8a7d3..ce7934d 100644 --- a/flake-modules/tests.nix +++ b/flake-modules/tests.nix @@ -6,25 +6,25 @@ checks = let testDomain = "webnstest.example"; + lastIPPath = "/var/lib/webnsupdate/last-ip.json"; zoneFile = pkgs.writeText "${testDomain}.zoneinfo" '' - $ORIGIN . $TTL 60 ; 1 minute - ${testDomain} IN SOA ns1.${testDomain}. admin.${testDomain}. ( - 1 ; serial - 21600 ; refresh (6 hours) - 3600 ; retry (1 hour) - 604800 ; expire (1 week) - 86400) ; negative caching TTL (1 day) - - IN NS ns1.${testDomain}. $ORIGIN ${testDomain}. - ${testDomain}. IN A 127.0.0.1 - ${testDomain}. IN AAAA ::1 - ns1 IN A 127.0.0.1 - ns1 IN AAAA ::1 - nsupdate IN A 127.0.0.1 - nsupdate IN AAAA ::1 + @ IN SOA ns1.${testDomain}. admin.${testDomain}. ( + 1 ; serial + 6h ; refresh + 1h ; retry + 1w ; expire + 1d) ; negative caching TTL + + IN NS ns1.${testDomain}. + @ IN A 127.0.0.1 + ns1 IN A 127.0.0.1 + nsupdate IN A 127.0.0.1 + @ IN AAAA ::1 + ns1 IN AAAA ::1 + nsupdate IN AAAA ::1 ''; bindDynamicZone = @@ -121,6 +121,16 @@ }; }; + webnsupdate-ipv4-only-machine = { + imports = [ webnsupdate-nginx-machine ]; + config.services.webnsupdate.allowedIPVersion = "ipv4-only"; + }; + + webnsupdate-ipv6-only-machine = { + imports = [ webnsupdate-nginx-machine ]; + config.services.webnsupdate.allowedIPVersion = "ipv6-only"; + }; + testScript = '' machine.start(allow_reboot=True) machine.wait_for_unit("bind.service") @@ -128,8 +138,8 @@ # ensure base DNS records area available with subtest("query base DNS records"): - machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") - machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") + machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") + machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") # ensure webnsupdate managed records are missing @@ -140,7 +150,7 @@ with subtest("update webnsupdate DNS records (invalid auth)"): machine.fail("curl --fail --silent -u test1:test1 -X GET http://localhost:5353/update") - machine.fail("cat /var/lib/webnsupdate/last-ip") # no last-ip set yet + machine.fail("cat ${lastIPPath}") # no last-ip set yet # ensure webnsupdate managed records are missing with subtest("query webnsupdate DNS records (fail)"): @@ -150,7 +160,7 @@ with subtest("update webnsupdate DNS records (valid auth)"): machine.succeed("curl --fail --silent -u test:test -X GET http://localhost:5353/update") - machine.succeed("cat /var/lib/webnsupdate/last-ip") + machine.succeed("cat ${lastIPPath}") # ensure webnsupdate managed records are available with subtest("query webnsupdate DNS records (succeed)"): @@ -159,9 +169,9 @@ machine.succeed("dig @127.0.0.1 test3.${testDomain} A test3.${testDomain} AAAA | grep ^test3.${testDomain}") machine.reboot() - machine.succeed("cat /var/lib/webnsupdate/last-ip") + machine.succeed("cat ${lastIPPath}") machine.wait_for_unit("webnsupdate.service") - machine.succeed("cat /var/lib/webnsupdate/last-ip") + machine.succeed("cat ${lastIPPath}") # ensure base DNS records area available after a reboot with subtest("query base DNS records"): @@ -197,8 +207,8 @@ # ensure base DNS records area available with subtest("query base DNS records"): - machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") - machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") + machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") + machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") # ensure webnsupdate managed records are missing @@ -212,7 +222,7 @@ with subtest("update webnsupdate DNS records (invalid auth)"): machine.fail("curl --fail --silent -u test1:test1 -X GET http://127.0.0.1/update") - machine.fail("cat /var/lib/webnsupdate/last-ip") # no last-ip set yet + machine.fail("cat ${lastIPPath}") # no last-ip set yet # ensure webnsupdate managed records are missing with subtest("query webnsupdate DNS records (fail)"): @@ -225,7 +235,7 @@ with subtest("update webnsupdate IPv4 DNS records (valid auth)"): machine.succeed("curl --fail --silent -u test:test -X GET http://127.0.0.1/update") - machine.succeed("cat /var/lib/webnsupdate/last-ip") + machine.succeed("cat ${lastIPPath}") # ensure webnsupdate managed IPv4 records are available with subtest("query webnsupdate IPv4 DNS records (succeed)"): @@ -241,7 +251,7 @@ with subtest("update webnsupdate IPv6 DNS records (valid auth)"): machine.succeed("curl --fail --silent -u test:test -X GET http://[::1]/update") - machine.succeed("cat /var/lib/webnsupdate/last-ip") + machine.succeed("cat ${lastIPPath}") # ensure webnsupdate managed IPv6 records are missing with subtest("query webnsupdate IPv6 DNS records (fail)"): @@ -250,9 +260,9 @@ machine.succeed("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") machine.reboot() - machine.succeed("cat /var/lib/webnsupdate/last-ip") + machine.succeed("cat ${lastIPPath}") machine.wait_for_unit("webnsupdate.service") - machine.succeed("cat /var/lib/webnsupdate/last-ip") + machine.succeed("cat ${lastIPPath}") # ensure base DNS records area available after a reboot with subtest("query base DNS records"): @@ -270,6 +280,172 @@ machine.succeed("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") ''; }; + module-ipv4-only-test = pkgs.testers.runNixOSTest { + name = "webnsupdate-ipv4-only-module"; + nodes.machine = webnsupdate-ipv4-only-machine; + testScript = '' + machine.start(allow_reboot=True) + machine.wait_for_unit("bind.service") + machine.wait_for_unit("webnsupdate.service") + + # ensure base DNS records area available + with subtest("query base DNS records"): + machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") + machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") + machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") + + # ensure webnsupdate managed records are missing + with subtest("query webnsupdate DNS records (fail)"): + machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") + machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") + + with subtest("update webnsupdate DNS records (invalid auth)"): + machine.fail("curl --fail --silent -u test1:test1 -X GET http://127.0.0.1/update") + machine.fail("cat ${lastIPPath}") # no last-ip set yet + + # ensure webnsupdate managed records are missing + with subtest("query webnsupdate DNS records (fail)"): + machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") + machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") + + with subtest("update webnsupdate IPv6 DNS records (valid auth)"): + machine.fail("curl --fail --silent -u test:test -X GET http://[::1]/update") + machine.fail("cat ${lastIPPath}") + + # ensure webnsupdate managed IPv6 records are missing + with subtest("query webnsupdate IPv6 DNS records (fail)"): + machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") + + with subtest("update webnsupdate IPv4 DNS records (valid auth)"): + machine.succeed("curl --fail --silent -u test:test -X GET http://127.0.0.1/update") + machine.succeed("cat ${lastIPPath}") + + # ensure webnsupdate managed IPv4 records are available + with subtest("query webnsupdate IPv4 DNS records (succeed)"): + machine.succeed("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") + machine.succeed("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") + machine.succeed("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") + + # ensure webnsupdate managed IPv6 records are missing + with subtest("query webnsupdate IPv6 DNS records (fail)"): + machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") + + machine.reboot() + machine.succeed("cat ${lastIPPath}") + machine.wait_for_unit("webnsupdate.service") + machine.succeed("cat ${lastIPPath}") + + # ensure base DNS records area available after a reboot + with subtest("query base DNS records"): + machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") + machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") + machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") + + # ensure webnsupdate managed records are available after a reboot + with subtest("query webnsupdate DNS records (succeed)"): + machine.succeed("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") + machine.succeed("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") + machine.succeed("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") + machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") + ''; + }; + module-ipv6-only-test = pkgs.testers.runNixOSTest { + name = "webnsupdate-ipv6-only-module"; + nodes.machine = webnsupdate-ipv6-only-machine; + testScript = '' + machine.start(allow_reboot=True) + machine.wait_for_unit("bind.service") + machine.wait_for_unit("webnsupdate.service") + + # ensure base DNS records area available + with subtest("query base DNS records"): + machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") + machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") + machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") + + # ensure webnsupdate managed records are missing + with subtest("query webnsupdate DNS records (fail)"): + machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") + machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") + + with subtest("update webnsupdate DNS records (invalid auth)"): + machine.fail("curl --fail --silent -u test1:test1 -X GET http://127.0.0.1/update") + machine.fail("cat ${lastIPPath}") # no last-ip set yet + + # ensure webnsupdate managed records are missing + with subtest("query webnsupdate DNS records (fail)"): + machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") + machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") + + with subtest("update webnsupdate IPv4 DNS records (valid auth)"): + machine.fail("curl --fail --silent -u test:test -X GET http://127.0.0.1/update") + machine.fail("cat ${lastIPPath}") + + # ensure webnsupdate managed IPv4 records are missing + with subtest("query webnsupdate IPv4 DNS records (fail)"): + machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") + + with subtest("update webnsupdate IPv6 DNS records (valid auth)"): + machine.succeed("curl --fail --silent -u test:test -X GET http://[::1]/update") + machine.succeed("cat ${lastIPPath}") + + # ensure webnsupdate managed IPv6 records are available + with subtest("query webnsupdate IPv6 DNS records (succeed)"): + machine.succeed("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.succeed("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.succeed("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") + + # ensure webnsupdate managed IPv4 records are missing + with subtest("query webnsupdate IPv4 DNS records (fail)"): + machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") + + machine.reboot() + machine.succeed("cat ${lastIPPath}") + machine.wait_for_unit("webnsupdate.service") + machine.succeed("cat ${lastIPPath}") + + # ensure base DNS records area available after a reboot + with subtest("query base DNS records"): + machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") + machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") + machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") + + # ensure webnsupdate managed records are available after a reboot + with subtest("query webnsupdate DNS records (succeed)"): + machine.succeed("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") + machine.succeed("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") + machine.succeed("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") + machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") + machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") + machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") + ''; + }; }; }; } From c8407a8eb4e48c64581622bf858b1c3f3f84022c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 26 Jan 2025 22:38:20 +0100 Subject: [PATCH 061/178] chore(release): prepare for 0.3.6 Generate changelog and bump version. --- CHANGELOG.md | 8 ++++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe32bf3..45c9f8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. +## [0.3.6] - 2025-01-26 + +### 🚀 Features + +- *(webnsupdate)* Allow running in IPv4/6 only mode +- *(module)* Add option for setting --ip-type +- *(flake)* Add tests for new allowedIPVersion option + ## [0.3.5] - 2025-01-23 ### 🚀 Features diff --git a/Cargo.lock b/Cargo.lock index 5c0e918..df31928 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1149,7 +1149,7 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "webnsupdate" -version = "0.3.5" +version = "0.3.6" dependencies = [ "axum", "axum-client-ip", diff --git a/Cargo.toml b/Cargo.toml index 79471c7..f435dbf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ cargo-features = ["codegen-backend"] [package] description = "An HTTP server using HTTP basic auth to make secure calls to nsupdate" name = "webnsupdate" -version = "0.3.5" +version = "0.3.6" edition = "2021" license-file = "LICENSE" readme = "README.md" From dff29cab77a483b1a2f6963f9a7922924ad80949 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 26 Jan 2025 23:00:37 +0100 Subject: [PATCH 062/178] chore(deps): lock file maintenance --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index cc541a7..75aaf2d 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1737632463, - "narHash": "sha256-38J9QfeGSej341ouwzqf77WIHAScihAKCt8PQJ+NH28=", + "lastModified": 1737885589, + "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0aa475546ed21629c4f5bbf90e38c846a99ec9e9", + "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8", "type": "github" }, "original": { From 09be5627c389f08e80424b577aada1b35b6d145e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Tue, 28 Jan 2025 00:18:36 +0100 Subject: [PATCH 063/178] refactor(module): NixOS tests Way easier to extend/maintain. --- flake-modules/tests.nix | 418 +++++++++++++--------------------------- 1 file changed, 129 insertions(+), 289 deletions(-) diff --git a/flake-modules/tests.nix b/flake-modules/tests.nix index ce7934d..3d06218 100644 --- a/flake-modules/tests.nix +++ b/flake-modules/tests.nix @@ -131,320 +131,160 @@ config.services.webnsupdate.allowedIPVersion = "ipv6-only"; }; - testScript = '' - machine.start(allow_reboot=True) - machine.wait_for_unit("bind.service") - machine.wait_for_unit("webnsupdate.service") + # "A" for IPv4, "AAAA" for IPv6, "ANY" for any + testTemplate = + { + ipv4 ? false, + ipv6 ? false, + nginx ? false, + exclusive ? false, + }: + if exclusive && (ipv4 == ipv6) then + builtins.throw "exclusive means one of ipv4 or ipv6 must be set, but not both" + else + '' + IPV4: bool = ${if ipv4 then "True" else "False"} + IPV6: bool = ${if ipv6 then "True" else "False"} + NGINX: bool = ${if nginx then "True" else "False"} + EXCLUSIVE: bool = ${if exclusive then "True" else "False"} + print(f"{IPV4=} {IPV6=} {EXCLUSIVE=}") - # ensure base DNS records area available - with subtest("query base DNS records"): - machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") - machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") - machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") + CURL: str = "curl --fail --no-progress-meter --show-error" - # ensure webnsupdate managed records are missing - with subtest("query webnsupdate DNS records (fail)"): - machine.fail("dig @127.0.0.1 test1.${testDomain} A test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} A test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} A test3.${testDomain} AAAA | grep ^test3.${testDomain}") + machine.start(allow_reboot=True) + machine.wait_for_unit("bind.service") + machine.wait_for_unit("webnsupdate.service") - with subtest("update webnsupdate DNS records (invalid auth)"): - machine.fail("curl --fail --silent -u test1:test1 -X GET http://localhost:5353/update") - machine.fail("cat ${lastIPPath}") # no last-ip set yet + STATIC_DOMAINS: list[str] = ["${testDomain}", "ns1.${testDomain}", "nsupdate.${testDomain}"] + DYNAMIC_DOMAINS: list[str] = ["test1.${testDomain}", "test2.${testDomain}", "test3.${testDomain}"] - # ensure webnsupdate managed records are missing - with subtest("query webnsupdate DNS records (fail)"): - machine.fail("dig @127.0.0.1 test1.${testDomain} A test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} A test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} A test3.${testDomain} AAAA | grep ^test3.${testDomain}") + def domain_available(domain: str, record: str): + machine.succeed(f"dig @localhost {record} {domain} | grep ^{domain}") - with subtest("update webnsupdate DNS records (valid auth)"): - machine.succeed("curl --fail --silent -u test:test -X GET http://localhost:5353/update") + def domain_missing(domain: str, record: str): + machine.fail(f"dig @localhost {record} {domain} +noall +noanswer | grep ^{domain}") + + def update_records(domain: str="localhost", path: str="update"): + machine.succeed(f"{CURL} -u test:test -X GET http://{domain}{"" if NGINX else ":5353"}/{path}") + machine.succeed("cat ${lastIPPath}") + + def update_records_fail(domain: str="localhost", identity: str="test:test", path: str="update"): + machine.fail(f"{CURL} -u {identity} -X GET http://{domain}{"" if NGINX else ":5353"}/{path}") + machine.fail("cat ${lastIPPath}") + + def invalid_update(domain: str="localhost"): + update_records_fail(domain, identity="bad_user:test") + update_records_fail(domain, identity="test:bad_pass") + + # Tests + + with subtest("static DNS records are available"): + print(f"{IPV4=} {IPV6=} {EXCLUSIVE=}") + for domain in STATIC_DOMAINS: + domain_available(domain, "A") # IPv4 + domain_available(domain, "AAAA") # IPv6 + + with subtest("dynamic DNS records are missing"): + print(f"{IPV4=} {IPV6=} {EXCLUSIVE=}") + for domain in DYNAMIC_DOMAINS: + domain_missing(domain, "A") # IPv4 + domain_missing(domain, "AAAA") # IPv6 + + with subtest("invalid auth fails to update records"): + print(f"{IPV4=} {IPV6=} {EXCLUSIVE=}") + invalid_update() + for domain in DYNAMIC_DOMAINS: + domain_missing(domain, "A") # IPv4 + domain_missing(domain, "AAAA") # IPv6 + + if EXCLUSIVE: + with subtest("exclusive IP version fails to update with invalid version"): + print(f"{IPV4=} {IPV6=} {EXCLUSIVE=}") + if IPV6: + update_records_fail("127.0.0.1") + if IPV4: + update_records_fail("[::1]") + + with subtest("valid auth updates records"): + print(f"{IPV4=} {IPV6=} {EXCLUSIVE=}") + if IPV4: + update_records("127.0.0.1") + if IPV6: + update_records("[::1]") + + for domain in DYNAMIC_DOMAINS: + if IPV4: + domain_available(domain, "A") + elif IPV6 and EXCLUSIVE: + domain_missing(domain, "A") + + if IPV6: + domain_available(domain, "AAAA") + elif IPV4 and EXCLUSIVE: + domain_missing(domain, "AAAA") + + machine.reboot() + machine.succeed("cat ${lastIPPath}") + machine.wait_for_unit("webnsupdate.service") machine.succeed("cat ${lastIPPath}") - # ensure webnsupdate managed records are available - with subtest("query webnsupdate DNS records (succeed)"): - machine.succeed("dig @127.0.0.1 test1.${testDomain} A test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.succeed("dig @127.0.0.1 test2.${testDomain} A test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.succeed("dig @127.0.0.1 test3.${testDomain} A test3.${testDomain} AAAA | grep ^test3.${testDomain}") + with subtest("static DNS records are available after reboot"): + print(f"{IPV4=} {IPV6=} {EXCLUSIVE=}") + for domain in STATIC_DOMAINS: + domain_available(domain, "A") # IPv4 + domain_available(domain, "AAAA") # IPv6 - machine.reboot() - machine.succeed("cat ${lastIPPath}") - machine.wait_for_unit("webnsupdate.service") - machine.succeed("cat ${lastIPPath}") + with subtest("dynamic DNS records are available after reboot"): + print(f"{IPV4=} {IPV6=} {EXCLUSIVE=}") + for domain in DYNAMIC_DOMAINS: + if IPV4: + domain_available(domain, "A") + elif IPV6 and EXCLUSIVE: + domain_missing(domain, "A") - # ensure base DNS records area available after a reboot - with subtest("query base DNS records"): - machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") - machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") - machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") - - # ensure webnsupdate managed records are available after a reboot - with subtest("query webnsupdate DNS records (succeed)"): - machine.succeed("dig @127.0.0.1 test1.${testDomain} A test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.succeed("dig @127.0.0.1 test2.${testDomain} A test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.succeed("dig @127.0.0.1 test3.${testDomain} A test3.${testDomain} AAAA | grep ^test3.${testDomain}") - ''; + if IPV6: + domain_available(domain, "AAAA") + elif IPV4 and EXCLUSIVE: + domain_missing(domain, "AAAA") + ''; in { - module-ipv4-test = pkgs.testers.runNixOSTest { + module-ipv4-test = pkgs.testers.nixosTest { name = "webnsupdate-ipv4-module"; nodes.machine = webnsupdate-ipv4-machine; - inherit testScript; + testScript = testTemplate { ipv4 = true; }; }; - module-ipv6-test = pkgs.testers.runNixOSTest { + module-ipv6-test = pkgs.testers.nixosTest { name = "webnsupdate-ipv6-module"; nodes.machine = webnsupdate-ipv6-machine; - inherit testScript; + testScript = testTemplate { ipv6 = true; }; }; - module-nginx-test = pkgs.testers.runNixOSTest { + module-nginx-test = pkgs.testers.nixosTest { name = "webnsupdate-nginx-module"; nodes.machine = webnsupdate-nginx-machine; - testScript = '' - machine.start(allow_reboot=True) - machine.wait_for_unit("bind.service") - machine.wait_for_unit("webnsupdate.service") - - # ensure base DNS records area available - with subtest("query base DNS records"): - machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") - machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") - machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") - - # ensure webnsupdate managed records are missing - with subtest("query webnsupdate DNS records (fail)"): - machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") - machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") - - with subtest("update webnsupdate DNS records (invalid auth)"): - machine.fail("curl --fail --silent -u test1:test1 -X GET http://127.0.0.1/update") - machine.fail("cat ${lastIPPath}") # no last-ip set yet - - # ensure webnsupdate managed records are missing - with subtest("query webnsupdate DNS records (fail)"): - machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") - machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") - - with subtest("update webnsupdate IPv4 DNS records (valid auth)"): - machine.succeed("curl --fail --silent -u test:test -X GET http://127.0.0.1/update") - machine.succeed("cat ${lastIPPath}") - - # ensure webnsupdate managed IPv4 records are available - with subtest("query webnsupdate IPv4 DNS records (succeed)"): - machine.succeed("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") - machine.succeed("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") - machine.succeed("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") - - # ensure webnsupdate managed IPv6 records are missing - with subtest("query webnsupdate IPv6 DNS records (fail)"): - machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") - - with subtest("update webnsupdate IPv6 DNS records (valid auth)"): - machine.succeed("curl --fail --silent -u test:test -X GET http://[::1]/update") - machine.succeed("cat ${lastIPPath}") - - # ensure webnsupdate managed IPv6 records are missing - with subtest("query webnsupdate IPv6 DNS records (fail)"): - machine.succeed("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.succeed("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.succeed("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") - - machine.reboot() - machine.succeed("cat ${lastIPPath}") - machine.wait_for_unit("webnsupdate.service") - machine.succeed("cat ${lastIPPath}") - - # ensure base DNS records area available after a reboot - with subtest("query base DNS records"): - machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") - machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") - machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") - - # ensure webnsupdate managed records are available after a reboot - with subtest("query webnsupdate DNS records (succeed)"): - machine.succeed("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") - machine.succeed("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") - machine.succeed("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") - machine.succeed("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.succeed("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.succeed("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") - ''; + testScript = testTemplate { + ipv4 = true; + ipv6 = true; + nginx = true; + }; }; - module-ipv4-only-test = pkgs.testers.runNixOSTest { + module-ipv4-only-test = pkgs.testers.nixosTest { name = "webnsupdate-ipv4-only-module"; nodes.machine = webnsupdate-ipv4-only-machine; - testScript = '' - machine.start(allow_reboot=True) - machine.wait_for_unit("bind.service") - machine.wait_for_unit("webnsupdate.service") - - # ensure base DNS records area available - with subtest("query base DNS records"): - machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") - machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") - machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") - - # ensure webnsupdate managed records are missing - with subtest("query webnsupdate DNS records (fail)"): - machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") - machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") - - with subtest("update webnsupdate DNS records (invalid auth)"): - machine.fail("curl --fail --silent -u test1:test1 -X GET http://127.0.0.1/update") - machine.fail("cat ${lastIPPath}") # no last-ip set yet - - # ensure webnsupdate managed records are missing - with subtest("query webnsupdate DNS records (fail)"): - machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") - machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") - - with subtest("update webnsupdate IPv6 DNS records (valid auth)"): - machine.fail("curl --fail --silent -u test:test -X GET http://[::1]/update") - machine.fail("cat ${lastIPPath}") - - # ensure webnsupdate managed IPv6 records are missing - with subtest("query webnsupdate IPv6 DNS records (fail)"): - machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") - - with subtest("update webnsupdate IPv4 DNS records (valid auth)"): - machine.succeed("curl --fail --silent -u test:test -X GET http://127.0.0.1/update") - machine.succeed("cat ${lastIPPath}") - - # ensure webnsupdate managed IPv4 records are available - with subtest("query webnsupdate IPv4 DNS records (succeed)"): - machine.succeed("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") - machine.succeed("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") - machine.succeed("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") - - # ensure webnsupdate managed IPv6 records are missing - with subtest("query webnsupdate IPv6 DNS records (fail)"): - machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") - - machine.reboot() - machine.succeed("cat ${lastIPPath}") - machine.wait_for_unit("webnsupdate.service") - machine.succeed("cat ${lastIPPath}") - - # ensure base DNS records area available after a reboot - with subtest("query base DNS records"): - machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") - machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") - machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") - - # ensure webnsupdate managed records are available after a reboot - with subtest("query webnsupdate DNS records (succeed)"): - machine.succeed("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") - machine.succeed("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") - machine.succeed("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") - machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") - ''; + testScript = testTemplate { + ipv4 = true; + nginx = true; + exclusive = true; + }; }; - module-ipv6-only-test = pkgs.testers.runNixOSTest { + module-ipv6-only-test = pkgs.testers.nixosTest { name = "webnsupdate-ipv6-only-module"; nodes.machine = webnsupdate-ipv6-only-machine; - testScript = '' - machine.start(allow_reboot=True) - machine.wait_for_unit("bind.service") - machine.wait_for_unit("webnsupdate.service") - - # ensure base DNS records area available - with subtest("query base DNS records"): - machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") - machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") - machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") - - # ensure webnsupdate managed records are missing - with subtest("query webnsupdate DNS records (fail)"): - machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") - machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") - - with subtest("update webnsupdate DNS records (invalid auth)"): - machine.fail("curl --fail --silent -u test1:test1 -X GET http://127.0.0.1/update") - machine.fail("cat ${lastIPPath}") # no last-ip set yet - - # ensure webnsupdate managed records are missing - with subtest("query webnsupdate DNS records (fail)"): - machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") - machine.fail("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") - - with subtest("update webnsupdate IPv4 DNS records (valid auth)"): - machine.fail("curl --fail --silent -u test:test -X GET http://127.0.0.1/update") - machine.fail("cat ${lastIPPath}") - - # ensure webnsupdate managed IPv4 records are missing - with subtest("query webnsupdate IPv4 DNS records (fail)"): - machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") - - with subtest("update webnsupdate IPv6 DNS records (valid auth)"): - machine.succeed("curl --fail --silent -u test:test -X GET http://[::1]/update") - machine.succeed("cat ${lastIPPath}") - - # ensure webnsupdate managed IPv6 records are available - with subtest("query webnsupdate IPv6 DNS records (succeed)"): - machine.succeed("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.succeed("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.succeed("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") - - # ensure webnsupdate managed IPv4 records are missing - with subtest("query webnsupdate IPv4 DNS records (fail)"): - machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") - - machine.reboot() - machine.succeed("cat ${lastIPPath}") - machine.wait_for_unit("webnsupdate.service") - machine.succeed("cat ${lastIPPath}") - - # ensure base DNS records area available after a reboot - with subtest("query base DNS records"): - machine.succeed("dig @127.0.0.1 ${testDomain} | grep ^${testDomain}") - machine.succeed("dig @127.0.0.1 ns1.${testDomain} | grep ^ns1.${testDomain}") - machine.succeed("dig @127.0.0.1 nsupdate.${testDomain} | grep ^nsupdate.${testDomain}") - - # ensure webnsupdate managed records are available after a reboot - with subtest("query webnsupdate DNS records (succeed)"): - machine.succeed("dig @127.0.0.1 test1.${testDomain} AAAA | grep ^test1.${testDomain}") - machine.succeed("dig @127.0.0.1 test2.${testDomain} AAAA | grep ^test2.${testDomain}") - machine.succeed("dig @127.0.0.1 test3.${testDomain} AAAA | grep ^test3.${testDomain}") - machine.fail("dig @127.0.0.1 test1.${testDomain} A | grep ^test1.${testDomain}") - machine.fail("dig @127.0.0.1 test2.${testDomain} A | grep ^test2.${testDomain}") - machine.fail("dig @127.0.0.1 test3.${testDomain} A | grep ^test3.${testDomain}") - ''; + testScript = testTemplate { + ipv6 = true; + nginx = true; + exclusive = true; + }; }; }; }; From 26566fd6124d14083723aefe59c099272bd15892 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 28 Jan 2025 19:00:24 +0100 Subject: [PATCH 064/178] fix(deps): update rust crate serde_json to v1.0.138 | datasource | package | from | to | | ---------- | ---------- | ------- | ------- | | crate | serde_json | 1.0.137 | 1.0.138 | --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index df31928..f427e8c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -794,9 +794,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.137" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", "memchr", From a39fa354e4fba02e09b452700928bfd8ef067302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Mon, 27 Jan 2025 18:49:46 +0100 Subject: [PATCH 065/178] feat(webnsupdate): add support for fritzbox style updates Update now optionally accepts query params (e.g. `/update?ipv4=1.2.3.4`) if present they will control how the update is made (only ipv4 and ipv6 are implemented right now). Closes #80 --- .forgejo/workflows/check.yml | 2 + flake-modules/tests.nix | 79 ++++++++++--- src/main.rs | 210 +++++++++++++++++++++++++++++++++-- 3 files changed, 268 insertions(+), 23 deletions(-) diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml index b61a4dc..342bcef 100644 --- a/.forgejo/workflows/check.yml +++ b/.forgejo/workflows/check.yml @@ -20,6 +20,8 @@ jobs: - 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@v4 - name: Check diff --git a/flake-modules/tests.nix b/flake-modules/tests.nix index 3d06218..5f0feef 100644 --- a/flake-modules/tests.nix +++ b/flake-modules/tests.nix @@ -158,18 +158,27 @@ STATIC_DOMAINS: list[str] = ["${testDomain}", "ns1.${testDomain}", "nsupdate.${testDomain}"] DYNAMIC_DOMAINS: list[str] = ["test1.${testDomain}", "test2.${testDomain}", "test3.${testDomain}"] - def domain_available(domain: str, record: str): - machine.succeed(f"dig @localhost {record} {domain} | grep ^{domain}") + 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 domain_missing(domain: str, record: str): - machine.fail(f"dig @localhost {record} {domain} +noall +noanswer | grep ^{domain}") + def curl_cmd(domain: str, identity: str, path: str, query: dict[str, str]) -> str: + from urllib.parse import urlencode + q= f"?{urlencode(query)}" if query else "" + return f"{CURL} -u {identity} -X GET 'http://{domain}{"" if NGINX else ":5353"}/{path}{q}'" - def update_records(domain: str="localhost", path: str="update"): - machine.succeed(f"{CURL} -u test:test -X GET http://{domain}{"" if NGINX else ":5353"}/{path}") + def domain_available(domain: str, record: str, ip: str | None=None): + machine.succeed(dig_cmd(domain, record, ip)) + + def domain_missing(domain: str, record: str, ip: str | None=None): + machine.fail(dig_cmd(domain, record, ip)) + + def update_records(domain: str="localhost", /, *, path: str="update", **kwargs): + machine.succeed(curl_cmd(domain, "test:test", path, kwargs)) machine.succeed("cat ${lastIPPath}") - def update_records_fail(domain: str="localhost", identity: str="test:test", path: str="update"): - machine.fail(f"{CURL} -u {identity} -X GET http://{domain}{"" if NGINX else ":5353"}/{path}") + def update_records_fail(domain: str="localhost", /, *, identity: str="test:test", path: str="update", **kwargs): + machine.fail(curl_cmd(domain, identity, path, kwargs)) machine.fail("cat ${lastIPPath}") def invalid_update(domain: str="localhost"): @@ -181,8 +190,8 @@ with subtest("static DNS records are available"): print(f"{IPV4=} {IPV6=} {EXCLUSIVE=}") for domain in STATIC_DOMAINS: - domain_available(domain, "A") # IPv4 - domain_available(domain, "AAAA") # IPv6 + domain_available(domain, "A", "127.0.0.1") # IPv4 + domain_available(domain, "AAAA", "::1") # IPv6 with subtest("dynamic DNS records are missing"): print(f"{IPV4=} {IPV6=} {EXCLUSIVE=}") @@ -214,12 +223,50 @@ for domain in DYNAMIC_DOMAINS: if IPV4: - domain_available(domain, "A") + domain_available(domain, "A", "127.0.0.1") elif IPV6 and EXCLUSIVE: domain_missing(domain, "A") if IPV6: - domain_available(domain, "AAAA") + domain_available(domain, "AAAA", "::1") + elif IPV4 and EXCLUSIVE: + domain_missing(domain, "AAAA") + + with subtest("valid auth fritzbox compatible updates records"): + print(f"{IPV4=} {IPV6=} {EXCLUSIVE=}") + if IPV4 and IPV6: + update_records("127.0.0.1", domain="test", ipv4="1.2.3.4", ipv6="::1234") + elif IPV4: + update_records("127.0.0.1", ipv4="1.2.3.4") + elif IPV6: + update_records("[::1]", ipv6="::1234") + + for domain in DYNAMIC_DOMAINS: + if IPV4: + domain_available(domain, "A", "1.2.3.4") + elif IPV6 and EXCLUSIVE: + domain_missing(domain, "A") + + if IPV6: + domain_available(domain, "AAAA", "::1234") + elif IPV4 and EXCLUSIVE: + domain_missing(domain, "AAAA") + + with subtest("valid auth replaces records"): + print(f"{IPV4=} {IPV6=} {EXCLUSIVE=}") + if IPV4: + update_records("127.0.0.1") + if IPV6: + update_records("[::1]") + + for domain in DYNAMIC_DOMAINS: + if IPV4: + domain_available(domain, "A", "127.0.0.1") + elif IPV6 and EXCLUSIVE: + domain_missing(domain, "A") + + if IPV6: + domain_available(domain, "AAAA", "::1") elif IPV4 and EXCLUSIVE: domain_missing(domain, "AAAA") @@ -231,19 +278,19 @@ with subtest("static DNS records are available after reboot"): print(f"{IPV4=} {IPV6=} {EXCLUSIVE=}") for domain in STATIC_DOMAINS: - domain_available(domain, "A") # IPv4 - domain_available(domain, "AAAA") # IPv6 + domain_available(domain, "A", "127.0.0.1") # IPv4 + domain_available(domain, "AAAA", "::1") # IPv6 with subtest("dynamic DNS records are available after reboot"): print(f"{IPV4=} {IPV6=} {EXCLUSIVE=}") for domain in DYNAMIC_DOMAINS: if IPV4: - domain_available(domain, "A") + domain_available(domain, "A", "127.0.0.1") elif IPV6 and EXCLUSIVE: domain_missing(domain, "A") if IPV6: - domain_available(domain, "AAAA") + domain_available(domain, "AAAA", "::1") elif IPV4 and EXCLUSIVE: domain_missing(domain, "AAAA") ''; diff --git a/src/main.rs b/src/main.rs index 922b00f..d522390 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,7 +5,11 @@ use std::{ time::Duration, }; -use axum::{extract::State, routing::get, Router}; +use axum::{ + extract::{Query, State}, + routing::get, + Router, +}; use axum_client_ip::{SecureClientIp, SecureClientIpSource}; use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; use clap::{Parser, Subcommand}; @@ -410,19 +414,115 @@ fn main() -> Result<()> { .wrap_err("failed to run main loop") } +#[derive(Debug, serde::Deserialize)] +#[serde(deny_unknown_fields)] +struct FritzBoxUpdateParams { + /// The domain that should be updated + #[allow(unused)] + #[serde(default)] + domain: Option, + /// IPv4 address for the domain + #[serde(default)] + ipv4: Option, + /// IPv6 address for the domain + #[serde(default)] + ipv6: Option, + /// IPv6 prefix for the home network + #[allow(unused)] + #[serde(default)] + ipv6prefix: Option, + /// Whether the networks uses both IPv4 and IPv6 + #[allow(unused)] + #[serde(default)] + dualstack: Option, +} + +impl FritzBoxUpdateParams { + fn has_data(&self) -> bool { + let Self { + domain, + ipv4, + ipv6, + ipv6prefix, + dualstack, + } = self; + domain.is_some() + | ipv4.is_some() + | ipv6.is_some() + | ipv6prefix.is_some() + | dualstack.is_some() + } +} + #[tracing::instrument(skip(state), level = "trace", ret(level = "info"))] async fn update_records( State(state): State>, SecureClientIp(ip): SecureClientIp, + Query(update_params): Query, ) -> axum::response::Result<&'static str> { info!("accepted update from {ip}"); - if !state.ip_type.valid_for_type(ip) { - let ip_type = state.ip_type; - tracing::warn!("rejecting update from {ip} as we are running a {ip_type} filter"); - return Err((StatusCode::CONFLICT, format!("running in {ip_type} mode")).into()); + if !update_params.has_data() { + if !state.ip_type.valid_for_type(ip) { + tracing::warn!( + "rejecting update from {ip} as we are running a {} filter", + state.ip_type + ); + return Err(( + StatusCode::CONFLICT, + format!("running in {} mode", state.ip_type), + ) + .into()); + } + + return trigger_update(ip, &state).await; } + // FIXME: mark suspicious updates (where IP doesn't match the update_ip) and reject them based + // on policy + + let FritzBoxUpdateParams { + domain: _, + ipv4, + ipv6, + ipv6prefix: _, + dualstack: _, + } = update_params; + + if ipv4.is_none() && ipv6.is_none() { + return Err(( + StatusCode::BAD_REQUEST, + "failed to provide an IP for the update", + ) + .into()); + } + + if let Some(ip) = ipv4 { + let ip = IpAddr::V4(ip); + if !state.ip_type.valid_for_type(ip) { + tracing::warn!("requested update of IPv4 but we are {}", state.ip_type); + } + + _ = trigger_update(ip, &state).await?; + } + + if let Some(ip) = ipv6 { + let ip = IpAddr::V6(ip); + if !state.ip_type.valid_for_type(ip) { + tracing::warn!("requested update of IPv6 but we are {}", state.ip_type); + } + + _ = trigger_update(ip, &state).await?; + } + + Ok("Successfully updated IP of records!\n") +} + +#[tracing::instrument(skip(state), level = "trace", ret(level = "info"))] +async fn trigger_update( + ip: IpAddr, + state: &AppState<'static>, +) -> axum::response::Result<&'static str> { match nsupdate::nsupdate(ip, state.ttl, state.key_file, state.records).await { Ok(status) if status.success() => { let ips = { @@ -432,16 +532,17 @@ async fn update_records( ips.clone() }; + let ip_file = state.ip_file; tokio::task::spawn_blocking(move || { info!("updating last ips to {ips:?}"); let data = serde_json::to_vec(&ips).expect("invalid serialization impl"); - if let Err(err) = std::fs::write(state.ip_file, data) { + if let Err(err) = std::fs::write(ip_file, data) { error!("Failed to update last IP: {err}"); } info!("updated last ips to {ips:?}"); }); - Ok("successful update") + Ok("Successfully updated IP of records!\n") } Ok(status) => { error!("nsupdate failed with code {status}"); @@ -458,3 +559,98 @@ async fn update_records( .into()), } } + +#[cfg(test)] +mod parse_query_params { + use axum::extract::Query; + + use super::FritzBoxUpdateParams; + + #[test] + fn no_params() { + let uri = http::Uri::builder() + .path_and_query("/update") + .build() + .unwrap(); + let query: Query = Query::try_from_uri(&uri).unwrap(); + insta::assert_debug_snapshot!(query, @r#" + Query( + FritzBoxUpdateParams { + domain: None, + ipv4: None, + ipv6: None, + ipv6prefix: None, + dualstack: None, + }, + ) + "#); + } + + #[test] + fn ipv4() { + let uri = http::Uri::builder() + .path_and_query("/update?ipv4=1.2.3.4") + .build() + .unwrap(); + let query: Query = Query::try_from_uri(&uri).unwrap(); + insta::assert_debug_snapshot!(query, @r#" + Query( + FritzBoxUpdateParams { + domain: None, + ipv4: Some( + 1.2.3.4, + ), + ipv6: None, + ipv6prefix: None, + dualstack: None, + }, + ) + "#); + } + + #[test] + fn ipv6() { + let uri = http::Uri::builder() + .path_and_query("/update?ipv6=%3A%3A1234") + .build() + .unwrap(); + let query: Query = Query::try_from_uri(&uri).unwrap(); + insta::assert_debug_snapshot!(query, @r#" + Query( + FritzBoxUpdateParams { + domain: None, + ipv4: None, + ipv6: Some( + ::1234, + ), + ipv6prefix: None, + dualstack: None, + }, + ) + "#); + } + + #[test] + fn ipv4_and_ipv6() { + let uri = http::Uri::builder() + .path_and_query("/update?ipv4=1.2.3.4&ipv6=%3A%3A1234") + .build() + .unwrap(); + let query: Query = Query::try_from_uri(&uri).unwrap(); + insta::assert_debug_snapshot!(query, @r#" + Query( + FritzBoxUpdateParams { + domain: None, + ipv4: Some( + 1.2.3.4, + ), + ipv6: Some( + ::1234, + ), + ipv6prefix: None, + dualstack: None, + }, + ) + "#); + } +} From a6bb8bf817be3a77ef3ea3dfa3283615b63cd950 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 29 Jan 2025 00:00:30 +0100 Subject: [PATCH 066/178] 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 f427e8c..5ac26f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -399,9 +399,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.5" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" [[package]] name = "httpdate" @@ -411,9 +411,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "1.5.2" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" dependencies = [ "bytes", "futures-channel", @@ -768,9 +768,9 @@ checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" [[package]] name = "serde" @@ -1107,9 +1107,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11cd88e12b17c6494200a9c1b683a04fcac9573ed74cd1b62aeb2727c5592243" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" [[package]] name = "unicode-linebreak" diff --git a/flake.lock b/flake.lock index 75aaf2d..a0d93cd 100644 --- a/flake.lock +++ b/flake.lock @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1737483750, - "narHash": "sha256-5An1wq5U8sNycOBBg3nsDDgpwBmR9liOpDGlhliA6Xo=", + "lastModified": 1738070913, + "narHash": "sha256-j6jC12vCFsTGDmY2u1H12lMr62fnclNjuCtAdF1a4Nk=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "f2cc121df15418d028a59c9737d38e3a90fbaf8f", + "rev": "bebf27d00f7d10ba75332a0541ac43676985dea3", "type": "github" }, "original": { From 09bd450a46060dab667a528cd7ff09937c35563a Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 29 Jan 2025 23:00:44 +0100 Subject: [PATCH 067/178] chore(deps): lock file maintenance --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index a0d93cd..80c565d 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1737885589, - "narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=", + "lastModified": 1738021509, + "narHash": "sha256-JNUiceGsr7cVBUQxLBF1ILCe99E0qLxsVuet6GsZUuw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8", + "rev": "9db269672dbdbb519e0bd3ea24f01506c135e46f", "type": "github" }, "original": { From 2f970084759169e65e4d656cf1c00dcaa48f7428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Fri, 31 Jan 2025 21:04:36 +0100 Subject: [PATCH 068/178] fix(webnsupdate): make IP none when query is empty This happens when one of the IPs hasn't changed (but the other has) in the FRITZ!Box DDNS client. --- src/main.rs | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index d522390..0a21937 100644 --- a/src/main.rs +++ b/src/main.rs @@ -414,6 +414,24 @@ fn main() -> Result<()> { .wrap_err("failed to run main loop") } +/// Serde deserialization decorator to map empty Strings to None, +/// +/// Adapted from: +fn empty_string_as_none<'de, D, T>(de: D) -> Result, D::Error> +where + D: serde::Deserializer<'de>, + T: std::str::FromStr, + T::Err: std::fmt::Display, +{ + use serde::Deserialize; + + let opt = Option::>::deserialize(de)?; + match opt.as_deref() { + None | Some("") => Ok(None), + Some(s) => s.parse::().map_err(serde::de::Error::custom).map(Some), + } +} + #[derive(Debug, serde::Deserialize)] #[serde(deny_unknown_fields)] struct FritzBoxUpdateParams { @@ -422,10 +440,10 @@ struct FritzBoxUpdateParams { #[serde(default)] domain: Option, /// IPv4 address for the domain - #[serde(default)] + #[serde(default, deserialize_with = "empty_string_as_none")] ipv4: Option, /// IPv6 address for the domain - #[serde(default)] + #[serde(default, deserialize_with = "empty_string_as_none")] ipv6: Option, /// IPv6 prefix for the home network #[allow(unused)] @@ -653,4 +671,48 @@ mod parse_query_params { ) "#); } + + #[test] + fn ipv4_and_empty_ipv6() { + let uri = http::Uri::builder() + .path_and_query("/update?ipv4=1.2.3.4&ipv6=") + .build() + .unwrap(); + let query: Query = Query::try_from_uri(&uri).unwrap(); + insta::assert_debug_snapshot!(query, @r#" + Query( + FritzBoxUpdateParams { + domain: None, + ipv4: Some( + 1.2.3.4, + ), + ipv6: None, + ipv6prefix: None, + dualstack: None, + }, + ) + "#); + } + + #[test] + fn empty_ipv4_and_ipv6() { + let uri = http::Uri::builder() + .path_and_query("/update?ipv4=&ipv6=%3A%3A1234") + .build() + .unwrap(); + let query: Query = Query::try_from_uri(&uri).unwrap(); + insta::assert_debug_snapshot!(query, @r#" + Query( + FritzBoxUpdateParams { + domain: None, + ipv4: None, + ipv6: Some( + ::1234, + ), + ipv6prefix: None, + dualstack: None, + }, + ) + "#); + } } From 70ed898f1d5b057977c9fd1ed1791ca27eac748b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Fri, 31 Jan 2025 21:04:36 +0100 Subject: [PATCH 069/178] fix(tests): add case for when query has empty string This is produced by the FRITZ!Box DDNS client. --- flake-modules/tests.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake-modules/tests.nix b/flake-modules/tests.nix index 5f0feef..45fc5ff 100644 --- a/flake-modules/tests.nix +++ b/flake-modules/tests.nix @@ -237,9 +237,9 @@ if IPV4 and IPV6: update_records("127.0.0.1", domain="test", ipv4="1.2.3.4", ipv6="::1234") elif IPV4: - update_records("127.0.0.1", ipv4="1.2.3.4") + update_records("127.0.0.1", ipv4="1.2.3.4", ipv6="") elif IPV6: - update_records("[::1]", ipv6="::1234") + update_records("[::1]", ipv4="", ipv6="::1234") for domain in DYNAMIC_DOMAINS: if IPV4: From 13c9c544a7e7ce1f8e34e7d38762d54e78d77bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Fri, 31 Jan 2025 21:45:47 +0100 Subject: [PATCH 070/178] fix(webnsupdate): updating IPv6 in ipv4-only mode Dumb logic error T-T. --- src/main.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0a21937..bea4268 100644 --- a/src/main.rs +++ b/src/main.rs @@ -517,20 +517,20 @@ async fn update_records( if let Some(ip) = ipv4 { let ip = IpAddr::V4(ip); - if !state.ip_type.valid_for_type(ip) { + if state.ip_type.valid_for_type(ip) { + _ = trigger_update(ip, &state).await?; + } else { tracing::warn!("requested update of IPv4 but we are {}", state.ip_type); } - - _ = trigger_update(ip, &state).await?; } if let Some(ip) = ipv6 { let ip = IpAddr::V6(ip); - if !state.ip_type.valid_for_type(ip) { + if state.ip_type.valid_for_type(ip) { + _ = trigger_update(ip, &state).await?; + } else { tracing::warn!("requested update of IPv6 but we are {}", state.ip_type); } - - _ = trigger_update(ip, &state).await?; } Ok("Successfully updated IP of records!\n") @@ -566,13 +566,13 @@ async fn trigger_update( error!("nsupdate failed with code {status}"); Err(( StatusCode::INTERNAL_SERVER_ERROR, - "nsupdate failed, check server logs", + "nsupdate failed, check server logs\n", ) .into()) } Err(error) => Err(( StatusCode::INTERNAL_SERVER_ERROR, - format!("failed to update records: {error}"), + format!("failed to update records: {error}\n"), ) .into()), } From d2f6c3cd663c7389ffb0ff1e21045306691ff9d7 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 31 Jan 2025 22:00:20 +0100 Subject: [PATCH 071/178] 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 5ac26f5..7f9c6bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,9 +185,9 @@ checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cc" -version = "1.2.10" +version = "1.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" +checksum = "e4730490333d58093109dc02c23174c3f4d490998c3fed3cc8e82d57afedb9cf" dependencies = [ "shlex", ] diff --git a/flake.lock b/flake.lock index 80c565d..5314233 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1738021509, - "narHash": "sha256-JNUiceGsr7cVBUQxLBF1ILCe99E0qLxsVuet6GsZUuw=", + "lastModified": 1738142207, + "narHash": "sha256-NGqpVVxNAHwIicXpgaVqJEJWeyqzoQJ9oc8lnK9+WC4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9db269672dbdbb519e0bd3ea24f01506c135e46f", + "rev": "9d3ae807ebd2981d593cddd0080856873139aa40", "type": "github" }, "original": { From 5655d7de674afca453c97d5867d7d034b90f6c88 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 1 Feb 2025 04:20:25 +0100 Subject: [PATCH 072/178] fix(deps): update rust crate miette to v7.5.0 | datasource | package | from | to | | ---------- | ------- | ----- | ----- | | crate | miette | 7.4.0 | 7.5.0 | --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7f9c6bd..275c634 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]] @@ -528,9 +528,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" -version = "7.4.0" +version = "7.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317f146e2eb7021892722af37cf1b971f0a70c8406f487e24952667616192c64" +checksum = "1a955165f87b37fd1862df2a59547ac542c77ef6d17c666f619d1ad22dd89484" dependencies = [ "backtrace", "backtrace-ext", @@ -548,9 +548,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "7.4.0" +version = "7.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c9b935fbe1d6cbd1dac857b54a688145e2d93f48db36010514d0f612d0ad67" +checksum = "bf45bf44ab49be92fd1227a3be6fc6f617f1a337c06af54981048574d8783147" dependencies = [ "proc-macro2", "quote", @@ -757,7 +757,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] From d8630aa8cbfe3ac3df656510d5412af2df36612a Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 1 Feb 2025 23:00:21 +0100 Subject: [PATCH 073/178] chore(deps): lock file maintenance --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 275c634..57d1bd9 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]] @@ -757,7 +757,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -907,9 +907,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.96" +version = "2.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "5dabd04e3b9a8c3c03d5e743f5ef5e1207befc9de704d477f7198cc28049763e" dependencies = [ "proc-macro2", "quote", From 72aa4f365e257f1dda51fc8915a7c7b7588cb6dd Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 3 Feb 2025 23:50:29 +0100 Subject: [PATCH 074/178] fix(deps): update rust crate clap to v4.5.28 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | clap | 4.5.27 | 4.5.28 | --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 57d1bd9..159191b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,9 +200,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.27" +version = "4.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" +checksum = "3e77c3243bd94243c03672cb5154667347c457ca271254724f9f393aee1c05ff" dependencies = [ "clap_builder", "clap_derive", @@ -232,9 +232,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.24" +version = "4.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" +checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" 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]] @@ -757,7 +757,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] From d56af9ecfef34e20a9cb83ce305d187cf0dae875 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 4 Feb 2025 00:00:46 +0100 Subject: [PATCH 075/178] chore(deps): lock file maintenance --- Cargo.lock | 20 ++++++++++---------- flake.lock | 12 ++++++------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 159191b..d494a9c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -179,9 +179,9 @@ checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bytes" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" [[package]] name = "cc" @@ -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]] @@ -634,18 +634,18 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e2ec53ad785f4d35dac0adea7f7dc6f1bb277ad84a680c7afefeae05d1f5916" +checksum = "dfe2e71e1471fe07709406bf725f710b02927c9c54b2b5b2ec0e8087d97c327d" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56a66c0c55993aa927429d0f8a0abfd74f084e4d9c192cffed01e418d83eefb" +checksum = "f6e859e6e5bd50440ab63c47e3ebabc90f26251f7c73c3d3e837b74a1cc3fa67" dependencies = [ "proc-macro2", "quote", @@ -757,7 +757,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -907,9 +907,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.97" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dabd04e3b9a8c3c03d5e743f5ef5e1207befc9de704d477f7198cc28049763e" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", diff --git a/flake.lock b/flake.lock index 5314233..33891ea 100644 --- a/flake.lock +++ b/flake.lock @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1736143030, - "narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=", + "lastModified": 1738453229, + "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de", + "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1738142207, - "narHash": "sha256-NGqpVVxNAHwIicXpgaVqJEJWeyqzoQJ9oc8lnK9+WC4=", + "lastModified": 1738410390, + "narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9d3ae807ebd2981d593cddd0080856873139aa40", + "rev": "3a228057f5b619feb3186e986dbe76278d707b6e", "type": "github" }, "original": { From 48c2e5be4d88df292edb0077869b887285241a49 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 4 Feb 2025 23:00:40 +0100 Subject: [PATCH 076/178] 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 d494a9c..32cf25c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,9 +185,9 @@ checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" [[package]] name = "cc" -version = "1.2.11" +version = "1.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4730490333d58093109dc02c23174c3f4d490998c3fed3cc8e82d57afedb9cf" +checksum = "755717a7de9ec452bf7f3f1a3099085deabd7f2962b861dae91ecd7a365903d2" dependencies = [ "shlex", ] diff --git a/flake.lock b/flake.lock index 33891ea..31c94b6 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1737689766, - "narHash": "sha256-ivVXYaYlShxYoKfSo5+y5930qMKKJ8CLcAoIBPQfJ6s=", + "lastModified": 1738652123, + "narHash": "sha256-zdZek5FXK/k95J0vnLF0AMnYuZl4AjARq83blKuJBYY=", "owner": "ipetkov", "repo": "crane", - "rev": "6fe74265bbb6d016d663b1091f015e2976c4a527", + "rev": "c7e015a5fcefb070778c7d91734768680188a9cd", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1738410390, - "narHash": "sha256-xvTo0Aw0+veek7hvEVLzErmJyQkEcRk6PSR4zsRQFEc=", + "lastModified": 1738546358, + "narHash": "sha256-nLivjIygCiqLp5QcL7l56Tca/elVqM9FG1hGd9ZSsrg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3a228057f5b619feb3186e986dbe76278d707b6e", + "rev": "c6e957d81b96751a3d5967a0fd73694f303cc914", "type": "github" }, "original": { @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1738070913, - "narHash": "sha256-j6jC12vCFsTGDmY2u1H12lMr62fnclNjuCtAdF1a4Nk=", + "lastModified": 1738680491, + "narHash": "sha256-8X7tR3kFGkE7WEF5EXVkt4apgaN85oHZdoTGutCFs6I=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "bebf27d00f7d10ba75332a0541ac43676985dea3", + "rev": "64dbb922d51a42c0ced6a7668ca008dded61c483", "type": "github" }, "original": { From b775f8e81127b288a6e9eba6339fd7328349dbaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Wed, 5 Feb 2025 21:51:07 +0100 Subject: [PATCH 077/178] refactor(nsupdate): send all commands at once This ensures `nsupdate` is only called once per IP update (even for both IPv4 and IPv6 in a single call). --- Cargo.toml | 6 +-- src/main.rs | 35 ++++++++-------- src/nsupdate.rs | 105 ++++++++++++++++++++++++++++++++++-------------- 3 files changed, 96 insertions(+), 50 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f435dbf..dd4bde5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,10 +27,10 @@ clap-verbosity-flag = { version = "3", default-features = false, features = [ http = "1" miette = { version = "7", features = ["fancy"] } ring = { version = "0.17", features = ["std"] } -serde = { version = "1.0.217", features = ["derive"] } -serde_json = "1.0.137" +serde = { version = "1", features = ["derive"] } +serde_json = "1" tokio = { version = "1", features = ["macros", "rt", "process", "io-util"] } -tower-http = { version = "0.6.2", features = ["validate-request"] } +tower-http = { version = "0.6", features = ["validate-request"] } tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/src/main.rs b/src/main.rs index bea4268..7718175 100644 --- a/src/main.rs +++ b/src/main.rs @@ -366,25 +366,25 @@ fn main() -> Result<()> { rt.block_on(async { // Update DNS record with previous IPs (if available) let ips = state.last_ips.lock().await.clone(); - for ip in ips.ips() { - if !ip_type.valid_for_type(ip) { - continue; - } - match nsupdate::nsupdate(ip, state.ttl, state.key_file, state.records).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"); + let actions = ips + .ips() + .filter(|ip| ip_type.valid_for_type(*ip)) + .flat_map(|ip| nsupdate::Action::from_records(ip, state.ttl, state.records)); + + 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"); + } } // Create services @@ -541,7 +541,8 @@ async fn trigger_update( ip: IpAddr, state: &AppState<'static>, ) -> axum::response::Result<&'static str> { - match nsupdate::nsupdate(ip, state.ttl, state.key_file, state.records).await { + let actions = nsupdate::Action::from_records(ip, state.ttl, state.records); + match nsupdate::nsupdate(state.key_file, actions).await { Ok(status) if status.success() => { let ips = { // Update state diff --git a/src/nsupdate.rs b/src/nsupdate.rs index 62395b7..74397fa 100644 --- a/src/nsupdate.rs +++ b/src/nsupdate.rs @@ -9,12 +9,51 @@ use std::{ use tokio::io::AsyncWriteExt; use tracing::{debug, warn}; -#[tracing::instrument(level = "trace", ret(level = "warn"))] +pub enum Action<'a> { + // Reassign a domain to a different IP + Reassign { + domain: &'a str, + to: IpAddr, + ttl: Duration, + }, +} + +impl<'a> Action<'a> { + /// Create a set of [`Action`]s reassigning the domains in `records` to the specified + /// [`IpAddr`] + pub fn from_records( + to: IpAddr, + ttl: Duration, + records: &'a [&'a str], + ) -> impl IntoIterator + 'a { + records + .iter() + .map(move |&domain| Action::Reassign { domain, to, ttl }) + } +} + +impl std::fmt::Display for Action<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Action::Reassign { domain, to, ttl } => { + let ttl = ttl.as_secs(); + let typ = match to { + IpAddr::V4(_) => "A", + IpAddr::V6(_) => "AAAA", + }; + // Delete previous record of type `typ` + writeln!(f, "update delete {domain} {ttl} IN {typ}")?; + // Add record with new IP + writeln!(f, "update add {domain} {ttl} IN {typ} {to}") + } + } + } +} + +#[tracing::instrument(level = "trace", skip(actions), ret(level = "warn"))] pub async fn nsupdate( - ip: IpAddr, - ttl: Duration, key_file: Option<&Path>, - records: &[&str], + actions: impl IntoIterator>, ) -> std::io::Result { let mut cmd = tokio::process::Command::new("nsupdate"); if let Some(key_file) = key_file { @@ -27,10 +66,13 @@ pub async fn nsupdate( .inspect_err(|err| warn!("failed to spawn child: {err}"))?; let mut stdin = child.stdin.take().expect("stdin not present"); debug!("sending update request"); + let mut buf = Vec::new(); + update_ns_records(&mut buf, actions).unwrap(); stdin - .write_all(update_ns_records(ip, ttl, records).as_bytes()) + .write_all(&buf) .await .inspect_err(|err| warn!("failed to write to the stdin of nsupdate: {err}"))?; + debug!("closing stdin"); stdin .shutdown() @@ -43,21 +85,16 @@ pub async fn nsupdate( .inspect_err(|err| warn!("failed to wait for child: {err}")) } -fn update_ns_records(ip: IpAddr, ttl: Duration, records: &[&str]) -> String { - use std::fmt::Write; - let ttl_s: u64 = ttl.as_secs(); - - let rec_type = match ip { - IpAddr::V4(_) => "A", - IpAddr::V6(_) => "AAAA", - }; - let mut cmds = String::from("server 127.0.0.1\n"); - for &record in records { - writeln!(cmds, "update delete {record} {ttl_s} IN {rec_type}").unwrap(); - writeln!(cmds, "update add {record} {ttl_s} IN {rec_type} {ip}").unwrap(); +fn update_ns_records<'a>( + mut buf: impl std::io::Write, + actions: impl IntoIterator>, +) -> std::io::Result<()> { + writeln!(buf, "server 127.0.0.1")?; + for action in actions { + writeln!(buf, "{action}")?; } - writeln!(cmds, "send\nquit").unwrap(); - cmds + writeln!(buf, "send")?; + writeln!(buf, "quit") } #[cfg(test)] @@ -66,17 +103,21 @@ mod test { use insta::assert_snapshot; - use super::update_ns_records; + use super::{update_ns_records, Action}; use crate::DEFAULT_TTL; #[test] #[allow(non_snake_case)] fn expected_update_string_A() { - assert_snapshot!(update_ns_records( - IpAddr::V4(Ipv4Addr::LOCALHOST), - DEFAULT_TTL, - &["example.com.", "example.org.", "example.net."], - ), @r###" + let mut buf = Vec::new(); + let actions = Action::from_records( + IpAddr::V4(Ipv4Addr::LOCALHOST), + DEFAULT_TTL, + &["example.com.", "example.org.", "example.net."], + ); + update_ns_records(&mut buf, actions).unwrap(); + + assert_snapshot!(String::from_utf8(buf).unwrap(), @r###" server 127.0.0.1 update delete example.com. 60 IN A update add example.com. 60 IN A 127.0.0.1 @@ -92,11 +133,15 @@ mod test { #[test] #[allow(non_snake_case)] fn expected_update_string_AAAA() { - assert_snapshot!(update_ns_records( - IpAddr::V6(Ipv6Addr::LOCALHOST), - DEFAULT_TTL, - &["example.com.", "example.org.", "example.net."], - ), @r###" + let mut buf = Vec::new(); + let actions = Action::from_records( + IpAddr::V6(Ipv6Addr::LOCALHOST), + DEFAULT_TTL, + &["example.com.", "example.org.", "example.net."], + ); + update_ns_records(&mut buf, actions).unwrap(); + + assert_snapshot!(String::from_utf8(buf).unwrap(), @r###" server 127.0.0.1 update delete example.com. 60 IN AAAA update add example.com. 60 IN AAAA ::1 From 172076eaad10830a97f75540fd63092512347bd5 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 078/178] feat(webnsupdate): parse IPv6 prefixes This allows us to better support IPv6 from fritzbox updates in the future. --- src/main.rs | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 7718175..cf37707 100644 --- a/src/main.rs +++ b/src/main.rs @@ -285,6 +285,37 @@ fn load_ip(path: &Path) -> Result> { .map(Some) } +#[derive(Clone, Copy, Debug)] +struct Ipv6Prefix { + prefix: Ipv6Addr, + length: u32, +} + +impl std::fmt::Display for Ipv6Prefix { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let Self { prefix, length } = self; + write!(f, "{prefix}/{length}") + } +} + +impl std::str::FromStr for Ipv6Prefix { + type Err = miette::Error; + + fn from_str(s: &str) -> std::result::Result { + let (addr, len) = s.split_once('/').wrap_err("missing `/` in ipv6 prefix")?; + Ok(Self { + prefix: addr + .parse() + .into_diagnostic() + .wrap_err("invalid ipv6 address for ipv6 prefix")?, + length: len + .parse() + .into_diagnostic() + .wrap_err("invalid length for ipv6 prefix")?, + }) + } +} + #[tracing::instrument(err)] fn main() -> Result<()> { // set panic hook to pretty print with miette's formatter @@ -437,7 +468,7 @@ where struct FritzBoxUpdateParams { /// The domain that should be updated #[allow(unused)] - #[serde(default)] + #[serde(default, deserialize_with = "empty_string_as_none")] domain: Option, /// IPv4 address for the domain #[serde(default, deserialize_with = "empty_string_as_none")] @@ -447,11 +478,11 @@ struct FritzBoxUpdateParams { ipv6: Option, /// IPv6 prefix for the home network #[allow(unused)] - #[serde(default)] - ipv6prefix: Option, + #[serde(default, deserialize_with = "empty_string_as_none")] + ipv6prefix: Option, /// Whether the networks uses both IPv4 and IPv6 #[allow(unused)] - #[serde(default)] + #[serde(default, deserialize_with = "empty_string_as_none")] dualstack: Option, } From 738fa8accfbaee220b44f50d9ce739d85b0f6d62 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 5 Feb 2025 23:30:28 +0100 Subject: [PATCH 079/178] 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 080/178] 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 081/178] 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 082/178] 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 083/178] 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 084/178] 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 085/178] 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 086/178] 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 087/178] 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 088/178] 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 089/178] 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 090/178] 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 091/178] 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 092/178] 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 093/178] 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 094/178] 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 095/178] 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 096/178] 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 097/178] 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 098/178] 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 099/178] 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 100/178] 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 101/178] 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 102/178] 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 103/178] 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 104/178] 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 105/178] 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 106/178] 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 107/178] 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 108/178] 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 109/178] 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 110/178] 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 111/178] 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 112/178] 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 113/178] 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 114/178] 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 115/178] 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 116/178] 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 117/178] 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 118/178] 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 119/178] 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 120/178] 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 121/178] 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 122/178] 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 123/178] 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 124/178] 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 125/178] 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 126/178] 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 127/178] 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 128/178] 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 129/178] 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 130/178] 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 131/178] 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 132/178] 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 133/178] 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 134/178] 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 135/178] 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 f9da4aecd495e2b930d6a45769e0a4f7960c7e91 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 20 Mar 2025 22:00:15 +0100 Subject: [PATCH 136/178] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cad88f4..5967e09 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]] @@ -763,7 +763,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] From ba2babb0ae260aa1a2ff5ea5515787c2d06f1427 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 21 Mar 2025 22:00:34 +0100 Subject: [PATCH 137/178] 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 5967e09..c896856 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,9 +185,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" -version = "1.2.16" +version = "1.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" dependencies = [ "shlex", ] diff --git a/flake.lock b/flake.lock index 4c2f403..1fab824 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1742288794, - "narHash": "sha256-Txwa5uO+qpQXrNG4eumPSD+hHzzYi/CdaM80M9XRLCo=", + "lastModified": 1742422364, + "narHash": "sha256-mNqIplmEohk5jRkqYqG19GA8MbQ/D4gQSK0Mu4LvfRQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b6eaf97c6960d97350c584de1b6dcff03c9daf42", + "rev": "a84ebe20c6bc2ecbcfb000a50776219f48d134cc", "type": "github" }, "original": { From 5f2ec1089fb042120ebbd8c23fd671323531424f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 23 Mar 2025 22:00:37 +0100 Subject: [PATCH 138/178] chore(deps): lock file maintenance --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 1fab824..2f498d7 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1742422364, - "narHash": "sha256-mNqIplmEohk5jRkqYqG19GA8MbQ/D4gQSK0Mu4LvfRQ=", + "lastModified": 1742669843, + "narHash": "sha256-G5n+FOXLXcRx+3hCJ6Rt6ZQyF1zqQ0DL0sWAMn2Nk0w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a84ebe20c6bc2ecbcfb000a50776219f48d134cc", + "rev": "1e5b653dff12029333a6546c11e108ede13052eb", "type": "github" }, "original": { From 7dca0efdf234b3924b928fb2281c29a5c3c30b96 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 24 Mar 2025 22:00:31 +0100 Subject: [PATCH 139/178] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c896856..0eb02b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -508,9 +508,9 @@ checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" [[package]] name = "log" -version = "0.4.26" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "matchers" From caa7c1165f31495693e48e1debfb2c58ca0b3292 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 26 Mar 2025 20:20:14 +0100 Subject: [PATCH 140/178] fix(deps): update rust crate clap to v4.5.33 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | clap | 4.5.32 | 4.5.33 | --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0eb02b8..28c2bcc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,9 +200,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.32" +version = "4.5.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" +checksum = "e2c80cae4c3350dd8f1272c73e83baff9a6ba550b8bfbe651b3c45b78cd1751e" dependencies = [ "clap_builder", "clap_derive", @@ -220,9 +220,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.32" +version = "4.5.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" +checksum = "0123e386f691c90aa228219b5b1ee72d465e8e231c79e9c82324f016a62a741c" 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]] @@ -763,7 +763,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] From f356463079b2dbdae3a1f60978bbce591d0744b7 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 26 Mar 2025 22:00:30 +0100 Subject: [PATCH 141/178] 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 28c2bcc..07fa613 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]] @@ -763,7 +763,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 2f498d7..9b9905a 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1742669843, - "narHash": "sha256-G5n+FOXLXcRx+3hCJ6Rt6ZQyF1zqQ0DL0sWAMn2Nk0w=", + "lastModified": 1742889210, + "narHash": "sha256-hw63HnwnqU3ZQfsMclLhMvOezpM7RSB0dMAtD5/sOiw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1e5b653dff12029333a6546c11e108ede13052eb", + "rev": "698214a32beb4f4c8e3942372c694f40848b360d", "type": "github" }, "original": { @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1742370146, - "narHash": "sha256-XRE8hL4vKIQyVMDXykFh4ceo3KSpuJF3ts8GKwh5bIU=", + "lastModified": 1742982148, + "narHash": "sha256-aRA6LSxjlbMI6MmMzi/M5WH/ynd8pK+vACD9za3MKLQ=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "adc195eef5da3606891cedf80c0d9ce2d3190808", + "rev": "61c88349bf6dff49fa52d7dfc39b21026c2a8881", "type": "github" }, "original": { From fe58c295ff9e88542bac808e430f37c9d18ea678 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 27 Mar 2025 03:10:24 +0100 Subject: [PATCH 142/178] fix(deps): update rust crate clap to v4.5.34 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | clap | 4.5.33 | 4.5.34 | --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 07fa613..a4eda5d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,9 +200,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.33" +version = "4.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2c80cae4c3350dd8f1272c73e83baff9a6ba550b8bfbe651b3c45b78cd1751e" +checksum = "e958897981290da2a852763fe9cdb89cd36977a5d729023127095fa94d95e2ff" dependencies = [ "clap_builder", "clap_derive", @@ -220,9 +220,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.33" +version = "4.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0123e386f691c90aa228219b5b1ee72d465e8e231c79e9c82324f016a62a741c" +checksum = "83b0f35019843db2160b5bb19ae09b4e6411ac33fc6a712003c33e03090e2489" 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]] @@ -763,7 +763,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] From c5c51645ba8d8cdc0eb8b98df1dd6bc7c3581a3a Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 27 Mar 2025 22:00:14 +0100 Subject: [PATCH 143/178] 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 a4eda5d..9e82dfa 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]] @@ -617,9 +617,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.1" +version = "1.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +checksum = "c2806eaa3524762875e21c3dcd057bc4b7bfa01ce4da8d46be1cd43649e1cc6b" [[package]] name = "overload" @@ -763,7 +763,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 9b9905a..ca68dfb 100644 --- a/flake.lock +++ b/flake.lock @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1742982148, - "narHash": "sha256-aRA6LSxjlbMI6MmMzi/M5WH/ynd8pK+vACD9za3MKLQ=", + "lastModified": 1743081648, + "narHash": "sha256-WRAylyYptt6OX5eCEBWyTwOEqEtD6zt33rlUkr6u3cE=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "61c88349bf6dff49fa52d7dfc39b21026c2a8881", + "rev": "29a3d7b768c70addce17af0869f6e2bd8f5be4b7", "type": "github" }, "original": { From 6ac1133486f630384ecf99422599c0207d16f6be Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 28 Mar 2025 21:50:30 +0100 Subject: [PATCH 144/178] fix(deps): update rust crate axum to v0.8.3 | datasource | package | from | to | | ---------- | ------- | ----- | ----- | | crate | axum | 0.8.1 | 0.8.3 | --- Cargo.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9e82dfa..9dfe683 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -78,9 +78,9 @@ dependencies = [ [[package]] name = "axum" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d6fd624c75e18b3b4c6b9caf42b1afe24437daaee904069137d8bab077be8b8" +checksum = "de45108900e1f9b9242f7f2e254aa3e2c029c921c258fe9e6b4217eeebd54288" dependencies = [ "axum-core", "bytes", @@ -123,12 +123,12 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df1362f362fd16024ae199c1970ce98f9661bf5ef94b9808fee734bc3698b733" +checksum = "68464cd0412f486726fb3373129ef5d2993f90c34bc2bc1c1e9943b2f4fc7ca6" dependencies = [ "bytes", - "futures-util", + "futures-core", "http", "http-body", "http-body-util", From 269a37c92018812eca1f8540c89df13a20c036c7 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 28 Mar 2025 22:00:17 +0100 Subject: [PATCH 145/178] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9dfe683..f6567a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -617,9 +617,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2806eaa3524762875e21c3dcd057bc4b7bfa01ce4da8d46be1cd43649e1cc6b" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "overload" From 4ab2f709a9e545f04855bdf5b87cab05bca4ee5c Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 29 Mar 2025 22:00:33 +0100 Subject: [PATCH 146/178] chore(deps): lock file maintenance --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index ca68dfb..85277b9 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1742889210, - "narHash": "sha256-hw63HnwnqU3ZQfsMclLhMvOezpM7RSB0dMAtD5/sOiw=", + "lastModified": 1743095683, + "narHash": "sha256-gWd4urRoLRe8GLVC/3rYRae1h+xfQzt09xOfb0PaHSk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "698214a32beb4f4c8e3942372c694f40848b360d", + "rev": "5e5402ecbcb27af32284d4a62553c019a3a49ea6", "type": "github" }, "original": { From 2183c81d70fa6b60f05ebb5ee69e181a9d4784a8 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 30 Mar 2025 22:00:20 +0200 Subject: [PATCH 147/178] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f6567a6..20c9998 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -870,9 +870,9 @@ checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" [[package]] name = "socket2" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" dependencies = [ "libc", "windows-sys 0.52.0", From 5a98e8205fd3b50a37ae186418dc3fdf673f0bf5 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Mon, 31 Mar 2025 22:00:32 +0200 Subject: [PATCH 148/178] 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 20c9998..c9b5606 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -436,9 +436,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2" dependencies = [ "bytes", "futures-util", diff --git a/flake.lock b/flake.lock index 85277b9..1651f11 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1743095683, - "narHash": "sha256-gWd4urRoLRe8GLVC/3rYRae1h+xfQzt09xOfb0PaHSk=", + "lastModified": 1743315132, + "narHash": "sha256-6hl6L/tRnwubHcA4pfUUtk542wn2Om+D4UnDhlDW9BE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5e5402ecbcb27af32284d4a62553c019a3a49ea6", + "rev": "52faf482a3889b7619003c0daec593a1912fddc1", "type": "github" }, "original": { From 7dcd2c6a4c659f723d24b24e74492caec196015c Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 1 Apr 2025 19:20:25 +0200 Subject: [PATCH 149/178] fix(deps): update rust crate clap to v4.5.35 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | clap | 4.5.34 | 4.5.35 | --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c9b5606..c60da11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,9 +200,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.34" +version = "4.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e958897981290da2a852763fe9cdb89cd36977a5d729023127095fa94d95e2ff" +checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" dependencies = [ "clap_builder", "clap_derive", @@ -220,9 +220,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.34" +version = "4.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b0f35019843db2160b5bb19ae09b4e6411ac33fc6a712003c33e03090e2489" +checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" 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]] @@ -763,7 +763,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] From 3c9587bd4cd5ca8540d5542a57012aaf19a0d0f0 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 1 Apr 2025 22:00:24 +0200 Subject: [PATCH 150/178] chore(deps): lock file maintenance --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c60da11..1717115 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]] @@ -755,15 +755,15 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustix" -version = "1.0.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" +checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] From 29916c08418853715e363c933d5d99e081fcf1a4 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 2 Apr 2025 11:30:15 +0200 Subject: [PATCH 151/178] fix(deps): update rust crate axum-client-ip to v1 | datasource | package | from | to | | ---------- | -------------- | ----- | ----- | | crate | axum-client-ip | 0.7.0 | 1.0.0 | --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/config.rs | 10 +++++----- src/main.rs | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1717115..b0a1798 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -112,9 +112,9 @@ dependencies = [ [[package]] name = "axum-client-ip" -version = "0.7.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff8ee1869817523c8f91c20bf17fd932707f66c2e7e0b0f811b29a227289562" +checksum = "b9329923fe6c30624095e63cb6c25796b32ffbf5d1da8c3a95d1054c301db92a" dependencies = [ "axum", "forwarded-header-value", diff --git a/Cargo.toml b/Cargo.toml index ee5cfbf..b3ae85c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ pedantic = { level = "warn", priority = -1 } [dependencies] axum = "0.8" -axum-client-ip = "0.7" +axum-client-ip = "1.0" base64 = "0.22" clap = { version = "4", features = ["derive", "env"] } clap-verbosity-flag = { version = "3", default-features = false, features = [ diff --git a/src/config.rs b/src/config.rs index 6e4af7f..d8523b2 100644 --- a/src/config.rs +++ b/src/config.rs @@ -4,7 +4,7 @@ use std::{ path::PathBuf, }; -use axum_client_ip::SecureClientIpSource; +use axum_client_ip::ClientIpSource; use miette::{Context, IntoDiagnostic}; #[derive(Debug, Default, Clone, Copy, serde::Deserialize, serde::Serialize)] @@ -99,9 +99,9 @@ pub struct Records { /// Set client IP source /// - /// see: + /// see: #[serde(default = "default_ip_source")] - pub ip_source: SecureClientIpSource, + pub ip_source: ClientIpSource, /// Set which IPs to allow updating (ipv4, ipv6 or both) #[serde(default = "default_ip_type")] @@ -198,8 +198,8 @@ fn default_address() -> SocketAddr { SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 5353) } -fn default_ip_source() -> SecureClientIpSource { - SecureClientIpSource::RightmostXForwardedFor +fn default_ip_source() -> ClientIpSource { + ClientIpSource::RightmostXForwardedFor } fn default_ip_type() -> IpType { diff --git a/src/main.rs b/src/main.rs index aa44bc6..f7e6fcb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,7 +10,7 @@ use axum::{ routing::get, Router, }; -use axum_client_ip::SecureClientIp; +use axum_client_ip::ClientIp; use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine}; use clap::{Parser, Subcommand}; use clap_verbosity_flag::Verbosity; @@ -456,7 +456,7 @@ impl FritzBoxUpdateParams { #[tracing::instrument(skip(state), level = "trace", ret(level = "info"))] async fn update_records( State(state): State>, - SecureClientIp(ip): SecureClientIp, + ClientIp(ip): ClientIp, Query(update_params): Query, ) -> axum::response::Result<&'static str> { info!("accepted update from {ip}"); From 1dac706aeb92cb9a6bd665ee2541470a0e8a05ef Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 2 Apr 2025 22:00:44 +0200 Subject: [PATCH 152/178] chore(deps): lock file maintenance --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index 1651f11..345470b 100644 --- a/flake.lock +++ b/flake.lock @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1741352980, - "narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=", + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1743315132, - "narHash": "sha256-6hl6L/tRnwubHcA4pfUUtk542wn2Om+D4UnDhlDW9BE=", + "lastModified": 1743448293, + "narHash": "sha256-bmEPmSjJakAp/JojZRrUvNcDX2R5/nuX6bm+seVaGhs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "52faf482a3889b7619003c0daec593a1912fddc1", + "rev": "77b584d61ff80b4cef9245829a6f1dfad5afdfa3", "type": "github" }, "original": { @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1743081648, - "narHash": "sha256-WRAylyYptt6OX5eCEBWyTwOEqEtD6zt33rlUkr6u3cE=", + "lastModified": 1743589519, + "narHash": "sha256-iBzr7Zb11nQxwX90bO1+Bm1MGlhMSmu4ixgnQFB+j4E=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "29a3d7b768c70addce17af0869f6e2bd8f5be4b7", + "rev": "18bed671738e36c5504e188aadc18b7e2a6e408f", "type": "github" }, "original": { From e28cf9be3f28c6894d857c345a356cbc2c3190a4 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 3 Apr 2025 22:00:34 +0200 Subject: [PATCH 153/178] 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 b0a1798..972f753 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -572,9 +572,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +checksum = "29c72f6929239626840b28f919ce8981a317fc5dc63ce25c30d2ab372f94886f" dependencies = [ "adler2", ] diff --git a/flake.lock b/flake.lock index 345470b..de81b9b 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1742394900, - "narHash": "sha256-vVOAp9ahvnU+fQoKd4SEXB2JG2wbENkpqcwlkIXgUC0=", + "lastModified": 1743700120, + "narHash": "sha256-8BjG/P0xnuCyVOXlYRwdI1B8nVtyYLf3oDwPSimqREY=", "owner": "ipetkov", "repo": "crane", - "rev": "70947c1908108c0c551ddfd73d4f750ff2ea67cd", + "rev": "e316f19ee058e6db50075115783be57ac549c389", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1743448293, - "narHash": "sha256-bmEPmSjJakAp/JojZRrUvNcDX2R5/nuX6bm+seVaGhs=", + "lastModified": 1743583204, + "narHash": "sha256-F7n4+KOIfWrwoQjXrL2wD9RhFYLs2/GGe/MQY1sSdlE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "77b584d61ff80b4cef9245829a6f1dfad5afdfa3", + "rev": "2c8d3f48d33929642c1c12cd243df4cc7d2ce434", "type": "github" }, "original": { @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1743589519, - "narHash": "sha256-iBzr7Zb11nQxwX90bO1+Bm1MGlhMSmu4ixgnQFB+j4E=", + "lastModified": 1743677901, + "narHash": "sha256-eWZln+k+L/VHO69tUTzEmgeDWNQNKIpSUa9nqQgBrSE=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "18bed671738e36c5504e188aadc18b7e2a6e408f", + "rev": "57dabe2a6255bd6165b2437ff6c2d1f6ee78421a", "type": "github" }, "original": { From 0f4ff679d205b77a13a424bd9fabfa56e1e19a4d Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 3 Apr 2025 22:10:16 +0200 Subject: [PATCH 154/178] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 972f753..8352ccb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -572,9 +572,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c72f6929239626840b28f919ce8981a317fc5dc63ce25c30d2ab372f94886f" +checksum = "ff70ce3e48ae43fa075863cef62e8b43b71a4f2382229920e0df362592919430" dependencies = [ "adler2", ] From c270a24de88832ff156a0fec58bc5217d2cde1bf Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 4 Apr 2025 22:00:17 +0200 Subject: [PATCH 155/178] 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 8352ccb..f662657 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,9 +185,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" -version = "1.2.17" +version = "1.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" +checksum = "525046617d8376e3db1deffb079e91cef90a89fc3ca5c185bbf8c9ecdd15cd5c" dependencies = [ "shlex", ] @@ -274,9 +274,9 @@ checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", "windows-sys 0.59.0", diff --git a/flake.lock b/flake.lock index de81b9b..00db951 100644 --- a/flake.lock +++ b/flake.lock @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1743677901, - "narHash": "sha256-eWZln+k+L/VHO69tUTzEmgeDWNQNKIpSUa9nqQgBrSE=", + "lastModified": 1743748085, + "narHash": "sha256-uhjnlaVTWo5iD3LXics1rp9gaKgDRQj6660+gbUU3cE=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "57dabe2a6255bd6165b2437ff6c2d1f6ee78421a", + "rev": "815e4121d6a5d504c0f96e5be2dd7f871e4fd99d", "type": "github" }, "original": { From ca8b9f00a06e6d9fb7ab8f20e65223191011173f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 5 Apr 2025 17:40:13 +0200 Subject: [PATCH 156/178] fix(deps): update rust crate tokio to v1.44.2 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | tokio | 1.44.1 | 1.44.2 | --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f662657..0a7047e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -994,9 +994,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.44.1" +version = "1.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" +checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48" dependencies = [ "backtrace", "bytes", From 5efb1f434483dd5189343d8fa95ccc85b275eb85 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 5 Apr 2025 22:00:14 +0200 Subject: [PATCH 157/178] 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 0a7047e..8278585 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -864,9 +864,9 @@ checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" [[package]] name = "smallvec" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" [[package]] name = "socket2" diff --git a/flake.lock b/flake.lock index 00db951..8764ddd 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1743700120, - "narHash": "sha256-8BjG/P0xnuCyVOXlYRwdI1B8nVtyYLf3oDwPSimqREY=", + "lastModified": 1743807446, + "narHash": "sha256-6ERwwMADv5VW+Eq6vrKZqFnGAj5+tL4vizGDmTWJjPc=", "owner": "ipetkov", "repo": "crane", - "rev": "e316f19ee058e6db50075115783be57ac549c389", + "rev": "b62437f7e7e11fd2b456af29c25d04734fc49aa2", "type": "github" }, "original": { From c7fdb1acc5546aeb6afd68cb9505da9044c5db1f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 6 Apr 2025 22:00:40 +0200 Subject: [PATCH 158/178] chore(deps): lock file maintenance --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 8764ddd..95243b8 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1743807446, - "narHash": "sha256-6ERwwMADv5VW+Eq6vrKZqFnGAj5+tL4vizGDmTWJjPc=", + "lastModified": 1743908961, + "narHash": "sha256-e1idZdpnnHWuosI3KsBgAgrhMR05T2oqskXCmNzGPq0=", "owner": "ipetkov", "repo": "crane", - "rev": "b62437f7e7e11fd2b456af29c25d04734fc49aa2", + "rev": "80ceeec0dc94ef967c371dcdc56adb280328f591", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1743583204, - "narHash": "sha256-F7n4+KOIfWrwoQjXrL2wD9RhFYLs2/GGe/MQY1sSdlE=", + "lastModified": 1743827369, + "narHash": "sha256-rpqepOZ8Eo1zg+KJeWoq1HAOgoMCDloqv5r2EAa9TSA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2c8d3f48d33929642c1c12cd243df4cc7d2ce434", + "rev": "42a1c966be226125b48c384171c44c651c236c22", "type": "github" }, "original": { From 55d7d3eb5a511451bf6b9a5327243849baa1db01 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 8 Apr 2025 22:00:29 +0200 Subject: [PATCH 159/178] 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 8278585..d24d8d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -572,9 +572,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff70ce3e48ae43fa075863cef62e8b43b71a4f2382229920e0df362592919430" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ "adler2", ] diff --git a/flake.lock b/flake.lock index 95243b8..b188ac7 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1743827369, - "narHash": "sha256-rpqepOZ8Eo1zg+KJeWoq1HAOgoMCDloqv5r2EAa9TSA=", + "lastModified": 1743964447, + "narHash": "sha256-nEo1t3Q0F+0jQ36HJfbJtiRU4OI+/0jX/iITURKe3EE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "42a1c966be226125b48c384171c44c651c236c22", + "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", "type": "github" }, "original": { From b6005180912d8bda7ab9cd40d739b756d948c2e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Tue, 8 Apr 2025 23:30:03 +0200 Subject: [PATCH 160/178] fix(cargo): properly declare license Declaring the license in the `license` field is better for other tools to parse. --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index b3ae85c..33dde62 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ description = "An HTTP server using HTTP basic auth to make secure calls to nsup name = "webnsupdate" version = "0.3.6" edition = "2021" +license = "MIT" license-file = "LICENSE" readme = "README.md" keywords = ["dns", "dyndns", "dynamic-ip"] From c3cb6f6298d2b103a7f16195349f8442a3659bd6 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 9 Apr 2025 22:00:33 +0200 Subject: [PATCH 161/178] 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 d24d8d9..2da9491 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -502,9 +502,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "log" diff --git a/flake.lock b/flake.lock index b188ac7..af1bfbe 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1743964447, - "narHash": "sha256-nEo1t3Q0F+0jQ36HJfbJtiRU4OI+/0jX/iITURKe3EE=", + "lastModified": 1744098102, + "narHash": "sha256-tzCdyIJj9AjysC3OuKA+tMD/kDEDAF9mICPDU7ix0JA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "063dece00c5a77e4a0ea24e5e5a5bd75232806f8", + "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", "type": "github" }, "original": { From 79b5803af6d75b3dd828cbc92b5df0379a3660e9 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 11 Apr 2025 22:00:30 +0200 Subject: [PATCH 162/178] 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 2da9491..0da5c4d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,9 +185,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" -version = "1.2.18" +version = "1.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525046617d8376e3db1deffb079e91cef90a89fc3ca5c185bbf8c9ecdd15cd5c" +checksum = "8e3a13707ac958681c13b39b458c073d0d9bc8a22cb1b2f4c8e55eb72c13f362" dependencies = [ "shlex", ] diff --git a/flake.lock b/flake.lock index af1bfbe..1cd0c38 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1743908961, - "narHash": "sha256-e1idZdpnnHWuosI3KsBgAgrhMR05T2oqskXCmNzGPq0=", + "lastModified": 1744386647, + "narHash": "sha256-DXwQEJllxpYeVOiSlBhQuGjfvkoGHTtILLYO2FvcyzQ=", "owner": "ipetkov", "repo": "crane", - "rev": "80ceeec0dc94ef967c371dcdc56adb280328f591", + "rev": "d02c1cdd7ec539699aa44e6ff912e15535969803", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1744098102, - "narHash": "sha256-tzCdyIJj9AjysC3OuKA+tMD/kDEDAF9mICPDU7ix0JA=", + "lastModified": 1744232761, + "narHash": "sha256-gbl9hE39nQRpZaLjhWKmEu5ejtQsgI5TWYrIVVJn30U=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c8cd81426f45942bb2906d5ed2fe21d2f19d95b7", + "rev": "f675531bc7e6657c10a18b565cfebd8aa9e24c14", "type": "github" }, "original": { From 45c11b993ecb6629245948d3b1f41c577f05086f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 11 Apr 2025 22:10:29 +0200 Subject: [PATCH 163/178] fix(deps): update rust crate clap to v4.5.36 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | clap | 4.5.35 | 4.5.36 | --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0da5c4d..6cfa95f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,9 +200,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.35" +version = "4.5.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" +checksum = "2df961d8c8a0d08aa9945718ccf584145eee3f3aa06cddbeac12933781102e04" dependencies = [ "clap_builder", "clap_derive", @@ -220,9 +220,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.35" +version = "4.5.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" +checksum = "132dbda40fb6753878316a489d5a1242a8ef2f0d9e47ba01c951ea8aa7d013a5" dependencies = [ "anstream", "anstyle", @@ -279,7 +279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" 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]] From 74b0ee48624cbbab702bdce98419994b665ca473 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 12 Apr 2025 22:00:21 +0200 Subject: [PATCH 164/178] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6cfa95f..ab36ff8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -763,7 +763,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] From 15fa0cbb4ea2014218c1cff49041f0ab28da1623 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 13 Apr 2025 22:00:36 +0200 Subject: [PATCH 165/178] chore(deps): lock file maintenance --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 1cd0c38..957fdf0 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1744232761, - "narHash": "sha256-gbl9hE39nQRpZaLjhWKmEu5ejtQsgI5TWYrIVVJn30U=", + "lastModified": 1744463964, + "narHash": "sha256-LWqduOgLHCFxiTNYi3Uj5Lgz0SR+Xhw3kr/3Xd0GPTM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f675531bc7e6657c10a18b565cfebd8aa9e24c14", + "rev": "2631b0b7abcea6e640ce31cd78ea58910d31e650", "type": "github" }, "original": { From 6e01834a0b160bf03f0855dfba50207fcbdd8e66 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 15 Apr 2025 22:00:23 +0200 Subject: [PATCH 166/178] 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 ab36ff8..361d5c8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -490,9 +490,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.171" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "linked-hash-map" diff --git a/flake.lock b/flake.lock index 957fdf0..1e52e9b 100644 --- a/flake.lock +++ b/flake.lock @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1743748085, - "narHash": "sha256-uhjnlaVTWo5iD3LXics1rp9gaKgDRQj6660+gbUU3cE=", + "lastModified": 1744707583, + "narHash": "sha256-IPFcShGro/UUp8BmwMBkq+6KscPlWQevZi9qqIwVUWg=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "815e4121d6a5d504c0f96e5be2dd7f871e4fd99d", + "rev": "49d05555ccdd2592300099d6a657cc33571f4fe0", "type": "github" }, "original": { From e013c8edd16637b474e6aec186f0451939895bd1 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Wed, 16 Apr 2025 22:00:17 +0200 Subject: [PATCH 167/178] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 361d5c8..8880384 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -673,9 +673,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "proc-macro2" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] From 81e65a896738dd087c1f0b9c3b96724406e2af8c Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 18 Apr 2025 21:20:17 +0200 Subject: [PATCH 168/178] fix(deps): update rust crate clap to v4.5.37 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | clap | 4.5.36 | 4.5.37 | --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8880384..12b2e79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,9 +200,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.36" +version = "4.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2df961d8c8a0d08aa9945718ccf584145eee3f3aa06cddbeac12933781102e04" +checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071" dependencies = [ "clap_builder", "clap_derive", @@ -220,9 +220,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.36" +version = "4.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "132dbda40fb6753878316a489d5a1242a8ef2f0d9e47ba01c951ea8aa7d013a5" +checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" dependencies = [ "anstream", "anstyle", @@ -279,7 +279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" 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]] From ba0c07a12545f237d047d9282ed8438a01908160 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 18 Apr 2025 22:00:32 +0200 Subject: [PATCH 169/178] 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 12b2e79..fc780f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -763,7 +763,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 1e52e9b..c91c30a 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1744463964, - "narHash": "sha256-LWqduOgLHCFxiTNYi3Uj5Lgz0SR+Xhw3kr/3Xd0GPTM=", + "lastModified": 1744932701, + "narHash": "sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2631b0b7abcea6e640ce31cd78ea58910d31e650", + "rev": "b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef", "type": "github" }, "original": { @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1744707583, - "narHash": "sha256-IPFcShGro/UUp8BmwMBkq+6KscPlWQevZi9qqIwVUWg=", + "lastModified": 1744961264, + "narHash": "sha256-aRmUh0AMwcbdjJHnytg1e5h5ECcaWtIFQa6d9gI85AI=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "49d05555ccdd2592300099d6a657cc33571f4fe0", + "rev": "8d404a69efe76146368885110f29a2ca3700bee6", "type": "github" }, "original": { From 52f87ca78fc1dff944b45a17ddcf67e43180da1e Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 19 Apr 2025 22:00:23 +0200 Subject: [PATCH 170/178] 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 fc780f2..b6675bf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -849,9 +849,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "a1ee1aca2bc74ef9589efa7ccaa0f3752751399940356209b3fd80c078149b5e" dependencies = [ "libc", ] diff --git a/flake.lock b/flake.lock index c91c30a..901922c 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1744386647, - "narHash": "sha256-DXwQEJllxpYeVOiSlBhQuGjfvkoGHTtILLYO2FvcyzQ=", + "lastModified": 1745022865, + "narHash": "sha256-tXL4qUlyYZEGOHUKUWjmmcvJjjLQ+4U38lPWSc8Cgdo=", "owner": "ipetkov", "repo": "crane", - "rev": "d02c1cdd7ec539699aa44e6ff912e15535969803", + "rev": "25ca4c50039d91ad88cc0b8feacb9ad7f748dedf", "type": "github" }, "original": { From 399eeb958491dd37e17f095109c778ffa24bdb68 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 20 Apr 2025 22:00:17 +0200 Subject: [PATCH 171/178] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b6675bf..20ce33a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -849,9 +849,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.4" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ee1aca2bc74ef9589efa7ccaa0f3752751399940356209b3fd80c078149b5e" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" dependencies = [ "libc", ] From ee3434d6f13098604320fc021d1f8979cc3a695b Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 22 Apr 2025 22:00:40 +0200 Subject: [PATCH 172/178] 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 20ce33a..3256ac0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -342,9 +342,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", diff --git a/flake.lock b/flake.lock index 901922c..29fbb76 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1744932701, - "narHash": "sha256-fusHbZCyv126cyArUwwKrLdCkgVAIaa/fQJYFlCEqiU=", + "lastModified": 1745234285, + "narHash": "sha256-GfpyMzxwkfgRVN0cTGQSkTC0OHhEkv3Jf6Tcjm//qZ0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b024ced1aac25639f8ca8fdfc2f8c4fbd66c48ef", + "rev": "c11863f1e964833214b767f4a369c6e6a7aba141", "type": "github" }, "original": { From 6aa9193ddf8cd4a648a85ed2215ab9da06aaf488 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Thu, 24 Apr 2025 22:00:44 +0200 Subject: [PATCH 173/178] chore(deps): lock file maintenance --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 29fbb76..26462b0 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1745022865, - "narHash": "sha256-tXL4qUlyYZEGOHUKUWjmmcvJjjLQ+4U38lPWSc8Cgdo=", + "lastModified": 1745454774, + "narHash": "sha256-oLvmxOnsEKGtwczxp/CwhrfmQUG2ym24OMWowcoRhH8=", "owner": "ipetkov", "repo": "crane", - "rev": "25ca4c50039d91ad88cc0b8feacb9ad7f748dedf", + "rev": "efd36682371678e2b6da3f108fdb5c613b3ec598", "type": "github" }, "original": { @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1745234285, - "narHash": "sha256-GfpyMzxwkfgRVN0cTGQSkTC0OHhEkv3Jf6Tcjm//qZ0=", + "lastModified": 1745391562, + "narHash": "sha256-sPwcCYuiEopaafePqlG826tBhctuJsLx/mhKKM5Fmjo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c11863f1e964833214b767f4a369c6e6a7aba141", + "rev": "8a2f738d9d1f1d986b5a4cd2fd2061a7127237d7", "type": "github" }, "original": { From 502dd9128988f45eccf00873fe77aa7e48e60555 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 25 Apr 2025 22:00:18 +0200 Subject: [PATCH 174/178] chore(deps): lock file maintenance --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3256ac0..4bffc7c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -185,9 +185,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" -version = "1.2.19" +version = "1.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3a13707ac958681c13b39b458c073d0d9bc8a22cb1b2f4c8e55eb72c13f362" +checksum = "04da6a0d40b948dfc4fa8f5bbf402b0fc1a64a28dbf7d12ffd683550f2c1b63a" dependencies = [ "shlex", ] From 11a5d487e32dd3b3802571ea30d6a8cfd7de2ad0 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Fri, 25 Apr 2025 23:30:18 +0200 Subject: [PATCH 175/178] chore(deps): update rust crate insta to v1.43.0 | datasource | package | from | to | | ---------- | ------- | ------ | ------ | | crate | insta | 1.42.2 | 1.43.0 | --- Cargo.lock | 32 ++------------------------------ Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4bffc7c..4f378aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -452,14 +452,12 @@ dependencies = [ [[package]] name = "insta" -version = "1.42.2" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50259abbaa67d11d2bcafc7ba1d094ed7a0c70e3ce893f0d0997f73558cb3084" +checksum = "ab2d11b2f17a45095b8c3603928ba29d7d918d7129d0d0641a36ba73cf07daa6" dependencies = [ "console", - "linked-hash-map", "once_cell", - "pin-project", "serde", "similar", ] @@ -494,12 +492,6 @@ version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" version = "0.9.4" @@ -639,26 +631,6 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "pin-project" -version = "1.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "pin-project-lite" version = "0.2.16" diff --git a/Cargo.toml b/Cargo.toml index 33dde62..0356c95 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } [dev-dependencies] -insta = { version = "=1.42.2", features = ["json"] } +insta = { version = "=1.43.0", features = ["json"] } [profile.release] opt-level = "s" From 1729ef4b2a5b6a52165f732737ec34f5528595c3 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sat, 26 Apr 2025 22:00:35 +0200 Subject: [PATCH 176/178] 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 4f378aa..1bc7e24 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -879,9 +879,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.100" +version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ "proc-macro2", "quote", diff --git a/flake.lock b/flake.lock index 26462b0..e9900b1 100644 --- a/flake.lock +++ b/flake.lock @@ -37,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1745391562, - "narHash": "sha256-sPwcCYuiEopaafePqlG826tBhctuJsLx/mhKKM5Fmjo=", + "lastModified": 1745526057, + "narHash": "sha256-ITSpPDwvLBZBnPRS2bUcHY3gZSwis/uTe255QgMtTLA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8a2f738d9d1f1d986b5a4cd2fd2061a7127237d7", + "rev": "f771eb401a46846c1aebd20552521b233dd7e18b", "type": "github" }, "original": { From 50aa6439fae1f82c31f2b41e643b5a99e7a39599 Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 27 Apr 2025 07:20:15 +0200 Subject: [PATCH 177/178] fix(deps): update rust crate miette to v7.6.0 | datasource | package | from | to | | ---------- | ------- | ----- | ----- | | crate | miette | 7.5.0 | 7.6.0 | --- Cargo.lock | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1bc7e24..f159601 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -527,9 +527,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" -version = "7.5.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a955165f87b37fd1862df2a59547ac542c77ef6d17c666f619d1ad22dd89484" +checksum = "5f98efec8807c63c752b5bd61f862c165c115b0a35685bdcfd9238c7aeb592b7" dependencies = [ "backtrace", "backtrace-ext", @@ -541,15 +541,14 @@ dependencies = [ "supports-unicode", "terminal_size", "textwrap", - "thiserror 1.0.69", "unicode-width 0.1.14", ] [[package]] name = "miette-derive" -version = "7.5.0" +version = "7.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf45bf44ab49be92fd1227a3be6fc6f617f1a337c06af54981048574d8783147" +checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" dependencies = [ "proc-macro2", "quote", @@ -735,7 +734,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] From e1d21cf3e44deed19b426a50bf8dec3fb3d4d0fa Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Sun, 27 Apr 2025 22:00:22 +0200 Subject: [PATCH 178/178] 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 f159601..ce274f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -734,7 +734,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 e9900b1..902dffc 100644 --- a/flake.lock +++ b/flake.lock @@ -82,11 +82,11 @@ ] }, "locked": { - "lastModified": 1744961264, - "narHash": "sha256-aRmUh0AMwcbdjJHnytg1e5h5ECcaWtIFQa6d9gI85AI=", + "lastModified": 1745780832, + "narHash": "sha256-jGzkZoJWx+nJnPe0Z2xQBUOqMKuR1slVFQrMjFTKgeM=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "8d404a69efe76146368885110f29a2ca3700bee6", + "rev": "b2b6c027d708fbf4b01c9c11f6e80f2800b5a624", "type": "github" }, "original": {