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 1/2] 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 2/2] 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": {