From 22320bea79d9d509ff26c574aaf8c2b8404eaa7c Mon Sep 17 00:00:00 2001 From: Timothy Miller Date: Wed, 29 Apr 2026 18:57:53 -0400 Subject: [PATCH] Release v2.1.1 Fix rand 0.10 compile error (RngExt trait import) and ship version bump alongside DELETE_ON_FAILURE, proportional jitter, and dependency refresh changes already merged on master. Co-Authored-By: Claude Opus 4.7 (1M context) --- Cargo.lock | 2 +- Cargo.toml | 2 +- RELEASE_NOTES_2.1.1.md | 49 ++++++++++++++++++++++++++++++++++++++++++ src/main.rs | 2 +- 4 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 RELEASE_NOTES_2.1.1.md diff --git a/Cargo.lock b/Cargo.lock index 3fcac88..6a29ce2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -92,7 +92,7 @@ dependencies = [ [[package]] name = "cloudflare-ddns" -version = "2.1.0" +version = "2.1.1" dependencies = [ "if-addrs", "rand", diff --git a/Cargo.toml b/Cargo.toml index 19cb4b1..fb0c976 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cloudflare-ddns" -version = "2.1.0" +version = "2.1.1" edition = "2021" description = "Access your home network remotely via a custom domain name without a static IP" license = "GPL-3.0" diff --git a/RELEASE_NOTES_2.1.1.md b/RELEASE_NOTES_2.1.1.md new file mode 100644 index 0000000..16cd75e --- /dev/null +++ b/RELEASE_NOTES_2.1.1.md @@ -0,0 +1,49 @@ +# cloudflare-ddns v2.1.1 + +Maintenance release. Bug fix for `rand` 0.10 API change, plus opt-in failure-safe deletion behavior contributed in the v2.1.0 → v2.1.1 window, dependency refresh, and proportional jitter for IP detection. + +## Highlights + +- **Fix:** Restore the build under `rand` 0.10 — `random_range` moved to the `RngExt` trait, and the unconditional jitter sleep in `--repeat` mode no longer fails to compile. +- **New:** `DELETE_ON_FAILURE` (env-var mode) controls whether DNS records are removed when an IP detection or update fails. Defaults to `true` to preserve existing behavior; set `DELETE_ON_FAILURE=false` to keep stale records on transient failures instead of yanking them. +- **Improvement:** Proportional jitter (up to 20% of the update interval) is added before each scheduled update to spread requests across clients and reduce synchronized spikes against the Cloudflare API. + +## Changes since v2.1.0 + +### Features +- `DELETE_ON_FAILURE` env var to prevent DNS record deletion on failed updates (#263, thanks @DMaxter) +- Proportional jitter on update intervals to desynchronize API traffic (#253, thanks @jhutchings1) + +### Fixes +- Compile fix for `rand` 0.10: import `RngExt` so `random_range` resolves +- `delete_on_failure` regression test coverage added + +### Dependencies +- `rustls` 0.23.37 → 0.23.40 +- `rustls-webpki` 0.103.10 → 0.103.13 +- `tokio` 1.50.0 → 1.52.1 +- `reqwest` 0.13.2 → 0.13.3 +- `rand` 0.9.2 → 0.10.1 + +### Docs +- Document `DELETE_ON_FAILURE` in the README + +## Upgrade notes + +- **Default behavior unchanged.** `DELETE_ON_FAILURE` defaults to `true`, matching pre-2.1.1 behavior. Set it to `false` if you want stale records preserved during outages. +- No config file schema changes. Existing `config.json` deployments continue to work without edits. + +## Docker + +```sh +docker pull timothyjmiller/cloudflare-ddns:2.1.1 +docker pull timothyjmiller/cloudflare-ddns:latest +``` + +Multi-arch: `linux/amd64`, `linux/arm64`, `linux/ppc64le`. + +## Verification + +- `cargo test` — 352 tests pass +- Release build succeeds, binary size ~1.7 MiB (pre-UPX) +- Smoke tested in both legacy `config.json` mode and env-var mode against the live Cloudflare API diff --git a/src/main.rs b/src/main.rs index d3aec00..9f31fbc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,7 @@ use crate::pp::PP; use std::collections::HashSet; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; -use rand::Rng; +use rand::RngExt; use reqwest::Client; use tokio::signal; use tokio::time::{sleep, Duration};