Skip to content

Commit e1ffd80

Browse files
committed
Updated dnscrypt-proxy to 2.0.31
1 parent f4a48fd commit e1ffd80

File tree

6 files changed

+81
-29
lines changed

6 files changed

+81
-29
lines changed
54.5 KB
Binary file not shown.
43.5 KB
Binary file not shown.

SimpleDnsCrypt/Helper/PatchHelper.cs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
public static class PatchHelper
77
{
88
public static bool Patch()
9-
{
10-
var version = VersionHelper.PublishVersion;
9+
{
10+
var version = VersionHelper.PublishVersion;
1111
if (!DnscryptProxyConfigurationManager.LoadConfiguration()) return false;
1212
if (version.Equals("0.6.5"))
13-
{
13+
{
1414
//added: netprobe_address = '255.255.255.0:53'
1515
//changed: netprobe_timeout = 0
1616
DnscryptProxyConfigurationManager.DnscryptProxyConfiguration.netprobe_address = "255.255.255.0:53";
1717
DnscryptProxyConfigurationManager.DnscryptProxyConfiguration.netprobe_timeout = 0;
1818
return DnscryptProxyConfigurationManager.SaveConfiguration();
19-
}
19+
}
2020
if (version.Equals("0.6.6"))
2121
{
2222
//changed: netprobe_address = '9.9.9.9:53'
@@ -25,7 +25,23 @@ public static bool Patch()
2525
DnscryptProxyConfigurationManager.DnscryptProxyConfiguration.netprobe_timeout = 60;
2626
return DnscryptProxyConfigurationManager.SaveConfiguration();
2727
}
28+
if (version.Equals("0.6.8"))
29+
{
30+
//changed: timeout = 5000
31+
//added: reject_ttl = 600
32+
//changed: cache_size = 1024
33+
//changed: cache_min_ttl = 2400
34+
//added: cache_neg_min_ttl = 60
35+
//added: cache_neg_max_ttl = 600
36+
DnscryptProxyConfigurationManager.DnscryptProxyConfiguration.timeout = 5000;
37+
DnscryptProxyConfigurationManager.DnscryptProxyConfiguration.reject_ttl = 600;
38+
DnscryptProxyConfigurationManager.DnscryptProxyConfiguration.cache_size = 1024;
39+
DnscryptProxyConfigurationManager.DnscryptProxyConfiguration.cache_min_ttl = 2400;
40+
DnscryptProxyConfigurationManager.DnscryptProxyConfiguration.cache_neg_min_ttl = 60;
41+
DnscryptProxyConfigurationManager.DnscryptProxyConfiguration.cache_neg_max_ttl = 600;
42+
return DnscryptProxyConfigurationManager.SaveConfiguration();
43+
}
2844
return false;
29-
}
45+
}
3046
}
3147
}

SimpleDnsCrypt/Models/DnscryptProxyConfiguration.cs

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ public class DnscryptProxyConfiguration : PropertyChangedBase
3939
private int _log_files_max_age;
4040
private int _log_files_max_backups;
4141
private bool _block_ipv6;
42+
private int _reject_ttl;
4243
private string _forwarding_rules;
4344
private string _cloaking_rules;
44-
private int _cache_neg_ttl;
45+
private int _cache_neg_min_ttl;
46+
private int _cache_neg_max_ttl;
4547
private int _cache_max_ttl;
4648
private int _cache_min_ttl;
4749
private int _cache_size;
@@ -51,7 +53,7 @@ public class DnscryptProxyConfiguration : PropertyChangedBase
5153
private Dictionary<string, Static> _static;
5254
private string _proxy;
5355
private ObservableCollection<string> _disabled_server_names;
54-
private bool _refused_code_in_responses;
56+
private string _blocked_query_response;
5557

5658
[TomlIgnore]
5759
public new bool IsNotifying
@@ -139,17 +141,18 @@ public ObservableCollection<string> disabled_server_names
139141
}
140142

141143
/// <summary>
142-
/// Use the REFUSED return code for blocked responses
143-
/// Setting this to `false` means that some responses will be lies.
144-
/// Unfortunately, `false` appears to be required for Android 8+
144+
/// Response for blocked queries. Options are `refused`, `hinfo` (default) or
145+
/// an IP response. To give an IP response, use the format `a:<IPv4>,aaaa:<IPv6>`.
146+
/// Using the `hinfo` option means that some responses will be lies.
147+
/// Unfortunately, the `hinfo` option appears to be required for Android 8+
145148
/// </summary>
146-
public bool refused_code_in_responses
149+
public string blocked_query_response
147150
{
148-
get => _refused_code_in_responses;
151+
get => _blocked_query_response;
149152
set
150153
{
151-
_refused_code_in_responses = value;
152-
NotifyOfPropertyChange(() => refused_code_in_responses);
154+
_blocked_query_response = value;
155+
NotifyOfPropertyChange(() => blocked_query_response);
153156
}
154157
}
155158

