Repository: favonia/cloudflare-ddns
Pull request #781 (2024-06-28 12:39:21)

docs: various changes and updates
Also fix README

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/favonia/cloudflare-ddns/pull/781?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 90.32%. Comparing base [(`36fc5e7`)](https://app.codecov.io/gh/favonia/cloudflare-ddns/commit/36fc5e7ad77f3130cd7c61826ee929c5bfebed2e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia) to head [(`9be9bf8`)](https://app.codecov.io/gh/favonia/cloudflare-ddns/commit/9be9bf8ed5c541396b019dc335a3a03341a37cfd?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia).

<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff           @@
##             main     #781   +/-   ##
=======================================
  Coverage   90.32%   90.32%           
=======================================
  Files          52       52           
  Lines        2161     2161           
=======================================
  Hits         1952     1952           
  Misses        198      198           
  Partials       11       11           
```

| [Flag](https://app.codecov.io/gh/favonia/cloudflare-ddns/pull/781/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia) | Coverage Δ | |
|---|---|---|
| [unittests](https://app.codecov.io/gh/favonia/cloudflare-ddns/pull/781/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia) | `90.32% <100.00%> (ø)` | |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia#carryforward-flags-in-the-pull-request-comment) to find out more.

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/favonia/cloudflare-ddns/pull/781?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia).


Patch:
diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown
index b6d777f..f62db44 100644
--- a/CHANGELOG.markdown
+++ b/CHANGELOG.markdown
@@ -1,21 +1,21 @@
-# [1.12.0](https://github.com/favonia/cloudflare-ddns/compare/v1.11.0...v1.12.0) (2024-06-27)
+# [1.12.0](https://github.com/favonia/cloudflare-ddns/compare/v1.11.0...v1.12.0) (2024-06-28)
 
 This is a major release with two significant improvements:
 
-1. The new version now embeds [shoutrrr](https://containrrr.dev/shoutrrr) to send general updates.
-2. The new version now supports non-Linux Unix-like platforms: support of Linux capabilities will be disabled on non-Linux platforms, but all other features should run as expected.
+1. The updater can **send general updates via [shoutrrr](https://containrrr.dev/shoutrrr) now.**
+2. The updater **supports non-Linux platforms now.** Linux capabilities are not supported on other platforms, but all other features should run as expected at least on Unix-like platforms.
 
 There are also two notable improvements to the stock Docker images. Starting from this version:
 
-1. Annotations are properly added to the Docker images, thanks to the updates to the upstream Docker tools.
+1. Annotations are properly added to the Docker images, thanks to the updates to the upstream Docker toolchain.
 2. A new Docker tag, `1`, is introduced to track the latest version with the major version `1`. I plan to develop `2.0.0` that may contain larger breaking changes. Sticking to `1` instead of `latest` now can avoid unexpected breakage in the future.
 
-Note that the notification system was revamped to integrate [shoutrrr](https://containrrr.dev/shoutrrr). As a result, messages have been reworded.
+Note that the notification system was revamped to integrate [shoutrrr](https://containrrr.dev/shoutrrr). As a result, messages may have been reworded.
 
 ### Bug Fixes
 
-- add annotations to Docker images ([#652](https://github.com/favonia/cloudflare-ddns/issues/652)) ([fe2ed00](https://github.com/favonia/cloudflare-ddns/commit/fe2ed0037ebba39bb7f2a4c594f58d462439a76f)) ([#653](https://github.com/favonia/cloudflare-ddns/issues/653)) ([56748eb](https://github.com/favonia/cloudflare-ddns/commit/56748eb00753abaac2b725ffafb80bfd4cb59fd8)) ([#659](https://github.com/favonia/cloudflare-ddns/issues/659)) ([687ccaa](https://github.com/favonia/cloudflare-ddns/commit/687ccaa7a8606f06d4d9e203603791b51f9bee98)), closes [#652](https://github.com/favonia/cloudflare-ddns/issues/652)
-- limit the number of bytes read from an HTTP response ([#629](https://github.com/favonia/cloudflare-ddns/issues/629)) ([d64e8d4](https://github.com/favonia/cloudflare-ddns/commit/d64e8d4da44fb1d497cc871385061fb009e5ead8))
+- add annotations to Docker images ([#651](https://github.com/favonia/cloudflare-ddns/issues/651)) ([dd04d0d](https://github.com/favonia/cloudflare-ddns/commit/dd04d0d287abe313fa1c446e129da1281a0e1362)) ([#652](https://github.com/favonia/cloudflare-ddns/issues/652)) ([fe2ed00](https://github.com/favonia/cloudflare-ddns/commit/fe2ed0037ebba39bb7f2a4c594f58d462439a76f)) ([#653](https://github.com/favonia/cloudflare-ddns/issues/653)) ([56748eb](https://github.com/favonia/cloudflare-ddns/commit/56748eb00753abaac2b725ffafb80bfd4cb59fd8)) ([#659](https://github.com/favonia/cloudflare-ddns/issues/659)) ([687ccaa](https://github.com/favonia/cloudflare-ddns/commit/687ccaa7a8606f06d4d9e203603791b51f9bee98)), closes [#454](https://github.com/favonia/cloudflare-ddns/issues/454)
+- limit the number of bytes read from an HTTP response (for extra security) ([#629](https://github.com/favonia/cloudflare-ddns/issues/629)) ([d64e8d4](https://github.com/favonia/cloudflare-ddns/commit/d64e8d4da44fb1d497cc871385061fb009e5ead8))
 - **monitor:** force non-empty error messages for Uptime Kuma ([#624](https://github.com/favonia/cloudflare-ddns/issues/624)) ([a9bce5c](https://github.com/favonia/cloudflare-ddns/commit/a9bce5c56df6dbabe9ca4ae973a92cadfef6735b)) ([#774](https://github.com/favonia/cloudflare-ddns/issues/774)) ([df565b9](https://github.com/favonia/cloudflare-ddns/commit/df565b94199ad97642438dd4eb5f9168193c981f))
 - **provider:** trim the response of `url:URL` (generic provider) before parsing it ([#709](https://github.com/favonia/cloudflare-ddns/issues/709)) ([48edb15](https://github.com/favonia/cloudflare-ddns/commit/48edb15b4be0b3c9e74cfe712fc9f1e01c4ef537))
 
@@ -24,7 +24,7 @@ Note that the notification system was revamped to integrate [shoutrrr](https://c
 - **cron:** show the far start time during countdown ([#761](https://github.com/favonia/cloudflare-ddns/issues/761)) ([39c659a](https://github.com/favonia/cloudflare-ddns/commit/39c659a29ff358dee7927148c13c45f2eea90265))
 - **droproot:** support non-Linux platforms ([#733](https://github.com/favonia/cloudflare-ddns/issues/733)) ([a93b6ab](https://github.com/favonia/cloudflare-ddns/commit/a93b6abca56ab0809dc56a84e64e665d1fdede12))
 - **monitor:** prioritize error messages ([#622](https://github.com/favonia/cloudflare-ddns/issues/622)) ([2f653ca](https://github.com/favonia/cloudflare-ddns/commit/2f653caddbb9d948110e79988bfb8523fe7cfccc))
-- **monitor:** send `Failed to detect the IPv4/6 address` to monitors ([#620](https://github.com/favonia/cloudflare-ddns/issues/620)) ([f1793ad](https://github.com/favonia/cloudflare-ddns/commit/f1793addc44f28f060732c2bd9add08d7d23018e))
+- **monitor:** send `Failed to detect IPv4/6 address` to monitors ([#620](https://github.com/favonia/cloudflare-ddns/issues/620)) ([f1793ad](https://github.com/favonia/cloudflare-ddns/commit/f1793addc44f28f060732c2bd9add08d7d23018e))
 - **notifier:** embed shoutrrr ([#633](https://github.com/favonia/cloudflare-ddns/issues/633)) ([61f42a0](https://github.com/favonia/cloudflare-ddns/commit/61f42a04b665ffb710b3cc9fb326dbe6ada53125)) ([#640](https://github.com/favonia/cloudflare-ddns/issues/640)) ([817125e](https://github.com/favonia/cloudflare-ddns/commit/817125ef46511d24372f54afb67a90b7547bb532)) ([#762](https://github.com/favonia/cloudflare-ddns/issues/762)) ([c09e2b2](https://github.com/favonia/cloudflare-ddns/commit/c09e2b2ed965b9028a37d21d6a318fca48f539ca)) ([#768](https://github.com/favonia/cloudflare-ddns/issues/768)) ([9cdfec3](https://github.com/favonia/cloudflare-ddns/commit/9cdfec393a3ef24803fc7a1280515c1fda72102e)) ([#772](https://github.com/favonia/cloudflare-ddns/issues/772)) ([b8d4604](https://github.com/favonia/cloudflare-ddns/commit/b8d4604109ae6521266032cd5fc81fd05578fc7a)), closes [#532](https://github.com/favonia/cloudflare-ddns/issues/532)
 - **setter:** print `(cached)` for results based on cached API responses ([#776](https://github.com/favonia/cloudflare-ddns/issues/776)) ([1bcbbf0](https://github.com/favonia/cloudflare-ddns/commit/1bcbbf058741594e13ce6ec382edc908b383f112))
 
diff --git a/README.markdown b/README.markdown
index 89b17fa..b6af86f 100644
--- a/README.markdown
+++ b/README.markdown
@@ -364,13 +364,13 @@ _(Click to expand the following items.)_
 <details>
 <summary>👁️ Logging, Healthchecks, Uptime Kuma, and shoutrrr</summary>
 
-| Name                           | Valid Values                                                                                                                                                               | Meaning                                                                                                                                                                                            | Required? | Default Value |
-| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ------------- |
-| `QUIET`                        | Boolean values, such as `true`, `false`, `0` and `1`. See [strconv.ParseBool](https://pkg.go.dev/strconv#ParseBool)                                                        | Whether the updater should reduce the logging                                                                                                                                                      | No        | `false`       |
-| `EMOJI`                        | Boolean values, such as `true`, `false`, `0` and `1`. See [strconv.ParseBool](https://pkg.go.dev/strconv#ParseBool)                                                        | Whether the updater should use emojis in the logging                                                                                                                                               | No        | `true`        |
-| `HEALTHCHECKS`                 | [Healthchecks ping URLs](https://healthchecks.io/docs/), such as `https://hc-ping.com/<uuid>` or `https://hc-ping.com/<project-ping-key>/<name-slug>` (see below)          | If set, the updater will ping the URL when it successfully updates IP addresses                                                                                                                    | No        | (unset)       |
-| `SHOUTRRR`                     | Newline-separated [shoutrrr URLs](https://containrrr.dev/shoutrrr/), such as `discord://<token>@<id>`. If set, the updater will send messages when it updates IP addresses | No                                                                                                                                                                                                 | (unset)   |
-| 🧪 `UPTIMEKUMA` (experimental) | 🧪 Uptime Kuma’s Push URLs, such as `https://<host>/push/<id>`. For convenience, you can directly copy the ‘Push URL’ from the Uptime Kuma configuration page.             | 🧪 If set, the updater will ping the URL when it successfully updates IP addresses. ⚠️ Remember to change the “Heartbeat Interval” to match your DNS updating schedule specified in `UPDATE_CRON`. | No        | (unset)       |
+| Name           | Valid Values                                                                                                                                                      | Meaning                                                                                                                                                                                         | Required? | Default Value |
+| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ------------- |
+| `EMOJI`        | Boolean values, such as `true`, `false`, `0` and `1`. See [strconv.ParseBool](https://pkg.go.dev/strconv#ParseBool)                                               | Whether the updater should use emojis in the logging                                                                                                                                            | No        | `true`        |
+| `HEALTHCHECKS` | [Healthchecks ping URLs](https://healthchecks.io/docs/), such as `https://hc-ping.com/<uuid>` or `https://hc-ping.com/<project-ping-key>/<name-slug>` (see below) | If set, the updater will ping the URL when it successfully updates IP addresses                                                                                                                 | No        | (unset)       |
+| `QUIET`        | Boolean values, such as `true`, `false`, `0` and `1`. See [strconv.ParseBool](https://pkg.go.dev/strconv#ParseBool)                                               | Whether the updater should reduce the logging                                                                                                                                                   | No        | `false`       |
+| `UPTIMEKUMA`   | Uptime Kuma’s Push URLs, such as `https://<host>/push/<id>`. For convenience, you can directly copy the ‘Push URL’ from the Uptime Kuma configuration page.       | If set, the updater will ping the URL when it successfully updates IP addresses. ⚠️ Remember to change the “Heartbeat Interval” to match your DNS updating schedule specified in `UPDATE_CRON`. | No        | (unset)       |
+| 🧪 `SHOUTRRR`  | 🧪 Newline-separated [shoutrrr URLs](https://containrrr.dev/shoutrrr/) such as `discord://<token>@<id>`                                                           | 🧪 If set, the updater will send messages when it updates IP addresses                                                                                                                          | No        | (unset)       |
 
 > 🩺 For `HEALTHCHECKS`, the updater can work with any server following the [same notification protocol](https://healthchecks.io/docs/http_api/), including but not limited to self-hosted instances of [Healthchecks](https://github.com/healthchecks/healthchecks). Both UUID and Slug URLs are supported, and the updater works regardless whether the POST-only mode is enabled.
 
diff --git a/internal/message/message.go b/internal/message/message.go
index ddd98b2..7372974 100644
--- a/internal/message/message.go
+++ b/internal/message/message.go
@@ -1,5 +1,10 @@
+// package message defines the structure holding messages to
+// monitors and notifiers.
 package message
 
+// Message holds the messages and success/failure status.
+// To monitors, the status is far more important than the message,
+// and to notifiers, all messages are important.
 type Message struct {
 	Ok               bool
 	MonitorMessages  []string
@@ -16,9 +21,9 @@ func NewEmpty() Message {
 
 func Merge(msgs ...Message) Message {
 	var (
-		allOk               = true
-		allMonitorMessages  = map[bool][]string{true: {}, false: {}}
-		allNotifierMessages = []string{}
+		allOk                        = true
+		allMonitorMessages           = map[bool][]string{}
+		allNotifierMessages []string = nil
 	)
 
 	for _, msg := range msgs {


Test patch:
diff --git a/internal/updater/updater_test.go b/internal/updater/updater_test.go
index 86842ac..e66d4e5 100644
--- a/internal/updater/updater_test.go
+++ b/internal/updater/updater_test.go
@@ -430,12 +430,12 @@ func TestUpdateIPs(t *testing.T) {
 		prepareMockSetter   func(ppfmt pp.PP, m *mocks.MockSetter)
 	}{
 		"none": {
-			true, []string{}, []string{}, nil, mockproviders{}, nil,
+			true, nil, nil, nil, mockproviders{}, nil,
 		},
 		"ip4only": {
 			true,
-			[]string{},
-			[]string{},
+			nil,
+			nil,
 			pp4only,
 			mockproviders{ipnet.IP4: provider4},
 			func(ppfmt pp.PP, m *mocks.MockSetter) {
@@ -478,8 +478,8 @@ func TestUpdateIPs(t *testing.T) {
 		},
 		"both": {
 			true,
-			[]string{},
-			[]string{},
+			nil,
+			nil,
 			ppBoth,
 			mockproviders{ipnet.IP4: provider4, ipnet.IP6: provider6},
 			func(ppfmt pp.PP, m *mocks.MockSetter) {
@@ -676,8 +676,8 @@ func TestDeleteIPs(t *testing.T) {
 	}{
 		"none": {
 			true,
-			[]string{},
-			[]string{},
+			nil,
+			nil,
 			nil,
 			mockproviders{},
 			nil,