diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index f853b38c..08001109 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -1,3 +1,16 @@ +# [1.11.0](https://github.com/favonia/cloudflare-ddns/compare/v1.10.1...v1.11.0) (2023-10-23) + +This release adds the experimental support of Uptime Kuma. + +### BREAKING CHANGES + +- `UPDATE_CRON=@disabled` is deprecated; use `UPDATE_CRON=@once` instead + +### Features + +- add support of Uptime Kuma ([#600](https://github.com/favonia/cloudflare-ddns/issues/600)) ([c68eeeb](https://github.com/favonia/cloudflare-ddns/commit/c68eeeb8472a8e6cc61e3ffb6dd5925d008ffa81)) ([#605](https://github.com/favonia/cloudflare-ddns/issues/605)) ([e65531a](https://github.com/favonia/cloudflare-ddns/commit/e65531ae09e08a1b0f25e0d4d8287eb136cacf52)) +- introduce `UPDATE_CRON=@once` ([#607](https://github.com/favonia/cloudflare-ddns/issues/607)) ([aa57602](https://github.com/favonia/cloudflare-ddns/commit/aa57602626c2f9b4bccbab330a61643d8fd0b2e8)) + # [1.10.1](https://github.com/favonia/cloudflare-ddns/compare/v1.10.0...v1.10.1) (2023-09-17) ### Bug Fixes diff --git a/README.markdown b/README.markdown index 03072de6..03f4010f 100644 --- a/README.markdown +++ b/README.markdown @@ -255,15 +255,15 @@ _(Click to expand the following items.)_
⏳ Schedules, triggers, and timeouts -| Name | Valid Values | Meaning | Required? | Default Value | -| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ----------------------------- | -| `CACHE_EXPIRATION` | Positive time durations with a unit, such as `1h` and `10m`. See [time.ParseDuration](https://golang.org/pkg/time/#ParseDuration) | The expiration of cached Cloudflare API responses | No | `6h0m0s` (6 hours) | -| `DELETE_ON_STOP` | Boolean values, such as `true`, `false`, `0` and `1`. See [strconv.ParseBool](https://pkg.go.dev/strconv#ParseBool) | Whether managed DNS records should be deleted on exit | No | `false` | -| `DETECTION_TIMEOUT` | Positive time durations with a unit, such as `1h` and `10m`. See [time.ParseDuration](https://golang.org/pkg/time/#ParseDuration) | The timeout of each attempt to detect IP addresses | No | `5s` (5 seconds) | -| `TZ` | Recognized timezones, such as `UTC` | The timezone used for logging and parsing `UPDATE_CRON` | No | `UTC` | +| Name | Valid Values | Meaning | Required? | Default Value | +| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ----------------------------- | +| `CACHE_EXPIRATION` | Positive time durations with a unit, such as `1h` and `10m`. See [time.ParseDuration](https://golang.org/pkg/time/#ParseDuration) | The expiration of cached Cloudflare API responses | No | `6h0m0s` (6 hours) | +| `DELETE_ON_STOP` | Boolean values, such as `true`, `false`, `0` and `1`. See [strconv.ParseBool](https://pkg.go.dev/strconv#ParseBool) | Whether managed DNS records should be deleted on exit | No | `false` | +| `DETECTION_TIMEOUT` | Positive time durations with a unit, such as `1h` and `10m`. See [time.ParseDuration](https://golang.org/pkg/time/#ParseDuration) | The timeout of each attempt to detect IP addresses | No | `5s` (5 seconds) | +| `TZ` | Recognized timezones, such as `UTC` | The timezone used for logging and parsing `UPDATE_CRON` | No | `UTC` | | `UPDATE_CRON` | Cron expressions _and_ the special value `@once`. See the [documentation of cron](https://pkg.go.dev/github.com/robfig/cron/v3#hdr-CRON_Expression_Format) for cron expressions. | The schedule to re-check IP addresses and update DNS records (if necessary). If the special value `@once` is used, cron is disabled and the updater will terminate immediately after updating the DNS records. | No | `@every 5m` (every 5 minutes) | -| `UPDATE_ON_START` | Boolean values, such as `true`, `false`, `0` and `1`. See [strconv.ParseBool](https://pkg.go.dev/strconv#ParseBool) | Whether to check IP addresses on start regardless of `UPDATE_CRON` | No | `true` | -| `UPDATE_TIMEOUT` | Positive time durations with a unit, such as `1h` and `10m`. See [time.ParseDuration](https://golang.org/pkg/time/#ParseDuration) | The timeout of each attempt to update DNS records, per domain, per record type | No | `30s` (30 seconds) | +| `UPDATE_ON_START` | Boolean values, such as `true`, `false`, `0` and `1`. See [strconv.ParseBool](https://pkg.go.dev/strconv#ParseBool) | Whether to check IP addresses on start regardless of `UPDATE_CRON` | No | `true` | +| `UPDATE_TIMEOUT` | Positive time durations with a unit, such as `1h` and `10m`. See [time.ParseDuration](https://golang.org/pkg/time/#ParseDuration) | The timeout of each attempt to update DNS records, per domain, per record type | No | `30s` (30 seconds) | > ⚠️ The update schedule _does not_ take the time to update records into consideration. For example, if the schedule is “for every 5 minutes”, and if the updating itself takes 2 minutes, then the actual interval between adjacent updates is 3 minutes, not 5 minutes. @@ -351,18 +351,18 @@ _(Click to expand the following items.)_ ⚠️ [oznu/cloudflare-ddns](https://github.com/oznu/docker-cloudflare-ddns) relies on the insecure DNS protocol to obtain public IP addresses; a malicious hacker could more easily forge DNS responses and trick it into updating your domain with any IP address. In comparison, we use only verified responses from Cloudflare, which makes the attack much more difficult. See the [design document](docs/DESIGN.markdown) for more information on security. -| Old Parameter | | Note | -| -------------------------------------- | --- | ------------------------------------------------------------------------------------ | -| `API_KEY=key` | ✔️ | Use `CF_API_TOKEN=key` | -| `API_KEY_FILE=file` | ✔️ | Use `CF_API_TOKEN_FILE=file` | -| `ZONE=example.org` and `SUBDOMAIN=sub` | ✔️ | Use `DOMAINS=sub.example.org` directly | -| `PROXIED=true` | ✔️ | Same (`PROXIED=true`) | -| `RRTYPE=A` | ✔️ | Both IPv4 and IPv6 are enabled by default; use `IP6_PROVIDER=none` to disable IPv6 | -| `RRTYPE=AAAA` | ✔️ | Both IPv4 and IPv6 are enabled by default; use `IP4_PROVIDER=none` to disable IPv4 | -| `DELETE_ON_STOP=true` | ✔️ | Same (`DELETE_ON_STOP=true`) | -| `INTERFACE=iface` | ✔️ | Not required for `local` providers; we can handle multiple network interfaces | -| `CUSTOM_LOOKUP_CMD=cmd` | ❌ | There are no shells in the minimal Docker image | -| `DNS_SERVER=server` | ❌ | Only Cloudflare is supported, except the experimental `url:URL` provider via HTTP(S) | +| Old Parameter | | Note | +| -------------------------------------- | --- | ---------------------------------------------------------------------------------- | +| `API_KEY=key` | ✔️ | Use `CF_API_TOKEN=key` | +| `API_KEY_FILE=file` | ✔️ | Use `CF_API_TOKEN_FILE=file` | +| `ZONE=example.org` and `SUBDOMAIN=sub` | ✔️ | Use `DOMAINS=sub.example.org` directly | +| `PROXIED=true` | ✔️ | Same (`PROXIED=true`) | +| `RRTYPE=A` | ✔️ | Both IPv4 and IPv6 are enabled by default; use `IP6_PROVIDER=none` to disable IPv6 | +| `RRTYPE=AAAA` | ✔️ | Both IPv4 and IPv6 are enabled by default; use `IP4_PROVIDER=none` to disable IPv4 | +| `DELETE_ON_STOP=true` | ✔️ | Same (`DELETE_ON_STOP=true`) | +| `INTERFACE=iface` | ✔️ | Not required for `local` providers; we can handle multiple network interfaces | +| `CUSTOM_LOOKUP_CMD=cmd` | ❌ | There are no shells in the minimal Docker image | +| `DNS_SERVER=server` | ❌ | Only Cloudflare is supported, except the `url:URL` provider via HTTP(S) |
diff --git a/internal/config/network_probe_test.go b/internal/config/network_probe_test.go index 094fa43e..2fbef09e 100644 --- a/internal/config/network_probe_test.go +++ b/internal/config/network_probe_test.go @@ -18,7 +18,9 @@ import ( func TestProbeURLTrue(t *testing.T) { t.Parallel() - server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {})) + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + // an "empty" HTTP server is good enough + })) defer server.Close() require.True(t, config.ProbeURL(context.Background(), server.URL)) } diff --git a/internal/monitor/composite_test.go b/internal/monitor/composite_test.go index 834cc998..32170407 100644 --- a/internal/monitor/composite_test.go +++ b/internal/monitor/composite_test.go @@ -23,7 +23,8 @@ func TestDescribeAll(t *testing.T) { ms = append(ms, m) } - monitor.DescribeAll(func(service, params string) {}, ms) + callback := func(service, params string) { /* the callback content is not relevant here. */ } + monitor.DescribeAll(callback, ms) } func TestSuccessAll(t *testing.T) {