@@ -360,7 +363,7 @@ public bool lb_estimator
360363
NotifyOfPropertyChange(() => lb_estimator);
361364
}
362365
}
363-
366+
364367
/// <summary>
365368
/// Maximum time (in seconds) to wait for network connectivity before initializing the proxy.
366369
/// Useful if the proxy is automatically started at boot, and network
@@ -539,6 +542,19 @@ public bool block_ipv6
539542
}
540543
}
541544

545+
/// <summary>
546+
/// TTL for synthetic responses sent when a request has been blocked (due to IPv6 or blacklists).
547+
/// </summary>
548+
public int reject_ttl
549+
{
550+
get => _reject_ttl;
551+
set
552+
{
553+
_reject_ttl = value;
554+
NotifyOfPropertyChange(() => reject_ttl);
555+
}
556+
}
557+
542558
/// <summary>
543559
/// Forwarding rule file.
544560
/// </summary>
@@ -564,7 +580,7 @@ public string cloaking_rules
564580
NotifyOfPropertyChange(() => cloaking_rules);
565581
}
566582
}
567-
583+
568584
/// <summary>
569585
/// Enable a DNS cache to reduce latency and outgoing traffic.
570586
/// </summary>
@@ -618,15 +634,28 @@ public int cache_max_ttl
618634
}
619635

620636
/// <summary>
621-
/// TTL for negatively cached entries.
637+
/// Minimum TTL for negatively cached entries.
638+
/// </summary>
639+
public int cache_neg_min_ttl
640+
{
641+
get => _cache_neg_min_ttl;
642+
set
643+
{
644+
_cache_neg_min_ttl = value;
645+
NotifyOfPropertyChange(() => cache_neg_min_ttl);
646+
}
647+
}
648+
649+
/// <summary>
650+
/// Maximum TTL for negatively cached entries
622651
/// </summary>
623-
public int cache_neg_ttl
652+
public int cache_neg_max_ttl
624653
{
625-
get => _cache_neg_ttl;
654+
get => _cache_neg_max_ttl;
626655
set
627656
{
628-
_cache_neg_ttl = value;
629-
NotifyOfPropertyChange(() => cache_neg_ttl);
657+
_cache_neg_max_ttl = value;
658+
NotifyOfPropertyChange(() => cache_neg_max_ttl);
630659
}
631660
}
632661

SimpleDnsCrypt/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
ResourceDictionaryLocation.None,
1515
ResourceDictionaryLocation.SourceAssembly
1616
)]
17-
[assembly: AssemblyVersion("0.6.7")]
18-
[assembly: AssemblyFileVersion("0.6.7")]
17+
[assembly: AssemblyVersion("0.6.8")]
18+
[assembly: AssemblyFileVersion("0.6.8")]

SimpleDnsCrypt/dnscrypt-proxy/dnscrypt-proxy.toml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require_dnssec = true
88
require_nolog = true
99
require_nofilter = true
1010
force_tcp = false
11-
timeout = 2500
11+
timeout = 5000
1212
keepalive = 30
1313
cert_refresh_delay = 240
1414
fallback_resolver = '9.9.9.9:53'
@@ -19,13 +19,14 @@ log_files_max_size = 10
1919
log_files_max_age = 7
2020
log_files_max_backups = 1
2121
block_ipv6 = true
22+
reject_ttl = 600
2223
cache = true
23-
cache_size = 256
24-
cache_min_ttl = 600
24+
cache_size = 1024
25+
cache_min_ttl = 2400
2526
cache_max_ttl = 86400
26-
cache_neg_ttl = 60
27+
cache_neg_min_ttl = 60
28+
cache_neg_max_ttl = 600
2729
disabled_server_names = []
28-
refused_code_in_responses = false
2930
[query_log]
3031
format = 'ltsv'
3132

@@ -42,5 +43,11 @@ refused_code_in_responses = false
4243
urls = ['https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v2/public-resolvers.md', 'https://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md']
4344
cache_file = 'public-resolvers.md'
4445
minisign_key = 'RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3'
45-
refresh_delay = 72
4646
prefix = ''
47+
48+
[sources.'relays']
49+
urls = ['https://github.com/DNSCrypt/dnscrypt-resolvers/raw/master/v2/relays.md', 'https://download.dnscrypt.info/resolvers-list/v2/relays.md']
50+
cache_file = 'relays.md'
51+
minisign_key = 'RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3'
52+
refresh_delay = 72
53+
prefix = ''

0 commit comments

Comments
 (0)