From 32c54c3028289469970a82cacce9caea854098b9 Mon Sep 17 00:00:00 2001 From: decodism <77468771+decodism@users.noreply.github.com> Date: Mon, 4 Apr 2022 01:14:28 +0200 Subject: [PATCH 1/6] Save text entries without return --- DNSecure/Views/DetailView.swift | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/DNSecure/Views/DetailView.swift b/DNSecure/Views/DetailView.swift index 4dfc954..42d43a0 100644 --- a/DNSecure/Views/DetailView.swift +++ b/DNSecure/Views/DetailView.swift @@ -48,8 +48,8 @@ extension DetailView: View { get: { configuration.servers[i] }, set: { configuration.servers[i] = $0 } ), - onCommit: { - self.server.configuration = .dnsOverTLS(configuration) + onEditingChanged: { + if (!$0) { self.server.configuration = .dnsOverTLS(configuration) } } ) .textContentType(.URL) @@ -87,8 +87,8 @@ extension DetailView: View { configuration.serverName = $0 } ), - onCommit: { - self.server.configuration = .dnsOverTLS(configuration) + onEditingChanged: { + if (!$0) { self.server.configuration = .dnsOverTLS(configuration) } } ) .multilineTextAlignment(.trailing) @@ -113,8 +113,8 @@ extension DetailView: View { get: { configuration.servers[i] }, set: { configuration.servers[i] = $0 } ), - onCommit: { - self.server.configuration = .dnsOverHTTPS(configuration) + onEditingChanged: { + if (!$0) { self.server.configuration = .dnsOverHTTPS(configuration) } } ) .textContentType(.URL) @@ -152,8 +152,8 @@ extension DetailView: View { configuration.serverURL = URL(string: $0) } ), - onCommit: { - self.server.configuration = .dnsOverHTTPS(configuration) + onEditingChanged: { + if (!$0) { self.server.configuration = .dnsOverHTTPS(configuration) } } ) .multilineTextAlignment(.trailing) From 73cd4c75ae45befeeb4888096be43e2d7e1ce88e Mon Sep 17 00:00:00 2001 From: decodism <77468771+decodism@users.noreply.github.com> Date: Mon, 4 Apr 2022 01:14:52 +0200 Subject: [PATCH 2/6] Trim text entries --- DNSecure/Views/DetailView.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DNSecure/Views/DetailView.swift b/DNSecure/Views/DetailView.swift index 42d43a0..eed57cf 100644 --- a/DNSecure/Views/DetailView.swift +++ b/DNSecure/Views/DetailView.swift @@ -46,7 +46,7 @@ extension DetailView: View { "IP address", text: .init( get: { configuration.servers[i] }, - set: { configuration.servers[i] = $0 } + set: { configuration.servers[i] = $0.trimmingCharacters(in: .whitespacesAndNewlines) } ), onEditingChanged: { if (!$0) { self.server.configuration = .dnsOverTLS(configuration) } @@ -84,7 +84,7 @@ extension DetailView: View { configuration.serverName ?? "" }, set: { - configuration.serverName = $0 + configuration.serverName = $0.trimmingCharacters(in: .whitespacesAndNewlines) } ), onEditingChanged: { @@ -111,7 +111,7 @@ extension DetailView: View { "IP address", text: .init( get: { configuration.servers[i] }, - set: { configuration.servers[i] = $0 } + set: { configuration.servers[i] = $0.trimmingCharacters(in: .whitespacesAndNewlines) } ), onEditingChanged: { if (!$0) { self.server.configuration = .dnsOverHTTPS(configuration) } @@ -149,7 +149,7 @@ extension DetailView: View { configuration.serverURL?.absoluteString ?? "" }, set: { - configuration.serverURL = URL(string: $0) + configuration.serverURL = URL(string: $0.trimmingCharacters(in: .whitespacesAndNewlines)) } ), onEditingChanged: { From b3b1fdd6ace9359dbc9948d2555fc38630719da3 Mon Sep 17 00:00:00 2001 From: decodism <77468771+decodism@users.noreply.github.com> Date: Mon, 4 Apr 2022 01:15:31 +0200 Subject: [PATCH 3/6] Update 1.1.1.1 preset --- DNSecure/Models/Presets.swift | 36 +++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/DNSecure/Models/Presets.swift b/DNSecure/Models/Presets.swift index 67f7b5e..2f39ffb 100644 --- a/DNSecure/Models/Presets.swift +++ b/DNSecure/Models/Presets.swift @@ -44,8 +44,8 @@ enum Presets { servers: [ "1.1.1.1", "1.0.0.1", - "2606:4700:4700::64", - "2606:4700:4700::6400", + "2606:4700:4700::1111", + "2606:4700:4700::1001", ], serverName: "cloudflare-dns.com" ) @@ -58,13 +58,41 @@ enum Presets { servers: [ "1.1.1.1", "1.0.0.1", - "2606:4700:4700::64", - "2606:4700:4700::6400", + "2606:4700:4700::1111", + "2606:4700:4700::1001", ], serverURL: URL(string: "https://cloudflare-dns.com/dns-query") ) ) ), + .init( + name: "1.1.1.1 (Block Malware)", + configuration: .dnsOverTLS( + DoTConfiguration( + servers: [ + "1.1.1.2", + "1.0.0.2", + "2606:4700:4700::1112", + "2606:4700:4700::1002", + ], + serverName: "cloudflare-dns.com" + ) + ) + ), + .init( + name: "1.1.1.1 (Block Malware)", + configuration: .dnsOverHTTPS( + DoHConfiguration( + servers: [ + "1.1.1.2", + "1.0.0.2", + "2606:4700:4700::1112", + "2606:4700:4700::1002", + ], + serverURL: URL(string: "https://security.cloudflare-dns.com/dns-query") + ) + ) + ), .init( name: "Quad9", configuration: .dnsOverTLS( From 3c8c13c90657ca668a720b8db47e82f4aa27473a Mon Sep 17 00:00:00 2001 From: decodism <77468771+decodism@users.noreply.github.com> Date: Mon, 4 Apr 2022 01:15:55 +0200 Subject: [PATCH 4/6] Update Quad9 preset --- DNSecure/Models/Presets.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DNSecure/Models/Presets.swift b/DNSecure/Models/Presets.swift index 2f39ffb..8fae365 100644 --- a/DNSecure/Models/Presets.swift +++ b/DNSecure/Models/Presets.swift @@ -94,28 +94,28 @@ enum Presets { ) ), .init( - name: "Quad9", + name: "Quad9 (Block Malware)", configuration: .dnsOverTLS( DoTConfiguration( servers: [ "9.9.9.9", "149.112.112.112", "2620:fe::fe", - "2620:fe::fe:9", + "2620:fe::9", ], serverName: "dns.quad9.net" ) ) ), .init( - name: "Quad9", + name: "Quad9 (Block Malware)", configuration: .dnsOverHTTPS( DoHConfiguration( servers: [ "9.9.9.9", "149.112.112.112", "2620:fe::fe", - "2620:fe::fe:9", + "2620:fe::9", ], serverURL: URL(string: "https://dns.quad9.net/dns-query") ) From 7cd23369984609ae2a38eaa395e0de6419ba4674 Mon Sep 17 00:00:00 2001 From: decodism <77468771+decodism@users.noreply.github.com> Date: Mon, 4 Apr 2022 01:16:21 +0200 Subject: [PATCH 5/6] Update LibreDNS preset --- DNSecure/Models/Presets.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/DNSecure/Models/Presets.swift b/DNSecure/Models/Presets.swift index 8fae365..0b65ec5 100644 --- a/DNSecure/Models/Presets.swift +++ b/DNSecure/Models/Presets.swift @@ -121,6 +121,17 @@ enum Presets { ) ) ), + .init( + name: "LibreDNS", + configuration: .dnsOverTLS( + DoTConfiguration( + servers: [ + "116.202.176.26", + ], + serverName: "dot.libredns.gr" + ) + ) + ), .init( name: "LibreDNS", configuration: .dnsOverHTTPS( @@ -133,7 +144,7 @@ enum Presets { ) ), .init( - name: "LibreDNS (No Ads)", + name: "LibreDNS (Block Ads / Trackers)", configuration: .dnsOverHTTPS( DoHConfiguration( servers: [ From 336162dda4793fa27a5f79df12011d74a9675ee0 Mon Sep 17 00:00:00 2001 From: decodism <77468771+decodism@users.noreply.github.com> Date: Mon, 4 Apr 2022 01:16:40 +0200 Subject: [PATCH 6/6] Add AdGuard DNS preset --- DNSecure/Models/Presets.swift | 56 +++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/DNSecure/Models/Presets.swift b/DNSecure/Models/Presets.swift index 0b65ec5..026c1d7 100644 --- a/DNSecure/Models/Presets.swift +++ b/DNSecure/Models/Presets.swift @@ -154,5 +154,61 @@ enum Presets { ) ) ), + .init( + name: "AdGuard DNS", + configuration: .dnsOverTLS( + DoTConfiguration( + servers: [ + "94.140.14.140", + "94.140.14.141", + "2a10:50c0::1:ff", + "2a10:50c0::2:ff", + ], + serverName: "dns-unfiltered.adguard.com" + ) + ) + ), + .init( + name: "AdGuard DNS", + configuration: .dnsOverHTTPS( + DoHConfiguration( + servers: [ + "94.140.14.140", + "94.140.14.141", + "2a10:50c0::1:ff", + "2a10:50c0::2:ff", + ], + serverURL: URL(string: "https://dns-unfiltered.adguard.com/dns-query") + ) + ) + ), + .init( + name: "AdGuard DNS (Block Ads / Trackers)", + configuration: .dnsOverTLS( + DoTConfiguration( + servers: [ + "94.140.14.14", + "94.140.15.15", + "2a10:50c0::ad1:ff", + "2a10:50c0::ad2:ff", + ], + serverName: "dns.adguard.com" + ) + ) + ), + .init( + name: "AdGuard DNS (Block Ads / Trackers)", + configuration: .dnsOverHTTPS( + DoHConfiguration( + servers: [ + "94.140.14.14", + "94.140.15.15", + "2a10:50c0::ad1:ff", + "2a10:50c0::ad2:ff", + ], + serverURL: URL(string: "https://dns.adguard.com/dns-query") + ) + ) + ), ] }