Repository: favonia/cloudflare-ddns
Pull request #513 (2023-06-06 21:30:44)

docs(CHANGELOG): get ready to release 1.9.3

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/favonia/cloudflare-ddns/pull/513?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia) Report
> Merging [#513](https://app.codecov.io/gh/favonia/cloudflare-ddns/pull/513?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia) (3a1a263) into [main](https://app.codecov.io/gh/favonia/cloudflare-ddns/commit/a86834de81828513f3a30ff7346c6e9332dd6163?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia) (a86834d) will **not change** coverage.
> The diff coverage is `100.00%`.

> :exclamation: Current head 3a1a263 differs from pull request most recent head f152aa3. Consider uploading reports for the commit f152aa3 to get more accurate results

```diff
@@           Coverage Diff           @@
##             main     #513   +/-   ##
=======================================
  Coverage   87.74%   87.74%           
=======================================
  Files          43       43           
  Lines        2163     2163           
=======================================
  Hits         1898     1898           
  Misses        256      256           
  Partials        9        9           
```

| Flag | Coverage Δ | |
|---|---|---|
| unittests | `87.74% <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.

| [Impacted Files](https://app.codecov.io/gh/favonia/cloudflare-ddns/pull/513?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia) | Coverage Δ | |
|---|---|---|
| [internal/provider/cloudflare\_doh.go](https://app.codecov.io/gh/favonia/cloudflare-ddns/pull/513?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia#diff-aW50ZXJuYWwvcHJvdmlkZXIvY2xvdWRmbGFyZV9kb2guZ28=) | `100.00% <100.00%> (ø)` | |
| [internal/provider/cloudflare\_trace.go](https://app.codecov.io/gh/favonia/cloudflare-ddns/pull/513?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia#diff-aW50ZXJuYWwvcHJvdmlkZXIvY2xvdWRmbGFyZV90cmFjZS5nbw==) | `100.00% <100.00%> (ø)` | |
| [internal/provider/protocol/switch.go](https://app.codecov.io/gh/favonia/cloudflare-ddns/pull/513?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=favonia#diff-aW50ZXJuYWwvcHJvdmlkZXIvcHJvdG9jb2wvc3dpdGNoLmdv) | `100.00% <100.00%> (ø)` | |

:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?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 0250a59..3e9ed10 100644
--- a/CHANGELOG.markdown
+++ b/CHANGELOG.markdown
@@ -1,3 +1,17 @@
+## [1.9.3](https://github.com/favonia/cloudflare-ddns/compare/v1.9.2...v1.9.3) (2023-06-05)
+
+This version will automatically switch to 1.0.0.1 when 1.1.1.1 appears to be blocked or intercepted by your ISP or your router. The blockage and interception should not happen, but many ISPs and routers were misconfigured to use 1.1.1.1 as a private IP. The new updater tries to work around it by switching to 1.0.0.1. The long-term solution is to notify your ISP or upgrade your router.
+
+### Bug Fixes
+
+- **setter:** quote DNS record IDs to prevent injection attacks ([#502](https://github.com/favonia/cloudflare-ddns/issues/502)) ([d978c68](https://github.com/favonia/cloudflare-ddns/commit/d978c68e61d3d73a927c95d1aff779133b998c3b))
+
+### Features
+
+- **config:** display a message when 1.0.0.1 also doesn't work ([#495](https://github.com/favonia/cloudflare-ddns/issues/495)) ([5f5602d](https://github.com/favonia/cloudflare-ddns/commit/5f5602d5965350f5a7ef2a3eefc136002d73a2a4))
+- **config:** check 1.1.1.1 only when IPv4 is used ([#494](https://github.com/favonia/cloudflare-ddns/issues/494)) ([d0db1be](https://github.com/favonia/cloudflare-ddns/commit/d0db1be82e6f9df0e894f9e6ea001b83701dfd81))
+- **config:** use 1.0.0.1 when 1.1.1.1 is blocked ([#491](https://github.com/favonia/cloudflare-ddns/issues/491)) ([8b9d160](https://github.com/favonia/cloudflare-ddns/commit/8b9d1603c92bf42995a9bd4febfa5506086ea190))
+
 # [1.9.2](https://github.com/favonia/cloudflare-ddns/compare/v1.9.1...v1.9.2) (2023-04-11)
 
 ### Bug Fixes
diff --git a/internal/provider/cloudflare_doh.go b/internal/provider/cloudflare_doh.go
index 7ed993c..5bb372f 100644
--- a/internal/provider/cloudflare_doh.go
+++ b/internal/provider/cloudflare_doh.go
@@ -20,8 +20,8 @@ func NewCloudflareDOH() Provider {
 		}{
 			ipnet.IP4: {
 				protocol.Switchable{
-					Use1111: "https://1.1.1.1/dns-query",
-					Use1001: "https://1.0.0.1/dns-query",
+					ValueFor1111: "https://1.1.1.1/dns-query",
+					ValueFor1001: "https://1.0.0.1/dns-query",
 				},
 				"whoami.cloudflare.", dnsmessage.ClassCHAOS,
 			},
diff --git a/internal/provider/cloudflare_trace.go b/internal/provider/cloudflare_trace.go
index 4bb035a..29d77c0 100644
--- a/internal/provider/cloudflare_trace.go
+++ b/internal/provider/cloudflare_trace.go
@@ -17,8 +17,8 @@ func NewCloudflareTrace() Provider {
 		}{
 			ipnet.IP4: {
 				protocol.Switchable{
-					Use1111: "https://1.1.1.1/cdn-cgi/trace",
-					Use1001: "https://1.0.0.1/cdn-cgi/trace",
+					ValueFor1111: "https://1.1.1.1/cdn-cgi/trace",
+					ValueFor1001: "https://1.0.0.1/cdn-cgi/trace",
 				},
 				"ip",
 			},
diff --git a/internal/provider/protocol/switch.go b/internal/provider/protocol/switch.go
index 4a776d8..3512c4d 100644
--- a/internal/provider/protocol/switch.go
+++ b/internal/provider/protocol/switch.go
@@ -9,14 +9,14 @@ type Constant string
 func (c Constant) Switch(_ bool) string { return string(c) }
 
 type Switchable struct {
-	Use1111 string
-	Use1001 string
+	ValueFor1001 string
+	ValueFor1111 string
 }
 
 func (s Switchable) Switch(use1001 bool) string {
 	if use1001 {
-		return s.Use1001
+		return s.ValueFor1001
 	} else {
-		return s.Use1111
+		return s.ValueFor1111
 	}
 }


Test patch:
diff --git a/internal/provider/protocol/switch_test.go b/internal/provider/protocol/switch_test.go
index e1af991..8491bea 100644
--- a/internal/provider/protocol/switch_test.go
+++ b/internal/provider/protocol/switch_test.go
@@ -17,7 +17,7 @@ func TestConstant(t *testing.T) {
 
 func TestSwitchable(t *testing.T) {
 	t.Parallel()
-	s := protocol.Switchable{Use1001: "very secret string 1", Use1111: "very secret string 2"}
+	s := protocol.Switchable{ValueFor1001: "very secret string 1", ValueFor1111: "very secret string 2"}
 	require.Equal(t, s.Switch(false), "very secret string 2")
 	require.Equal(t, s.Switch(true), "very secret string 1")
 }