docstring_tokens
stringlengths
18
16.9k
code_tokens
stringlengths
75
1.81M
html_url
stringlengths
74
116
file_name
stringlengths
3
311
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> log.Info("tls: number of certs: %d", len(parsedCerts)) <mask> <mask> if !aghtls.CertificateHasIP(parsedCerts[0]) { <mask> err = errors.Error(`certificate has no IP addresses` + <mask> `, this may cause issues with DNS-over-TLS clients`) <mask> } <mask> <mask> return parsedCerts, true, err <mask> } <mask> </s> Pull request: 4927-imp-ui Updates #4927. Squashed commit of the following: commit 510143325805133e379ebc207cdc6bff59c94ade Author: Ainar Garipov <[email protected]> Date: Tue Nov 22 15:00:13 2022 +0300 home: imp err commit fd65a9914494b6dccdee7c0f0aa08bce80ce0945 Author: Ainar Garipov <[email protected]> Date: Mon Nov 21 18:53:39 2022 +0300 client: imp validation ui </s> add // errNoIPInCert is the error that is returned from [parseCertChain] if the leaf // certificate doesn't contain IPs. const errNoIPInCert errors.Error = `certificates has no IP addresses; ` + `DNS-over-TLS won't be advertised via DDR` </s> add "encryption_warning": "Warning", </s> add const isWarning = valid_key && valid_cert && valid_pair; </s> remove {warning_validation && ( <div className="col-12"> <p className="text-danger">{warning_validation}</p> </div> )} </s> add {validationMessage(warning_validation, isWarning)}
https://github.com/AdguardTeam/AdGuardHome/commit/08282dc4d9958d8a2ac6163d6d0921517ec45f92
internal/home/tls.go
keep keep keep replace keep keep keep keep keep
<mask> 'name': 'build' <mask> <mask> 'env': <mask> 'GO_VERSION': '1.18' <mask> 'NODE_VERSION': '14' <mask> <mask> 'on': <mask> 'push': <mask> 'branches': </s> all: use precise go version in github workflows </s> remove 'GO_VERSION': '1.18' </s> add 'GO_VERSION': '1.18.6' </s> remove 'uses': 'actions/setup-go@v2' </s> add 'uses': 'actions/setup-go@v3' </s> remove 'uses': 'actions/setup-go@v2' </s> add 'uses': 'actions/setup-go@v3' </s> remove 'uses': 'actions/setup-go@v2' </s> add 'uses': 'actions/setup-go@v3'
https://github.com/AdguardTeam/AdGuardHome/commit/08799e9d0a335046f315977aefc4e468b60fddc0
.github/workflows/build.yml
keep keep keep keep replace keep keep keep keep keep
<mask> 'uses': 'actions/checkout@v2' <mask> 'with': <mask> 'fetch-depth': 0 <mask> - 'name': 'Set up Go' <mask> 'uses': 'actions/setup-go@v2' <mask> 'with': <mask> 'go-version': '${{ env.GO_VERSION }}' <mask> - 'name': 'Set up Node' <mask> 'uses': 'actions/setup-node@v1' <mask> 'with': </s> all: use precise go version in github workflows </s> remove 'uses': 'actions/setup-go@v2' </s> add 'uses': 'actions/setup-go@v3' </s> remove 'uses': 'actions/setup-go@v2' </s> add 'uses': 'actions/setup-go@v3' </s> remove 'GO_VERSION': '1.18' </s> add 'GO_VERSION': '1.18.6' </s> remove 'GO_VERSION': '1.18' </s> add 'GO_VERSION': '1.18.6'
https://github.com/AdguardTeam/AdGuardHome/commit/08799e9d0a335046f315977aefc4e468b60fddc0
.github/workflows/build.yml
keep keep keep keep replace keep keep keep keep keep
<mask> 'uses': 'actions/checkout@v2' <mask> 'with': <mask> 'fetch-depth': 0 <mask> - 'name': 'Set up Go' <mask> 'uses': 'actions/setup-go@v2' <mask> 'with': <mask> 'go-version': '${{ env.GO_VERSION }}' <mask> - 'name': 'Set up Node' <mask> 'uses': 'actions/setup-node@v1' <mask> 'with': </s> all: use precise go version in github workflows
https://github.com/AdguardTeam/AdGuardHome/commit/08799e9d0a335046f315977aefc4e468b60fddc0
.github/workflows/build.yml
keep keep keep replace keep keep keep keep keep
<mask> 'name': 'lint' <mask> <mask> 'env': <mask> 'GO_VERSION': '1.18' <mask> <mask> 'on': <mask> 'push': <mask> 'tags': <mask> - 'v*' </s> all: use precise go version in github workflows </s> remove 'GO_VERSION': '1.18' </s> add 'GO_VERSION': '1.18.6' </s> remove 'uses': 'actions/setup-go@v2' </s> add 'uses': 'actions/setup-go@v3' </s> remove 'uses': 'actions/setup-go@v2' </s> add 'uses': 'actions/setup-go@v3' </s> remove 'uses': 'actions/setup-go@v2' </s> add 'uses': 'actions/setup-go@v3'
https://github.com/AdguardTeam/AdGuardHome/commit/08799e9d0a335046f315977aefc4e468b60fddc0
.github/workflows/lint.yml
keep keep keep keep replace keep keep keep keep keep
<mask> 'runs-on': 'ubuntu-latest' <mask> 'steps': <mask> - 'uses': 'actions/checkout@v2' <mask> - 'name': 'Set up Go' <mask> 'uses': 'actions/setup-go@v2' <mask> 'with': <mask> 'go-version': '${{ env.GO_VERSION }}' <mask> - 'name': 'run-lint' <mask> 'run': > <mask> make go-deps go-tools go-lint </s> all: use precise go version in github workflows </s> remove 'uses': 'actions/setup-go@v2' </s> add 'uses': 'actions/setup-go@v3' </s> remove 'uses': 'actions/setup-go@v2' </s> add 'uses': 'actions/setup-go@v3' </s> remove 'GO_VERSION': '1.18' </s> add 'GO_VERSION': '1.18.6' </s> remove 'GO_VERSION': '1.18' </s> add 'GO_VERSION': '1.18.6'
https://github.com/AdguardTeam/AdGuardHome/commit/08799e9d0a335046f315977aefc4e468b60fddc0
.github/workflows/lint.yml
keep keep keep keep replace keep keep keep keep keep
<mask> go 1.16 <mask> <mask> require ( <mask> github.com/AdguardTeam/dnsproxy v0.39.8 <mask> github.com/AdguardTeam/golibs v0.9.3 <mask> github.com/AdguardTeam/urlfilter v0.14.6 <mask> github.com/NYTimes/gziphandler v1.1.1 <mask> github.com/ameshkov/dnscrypt/v2 v2.2.2 <mask> github.com/digineo/go-ipset/v2 v2.2.1 <mask> github.com/fsnotify/fsnotify v1.4.9 </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove github.com/AdguardTeam/golibs v0.9.3 h1:noeKHJEzrSwxzX0Zi3USM3cXf1qQV99SO772jet/uEY= github.com/AdguardTeam/golibs v0.9.3/go.mod h1:fCAMwPBJ8S7YMYbTWvYS+eeTLblP5E04IDtNAo7y7IY= </s> add github.com/AdguardTeam/golibs v0.10.0 h1:A7MXRfZ+ItpOyS9tWKtqrLj3vZtE9FJFC+dOVY/LcWs= github.com/AdguardTeam/golibs v0.10.0/go.mod h1:rSfQRGHIdgfxriDDNgNJ7HmE5zRoURq8R+VdR81Zuzw= </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove quarterDay = 6 * time.Hour day = 24 * time.Hour week = day * 7 month = day * 30 threeMonths = day * 90 </s> add quarterDay = timeutil.Day / 4 day = timeutil.Day week = timeutil.Day * 7 month = timeutil.Day * 30 threeMonths = timeutil.Day * 90
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
go.mod
keep keep keep keep replace keep keep keep keep keep
<mask> github.com/stretchr/testify v1.7.0 <mask> github.com/ti-mo/netfilter v0.4.0 <mask> go.etcd.io/bbolt v1.3.6 <mask> golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 <mask> golang.org/x/net v0.0.0-20210825183410-e898025ed96a <mask> golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e <mask> gopkg.in/natefinch/lumberjack.v2 v2.0.0 <mask> gopkg.in/yaml.v2 v2.4.0 <mask> howett.net/plist v0.0.0-20201203080718-1454fab16a06 <mask> ) </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove golang.org/x/net v0.0.0-20210825183410-e898025ed96a h1:bRuuGXV8wwSdGTB+CtJf+FjgO1APK1CoO39T4BN/XBw= golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= </s> add golang.org/x/net v0.0.0-20210929193557-e81a3d93ecf6 h1:Z04ewVs7JhXaYkmDhBERPi41gnltfQpMWDnTnQbaCqk= golang.org/x/net v0.0.0-20210929193557-e81a3d93ecf6/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil"
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
go.mod
keep keep keep keep replace replace keep keep keep keep keep
<mask> github.com/AdguardTeam/dnsproxy v0.39.8/go.mod h1:eDpJKAdkHORRwAedjuERv+7SWlcz4cn+5uwrbUAWHRY= <mask> github.com/AdguardTeam/golibs v0.4.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/golibs v0.4.2/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/golibs v0.9.2/go.mod h1:fCAMwPBJ8S7YMYbTWvYS+eeTLblP5E04IDtNAo7y7IY= <mask> github.com/AdguardTeam/golibs v0.9.3 h1:noeKHJEzrSwxzX0Zi3USM3cXf1qQV99SO772jet/uEY= <mask> github.com/AdguardTeam/golibs v0.9.3/go.mod h1:fCAMwPBJ8S7YMYbTWvYS+eeTLblP5E04IDtNAo7y7IY= <mask> github.com/AdguardTeam/gomitmproxy v0.2.0/go.mod h1:Qdv0Mktnzer5zpdpi5rAwixNJzW2FN91LjKJCkVbYGU= <mask> github.com/AdguardTeam/urlfilter v0.14.6 h1:emqoKZElooHACYehRBYENeKVN1a/rspxiqTIMYLuoIo= <mask> github.com/AdguardTeam/urlfilter v0.14.6/go.mod h1:klx4JbOfc4EaNb5lWLqOwfg+pVcyRukmoJRvO55lL5U= <mask> github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= <mask> github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove github.com/AdguardTeam/golibs v0.9.3 </s> add github.com/AdguardTeam/golibs v0.10.0 </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove QueryLogInterval aghtime.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> add QueryLogInterval timeutil.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add </s> remove "time" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
go.sum
keep keep keep keep replace replace keep keep keep keep keep
<mask> golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= <mask> golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= <mask> golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= <mask> golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= <mask> golang.org/x/net v0.0.0-20210825183410-e898025ed96a h1:bRuuGXV8wwSdGTB+CtJf+FjgO1APK1CoO39T4BN/XBw= <mask> golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= <mask> golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= <mask> golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= <mask> golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= <mask> golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= <mask> golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove golang.org/x/net v0.0.0-20210825183410-e898025ed96a </s> add golang.org/x/net v0.0.0-20210929193557-e81a3d93ecf6 </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove FastestTimeout aghtime.Duration `yaml:"fastest_timeout"` </s> add FastestTimeout timeutil.Duration `yaml:"fastest_timeout"` </s> remove QueryLogInterval aghtime.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> add QueryLogInterval timeutil.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
go.sum
keep keep keep keep replace keep keep keep keep keep
<mask> golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= <mask> golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= <mask> golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= <mask> golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= <mask> golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= <mask> golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= <mask> golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= <mask> golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= <mask> golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= <mask> golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> add golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove FastestTimeout aghtime.Duration `yaml:"fastest_timeout"` </s> add FastestTimeout timeutil.Duration `yaml:"fastest_timeout"` </s> remove QueryLogInterval aghtime.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> add QueryLogInterval timeutil.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
go.sum
keep keep keep add keep keep keep keep
<mask> golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= <mask> golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= <mask> golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= <mask> golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= <mask> golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= <mask> golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= <mask> golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= <mask> golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= </s> add </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove FastestTimeout aghtime.Duration `yaml:"fastest_timeout"` </s> add FastestTimeout timeutil.Duration `yaml:"fastest_timeout"` </s> remove QueryLogInterval aghtime.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> add QueryLogInterval timeutil.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
go.sum
keep add keep keep keep keep keep keep
<mask> "github.com/AdguardTeam/golibs/netutil" <mask> "github.com/AdguardTeam/golibs/stringutil" <mask> "github.com/go-ping/ping" <mask> "github.com/insomniacslk/dhcp/dhcpv4" <mask> "github.com/insomniacslk/dhcp/dhcpv4/server4" <mask> "github.com/mdlayher/raw" <mask> ) <mask> </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add </s> add "github.com/AdguardTeam/golibs/timeutil"
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/dhcpd/v4.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> s.leasedOffsets = newBitSet() <mask> <mask> if conf.LeaseDuration == 0 { <mask> s.conf.leaseTime = time.Hour * 24 <mask> s.conf.LeaseDuration = uint32(s.conf.leaseTime.Seconds()) <mask> } else { <mask> s.conf.leaseTime = time.Second * time.Duration(conf.LeaseDuration) <mask> } <mask> </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove config.DNS.UpstreamTimeout = aghtime.Duration{Duration: dnsforward.DefaultTimeout} </s> add config.DNS.UpstreamTimeout = timeutil.Duration{Duration: dnsforward.DefaultTimeout} </s> remove quarterDay = 6 * time.Hour day = 24 * time.Hour week = day * 7 month = day * 30 threeMonths = day * 90 </s> add quarterDay = timeutil.Day / 4 day = timeutil.Day week = timeutil.Day * 7 month = timeutil.Day * 30 threeMonths = timeutil.Day * 90 </s> remove l.conf.RotationIvl = 24 * time.Hour </s> add l.conf.RotationIvl = timeutil.Day </s> remove config.DNS.QueryLogInterval = aghtime.Duration{Duration: dc.RotationIvl} </s> add config.DNS.QueryLogInterval = timeutil.Duration{Duration: dc.RotationIvl} </s> remove config.DNS.QueryLogInterval = aghtime.Duration{Duration: 90 * 24 * time.Hour} </s> add config.DNS.QueryLogInterval = timeutil.Duration{Duration: 90 * timeutil.Day}
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/dhcpd/v4.go
keep add keep keep keep keep keep
<mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/netutil" <mask> "github.com/insomniacslk/dhcp/dhcpv6" <mask> "github.com/insomniacslk/dhcp/dhcpv6/server6" <mask> "github.com/insomniacslk/dhcp/iana" <mask> ) <mask> </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil"
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/dhcpd/v6.go
keep keep keep keep replace keep keep keep keep keep
<mask> return s, fmt.Errorf("dhcpv6: invalid range-start IP: %s", conf.RangeStart) <mask> } <mask> <mask> if conf.LeaseDuration == 0 { <mask> s.conf.leaseTime = time.Hour * 24 <mask> s.conf.LeaseDuration = uint32(s.conf.leaseTime.Seconds()) <mask> } else { <mask> s.conf.leaseTime = time.Second * time.Duration(conf.LeaseDuration) <mask> } <mask> </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove config.DNS.UpstreamTimeout = aghtime.Duration{Duration: dnsforward.DefaultTimeout} </s> add config.DNS.UpstreamTimeout = timeutil.Duration{Duration: dnsforward.DefaultTimeout} </s> remove quarterDay = 6 * time.Hour day = 24 * time.Hour week = day * 7 month = day * 30 threeMonths = day * 90 </s> add quarterDay = timeutil.Day / 4 day = timeutil.Day week = timeutil.Day * 7 month = timeutil.Day * 30 threeMonths = timeutil.Day * 90 </s> remove l.conf.RotationIvl = 24 * time.Hour </s> add l.conf.RotationIvl = timeutil.Day </s> remove dns[field] = aghtime.Duration{Duration: time.Duration(qlogIvl) * 24 * time.Hour} </s> add dns[field] = timeutil.Duration{Duration: time.Duration(qlogIvl) * timeutil.Day} </s> remove config.DNS.QueryLogInterval = aghtime.Duration{Duration: dc.RotationIvl} </s> add config.DNS.QueryLogInterval = timeutil.Duration{Duration: dc.RotationIvl}
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/dhcpd/v6.go
keep keep keep keep replace keep keep keep keep keep
<mask> "sort" <mask> "strings" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtime" <mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering" <mask> "github.com/AdguardTeam/dnsproxy/proxy" <mask> "github.com/AdguardTeam/dnsproxy/upstream" <mask> "github.com/AdguardTeam/golibs/errors" <mask> "github.com/AdguardTeam/golibs/log" </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "time" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil"
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/dnsforward/config.go
keep keep add keep keep keep keep
<mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/netutil" <mask> "github.com/AdguardTeam/golibs/stringutil" <mask> "github.com/ameshkov/dnscrypt/v2" <mask> ) <mask> <mask> // BlockingMode is an enum of all allowed blocking modes. </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove const cookieTTL = 365 * 24 * time.Hour </s> add const cookieTTL = 365 * timeutil.Day </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove FastestTimeout aghtime.Duration `yaml:"fastest_timeout"` </s> add FastestTimeout timeutil.Duration `yaml:"fastest_timeout"`
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/dnsforward/config.go
keep keep keep keep replace keep keep keep keep keep
<mask> AllServers bool `yaml:"all_servers"` // if true, parallel queries to all configured upstream servers are enabled <mask> FastestAddr bool `yaml:"fastest_addr"` // use Fastest Address algorithm <mask> // FastestTimeout replaces the default timeout for dialing IP addresses <mask> // when FastestAddr is true. <mask> FastestTimeout aghtime.Duration `yaml:"fastest_timeout"` <mask> <mask> // Access settings <mask> // -- <mask> <mask> AllowedClients []string `yaml:"allowed_clients"` // IP addresses of whitelist clients </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove QueryLogInterval aghtime.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> add QueryLogInterval timeutil.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> remove UpstreamTimeout aghtime.Duration `yaml:"upstream_timeout"` </s> add UpstreamTimeout timeutil.Duration `yaml:"upstream_timeout"` </s> remove const cookieTTL = 365 * 24 * time.Hour </s> add const cookieTTL = 365 * timeutil.Day </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil"
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/dnsforward/config.go
keep keep add keep keep keep keep
<mask> "github.com/AdguardTeam/dnsproxy/proxy" <mask> "github.com/AdguardTeam/dnsproxy/upstream" <mask> "github.com/AdguardTeam/golibs/errors" <mask> "github.com/miekg/dns" <mask> "github.com/stretchr/testify/assert" <mask> "github.com/stretchr/testify/require" <mask> ) </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil"
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/dnsforward/dnsforward_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> serialNumber, err := rand.Int(rand.Reader, serialNumberLimit) <mask> require.NoErrorf(t, err, "failed to generate serial number: %s", err) <mask> <mask> notBefore := time.Now() <mask> notAfter := notBefore.Add(5 * 365 * time.Hour * 24) <mask> <mask> template := x509.Certificate{ <mask> SerialNumber: serialNumber, <mask> Subject: pkix.Name{ <mask> Organization: []string{"AdGuard Tests"}, </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove const cookieTTL = 365 * 24 * time.Hour </s> add const cookieTTL = 365 * timeutil.Day
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/dnsforward/dnsforward_test.go
keep add keep keep keep keep
<mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/netutil" <mask> "go.etcd.io/bbolt" <mask> "golang.org/x/crypto/bcrypt" <mask> ) <mask> </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil"
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/auth.go
keep keep keep keep replace keep keep keep keep keep
<mask> "golang.org/x/crypto/bcrypt" <mask> ) <mask> <mask> // cookieTTL is the time-to-live of the session cookie. <mask> const cookieTTL = 365 * 24 * time.Hour <mask> <mask> // sessionCookieName is the name of the session cookie. <mask> const sessionCookieName = "agh_session" <mask> <mask> // sessionTokenSize is the length of session token in bytes. </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove UpstreamTimeout aghtime.Duration `yaml:"upstream_timeout"` </s> add UpstreamTimeout timeutil.Duration `yaml:"upstream_timeout"` </s> remove QueryLogInterval aghtime.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> add QueryLogInterval timeutil.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> remove FastestTimeout aghtime.Duration `yaml:"fastest_timeout"` </s> add FastestTimeout timeutil.Duration `yaml:"fastest_timeout"` </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil"
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/auth.go
keep replace keep replace keep keep keep
<mask> "sync" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtime" <mask> "github.com/AdguardTeam/AdGuardHome/internal/dhcpd" <mask> "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" <mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering" </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil"
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/config.go
keep add keep keep keep keep keep
<mask> "github.com/AdguardTeam/golibs/errors" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/google/renameio/maybe" <mask> yaml "gopkg.in/yaml.v2" <mask> ) <mask> <mask> const ( </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/config.go
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> <mask> QueryLogEnabled bool `yaml:"querylog_enabled"` // if true, query log is enabled <mask> QueryLogFileEnabled bool `yaml:"querylog_file_enabled"` // if true, query log will be written to a file <mask> // QueryLogInterval is the interval for query log's files rotation. <mask> QueryLogInterval aghtime.Duration `yaml:"querylog_interval"` <mask> QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk <mask> AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats <mask> <mask> dnsforward.FilteringConfig `yaml:",inline"` <mask> <mask> FilteringEnabled bool `yaml:"filtering_enabled"` // whether or not use filter lists <mask> FiltersUpdateIntervalHours uint32 `yaml:"filters_update_interval"` // time period to update filters (in hours) </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove FastestTimeout aghtime.Duration `yaml:"fastest_timeout"` </s> add FastestTimeout timeutil.Duration `yaml:"fastest_timeout"` </s> remove UpstreamTimeout aghtime.Duration `yaml:"upstream_timeout"` </s> add UpstreamTimeout timeutil.Duration `yaml:"upstream_timeout"` </s> remove UpstreamTimeout: aghtime.Duration{Duration: dnsforward.DefaultTimeout}, </s> add UpstreamTimeout: timeutil.Duration{Duration: dnsforward.DefaultTimeout}, </s> remove const cookieTTL = 365 * 24 * time.Hour </s> add const cookieTTL = 365 * timeutil.Day </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove FastestTimeout: aghtime.Duration{ </s> add FastestTimeout: timeutil.Duration{
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/config.go
keep keep keep keep replace keep keep keep keep keep
<mask> FiltersUpdateIntervalHours uint32 `yaml:"filters_update_interval"` // time period to update filters (in hours) <mask> DnsfilterConf filtering.Config `yaml:",inline"` <mask> <mask> // UpstreamTimeout is the timeout for querying upstream servers. <mask> UpstreamTimeout aghtime.Duration `yaml:"upstream_timeout"` <mask> <mask> // LocalDomainName is the domain name used for known internal hosts. <mask> // For example, a machine called "myhost" can be addressed as <mask> // "myhost.lan" when LocalDomainName is "lan". <mask> LocalDomainName string `yaml:"local_domain_name"` </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove QueryLogInterval aghtime.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> add QueryLogInterval timeutil.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> remove FastestTimeout aghtime.Duration `yaml:"fastest_timeout"` </s> add FastestTimeout timeutil.Duration `yaml:"fastest_timeout"` </s> remove const cookieTTL = 365 * 24 * time.Hour </s> add const cookieTTL = 365 * timeutil.Day </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil"
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/config.go
keep keep keep keep replace keep keep keep keep keep
<mask> BlockedResponseTTL: 10, // in seconds <mask> Ratelimit: 20, <mask> RefuseAny: true, <mask> AllServers: false, <mask> FastestTimeout: aghtime.Duration{ <mask> Duration: fastip.DefaultPingWaitTimeout, <mask> }, <mask> <mask> TrustedProxies: []string{"127.0.0.0/8", "::1/128"}, <mask> </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove UpstreamTimeout: aghtime.Duration{Duration: dnsforward.DefaultTimeout}, </s> add UpstreamTimeout: timeutil.Duration{Duration: dnsforward.DefaultTimeout}, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove QueryLogInterval aghtime.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> add QueryLogInterval timeutil.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove const cookieTTL = 365 * 24 * time.Hour </s> add const cookieTTL = 365 * timeutil.Day </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day,
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/config.go
keep keep keep keep replace keep keep keep keep keep
<mask> MaxGoroutines: 300, <mask> }, <mask> FilteringEnabled: true, // whether or not use filter lists <mask> FiltersUpdateIntervalHours: 24, <mask> UpstreamTimeout: aghtime.Duration{Duration: dnsforward.DefaultTimeout}, <mask> LocalDomainName: "lan", <mask> ResolveClients: true, <mask> UsePrivateRDNS: true, <mask> }, <mask> TLS: tlsConfigSettings{ </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove FastestTimeout: aghtime.Duration{ </s> add FastestTimeout: timeutil.Duration{ </s> remove QueryLogInterval aghtime.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> add QueryLogInterval timeutil.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> remove want: aghtime.Duration{Duration: 24 * time.Hour}, </s> add want: timeutil.Duration{Duration: timeutil.Day}, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day,
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/config.go
keep keep keep keep replace keep keep keep keep keep
<mask> config.WebSessionTTLHours = 30 * 24 <mask> <mask> config.DNS.QueryLogEnabled = true <mask> config.DNS.QueryLogFileEnabled = true <mask> config.DNS.QueryLogInterval = aghtime.Duration{Duration: 90 * 24 * time.Hour} <mask> config.DNS.QueryLogMemSize = 1000 <mask> <mask> config.DNS.CacheSize = 4 * 1024 * 1024 <mask> config.DNS.DnsfilterConf.SafeBrowsingCacheSize = 1 * 1024 * 1024 <mask> config.DNS.DnsfilterConf.SafeSearchCacheSize = 1 * 1024 * 1024 </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove quarterDay = 6 * time.Hour day = 24 * time.Hour week = day * 7 month = day * 30 threeMonths = day * 90 </s> add quarterDay = timeutil.Day / 4 day = timeutil.Day week = timeutil.Day * 7 month = timeutil.Day * 30 threeMonths = timeutil.Day * 90 </s> remove config.DNS.QueryLogInterval = aghtime.Duration{Duration: dc.RotationIvl} </s> add config.DNS.QueryLogInterval = timeutil.Duration{Duration: dc.RotationIvl} </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove l.conf.RotationIvl = 24 * time.Hour </s> add l.conf.RotationIvl = timeutil.Day </s> remove dns[field] = aghtime.Duration{Duration: time.Duration(qlogIvl) * 24 * time.Hour} </s> add dns[field] = timeutil.Duration{Duration: time.Duration(qlogIvl) * timeutil.Day} </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/config.go
keep keep keep keep replace keep keep keep keep keep
<mask> config.DNS.FiltersUpdateIntervalHours = 24 <mask> } <mask> <mask> if config.DNS.UpstreamTimeout.Duration == 0 { <mask> config.DNS.UpstreamTimeout = aghtime.Duration{Duration: dnsforward.DefaultTimeout} <mask> } <mask> <mask> return nil <mask> } <mask> </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove dns[field] = aghtime.Duration{Duration: time.Duration(qlogIvl) * 24 * time.Hour} </s> add dns[field] = timeutil.Duration{Duration: time.Duration(qlogIvl) * timeutil.Day} </s> remove config.DNS.QueryLogInterval = aghtime.Duration{Duration: dc.RotationIvl} </s> add config.DNS.QueryLogInterval = timeutil.Duration{Duration: dc.RotationIvl} </s> remove l.conf.RotationIvl = 24 * time.Hour </s> add l.conf.RotationIvl = timeutil.Day </s> remove quarterDay = 6 * time.Hour day = 24 * time.Hour week = day * 7 month = day * 30 threeMonths = day * 90 </s> add quarterDay = timeutil.Day / 4 day = timeutil.Day week = timeutil.Day * 7 month = timeutil.Day * 30 threeMonths = timeutil.Day * 90
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/config.go
keep keep keep keep replace keep keep keep keep keep
<mask> dc := querylog.Config{} <mask> Context.queryLog.WriteDiskConfig(&dc) <mask> config.DNS.QueryLogEnabled = dc.Enabled <mask> config.DNS.QueryLogFileEnabled = dc.FileEnabled <mask> config.DNS.QueryLogInterval = aghtime.Duration{Duration: dc.RotationIvl} <mask> config.DNS.QueryLogMemSize = dc.MemSize <mask> config.DNS.AnonymizeClientIP = dc.AnonymizeClientIP <mask> } <mask> <mask> if Context.dnsFilter != nil { </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove config.DNS.QueryLogInterval = aghtime.Duration{Duration: 90 * 24 * time.Hour} </s> add config.DNS.QueryLogInterval = timeutil.Duration{Duration: 90 * timeutil.Day} </s> remove config.DNS.UpstreamTimeout = aghtime.Duration{Duration: dnsforward.DefaultTimeout} </s> add config.DNS.UpstreamTimeout = timeutil.Duration{Duration: dnsforward.DefaultTimeout} </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove dns[field] = aghtime.Duration{Duration: time.Duration(qlogIvl) * 24 * time.Hour} </s> add dns[field] = timeutil.Duration{Duration: time.Duration(qlogIvl) * timeutil.Day} </s> remove quarterDay = 6 * time.Hour day = 24 * time.Hour week = day * 7 month = day * 30 threeMonths = day * 90 </s> add quarterDay = timeutil.Day / 4 day = timeutil.Day week = timeutil.Day * 7 month = timeutil.Day * 30 threeMonths = timeutil.Day * 90
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/config.go
keep keep keep keep replace keep keep keep keep keep
<mask> "strconv" <mask> "strings" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtime" <mask> "github.com/AdguardTeam/golibs/errors" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/netutil" <mask> "github.com/google/renameio/maybe" <mask> "golang.org/x/crypto/bcrypt" </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add </s> remove "time" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/upgrade.go
keep keep add keep keep keep keep keep keep
<mask> "github.com/AdguardTeam/golibs/errors" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/netutil" <mask> "github.com/google/renameio/maybe" <mask> "golang.org/x/crypto/bcrypt" <mask> yaml "gopkg.in/yaml.v2" <mask> ) <mask> <mask> // currentSchemaVersion is the current schema version. </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove const cookieTTL = 365 * 24 * time.Hour </s> add const cookieTTL = 365 * timeutil.Day </s> add "github.com/AdguardTeam/golibs/timeutil"
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/upgrade.go
keep keep keep keep replace keep keep keep keep keep
<mask> return fmt.Errorf("unexpected type of %s: %T", field, qlogIvlVal) <mask> } <mask> } <mask> <mask> dns[field] = aghtime.Duration{Duration: time.Duration(qlogIvl) * 24 * time.Hour} <mask> <mask> return nil <mask> } <mask> <mask> // TODO(a.garipov): Replace with log.Output when we port it to our logging </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove config.DNS.UpstreamTimeout = aghtime.Duration{Duration: dnsforward.DefaultTimeout} </s> add config.DNS.UpstreamTimeout = timeutil.Duration{Duration: dnsforward.DefaultTimeout} </s> remove l.conf.RotationIvl = 24 * time.Hour </s> add l.conf.RotationIvl = timeutil.Day </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove time.Sleep(24 * time.Hour) </s> add time.Sleep(timeutil.Day) </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove quarterDay = 6 * time.Hour day = 24 * time.Hour week = day * 7 month = day * 30 threeMonths = day * 90 </s> add quarterDay = timeutil.Day / 4 day = timeutil.Day week = timeutil.Day * 7 month = timeutil.Day * 30 threeMonths = timeutil.Day * 90
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/upgrade.go
keep keep keep keep replace keep keep keep keep keep
<mask> import ( <mask> "testing" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtime" <mask> "github.com/stretchr/testify/assert" <mask> "github.com/stretchr/testify/require" <mask> ) <mask> <mask> // TODO(a.garipov): Cover all migrations, use a testdata/ dir. </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add </s> remove "time" </s> add </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/upgrade_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> wantErr string <mask> name string <mask> }{{ <mask> ivl: 1, <mask> want: aghtime.Duration{Duration: 24 * time.Hour}, <mask> wantErr: "", <mask> name: "success", <mask> }, { <mask> ivl: 0.25, <mask> want: 0, </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove UpstreamTimeout aghtime.Duration `yaml:"upstream_timeout"` </s> add UpstreamTimeout timeutil.Duration `yaml:"upstream_timeout"` </s> remove UpstreamTimeout: aghtime.Duration{Duration: dnsforward.DefaultTimeout}, </s> add UpstreamTimeout: timeutil.Duration{Duration: dnsforward.DefaultTimeout}, </s> remove config.DNS.UpstreamTimeout = aghtime.Duration{Duration: dnsforward.DefaultTimeout} </s> add config.DNS.UpstreamTimeout = timeutil.Duration{Duration: dnsforward.DefaultTimeout} </s> remove config.DNS.QueryLogInterval = aghtime.Duration{Duration: 90 * 24 * time.Hour} </s> add config.DNS.QueryLogInterval = timeutil.Duration{Duration: 90 * timeutil.Day} </s> remove const cookieTTL = 365 * 24 * time.Hour </s> add const cookieTTL = 365 * timeutil.Day
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/upgrade_test.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> var newDNSConf yobj <mask> newDNSConf, ok = dnsVal.(yobj) <mask> require.True(t, ok) <mask> <mask> var newIvl aghtime.Duration <mask> newIvl, ok = newDNSConf["querylog_interval"].(aghtime.Duration) <mask> require.True(t, ok) <mask> <mask> assert.Equal(t, tc.want, newIvl) <mask> }) <mask> } </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove var ivlVal aghtime.Duration ivlVal, ok = ivl.(aghtime.Duration) </s> add var ivlVal timeutil.Duration ivlVal, ok = ivl.(timeutil.Duration) </s> remove config.DNS.UpstreamTimeout = aghtime.Duration{Duration: dnsforward.DefaultTimeout} </s> add config.DNS.UpstreamTimeout = timeutil.Duration{Duration: dnsforward.DefaultTimeout} </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove config.DNS.QueryLogInterval = aghtime.Duration{Duration: dc.RotationIvl} </s> add config.DNS.QueryLogInterval = timeutil.Duration{Duration: dc.RotationIvl} </s> remove l.conf.RotationIvl = 24 * time.Hour </s> add l.conf.RotationIvl = timeutil.Day
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/upgrade_test.go
keep keep keep keep replace replace keep keep keep keep keep
<mask> var ivl interface{} <mask> ivl, ok = dnsVal["querylog_interval"] <mask> require.True(t, ok) <mask> <mask> var ivlVal aghtime.Duration <mask> ivlVal, ok = ivl.(aghtime.Duration) <mask> require.True(t, ok) <mask> <mask> assert.Equal(t, 90*24*time.Hour, ivlVal.Duration) <mask> }) <mask> } </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove var newIvl aghtime.Duration newIvl, ok = newDNSConf["querylog_interval"].(aghtime.Duration) </s> add var newIvl timeutil.Duration newIvl, ok = newDNSConf["querylog_interval"].(timeutil.Duration) </s> remove quarterDay = 6 * time.Hour day = 24 * time.Hour week = day * 7 month = day * 30 threeMonths = day * 90 </s> add quarterDay = timeutil.Day / 4 day = timeutil.Day week = timeutil.Day * 7 month = timeutil.Day * 30 threeMonths = timeutil.Day * 90 </s> remove config.DNS.UpstreamTimeout = aghtime.Duration{Duration: dnsforward.DefaultTimeout} </s> add config.DNS.UpstreamTimeout = timeutil.Duration{Duration: dnsforward.DefaultTimeout} </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove config.DNS.QueryLogInterval = aghtime.Duration{Duration: dc.RotationIvl} </s> add config.DNS.QueryLogInterval = timeutil.Duration{Duration: dc.RotationIvl}
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/home/upgrade_test.go
keep keep keep add keep keep keep keep
<mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering" <mask> "github.com/AdguardTeam/golibs/errors" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/miekg/dns" <mask> ) <mask> <mask> const ( </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil"
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/querylog/qlog.go
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
<mask> <mask> func checkInterval(ivl time.Duration) (ok bool) { <mask> // The constants for possible values of query log's rotation interval. <mask> const ( <mask> quarterDay = 6 * time.Hour <mask> day = 24 * time.Hour <mask> week = day * 7 <mask> month = day * 30 <mask> threeMonths = day * 90 <mask> ) <mask> <mask> return ivl == quarterDay || ivl == day || ivl == week || ivl == month || ivl == threeMonths <mask> } <mask> </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove config.DNS.UpstreamTimeout = aghtime.Duration{Duration: dnsforward.DefaultTimeout} </s> add config.DNS.UpstreamTimeout = timeutil.Duration{Duration: dnsforward.DefaultTimeout} </s> remove config.DNS.QueryLogInterval = aghtime.Duration{Duration: 90 * 24 * time.Hour} </s> add config.DNS.QueryLogInterval = timeutil.Duration{Duration: 90 * timeutil.Day} </s> remove l.conf.RotationIvl = 24 * time.Hour </s> add l.conf.RotationIvl = timeutil.Day </s> remove var ivlVal aghtime.Duration ivlVal, ok = ivl.(aghtime.Duration) </s> add var ivlVal timeutil.Duration ivlVal, ok = ivl.(timeutil.Duration)
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/querylog/qlog.go
keep keep add keep keep keep keep keep keep
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest" <mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering" <mask> "github.com/AdguardTeam/dnsproxy/proxyutil" <mask> "github.com/miekg/dns" <mask> "github.com/stretchr/testify/assert" <mask> "github.com/stretchr/testify/require" <mask> ) <mask> <mask> func TestMain(m *testing.M) { </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil"
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/querylog/qlog_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> func TestQueryLog(t *testing.T) { <mask> l := newQueryLog(Config{ <mask> Enabled: true, <mask> FileEnabled: true, <mask> RotationIvl: 24 * time.Hour, <mask> MemSize: 100, <mask> BaseDir: t.TempDir(), <mask> }) <mask> <mask> // Add disk entries. </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove UpstreamTimeout: aghtime.Duration{Duration: dnsforward.DefaultTimeout}, </s> add UpstreamTimeout: timeutil.Duration{Duration: dnsforward.DefaultTimeout},
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/querylog/qlog_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> func TestQueryLogOffsetLimit(t *testing.T) { <mask> l := newQueryLog(Config{ <mask> Enabled: true, <mask> RotationIvl: 24 * time.Hour, <mask> MemSize: 100, <mask> BaseDir: t.TempDir(), <mask> }) <mask> <mask> const ( </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil"
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/querylog/qlog_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> func TestQueryLogMaxFileScanEntries(t *testing.T) { <mask> l := newQueryLog(Config{ <mask> Enabled: true, <mask> FileEnabled: true, <mask> RotationIvl: 24 * time.Hour, <mask> MemSize: 100, <mask> BaseDir: t.TempDir(), <mask> }) <mask> <mask> const entNum = 10 </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove const cookieTTL = 365 * 24 * time.Hour </s> add const cookieTTL = 365 * timeutil.Day
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/querylog/qlog_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> func TestQueryLogFileDisabled(t *testing.T) { <mask> l := newQueryLog(Config{ <mask> Enabled: true, <mask> FileEnabled: false, <mask> RotationIvl: 24 * time.Hour, <mask> MemSize: 2, <mask> BaseDir: t.TempDir(), <mask> }) <mask> <mask> addEntry(l, "example1.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1)) </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove want: aghtime.Duration{Duration: 24 * time.Hour}, </s> add want: timeutil.Duration{Duration: timeutil.Day}, </s> add "github.com/AdguardTeam/golibs/timeutil"
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/querylog/qlog_test.go
keep keep keep add keep keep keep keep
<mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering" <mask> "github.com/AdguardTeam/golibs/errors" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/miekg/dns" <mask> ) <mask> <mask> // QueryLog - main interface </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil"
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/querylog/querylog.go
keep keep keep keep replace keep keep keep keep
<mask> log.Info( <mask> "querylog: warning: unsupported rotation interval %d, setting to 1 day", <mask> conf.RotationIvl, <mask> ) <mask> l.conf.RotationIvl = 24 * time.Hour <mask> } <mask> <mask> return l <mask> } </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove dns[field] = aghtime.Duration{Duration: time.Duration(qlogIvl) * 24 * time.Hour} </s> add dns[field] = timeutil.Duration{Duration: time.Duration(qlogIvl) * timeutil.Day} </s> remove config.DNS.UpstreamTimeout = aghtime.Duration{Duration: dnsforward.DefaultTimeout} </s> add config.DNS.UpstreamTimeout = timeutil.Duration{Duration: dnsforward.DefaultTimeout} </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove quarterDay = 6 * time.Hour day = 24 * time.Hour week = day * 7 month = day * 30 threeMonths = day * 90 </s> add quarterDay = timeutil.Day / 4 day = timeutil.Day week = timeutil.Day * 7 month = timeutil.Day * 30 threeMonths = timeutil.Day * 90 </s> remove config.DNS.QueryLogInterval = aghtime.Duration{Duration: 90 * 24 * time.Hour} </s> add config.DNS.QueryLogInterval = timeutil.Duration{Duration: 90 * timeutil.Day}
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/querylog/querylog.go
keep add keep keep keep keep keep keep
<mask> "github.com/AdguardTeam/golibs/errors" <mask> "github.com/AdguardTeam/golibs/log" <mask> ) <mask> <mask> // flushLogBuffer flushes the current buffer to file and resets the current buffer <mask> func (l *queryLog) flushLogBuffer(fullFlush bool) error { <mask> if !l.conf.FileEnabled { <mask> return nil </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove QueryLogInterval aghtime.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> add QueryLogInterval timeutil.Duration `yaml:"querylog_interval"` QueryLogMemSize uint32 `yaml:"querylog_size_memory"` // number of entries kept in memory before they are flushed to disk AnonymizeClientIP bool `yaml:"anonymize_client_ip"` // anonymize clients' IP addresses in logs and stats </s> remove config.DNS.UpstreamTimeout = aghtime.Duration{Duration: dnsforward.DefaultTimeout} </s> add config.DNS.UpstreamTimeout = timeutil.Duration{Duration: dnsforward.DefaultTimeout} </s> remove const cookieTTL = 365 * 24 * time.Hour </s> add const cookieTTL = 365 * timeutil.Day </s> remove dns[field] = aghtime.Duration{Duration: time.Duration(qlogIvl) * 24 * time.Hour} </s> add dns[field] = timeutil.Duration{Duration: time.Duration(qlogIvl) * timeutil.Day} </s> remove UpstreamTimeout aghtime.Duration `yaml:"upstream_timeout"` </s> add UpstreamTimeout timeutil.Duration `yaml:"upstream_timeout"`
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/querylog/querylogfile.go
keep keep keep keep replace keep keep
<mask> } <mask> } <mask> <mask> // What? <mask> time.Sleep(24 * time.Hour) <mask> } <mask> } </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove dns[field] = aghtime.Duration{Duration: time.Duration(qlogIvl) * 24 * time.Hour} </s> add dns[field] = timeutil.Duration{Duration: time.Duration(qlogIvl) * timeutil.Day} </s> remove config.DNS.UpstreamTimeout = aghtime.Duration{Duration: dnsforward.DefaultTimeout} </s> add config.DNS.UpstreamTimeout = timeutil.Duration{Duration: dnsforward.DefaultTimeout} </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove s.conf.leaseTime = time.Hour * 24 </s> add s.conf.leaseTime = timeutil.Day </s> remove l.conf.RotationIvl = 24 * time.Hour </s> add l.conf.RotationIvl = timeutil.Day </s> remove var ivlVal aghtime.Duration ivlVal, ok = ivl.(aghtime.Duration) </s> add var ivlVal timeutil.Duration ivlVal, ok = ivl.(timeutil.Duration)
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/querylog/querylogfile.go
keep keep add keep keep keep keep keep keep
<mask> "testing" <mask> "time" <mask> <mask> "github.com/miekg/dns" <mask> "github.com/stretchr/testify/assert" <mask> "github.com/stretchr/testify/require" <mask> ) <mask> <mask> func TestQueryLog_Search_findClient(t *testing.T) { </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtime" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> add "github.com/AdguardTeam/golibs/timeutil" </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day,
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/querylog/search_test.go
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> l := newQueryLog(Config{ <mask> FindClient: findClient, <mask> BaseDir: t.TempDir(), <mask> RotationIvl: 24 * time.Hour, <mask> MemSize: 100, <mask> Enabled: true, <mask> FileEnabled: true, <mask> AnonymizeClientIP: false, <mask> }) </s> Pull request: upd golibs, use timeutil Merge in DNS/adguard-home from use-timeutil to master Squashed commit of the following: commit 28defb577b2b00efa448f63fe6a0cc468aa53164 Author: Eugene Burkov <[email protected]> Date: Thu Sep 30 19:46:38 2021 +0300 all: upd golibs, use timeutil </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove RotationIvl: 24 * time.Hour, </s> add RotationIvl: timeutil.Day, </s> remove FastestTimeout: aghtime.Duration{ </s> add FastestTimeout: timeutil.Duration{ </s> remove UpstreamTimeout: aghtime.Duration{Duration: dnsforward.DefaultTimeout}, </s> add UpstreamTimeout: timeutil.Duration{Duration: dnsforward.DefaultTimeout},
https://github.com/AdguardTeam/AdGuardHome/commit/08ec3f604ea5ed5a9a7fa443ce64e25468ccaecb
internal/querylog/search_test.go
keep keep keep add keep keep keep keep keep
<mask> <mask> for { <mask> ok, next, err := tryConn(req, c, iface) <mask> if next { <mask> continue <mask> } <mask> if ok { <mask> return true, nil <mask> } </s> Pull request: dhcpd: fix possible infinite loop, set timeouts better Merge in DNS/adguard-home from 2301-dhcp-check to master Closes #2301. Squashed commit of the following: commit bf5c31b8592f909a372fcdaebacc491d310cc3e6 Author: Ainar Garipov <[email protected]> Date: Fri Nov 13 14:28:54 2020 +0300 dhcpd: fix possible infinite loop, set timeouts better </s> remove log.Debug("%s", err) </s> add return false, err </s> remove _ = c.SetReadDeadline(time.Now().Add(defaultDiscoverTime)) </s> add err = c.SetDeadline(time.Now().Add(defaultDiscoverTime)) if err != nil { return false, false, fmt.Errorf("setting deadline: %w", err) }
https://github.com/AdguardTeam/AdGuardHome/commit/09196118e9f5f089dc09e792f040bdc97fcc7432
internal/dhcpd/check_other_dhcp.go
keep keep keep keep replace keep keep keep keep keep
<mask> if ok { <mask> return true, nil <mask> } <mask> if err != nil { <mask> log.Debug("%s", err) <mask> } <mask> } <mask> } <mask> <mask> // TODO(a.garipov): Refactor further. Inspect error handling, remove the next </s> Pull request: dhcpd: fix possible infinite loop, set timeouts better Merge in DNS/adguard-home from 2301-dhcp-check to master Closes #2301. Squashed commit of the following: commit bf5c31b8592f909a372fcdaebacc491d310cc3e6 Author: Ainar Garipov <[email protected]> Date: Fri Nov 13 14:28:54 2020 +0300 dhcpd: fix possible infinite loop, set timeouts better </s> add if err != nil { log.Debug("dhcpv4: trying a connection: %s", err) } </s> remove _ = c.SetReadDeadline(time.Now().Add(defaultDiscoverTime)) </s> add err = c.SetDeadline(time.Now().Add(defaultDiscoverTime)) if err != nil { return false, false, fmt.Errorf("setting deadline: %w", err) }
https://github.com/AdguardTeam/AdGuardHome/commit/09196118e9f5f089dc09e792f040bdc97fcc7432
internal/dhcpd/check_other_dhcp.go
keep keep keep keep replace keep keep keep keep keep
<mask> // progressively longer timeouts. <mask> log.Tracef("waiting %v for an answer", defaultDiscoverTime) <mask> <mask> b := make([]byte, 1500) <mask> _ = c.SetReadDeadline(time.Now().Add(defaultDiscoverTime)) <mask> n, _, err := c.ReadFrom(b) <mask> if err != nil { <mask> if isTimeout(err) { <mask> log.Debug("dhcpv4: didn't receive dhcp response") <mask> </s> Pull request: dhcpd: fix possible infinite loop, set timeouts better Merge in DNS/adguard-home from 2301-dhcp-check to master Closes #2301. Squashed commit of the following: commit bf5c31b8592f909a372fcdaebacc491d310cc3e6 Author: Ainar Garipov <[email protected]> Date: Fri Nov 13 14:28:54 2020 +0300 dhcpd: fix possible infinite loop, set timeouts better </s> add if err != nil { log.Debug("dhcpv4: trying a connection: %s", err) } </s> remove log.Debug("%s", err) </s> add return false, err
https://github.com/AdguardTeam/AdGuardHome/commit/09196118e9f5f089dc09e792f040bdc97fcc7432
internal/dhcpd/check_other_dhcp.go
keep keep replace keep keep keep keep replace
<mask> <mask> const coreDNSConfigTemplate = `. { <mask> {{if .FilteringEnabled}}dnsfilter {{.FilterFile}} { <mask> {{if .SafeBrowsingEnabled}}safebrowsing{{end}} <mask> {{if .ParentalEnabled}}parental {{.ParentalSensitivity}}{{end}} <mask> {{if .SafeSearchEnabled}}safesearch{{end}} <mask> {{if .QueryLogEnabled}}querylog{{end}} <mask> }{{end}} </s> Allow disabling of filtering but keeping querylog, safebrowsing, safesearch and parental working. </s> remove hosts { fallthrough } </s> add hosts { fallthrough } </s> remove if len(args) == 0 { // must have at least one argument return nil, c.ArgErr() </s> add if len(args) > 0 { filterFileNames = append(filterFileNames, args...) </s> remove filterFileName = args[0] </s> add </s> remove if err = scanner.Err(); err != nil { return nil, err </s> add if err = scanner.Err(); err != nil { return nil, err } </s> remove file, err := os.Open(filterFileName) if err != nil { return nil, err } defer file.Close() count := 0 scanner := bufio.NewScanner(file) for scanner.Scan() { text := scanner.Text() if p.parseEtcHosts(text) { continue } err = p.d.AddRule(text, 0) if err == dnsfilter.ErrInvalidSyntax { continue } </s> add log.Printf("filterFileNames = %+v", filterFileNames) for i, filterFileName := range filterFileNames { file, err := os.Open(filterFileName)
https://github.com/AdguardTeam/AdGuardHome/commit/09a39cce03f69b1f9801e66d763d7b5208411336
config.go
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> {{if .SafeSearchEnabled}}safesearch{{end}} <mask> {{if .QueryLogEnabled}}querylog{{end}} <mask> }{{end}} <mask> {{.Pprof}} <mask> hosts { <mask> fallthrough <mask> } <mask> {{if .UpstreamDNS}}forward . {{range .UpstreamDNS}}{{.}} {{end}}{{end}} <mask> {{.Cache}} <mask> {{.Prometheus}} <mask> } <mask> ` </s> Allow disabling of filtering but keeping querylog, safebrowsing, safesearch and parental working. </s> remove }{{end}} </s> add } </s> remove {{if .FilteringEnabled}}dnsfilter {{.FilterFile}} { </s> add dnsfilter {{if .FilteringEnabled}}{{.FilterFile}}{{end}} { </s> remove file, err := os.Open(filterFileName) if err != nil { return nil, err } defer file.Close() count := 0 scanner := bufio.NewScanner(file) for scanner.Scan() { text := scanner.Text() if p.parseEtcHosts(text) { continue } err = p.d.AddRule(text, 0) if err == dnsfilter.ErrInvalidSyntax { continue } </s> add log.Printf("filterFileNames = %+v", filterFileNames) for i, filterFileName := range filterFileNames { file, err := os.Open(filterFileName) </s> remove count++ } log.Printf("Added %d rules from %s", count, filterFileName) </s> add defer file.Close() count := 0 scanner := bufio.NewScanner(file) for scanner.Scan() { text := scanner.Text() if p.parseEtcHosts(text) { continue } err = p.d.AddRule(text, uint32(i)) if err == dnsfilter.ErrInvalidSyntax { continue } if err != nil { return nil, err } count++ } log.Printf("Added %d rules from %s", count, filterFileName) </s> add var err error </s> remove if err = scanner.Err(); err != nil { return nil, err </s> add if err = scanner.Err(); err != nil { return nil, err }
https://github.com/AdguardTeam/AdGuardHome/commit/09a39cce03f69b1f9801e66d763d7b5208411336
config.go
keep keep keep keep replace keep keep replace replace replace keep
<mask> *p = defaultPlugin <mask> p.d = dnsfilter.New() <mask> p.hosts = make(map[string]net.IP) <mask> <mask> var filterFileName string <mask> for c.Next() { <mask> args := c.RemainingArgs() <mask> if len(args) == 0 { <mask> // must have at least one argument <mask> return nil, c.ArgErr() <mask> } </s> Allow disabling of filtering but keeping querylog, safebrowsing, safesearch and parental working. </s> remove filterFileName = args[0] </s> add </s> remove file, err := os.Open(filterFileName) if err != nil { return nil, err } defer file.Close() count := 0 scanner := bufio.NewScanner(file) for scanner.Scan() { text := scanner.Text() if p.parseEtcHosts(text) { continue } err = p.d.AddRule(text, 0) if err == dnsfilter.ErrInvalidSyntax { continue } </s> add log.Printf("filterFileNames = %+v", filterFileNames) for i, filterFileName := range filterFileNames { file, err := os.Open(filterFileName) </s> add var err error </s> remove count++ } log.Printf("Added %d rules from %s", count, filterFileName) </s> add defer file.Close() count := 0 scanner := bufio.NewScanner(file) for scanner.Scan() { text := scanner.Text() if p.parseEtcHosts(text) { continue } err = p.d.AddRule(text, uint32(i)) if err == dnsfilter.ErrInvalidSyntax { continue } if err != nil { return nil, err } count++ } log.Printf("Added %d rules from %s", count, filterFileName) </s> remove if err = scanner.Err(); err != nil { return nil, err </s> add if err = scanner.Err(); err != nil { return nil, err }
https://github.com/AdguardTeam/AdGuardHome/commit/09a39cce03f69b1f9801e66d763d7b5208411336
coredns_plugin/coredns_plugin.go
keep keep keep keep replace keep keep keep keep keep
<mask> if len(args) == 0 { <mask> // must have at least one argument <mask> return nil, c.ArgErr() <mask> } <mask> filterFileName = args[0] <mask> for c.NextBlock() { <mask> switch c.Val() { <mask> case "safebrowsing": <mask> p.d.EnableSafeBrowsing() <mask> if c.NextArg() { </s> Allow disabling of filtering but keeping querylog, safebrowsing, safesearch and parental working. </s> remove if len(args) == 0 { // must have at least one argument return nil, c.ArgErr() </s> add if len(args) > 0 { filterFileNames = append(filterFileNames, args...) </s> remove var filterFileName string </s> add filterFileNames := []string{} </s> remove file, err := os.Open(filterFileName) if err != nil { return nil, err } defer file.Close() count := 0 scanner := bufio.NewScanner(file) for scanner.Scan() { text := scanner.Text() if p.parseEtcHosts(text) { continue } err = p.d.AddRule(text, 0) if err == dnsfilter.ErrInvalidSyntax { continue } </s> add log.Printf("filterFileNames = %+v", filterFileNames) for i, filterFileName := range filterFileNames { file, err := os.Open(filterFileName) </s> remove count++ } log.Printf("Added %d rules from %s", count, filterFileName) </s> add defer file.Close() count := 0 scanner := bufio.NewScanner(file) for scanner.Scan() { text := scanner.Text() if p.parseEtcHosts(text) { continue } err = p.d.AddRule(text, uint32(i)) if err == dnsfilter.ErrInvalidSyntax { continue } if err != nil { return nil, err } count++ } log.Printf("Added %d rules from %s", count, filterFileName) </s> remove if err = scanner.Err(); err != nil { return nil, err </s> add if err = scanner.Err(); err != nil { return nil, err } </s> add var err error
https://github.com/AdguardTeam/AdGuardHome/commit/09a39cce03f69b1f9801e66d763d7b5208411336
coredns_plugin/coredns_plugin.go
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> } <mask> } <mask> } <mask> <mask> file, err := os.Open(filterFileName) <mask> if err != nil { <mask> return nil, err <mask> } <mask> defer file.Close() <mask> <mask> count := 0 <mask> scanner := bufio.NewScanner(file) <mask> for scanner.Scan() { <mask> text := scanner.Text() <mask> if p.parseEtcHosts(text) { <mask> continue <mask> } <mask> err = p.d.AddRule(text, 0) <mask> if err == dnsfilter.ErrInvalidSyntax { <mask> continue <mask> } <mask> if err != nil { <mask> return nil, err <mask> } <mask> count++ <mask> } </s> Allow disabling of filtering but keeping querylog, safebrowsing, safesearch and parental working. </s> remove count++ } log.Printf("Added %d rules from %s", count, filterFileName) </s> add defer file.Close() count := 0 scanner := bufio.NewScanner(file) for scanner.Scan() { text := scanner.Text() if p.parseEtcHosts(text) { continue } err = p.d.AddRule(text, uint32(i)) if err == dnsfilter.ErrInvalidSyntax { continue } if err != nil { return nil, err } count++ } log.Printf("Added %d rules from %s", count, filterFileName) </s> remove if err = scanner.Err(); err != nil { return nil, err </s> add if err = scanner.Err(); err != nil { return nil, err } </s> add var err error </s> remove filterFileName = args[0] </s> add </s> remove if len(args) == 0 { // must have at least one argument return nil, c.ArgErr() </s> add if len(args) > 0 { filterFileNames = append(filterFileNames, args...) </s> remove {{if .FilteringEnabled}}dnsfilter {{.FilterFile}} { </s> add dnsfilter {{if .FilteringEnabled}}{{.FilterFile}}{{end}} {
https://github.com/AdguardTeam/AdGuardHome/commit/09a39cce03f69b1f9801e66d763d7b5208411336
coredns_plugin/coredns_plugin.go
keep keep keep keep replace replace replace keep replace replace keep
<mask> } <mask> if err != nil { <mask> return nil, err <mask> } <mask> count++ <mask> } <mask> log.Printf("Added %d rules from %s", count, filterFileName) <mask> <mask> if err = scanner.Err(); err != nil { <mask> return nil, err <mask> } </s> Allow disabling of filtering but keeping querylog, safebrowsing, safesearch and parental working. </s> remove file, err := os.Open(filterFileName) if err != nil { return nil, err } defer file.Close() count := 0 scanner := bufio.NewScanner(file) for scanner.Scan() { text := scanner.Text() if p.parseEtcHosts(text) { continue } err = p.d.AddRule(text, 0) if err == dnsfilter.ErrInvalidSyntax { continue } </s> add log.Printf("filterFileNames = %+v", filterFileNames) for i, filterFileName := range filterFileNames { file, err := os.Open(filterFileName) </s> add var err error </s> remove filterFileName = args[0] </s> add </s> remove if len(args) == 0 { // must have at least one argument return nil, c.ArgErr() </s> add if len(args) > 0 { filterFileNames = append(filterFileNames, args...) </s> remove {{if .FilteringEnabled}}dnsfilter {{.FilterFile}} { </s> add dnsfilter {{if .FilteringEnabled}}{{.FilterFile}}{{end}} {
https://github.com/AdguardTeam/AdGuardHome/commit/09a39cce03f69b1f9801e66d763d7b5208411336
coredns_plugin/coredns_plugin.go
keep add keep keep keep keep
<mask> } <mask> <mask> p.upstream, err = upstream.New(nil) <mask> if err != nil { <mask> return nil, err <mask> } </s> Allow disabling of filtering but keeping querylog, safebrowsing, safesearch and parental working. </s> remove if err = scanner.Err(); err != nil { return nil, err </s> add if err = scanner.Err(); err != nil { return nil, err } </s> remove count++ } log.Printf("Added %d rules from %s", count, filterFileName) </s> add defer file.Close() count := 0 scanner := bufio.NewScanner(file) for scanner.Scan() { text := scanner.Text() if p.parseEtcHosts(text) { continue } err = p.d.AddRule(text, uint32(i)) if err == dnsfilter.ErrInvalidSyntax { continue } if err != nil { return nil, err } count++ } log.Printf("Added %d rules from %s", count, filterFileName) </s> remove file, err := os.Open(filterFileName) if err != nil { return nil, err } defer file.Close() count := 0 scanner := bufio.NewScanner(file) for scanner.Scan() { text := scanner.Text() if p.parseEtcHosts(text) { continue } err = p.d.AddRule(text, 0) if err == dnsfilter.ErrInvalidSyntax { continue } </s> add log.Printf("filterFileNames = %+v", filterFileNames) for i, filterFileName := range filterFileNames { file, err := os.Open(filterFileName) </s> remove filterFileName = args[0] </s> add </s> remove if len(args) == 0 { // must have at least one argument return nil, c.ArgErr() </s> add if len(args) > 0 { filterFileNames = append(filterFileNames, args...) </s> remove {{if .FilteringEnabled}}dnsfilter {{.FilterFile}} { </s> add dnsfilter {{if .FilteringEnabled}}{{.FilterFile}}{{end}} {
https://github.com/AdguardTeam/AdGuardHome/commit/09a39cce03f69b1f9801e66d763d7b5208411336
coredns_plugin/coredns_plugin.go
keep keep keep keep replace keep keep keep keep keep
<mask> for i, testcase := range []struct { <mask> config string <mask> failing bool <mask> }{ <mask> {`dnsfilter`, true}, <mask> {`dnsfilter ../tests/dns.txt`, false}, <mask> {`dnsfilter ../tests/dns.txt { safebrowsing }`, false}, <mask> {`dnsfilter ../tests/dns.txt { parental }`, true}, <mask> } { <mask> c := caddy.NewTestController("dns", testcase.config) </s> Allow disabling of filtering but keeping querylog, safebrowsing, safesearch and parental working. </s> remove file, err := os.Open(filterFileName) if err != nil { return nil, err } defer file.Close() count := 0 scanner := bufio.NewScanner(file) for scanner.Scan() { text := scanner.Text() if p.parseEtcHosts(text) { continue } err = p.d.AddRule(text, 0) if err == dnsfilter.ErrInvalidSyntax { continue } </s> add log.Printf("filterFileNames = %+v", filterFileNames) for i, filterFileName := range filterFileNames { file, err := os.Open(filterFileName) </s> remove if len(args) == 0 { // must have at least one argument return nil, c.ArgErr() </s> add if len(args) > 0 { filterFileNames = append(filterFileNames, args...) </s> remove var filterFileName string </s> add filterFileNames := []string{} </s> remove count++ } log.Printf("Added %d rules from %s", count, filterFileName) </s> add defer file.Close() count := 0 scanner := bufio.NewScanner(file) for scanner.Scan() { text := scanner.Text() if p.parseEtcHosts(text) { continue } err = p.d.AddRule(text, uint32(i)) if err == dnsfilter.ErrInvalidSyntax { continue } if err != nil { return nil, err } count++ } log.Printf("Added %d rules from %s", count, filterFileName) </s> remove filterFileName = args[0] </s> add </s> remove {{if .FilteringEnabled}}dnsfilter {{.FilterFile}} { </s> add dnsfilter {{if .FilteringEnabled}}{{.FilterFile}}{{end}} {
https://github.com/AdguardTeam/AdGuardHome/commit/09a39cce03f69b1f9801e66d763d7b5208411336
coredns_plugin/coredns_plugin_test.go
keep keep add keep keep keep keep keep keep
<mask> github.com/AdguardTeam/golibs v0.4.4 <mask> github.com/AdguardTeam/urlfilter v0.13.0 <mask> github.com/NYTimes/gziphandler v1.1.1 <mask> github.com/beefsack/go-rate v0.0.0-20200827232406-6cde80facd47 // indirect <mask> github.com/fsnotify/fsnotify v1.4.9 <mask> github.com/go-ping/ping v0.0.0-20201115131931-3300c582a663 <mask> github.com/gobuffalo/envy v1.9.0 // indirect <mask> github.com/gobuffalo/packr v1.30.1 <mask> github.com/gobuffalo/packr/v2 v2.8.1 // indirect </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> remove github.com/AdguardTeam/urlfilter v0.12.3 h1:FMjQG0eTgrr8xA3z2zaLVcCgGdpzoECPGWwgPjtwPNs= github.com/AdguardTeam/urlfilter v0.12.3/go.mod h1:1fcCQx5TGJANrQN6sHNNM9KPBl7qx7BJml45ko6vru0= </s> add </s> remove github.com/go-ping/ping v0.0.0-20201022122018-3977ed72668a h1:O9xspHB2yrvKfMQ1m6OQhqe37i5yvg0dXAYMuAjugmM= github.com/go-ping/ping v0.0.0-20201022122018-3977ed72668a/go.mod h1:35JbSyV/BYqHwwRA6Zr1uVDm1637YlNOU61wI797NPI= </s> add </s> add // PortDNSCrypt is the port for DNSCrypt requests. If it's zero, // DNSCrypt is disabled. PortDNSCrypt int `yaml:"port_dnscrypt" json:"port_dnscrypt"` // DNSCryptConfigFile is the path to the DNSCrypt config file. Must be // set if PortDNSCrypt is not zero. // // See https://github.com/AdguardTeam/dnsproxy and // https://github.com/ameshkov/dnscrypt. DNSCryptConfigFile string `yaml:"dnscrypt_config_file" json:"dnscrypt_config_file"` </s> add // DNSCryptConfig is the DNSCrypt server configuration struct. type DNSCryptConfig struct { UDPListenAddr *net.UDPAddr TCPListenAddr *net.TCPAddr ProviderName string ResolverCert *dnscrypt.Cert Enabled bool } </s> add "github.com/ameshkov/dnscrypt/v2" </s> add DNSCryptConfig
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
go.mod
keep keep keep keep replace replace keep keep keep keep keep
<mask> github.com/AdguardTeam/golibs v0.4.3/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/golibs v0.4.4 h1:cM9UySQiYFW79zo5XRwnaIWVzfW4eNXmZktMrWbthpw= <mask> github.com/AdguardTeam/golibs v0.4.4/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= <mask> github.com/AdguardTeam/gomitmproxy v0.2.0/go.mod h1:Qdv0Mktnzer5zpdpi5rAwixNJzW2FN91LjKJCkVbYGU= <mask> github.com/AdguardTeam/urlfilter v0.12.3 h1:FMjQG0eTgrr8xA3z2zaLVcCgGdpzoECPGWwgPjtwPNs= <mask> github.com/AdguardTeam/urlfilter v0.12.3/go.mod h1:1fcCQx5TGJANrQN6sHNNM9KPBl7qx7BJml45ko6vru0= <mask> github.com/AdguardTeam/urlfilter v0.13.0 h1:MfO46K81JVTkhgP6gRu/buKl5wAOSfusjiDwjT1JN1c= <mask> github.com/AdguardTeam/urlfilter v0.13.0/go.mod h1:klx4JbOfc4EaNb5lWLqOwfg+pVcyRukmoJRvO55lL5U= <mask> github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= <mask> github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= <mask> github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> add github.com/ameshkov/dnscrypt/v2 v2.0.0 </s> remove github.com/lucas-clemente/quic-go v0.19.0 h1:IG5lB7DfHl6eZ7WTBVL8bnbDg0JGwDv906l6JffQbyg= github.com/lucas-clemente/quic-go v0.19.0/go.mod h1:ZUygOqIoai0ASXXLJ92LTnKdbqh9MHCLTX6Nr1jUrK0= </s> add </s> add if s.conf.DNSCryptConfig.Enabled { proxyConfig.DNSCryptUDPListenAddr = []*net.UDPAddr{s.conf.DNSCryptConfig.UDPListenAddr} proxyConfig.DNSCryptTCPListenAddr = []*net.TCPAddr{s.conf.DNSCryptConfig.TCPListenAddr} proxyConfig.DNSCryptProviderName = s.conf.DNSCryptConfig.ProviderName proxyConfig.DNSCryptResolverCert = s.conf.DNSCryptConfig.ResolverCert } </s> remove github.com/go-ping/ping v0.0.0-20201022122018-3977ed72668a h1:O9xspHB2yrvKfMQ1m6OQhqe37i5yvg0dXAYMuAjugmM= github.com/go-ping/ping v0.0.0-20201022122018-3977ed72668a/go.mod h1:35JbSyV/BYqHwwRA6Zr1uVDm1637YlNOU61wI797NPI= </s> add </s> remove github.com/kardianos/service v1.1.0 h1:QV2SiEeWK42P0aEmGcsAgjApw/lRxkwopvT+Gu6t1/0= github.com/kardianos/service v1.1.0/go.mod h1:RrJI2xn5vve/r32U5suTbeaSGoMU6GbNPoj36CVYcHc= </s> add </s> remove golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9 h1:umElSU9WZirRdgu2yFHY0ayQkEnKiOC1TtM3fWXFnoU= golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
go.sum
keep keep keep keep replace replace keep keep keep keep keep
<mask> github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= <mask> github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= <mask> github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI= <mask> github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= <mask> github.com/go-ping/ping v0.0.0-20201022122018-3977ed72668a h1:O9xspHB2yrvKfMQ1m6OQhqe37i5yvg0dXAYMuAjugmM= <mask> github.com/go-ping/ping v0.0.0-20201022122018-3977ed72668a/go.mod h1:35JbSyV/BYqHwwRA6Zr1uVDm1637YlNOU61wI797NPI= <mask> github.com/go-ping/ping v0.0.0-20201115131931-3300c582a663 h1:jI2GiiRh+pPbey52EVmbU6kuLiXqwy4CXZ4gwUBj8Y0= <mask> github.com/go-ping/ping v0.0.0-20201115131931-3300c582a663/go.mod h1:35JbSyV/BYqHwwRA6Zr1uVDm1637YlNOU61wI797NPI= <mask> github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= <mask> github.com/go-test/deep v1.0.5 h1:AKODKU3pDH1RzZzm6YZu77YWtEAq6uh1rLIAQlay2qc= <mask> github.com/go-test/deep v1.0.5/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> add github.com/ameshkov/dnscrypt/v2 v2.0.0 </s> remove github.com/lucas-clemente/quic-go v0.19.0 h1:IG5lB7DfHl6eZ7WTBVL8bnbDg0JGwDv906l6JffQbyg= github.com/lucas-clemente/quic-go v0.19.0/go.mod h1:ZUygOqIoai0ASXXLJ92LTnKdbqh9MHCLTX6Nr1jUrK0= </s> add </s> add if s.conf.DNSCryptConfig.Enabled { proxyConfig.DNSCryptUDPListenAddr = []*net.UDPAddr{s.conf.DNSCryptConfig.UDPListenAddr} proxyConfig.DNSCryptTCPListenAddr = []*net.TCPAddr{s.conf.DNSCryptConfig.TCPListenAddr} proxyConfig.DNSCryptProviderName = s.conf.DNSCryptConfig.ProviderName proxyConfig.DNSCryptResolverCert = s.conf.DNSCryptConfig.ResolverCert } </s> remove github.com/AdguardTeam/urlfilter v0.12.3 h1:FMjQG0eTgrr8xA3z2zaLVcCgGdpzoECPGWwgPjtwPNs= github.com/AdguardTeam/urlfilter v0.12.3/go.mod h1:1fcCQx5TGJANrQN6sHNNM9KPBl7qx7BJml45ko6vru0= </s> add </s> remove github.com/kardianos/service v1.1.0 h1:QV2SiEeWK42P0aEmGcsAgjApw/lRxkwopvT+Gu6t1/0= github.com/kardianos/service v1.1.0/go.mod h1:RrJI2xn5vve/r32U5suTbeaSGoMU6GbNPoj36CVYcHc= </s> add </s> remove golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9 h1:umElSU9WZirRdgu2yFHY0ayQkEnKiOC1TtM3fWXFnoU= golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
go.sum
keep keep keep keep replace replace keep keep keep keep keep
<mask> github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= <mask> github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= <mask> github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= <mask> github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= <mask> github.com/kardianos/service v1.1.0 h1:QV2SiEeWK42P0aEmGcsAgjApw/lRxkwopvT+Gu6t1/0= <mask> github.com/kardianos/service v1.1.0/go.mod h1:RrJI2xn5vve/r32U5suTbeaSGoMU6GbNPoj36CVYcHc= <mask> github.com/kardianos/service v1.2.0 h1:bGuZ/epo3vrt8IPC7mnKQolqFeYJb7Cs8Rk4PSOBB/g= <mask> github.com/kardianos/service v1.2.0/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM= <mask> github.com/karrick/godirwalk v1.10.12 h1:BqUm+LuJcXjGv1d2mj3gBiQyrQ57a0rYoAmhvJQ7RDU= <mask> github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= <mask> github.com/karrick/godirwalk v1.15.8/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk= </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> remove return fmt.Errorf("couldn't start forwarding DNS server: %w", err) </s> add return fmt.Errorf("generating forwarding dns server config: %w", err) } err = Context.dnsServer.Reconfigure(&newconfig) if err != nil { return fmt.Errorf("starting forwarding dns server: %w", err) </s> add if s.conf.DNSCryptConfig.Enabled { proxyConfig.DNSCryptUDPListenAddr = []*net.UDPAddr{s.conf.DNSCryptConfig.UDPListenAddr} proxyConfig.DNSCryptTCPListenAddr = []*net.TCPAddr{s.conf.DNSCryptConfig.TCPListenAddr} proxyConfig.DNSCryptProviderName = s.conf.DNSCryptConfig.ProviderName proxyConfig.DNSCryptResolverCert = s.conf.DNSCryptConfig.ResolverCert } </s> remove github.com/AdguardTeam/urlfilter v0.12.3 h1:FMjQG0eTgrr8xA3z2zaLVcCgGdpzoECPGWwgPjtwPNs= github.com/AdguardTeam/urlfilter v0.12.3/go.mod h1:1fcCQx5TGJANrQN6sHNNM9KPBl7qx7BJml45ko6vru0= </s> add </s> remove github.com/go-ping/ping v0.0.0-20201022122018-3977ed72668a h1:O9xspHB2yrvKfMQ1m6OQhqe37i5yvg0dXAYMuAjugmM= github.com/go-ping/ping v0.0.0-20201022122018-3977ed72668a/go.mod h1:35JbSyV/BYqHwwRA6Zr1uVDm1637YlNOU61wI797NPI= </s> add </s> remove github.com/lucas-clemente/quic-go v0.19.0 h1:IG5lB7DfHl6eZ7WTBVL8bnbDg0JGwDv906l6JffQbyg= github.com/lucas-clemente/quic-go v0.19.0/go.mod h1:ZUygOqIoai0ASXXLJ92LTnKdbqh9MHCLTX6Nr1jUrK0= </s> add </s> remove golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9 h1:umElSU9WZirRdgu2yFHY0ayQkEnKiOC1TtM3fWXFnoU= golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
go.sum
keep keep keep keep replace replace keep keep keep keep keep
<mask> github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= <mask> github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= <mask> github.com/lucas-clemente/quic-go v0.18.1 h1:DMR7guC0NtVS8zNZR3IO7NARZvZygkSC56GGtC6cyys= <mask> github.com/lucas-clemente/quic-go v0.18.1/go.mod h1:yXttHsSNxQi8AWijC/vLP+OJczXqzHSOcJrM5ITUlCg= <mask> github.com/lucas-clemente/quic-go v0.19.0 h1:IG5lB7DfHl6eZ7WTBVL8bnbDg0JGwDv906l6JffQbyg= <mask> github.com/lucas-clemente/quic-go v0.19.0/go.mod h1:ZUygOqIoai0ASXXLJ92LTnKdbqh9MHCLTX6Nr1jUrK0= <mask> github.com/lucas-clemente/quic-go v0.19.1 h1:J9TkQJGJVOR3UmGhd4zdVYwKSA0EoXbLRf15uQJ6gT4= <mask> github.com/lucas-clemente/quic-go v0.19.1/go.mod h1:ZUygOqIoai0ASXXLJ92LTnKdbqh9MHCLTX6Nr1jUrK0= <mask> github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= <mask> github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= <mask> github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> remove github.com/AdguardTeam/urlfilter v0.12.3 h1:FMjQG0eTgrr8xA3z2zaLVcCgGdpzoECPGWwgPjtwPNs= github.com/AdguardTeam/urlfilter v0.12.3/go.mod h1:1fcCQx5TGJANrQN6sHNNM9KPBl7qx7BJml45ko6vru0= </s> add </s> remove github.com/go-ping/ping v0.0.0-20201022122018-3977ed72668a h1:O9xspHB2yrvKfMQ1m6OQhqe37i5yvg0dXAYMuAjugmM= github.com/go-ping/ping v0.0.0-20201022122018-3977ed72668a/go.mod h1:35JbSyV/BYqHwwRA6Zr1uVDm1637YlNOU61wI797NPI= </s> add </s> remove return fmt.Errorf("couldn't start forwarding DNS server: %w", err) </s> add return fmt.Errorf("generating forwarding dns server config: %w", err) } err = Context.dnsServer.Reconfigure(&newconfig) if err != nil { return fmt.Errorf("starting forwarding dns server: %w", err) </s> add if s.conf.DNSCryptConfig.Enabled { proxyConfig.DNSCryptUDPListenAddr = []*net.UDPAddr{s.conf.DNSCryptConfig.UDPListenAddr} proxyConfig.DNSCryptTCPListenAddr = []*net.TCPAddr{s.conf.DNSCryptConfig.TCPListenAddr} proxyConfig.DNSCryptProviderName = s.conf.DNSCryptConfig.ProviderName proxyConfig.DNSCryptResolverCert = s.conf.DNSCryptConfig.ResolverCert } </s> remove github.com/kardianos/service v1.1.0 h1:QV2SiEeWK42P0aEmGcsAgjApw/lRxkwopvT+Gu6t1/0= github.com/kardianos/service v1.1.0/go.mod h1:RrJI2xn5vve/r32U5suTbeaSGoMU6GbNPoj36CVYcHc= </s> add </s> remove golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9 h1:umElSU9WZirRdgu2yFHY0ayQkEnKiOC1TtM3fWXFnoU= golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
go.sum
keep keep keep keep replace replace keep keep keep keep keep
<mask> golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= <mask> golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= <mask> golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= <mask> golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= <mask> golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9 h1:umElSU9WZirRdgu2yFHY0ayQkEnKiOC1TtM3fWXFnoU= <mask> golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= <mask> golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9 h1:phUcVbl53swtrUN8kQEXFhUxPlIlWyBfKmidCu7P95o= <mask> golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= <mask> golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= <mask> golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= <mask> golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> remove return fmt.Errorf("couldn't start forwarding DNS server: %w", err) </s> add return fmt.Errorf("generating forwarding dns server config: %w", err) } err = Context.dnsServer.Reconfigure(&newconfig) if err != nil { return fmt.Errorf("starting forwarding dns server: %w", err) </s> add if s.conf.DNSCryptConfig.Enabled { proxyConfig.DNSCryptUDPListenAddr = []*net.UDPAddr{s.conf.DNSCryptConfig.UDPListenAddr} proxyConfig.DNSCryptTCPListenAddr = []*net.TCPAddr{s.conf.DNSCryptConfig.TCPListenAddr} proxyConfig.DNSCryptProviderName = s.conf.DNSCryptConfig.ProviderName proxyConfig.DNSCryptResolverCert = s.conf.DNSCryptConfig.ResolverCert } </s> remove github.com/AdguardTeam/urlfilter v0.12.3 h1:FMjQG0eTgrr8xA3z2zaLVcCgGdpzoECPGWwgPjtwPNs= github.com/AdguardTeam/urlfilter v0.12.3/go.mod h1:1fcCQx5TGJANrQN6sHNNM9KPBl7qx7BJml45ko6vru0= </s> add </s> remove github.com/go-ping/ping v0.0.0-20201022122018-3977ed72668a h1:O9xspHB2yrvKfMQ1m6OQhqe37i5yvg0dXAYMuAjugmM= github.com/go-ping/ping v0.0.0-20201022122018-3977ed72668a/go.mod h1:35JbSyV/BYqHwwRA6Zr1uVDm1637YlNOU61wI797NPI= </s> add </s> remove github.com/kardianos/service v1.1.0 h1:QV2SiEeWK42P0aEmGcsAgjApw/lRxkwopvT+Gu6t1/0= github.com/kardianos/service v1.1.0/go.mod h1:RrJI2xn5vve/r32U5suTbeaSGoMU6GbNPoj36CVYcHc= </s> add </s> remove github.com/lucas-clemente/quic-go v0.19.0 h1:IG5lB7DfHl6eZ7WTBVL8bnbDg0JGwDv906l6JffQbyg= github.com/lucas-clemente/quic-go v0.19.0/go.mod h1:ZUygOqIoai0ASXXLJ92LTnKdbqh9MHCLTX6Nr1jUrK0= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
go.sum
keep keep keep keep replace keep keep keep keep keep
<mask> golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= <mask> golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= <mask> golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= <mask> golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= <mask> golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= <mask> golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= <mask> golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20190411185658-b44545bcd369/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= <mask> golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> remove return fmt.Errorf("couldn't start forwarding DNS server: %w", err) </s> add return fmt.Errorf("generating forwarding dns server config: %w", err) } err = Context.dnsServer.Reconfigure(&newconfig) if err != nil { return fmt.Errorf("starting forwarding dns server: %w", err) </s> add if s.conf.DNSCryptConfig.Enabled { proxyConfig.DNSCryptUDPListenAddr = []*net.UDPAddr{s.conf.DNSCryptConfig.UDPListenAddr} proxyConfig.DNSCryptTCPListenAddr = []*net.TCPAddr{s.conf.DNSCryptConfig.TCPListenAddr} proxyConfig.DNSCryptProviderName = s.conf.DNSCryptConfig.ProviderName proxyConfig.DNSCryptResolverCert = s.conf.DNSCryptConfig.ResolverCert } </s> remove github.com/AdguardTeam/urlfilter v0.12.3 h1:FMjQG0eTgrr8xA3z2zaLVcCgGdpzoECPGWwgPjtwPNs= github.com/AdguardTeam/urlfilter v0.12.3/go.mod h1:1fcCQx5TGJANrQN6sHNNM9KPBl7qx7BJml45ko6vru0= </s> add </s> remove github.com/go-ping/ping v0.0.0-20201022122018-3977ed72668a h1:O9xspHB2yrvKfMQ1m6OQhqe37i5yvg0dXAYMuAjugmM= github.com/go-ping/ping v0.0.0-20201022122018-3977ed72668a/go.mod h1:35JbSyV/BYqHwwRA6Zr1uVDm1637YlNOU61wI797NPI= </s> add </s> remove github.com/kardianos/service v1.1.0 h1:QV2SiEeWK42P0aEmGcsAgjApw/lRxkwopvT+Gu6t1/0= github.com/kardianos/service v1.1.0/go.mod h1:RrJI2xn5vve/r32U5suTbeaSGoMU6GbNPoj36CVYcHc= </s> add </s> remove github.com/lucas-clemente/quic-go v0.19.0 h1:IG5lB7DfHl6eZ7WTBVL8bnbDg0JGwDv906l6JffQbyg= github.com/lucas-clemente/quic-go v0.19.0/go.mod h1:ZUygOqIoai0ASXXLJ92LTnKdbqh9MHCLTX6Nr1jUrK0= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
go.sum
keep keep add keep keep keep keep keep keep
<mask> "github.com/AdguardTeam/dnsproxy/proxy" <mask> "github.com/AdguardTeam/dnsproxy/upstream" <mask> "github.com/AdguardTeam/golibs/log" <mask> ) <mask> <mask> // FilteringConfig represents the DNS filtering configuration of AdGuard Home <mask> // The zero FilteringConfig is empty and ready for use. <mask> type FilteringConfig struct { <mask> // Callbacks for other modules </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> add // DNSCryptConfig is the DNSCrypt server configuration struct. type DNSCryptConfig struct { UDPListenAddr *net.UDPAddr TCPListenAddr *net.TCPAddr ProviderName string ResolverCert *dnscrypt.Cert Enabled bool } </s> add "github.com/ameshkov/dnscrypt/v2" yaml "gopkg.in/yaml.v2" </s> add DNSCryptConfig </s> add // PortDNSCrypt is the port for DNSCrypt requests. If it's zero, // DNSCrypt is disabled. PortDNSCrypt int `yaml:"port_dnscrypt" json:"port_dnscrypt"` // DNSCryptConfigFile is the path to the DNSCrypt config file. Must be // set if PortDNSCrypt is not zero. // // See https://github.com/AdguardTeam/dnsproxy and // https://github.com/ameshkov/dnscrypt. DNSCryptConfigFile string `yaml:"dnscrypt_config_file" json:"dnscrypt_config_file"` </s> add if tlsConf.PortDNSCrypt != 0 { newconfig.DNSCryptConfig, err = newDNSCrypt(bindHost, tlsConf) if err != nil { // Don't wrap the error, because it's already // wrapped by newDNSCrypt. return dnsforward.ServerConfig{}, err } } </s> add github.com/ameshkov/dnscrypt/v2 v2.0.0
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
internal/dnsforward/config.go
keep keep keep add keep keep keep keep
<mask> // DNS names from certificate (SAN) or CN value from Subject <mask> dnsNames []string <mask> } <mask> <mask> // ServerConfig represents server configuration. <mask> // The zero ServerConfig is empty and ready for use. <mask> type ServerConfig struct { <mask> UDPListenAddr *net.UDPAddr // UDP listen address </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> add "github.com/ameshkov/dnscrypt/v2" </s> add // PortDNSCrypt is the port for DNSCrypt requests. If it's zero, // DNSCrypt is disabled. PortDNSCrypt int `yaml:"port_dnscrypt" json:"port_dnscrypt"` // DNSCryptConfigFile is the path to the DNSCrypt config file. Must be // set if PortDNSCrypt is not zero. // // See https://github.com/AdguardTeam/dnsproxy and // https://github.com/ameshkov/dnscrypt. DNSCryptConfigFile string `yaml:"dnscrypt_config_file" json:"dnscrypt_config_file"` </s> add "github.com/ameshkov/dnscrypt/v2" yaml "gopkg.in/yaml.v2" </s> add DNSCryptConfig </s> add github.com/ameshkov/dnscrypt/v2 v2.0.0 </s> add if tlsConf.PortDNSCrypt != 0 { newconfig.DNSCryptConfig, err = newDNSCrypt(bindHost, tlsConf) if err != nil { // Don't wrap the error, because it's already // wrapped by newDNSCrypt. return dnsforward.ServerConfig{}, err } }
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
internal/dnsforward/config.go
keep add keep keep keep keep
<mask> FilteringConfig <mask> TLSConfig <mask> TLSAllowUnencryptedDOH bool <mask> <mask> TLSv12Roots *x509.CertPool // list of root CAs for TLSv1.2 <mask> TLSCiphers []uint16 // list of TLS ciphers to use </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> add "github.com/ameshkov/dnscrypt/v2" </s> add // PortDNSCrypt is the port for DNSCrypt requests. If it's zero, // DNSCrypt is disabled. PortDNSCrypt int `yaml:"port_dnscrypt" json:"port_dnscrypt"` // DNSCryptConfigFile is the path to the DNSCrypt config file. Must be // set if PortDNSCrypt is not zero. // // See https://github.com/AdguardTeam/dnsproxy and // https://github.com/ameshkov/dnscrypt. DNSCryptConfigFile string `yaml:"dnscrypt_config_file" json:"dnscrypt_config_file"` </s> add // DNSCryptConfig is the DNSCrypt server configuration struct. type DNSCryptConfig struct { UDPListenAddr *net.UDPAddr TCPListenAddr *net.TCPAddr ProviderName string ResolverCert *dnscrypt.Cert Enabled bool } </s> add github.com/ameshkov/dnscrypt/v2 v2.0.0 </s> add if tlsConf.PortDNSCrypt != 0 { newconfig.DNSCryptConfig, err = newDNSCrypt(bindHost, tlsConf) if err != nil { // Don't wrap the error, because it's already // wrapped by newDNSCrypt. return dnsforward.ServerConfig{}, err } } </s> add "github.com/ameshkov/dnscrypt/v2" yaml "gopkg.in/yaml.v2"
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
internal/dnsforward/config.go
keep keep keep add keep keep keep keep keep keep
<mask> if err != nil { <mask> return proxyConfig, err <mask> } <mask> <mask> // Validate proxy config <mask> if proxyConfig.UpstreamConfig == nil || len(proxyConfig.UpstreamConfig.Upstreams) == 0 { <mask> return proxyConfig, errors.New("no default upstream servers configured") <mask> } <mask> <mask> return proxyConfig, nil </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> remove return newconfig </s> add return newconfig, nil } func newDNSCrypt(bindHost net.IP, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) { if tlsConf.DNSCryptConfigFile == "" { return dnscc, agherr.Error("no dnscrypt_config_file") } f, err := os.Open(tlsConf.DNSCryptConfigFile) if err != nil { return dnscc, fmt.Errorf("opening dnscrypt config: %w", err) } defer f.Close() rc := &dnscrypt.ResolverConfig{} err = yaml.NewDecoder(f).Decode(rc) if err != nil { return dnscc, fmt.Errorf("decoding dnscrypt config: %w", err) } cert, err := rc.CreateCert() if err != nil { return dnscc, fmt.Errorf("creating dnscrypt cert: %w", err) } udpAddr := &net.UDPAddr{ IP: bindHost, Port: tlsConf.PortDNSCrypt, } tcpAddr := &net.TCPAddr{ IP: bindHost, Port: tlsConf.PortDNSCrypt, } return dnsforward.DNSCryptConfig{ UDPListenAddr: udpAddr, TCPListenAddr: tcpAddr, ResolverCert: cert, ProviderName: rc.ProviderName, Enabled: true, }, nil </s> remove return fmt.Errorf("couldn't start forwarding DNS server: %w", err) </s> add return fmt.Errorf("generating forwarding dns server config: %w", err) } err = Context.dnsServer.Reconfigure(&newconfig) if err != nil { return fmt.Errorf("starting forwarding dns server: %w", err) </s> remove func reconfigureDNSServer() error { newconfig := generateServerConfig() err := Context.dnsServer.Reconfigure(&newconfig) </s> add func reconfigureDNSServer() (err error) { var newconfig dnsforward.ServerConfig newconfig, err = generateServerConfig() </s> remove dnsConfig := generateServerConfig() </s> add dnsConfig, err := generateServerConfig() if err != nil { closeDNSServer() return fmt.Errorf("generateServerConfig: %w", err) } </s> add if tlsConf.PortDNSCrypt != 0 { newconfig.DNSCryptConfig, err = newDNSCrypt(bindHost, tlsConf) if err != nil { // Don't wrap the error, because it's already // wrapped by newDNSCrypt. return dnsforward.ServerConfig{}, err } } </s> remove IP: net.ParseIP(config.DNS.BindHost), </s> add IP: bindHost,
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
internal/dnsforward/config.go
keep keep keep add keep keep keep keep keep
<mask> PortHTTPS int `yaml:"port_https" json:"port_https,omitempty"` // HTTPS port. If 0, HTTPS will be disabled <mask> PortDNSOverTLS int `yaml:"port_dns_over_tls" json:"port_dns_over_tls,omitempty"` // DNS-over-TLS port. If 0, DOT will be disabled <mask> PortDNSOverQUIC uint16 `yaml:"port_dns_over_quic" json:"port_dns_over_quic,omitempty"` // DNS-over-QUIC port. If 0, DoQ will be disabled <mask> <mask> // Allow DOH queries via unencrypted HTTP (e.g. for reverse proxying) <mask> AllowUnencryptedDOH bool `yaml:"allow_unencrypted_doh" json:"allow_unencrypted_doh"` <mask> <mask> dnsforward.TLSConfig `yaml:",inline" json:",inline"` <mask> } </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> add DNSCryptConfig </s> add // DNSCryptConfig is the DNSCrypt server configuration struct. type DNSCryptConfig struct { UDPListenAddr *net.UDPAddr TCPListenAddr *net.TCPAddr ProviderName string ResolverCert *dnscrypt.Cert Enabled bool } </s> add "github.com/ameshkov/dnscrypt/v2" </s> add github.com/ameshkov/dnscrypt/v2 v2.0.0 </s> add if tlsConf.PortDNSCrypt != 0 { newconfig.DNSCryptConfig, err = newDNSCrypt(bindHost, tlsConf) if err != nil { // Don't wrap the error, because it's already // wrapped by newDNSCrypt. return dnsforward.ServerConfig{}, err } } </s> add "github.com/ameshkov/dnscrypt/v2" yaml "gopkg.in/yaml.v2"
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
internal/home/config.go
keep keep add keep keep keep keep keep
<mask> import ( <mask> "fmt" <mask> "net" <mask> "path/filepath" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/agherr" <mask> "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" <mask> "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> add "github.com/AdguardTeam/AdGuardHome/internal/agherr" </s> remove return fmt.Errorf("couldn't start forwarding DNS server: %w", err) </s> add return fmt.Errorf("generating forwarding dns server config: %w", err) } err = Context.dnsServer.Reconfigure(&newconfig) if err != nil { return fmt.Errorf("starting forwarding dns server: %w", err) </s> add DNSCryptConfig </s> remove github.com/AdguardTeam/urlfilter v0.12.3 h1:FMjQG0eTgrr8xA3z2zaLVcCgGdpzoECPGWwgPjtwPNs= github.com/AdguardTeam/urlfilter v0.12.3/go.mod h1:1fcCQx5TGJANrQN6sHNNM9KPBl7qx7BJml45ko6vru0= </s> add </s> remove github.com/go-ping/ping v0.0.0-20201022122018-3977ed72668a h1:O9xspHB2yrvKfMQ1m6OQhqe37i5yvg0dXAYMuAjugmM= github.com/go-ping/ping v0.0.0-20201022122018-3977ed72668a/go.mod h1:35JbSyV/BYqHwwRA6Zr1uVDm1637YlNOU61wI797NPI= </s> add </s> remove github.com/kardianos/service v1.1.0 h1:QV2SiEeWK42P0aEmGcsAgjApw/lRxkwopvT+Gu6t1/0= github.com/kardianos/service v1.1.0/go.mod h1:RrJI2xn5vve/r32U5suTbeaSGoMU6GbNPoj36CVYcHc= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
internal/home/dns.go
keep add keep keep keep keep keep keep
<mask> "path/filepath" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/dnsfilter" <mask> "github.com/AdguardTeam/AdGuardHome/internal/dnsforward" <mask> "github.com/AdguardTeam/AdGuardHome/internal/querylog" <mask> "github.com/AdguardTeam/AdGuardHome/internal/stats" <mask> "github.com/AdguardTeam/AdGuardHome/internal/util" <mask> "github.com/AdguardTeam/dnsproxy/proxy" </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> add "os" </s> add "github.com/ameshkov/dnscrypt/v2" yaml "gopkg.in/yaml.v2" </s> add "github.com/ameshkov/dnscrypt/v2" </s> remove return fmt.Errorf("couldn't start forwarding DNS server: %w", err) </s> add return fmt.Errorf("generating forwarding dns server config: %w", err) } err = Context.dnsServer.Reconfigure(&newconfig) if err != nil { return fmt.Errorf("starting forwarding dns server: %w", err) </s> add DNSCryptConfig </s> remove github.com/AdguardTeam/urlfilter v0.12.3 h1:FMjQG0eTgrr8xA3z2zaLVcCgGdpzoECPGWwgPjtwPNs= github.com/AdguardTeam/urlfilter v0.12.3/go.mod h1:1fcCQx5TGJANrQN6sHNNM9KPBl7qx7BJml45ko6vru0= </s> add
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
internal/home/dns.go
keep add keep keep keep keep
<mask> "github.com/AdguardTeam/dnsproxy/proxy" <mask> "github.com/AdguardTeam/golibs/log" <mask> ) <mask> <mask> // Called by other modules when configuration is changed <mask> func onConfigModified() { </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> add "github.com/ameshkov/dnscrypt/v2" </s> add // DNSCryptConfig is the DNSCrypt server configuration struct. type DNSCryptConfig struct { UDPListenAddr *net.UDPAddr TCPListenAddr *net.TCPAddr ProviderName string ResolverCert *dnscrypt.Cert Enabled bool } </s> add if tlsConf.PortDNSCrypt != 0 { newconfig.DNSCryptConfig, err = newDNSCrypt(bindHost, tlsConf) if err != nil { // Don't wrap the error, because it's already // wrapped by newDNSCrypt. return dnsforward.ServerConfig{}, err } } </s> add // PortDNSCrypt is the port for DNSCrypt requests. If it's zero, // DNSCrypt is disabled. PortDNSCrypt int `yaml:"port_dnscrypt" json:"port_dnscrypt"` // DNSCryptConfigFile is the path to the DNSCrypt config file. Must be // set if PortDNSCrypt is not zero. // // See https://github.com/AdguardTeam/dnsproxy and // https://github.com/ameshkov/dnscrypt. DNSCryptConfigFile string `yaml:"dnscrypt_config_file" json:"dnscrypt_config_file"` </s> remove func reconfigureDNSServer() error { newconfig := generateServerConfig() err := Context.dnsServer.Reconfigure(&newconfig) </s> add func reconfigureDNSServer() (err error) { var newconfig dnsforward.ServerConfig newconfig, err = generateServerConfig() </s> add "github.com/AdguardTeam/AdGuardHome/internal/agherr"
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
internal/home/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> p.DHCPServer = Context.dhcpServer <mask> } <mask> Context.dnsServer = dnsforward.NewServer(p) <mask> Context.clients.dnsServer = Context.dnsServer <mask> dnsConfig := generateServerConfig() <mask> err = Context.dnsServer.Prepare(&dnsConfig) <mask> if err != nil { <mask> closeDNSServer() <mask> return fmt.Errorf("dnsServer.Prepare: %w", err) <mask> } </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> remove return fmt.Errorf("couldn't start forwarding DNS server: %w", err) </s> add return fmt.Errorf("generating forwarding dns server config: %w", err) } err = Context.dnsServer.Reconfigure(&newconfig) if err != nil { return fmt.Errorf("starting forwarding dns server: %w", err) </s> remove func reconfigureDNSServer() error { newconfig := generateServerConfig() err := Context.dnsServer.Reconfigure(&newconfig) </s> add func reconfigureDNSServer() (err error) { var newconfig dnsforward.ServerConfig newconfig, err = generateServerConfig() </s> remove return newconfig </s> add return newconfig, nil } func newDNSCrypt(bindHost net.IP, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) { if tlsConf.DNSCryptConfigFile == "" { return dnscc, agherr.Error("no dnscrypt_config_file") } f, err := os.Open(tlsConf.DNSCryptConfigFile) if err != nil { return dnscc, fmt.Errorf("opening dnscrypt config: %w", err) } defer f.Close() rc := &dnscrypt.ResolverConfig{} err = yaml.NewDecoder(f).Decode(rc) if err != nil { return dnscc, fmt.Errorf("decoding dnscrypt config: %w", err) } cert, err := rc.CreateCert() if err != nil { return dnscc, fmt.Errorf("creating dnscrypt cert: %w", err) } udpAddr := &net.UDPAddr{ IP: bindHost, Port: tlsConf.PortDNSCrypt, } tcpAddr := &net.TCPAddr{ IP: bindHost, Port: tlsConf.PortDNSCrypt, } return dnsforward.DNSCryptConfig{ UDPListenAddr: udpAddr, TCPListenAddr: tcpAddr, ResolverCert: cert, ProviderName: rc.ProviderName, Enabled: true, }, nil </s> add if s.conf.DNSCryptConfig.Enabled { proxyConfig.DNSCryptUDPListenAddr = []*net.UDPAddr{s.conf.DNSCryptConfig.UDPListenAddr} proxyConfig.DNSCryptTCPListenAddr = []*net.TCPAddr{s.conf.DNSCryptConfig.TCPListenAddr} proxyConfig.DNSCryptProviderName = s.conf.DNSCryptConfig.ProviderName proxyConfig.DNSCryptResolverCert = s.conf.DNSCryptConfig.ResolverCert } </s> add if tlsConf.PortDNSCrypt != 0 { newconfig.DNSCryptConfig, err = newDNSCrypt(bindHost, tlsConf) if err != nil { // Don't wrap the error, because it's already // wrapped by newDNSCrypt. return dnsforward.ServerConfig{}, err } } </s> remove func generateServerConfig() dnsforward.ServerConfig { newconfig := dnsforward.ServerConfig{ UDPListenAddr: &net.UDPAddr{IP: net.ParseIP(config.DNS.BindHost), Port: config.DNS.Port}, TCPListenAddr: &net.TCPAddr{IP: net.ParseIP(config.DNS.BindHost), Port: config.DNS.Port}, </s> add func generateServerConfig() (newconfig dnsforward.ServerConfig, err error) { bindHost := net.ParseIP(config.DNS.BindHost) newconfig = dnsforward.ServerConfig{ UDPListenAddr: &net.UDPAddr{IP: bindHost, Port: config.DNS.Port}, TCPListenAddr: &net.TCPAddr{IP: bindHost, Port: config.DNS.Port},
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
internal/home/dns.go
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> Context.whois.Begin(ip) <mask> } <mask> } <mask> <mask> func generateServerConfig() dnsforward.ServerConfig { <mask> newconfig := dnsforward.ServerConfig{ <mask> UDPListenAddr: &net.UDPAddr{IP: net.ParseIP(config.DNS.BindHost), Port: config.DNS.Port}, <mask> TCPListenAddr: &net.TCPAddr{IP: net.ParseIP(config.DNS.BindHost), Port: config.DNS.Port}, <mask> FilteringConfig: config.DNS.FilteringConfig, <mask> ConfigModified: onConfigModified, <mask> HTTPRegister: httpRegister, <mask> OnDNSRequest: onDNSRequest, <mask> } </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> remove func reconfigureDNSServer() error { newconfig := generateServerConfig() err := Context.dnsServer.Reconfigure(&newconfig) </s> add func reconfigureDNSServer() (err error) { var newconfig dnsforward.ServerConfig newconfig, err = generateServerConfig() </s> remove IP: net.ParseIP(config.DNS.BindHost), </s> add IP: bindHost, </s> remove IP: net.ParseIP(config.DNS.BindHost), </s> add IP: bindHost, </s> remove return newconfig </s> add return newconfig, nil } func newDNSCrypt(bindHost net.IP, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) { if tlsConf.DNSCryptConfigFile == "" { return dnscc, agherr.Error("no dnscrypt_config_file") } f, err := os.Open(tlsConf.DNSCryptConfigFile) if err != nil { return dnscc, fmt.Errorf("opening dnscrypt config: %w", err) } defer f.Close() rc := &dnscrypt.ResolverConfig{} err = yaml.NewDecoder(f).Decode(rc) if err != nil { return dnscc, fmt.Errorf("decoding dnscrypt config: %w", err) } cert, err := rc.CreateCert() if err != nil { return dnscc, fmt.Errorf("creating dnscrypt cert: %w", err) } udpAddr := &net.UDPAddr{ IP: bindHost, Port: tlsConf.PortDNSCrypt, } tcpAddr := &net.TCPAddr{ IP: bindHost, Port: tlsConf.PortDNSCrypt, } return dnsforward.DNSCryptConfig{ UDPListenAddr: udpAddr, TCPListenAddr: tcpAddr, ResolverCert: cert, ProviderName: rc.ProviderName, Enabled: true, }, nil </s> remove return fmt.Errorf("couldn't start forwarding DNS server: %w", err) </s> add return fmt.Errorf("generating forwarding dns server config: %w", err) } err = Context.dnsServer.Reconfigure(&newconfig) if err != nil { return fmt.Errorf("starting forwarding dns server: %w", err) </s> remove dnsConfig := generateServerConfig() </s> add dnsConfig, err := generateServerConfig() if err != nil { closeDNSServer() return fmt.Errorf("generateServerConfig: %w", err) }
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
internal/home/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> newconfig.TLSConfig = tlsConf.TLSConfig <mask> <mask> if tlsConf.PortDNSOverTLS != 0 { <mask> newconfig.TLSListenAddr = &net.TCPAddr{ <mask> IP: net.ParseIP(config.DNS.BindHost), <mask> Port: tlsConf.PortDNSOverTLS, <mask> } <mask> } <mask> <mask> if tlsConf.PortDNSOverQUIC != 0 { </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> remove IP: net.ParseIP(config.DNS.BindHost), </s> add IP: bindHost, </s> remove return newconfig </s> add return newconfig, nil } func newDNSCrypt(bindHost net.IP, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) { if tlsConf.DNSCryptConfigFile == "" { return dnscc, agherr.Error("no dnscrypt_config_file") } f, err := os.Open(tlsConf.DNSCryptConfigFile) if err != nil { return dnscc, fmt.Errorf("opening dnscrypt config: %w", err) } defer f.Close() rc := &dnscrypt.ResolverConfig{} err = yaml.NewDecoder(f).Decode(rc) if err != nil { return dnscc, fmt.Errorf("decoding dnscrypt config: %w", err) } cert, err := rc.CreateCert() if err != nil { return dnscc, fmt.Errorf("creating dnscrypt cert: %w", err) } udpAddr := &net.UDPAddr{ IP: bindHost, Port: tlsConf.PortDNSCrypt, } tcpAddr := &net.TCPAddr{ IP: bindHost, Port: tlsConf.PortDNSCrypt, } return dnsforward.DNSCryptConfig{ UDPListenAddr: udpAddr, TCPListenAddr: tcpAddr, ResolverCert: cert, ProviderName: rc.ProviderName, Enabled: true, }, nil </s> add if tlsConf.PortDNSCrypt != 0 { newconfig.DNSCryptConfig, err = newDNSCrypt(bindHost, tlsConf) if err != nil { // Don't wrap the error, because it's already // wrapped by newDNSCrypt. return dnsforward.ServerConfig{}, err } } </s> add if s.conf.DNSCryptConfig.Enabled { proxyConfig.DNSCryptUDPListenAddr = []*net.UDPAddr{s.conf.DNSCryptConfig.UDPListenAddr} proxyConfig.DNSCryptTCPListenAddr = []*net.TCPAddr{s.conf.DNSCryptConfig.TCPListenAddr} proxyConfig.DNSCryptProviderName = s.conf.DNSCryptConfig.ProviderName proxyConfig.DNSCryptResolverCert = s.conf.DNSCryptConfig.ResolverCert } </s> remove func generateServerConfig() dnsforward.ServerConfig { newconfig := dnsforward.ServerConfig{ UDPListenAddr: &net.UDPAddr{IP: net.ParseIP(config.DNS.BindHost), Port: config.DNS.Port}, TCPListenAddr: &net.TCPAddr{IP: net.ParseIP(config.DNS.BindHost), Port: config.DNS.Port}, </s> add func generateServerConfig() (newconfig dnsforward.ServerConfig, err error) { bindHost := net.ParseIP(config.DNS.BindHost) newconfig = dnsforward.ServerConfig{ UDPListenAddr: &net.UDPAddr{IP: bindHost, Port: config.DNS.Port}, TCPListenAddr: &net.TCPAddr{IP: bindHost, Port: config.DNS.Port}, </s> remove dnsConfig := generateServerConfig() </s> add dnsConfig, err := generateServerConfig() if err != nil { closeDNSServer() return fmt.Errorf("generateServerConfig: %w", err) }
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
internal/home/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> if tlsConf.PortDNSOverQUIC != 0 { <mask> newconfig.QUICListenAddr = &net.UDPAddr{ <mask> IP: net.ParseIP(config.DNS.BindHost), <mask> Port: int(tlsConf.PortDNSOverQUIC), <mask> } <mask> } <mask> } <mask> newconfig.TLSv12Roots = Context.tlsRoots </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> remove IP: net.ParseIP(config.DNS.BindHost), </s> add IP: bindHost, </s> add if tlsConf.PortDNSCrypt != 0 { newconfig.DNSCryptConfig, err = newDNSCrypt(bindHost, tlsConf) if err != nil { // Don't wrap the error, because it's already // wrapped by newDNSCrypt. return dnsforward.ServerConfig{}, err } } </s> remove return newconfig </s> add return newconfig, nil } func newDNSCrypt(bindHost net.IP, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) { if tlsConf.DNSCryptConfigFile == "" { return dnscc, agherr.Error("no dnscrypt_config_file") } f, err := os.Open(tlsConf.DNSCryptConfigFile) if err != nil { return dnscc, fmt.Errorf("opening dnscrypt config: %w", err) } defer f.Close() rc := &dnscrypt.ResolverConfig{} err = yaml.NewDecoder(f).Decode(rc) if err != nil { return dnscc, fmt.Errorf("decoding dnscrypt config: %w", err) } cert, err := rc.CreateCert() if err != nil { return dnscc, fmt.Errorf("creating dnscrypt cert: %w", err) } udpAddr := &net.UDPAddr{ IP: bindHost, Port: tlsConf.PortDNSCrypt, } tcpAddr := &net.TCPAddr{ IP: bindHost, Port: tlsConf.PortDNSCrypt, } return dnsforward.DNSCryptConfig{ UDPListenAddr: udpAddr, TCPListenAddr: tcpAddr, ResolverCert: cert, ProviderName: rc.ProviderName, Enabled: true, }, nil </s> remove func generateServerConfig() dnsforward.ServerConfig { newconfig := dnsforward.ServerConfig{ UDPListenAddr: &net.UDPAddr{IP: net.ParseIP(config.DNS.BindHost), Port: config.DNS.Port}, TCPListenAddr: &net.TCPAddr{IP: net.ParseIP(config.DNS.BindHost), Port: config.DNS.Port}, </s> add func generateServerConfig() (newconfig dnsforward.ServerConfig, err error) { bindHost := net.ParseIP(config.DNS.BindHost) newconfig = dnsforward.ServerConfig{ UDPListenAddr: &net.UDPAddr{IP: bindHost, Port: config.DNS.Port}, TCPListenAddr: &net.TCPAddr{IP: bindHost, Port: config.DNS.Port}, </s> add if s.conf.DNSCryptConfig.Enabled { proxyConfig.DNSCryptUDPListenAddr = []*net.UDPAddr{s.conf.DNSCryptConfig.UDPListenAddr} proxyConfig.DNSCryptTCPListenAddr = []*net.TCPAddr{s.conf.DNSCryptConfig.TCPListenAddr} proxyConfig.DNSCryptProviderName = s.conf.DNSCryptConfig.ProviderName proxyConfig.DNSCryptResolverCert = s.conf.DNSCryptConfig.ResolverCert } </s> remove dnsConfig := generateServerConfig() </s> add dnsConfig, err := generateServerConfig() if err != nil { closeDNSServer() return fmt.Errorf("generateServerConfig: %w", err) }
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
internal/home/dns.go
keep add keep keep keep keep keep keep
<mask> } <mask> } <mask> } <mask> <mask> newconfig.TLSv12Roots = Context.tlsRoots <mask> newconfig.TLSCiphers = Context.tlsCiphers <mask> newconfig.TLSAllowUnencryptedDOH = tlsConf.AllowUnencryptedDOH <mask> </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> remove IP: net.ParseIP(config.DNS.BindHost), </s> add IP: bindHost, </s> remove return newconfig </s> add return newconfig, nil } func newDNSCrypt(bindHost net.IP, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) { if tlsConf.DNSCryptConfigFile == "" { return dnscc, agherr.Error("no dnscrypt_config_file") } f, err := os.Open(tlsConf.DNSCryptConfigFile) if err != nil { return dnscc, fmt.Errorf("opening dnscrypt config: %w", err) } defer f.Close() rc := &dnscrypt.ResolverConfig{} err = yaml.NewDecoder(f).Decode(rc) if err != nil { return dnscc, fmt.Errorf("decoding dnscrypt config: %w", err) } cert, err := rc.CreateCert() if err != nil { return dnscc, fmt.Errorf("creating dnscrypt cert: %w", err) } udpAddr := &net.UDPAddr{ IP: bindHost, Port: tlsConf.PortDNSCrypt, } tcpAddr := &net.TCPAddr{ IP: bindHost, Port: tlsConf.PortDNSCrypt, } return dnsforward.DNSCryptConfig{ UDPListenAddr: udpAddr, TCPListenAddr: tcpAddr, ResolverCert: cert, ProviderName: rc.ProviderName, Enabled: true, }, nil </s> remove dnsConfig := generateServerConfig() </s> add dnsConfig, err := generateServerConfig() if err != nil { closeDNSServer() return fmt.Errorf("generateServerConfig: %w", err) } </s> add if s.conf.DNSCryptConfig.Enabled { proxyConfig.DNSCryptUDPListenAddr = []*net.UDPAddr{s.conf.DNSCryptConfig.UDPListenAddr} proxyConfig.DNSCryptTCPListenAddr = []*net.TCPAddr{s.conf.DNSCryptConfig.TCPListenAddr} proxyConfig.DNSCryptProviderName = s.conf.DNSCryptConfig.ProviderName proxyConfig.DNSCryptResolverCert = s.conf.DNSCryptConfig.ResolverCert } </s> remove IP: net.ParseIP(config.DNS.BindHost), </s> add IP: bindHost, </s> remove func reconfigureDNSServer() error { newconfig := generateServerConfig() err := Context.dnsServer.Reconfigure(&newconfig) </s> add func reconfigureDNSServer() (err error) { var newconfig dnsforward.ServerConfig newconfig, err = generateServerConfig()
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
internal/home/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> newconfig.TLSAllowUnencryptedDOH = tlsConf.AllowUnencryptedDOH <mask> <mask> newconfig.FilterHandler = applyAdditionalFiltering <mask> newconfig.GetCustomUpstreamByClient = Context.clients.FindUpstreams <mask> return newconfig <mask> } <mask> <mask> type dnsEncryption struct { <mask> https string <mask> tls string </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> add if tlsConf.PortDNSCrypt != 0 { newconfig.DNSCryptConfig, err = newDNSCrypt(bindHost, tlsConf) if err != nil { // Don't wrap the error, because it's already // wrapped by newDNSCrypt. return dnsforward.ServerConfig{}, err } } </s> add // DNSCryptConfig is the DNSCrypt server configuration struct. type DNSCryptConfig struct { UDPListenAddr *net.UDPAddr TCPListenAddr *net.TCPAddr ProviderName string ResolverCert *dnscrypt.Cert Enabled bool } </s> remove func reconfigureDNSServer() error { newconfig := generateServerConfig() err := Context.dnsServer.Reconfigure(&newconfig) </s> add func reconfigureDNSServer() (err error) { var newconfig dnsforward.ServerConfig newconfig, err = generateServerConfig() </s> remove return fmt.Errorf("couldn't start forwarding DNS server: %w", err) </s> add return fmt.Errorf("generating forwarding dns server config: %w", err) } err = Context.dnsServer.Reconfigure(&newconfig) if err != nil { return fmt.Errorf("starting forwarding dns server: %w", err) </s> add if s.conf.DNSCryptConfig.Enabled { proxyConfig.DNSCryptUDPListenAddr = []*net.UDPAddr{s.conf.DNSCryptConfig.UDPListenAddr} proxyConfig.DNSCryptTCPListenAddr = []*net.TCPAddr{s.conf.DNSCryptConfig.TCPListenAddr} proxyConfig.DNSCryptProviderName = s.conf.DNSCryptConfig.ProviderName proxyConfig.DNSCryptResolverCert = s.conf.DNSCryptConfig.ResolverCert } </s> remove dnsConfig := generateServerConfig() </s> add dnsConfig, err := generateServerConfig() if err != nil { closeDNSServer() return fmt.Errorf("generateServerConfig: %w", err) }
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
internal/home/dns.go
keep keep keep keep replace replace replace keep replace keep keep
<mask> <mask> return nil <mask> } <mask> <mask> func reconfigureDNSServer() error { <mask> newconfig := generateServerConfig() <mask> err := Context.dnsServer.Reconfigure(&newconfig) <mask> if err != nil { <mask> return fmt.Errorf("couldn't start forwarding DNS server: %w", err) <mask> } <mask> </s> Pull request: all: add dnscrypt support Merge in DNS/adguard-home from 1361-dnscrypt to master Closes #1361. Squashed commit of the following: commit 31b780c16cc6b68336b95275f62381cee2e822a2 Merge: c2ce98aaf 9b963fc77 Author: Ainar Garipov <[email protected]> Date: Mon Dec 7 17:48:41 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit c2ce98aaf24bd5ed5b5cd7da86aae093866ab34e Merge: 3bf3d7b96 63e513e33 Author: Ainar Garipov <[email protected]> Date: Fri Dec 4 19:32:40 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 3bf3d7b96530c86b54545462390562ebedc616b2 Merge: 5de451996 4134220c5 Author: Ainar Garipov <[email protected]> Date: Thu Dec 3 17:31:59 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 5de451996d48ab3792ce78291068f72785303494 Merge: 60d7976f7 ab8defdb0 Author: Ainar Garipov <[email protected]> Date: Wed Dec 2 19:07:56 2020 +0300 Merge branch 'master' into 1361-dnscrypt commit 60d7976f7c7ad0316751b92477a31f882c1e3134 Author: Ainar Garipov <[email protected]> Date: Mon Nov 30 19:11:14 2020 +0300 all: add dnscrypt support </s> remove dnsConfig := generateServerConfig() </s> add dnsConfig, err := generateServerConfig() if err != nil { closeDNSServer() return fmt.Errorf("generateServerConfig: %w", err) } </s> remove return newconfig </s> add return newconfig, nil } func newDNSCrypt(bindHost net.IP, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) { if tlsConf.DNSCryptConfigFile == "" { return dnscc, agherr.Error("no dnscrypt_config_file") } f, err := os.Open(tlsConf.DNSCryptConfigFile) if err != nil { return dnscc, fmt.Errorf("opening dnscrypt config: %w", err) } defer f.Close() rc := &dnscrypt.ResolverConfig{} err = yaml.NewDecoder(f).Decode(rc) if err != nil { return dnscc, fmt.Errorf("decoding dnscrypt config: %w", err) } cert, err := rc.CreateCert() if err != nil { return dnscc, fmt.Errorf("creating dnscrypt cert: %w", err) } udpAddr := &net.UDPAddr{ IP: bindHost, Port: tlsConf.PortDNSCrypt, } tcpAddr := &net.TCPAddr{ IP: bindHost, Port: tlsConf.PortDNSCrypt, } return dnsforward.DNSCryptConfig{ UDPListenAddr: udpAddr, TCPListenAddr: tcpAddr, ResolverCert: cert, ProviderName: rc.ProviderName, Enabled: true, }, nil </s> remove func generateServerConfig() dnsforward.ServerConfig { newconfig := dnsforward.ServerConfig{ UDPListenAddr: &net.UDPAddr{IP: net.ParseIP(config.DNS.BindHost), Port: config.DNS.Port}, TCPListenAddr: &net.TCPAddr{IP: net.ParseIP(config.DNS.BindHost), Port: config.DNS.Port}, </s> add func generateServerConfig() (newconfig dnsforward.ServerConfig, err error) { bindHost := net.ParseIP(config.DNS.BindHost) newconfig = dnsforward.ServerConfig{ UDPListenAddr: &net.UDPAddr{IP: bindHost, Port: config.DNS.Port}, TCPListenAddr: &net.TCPAddr{IP: bindHost, Port: config.DNS.Port}, </s> add if s.conf.DNSCryptConfig.Enabled { proxyConfig.DNSCryptUDPListenAddr = []*net.UDPAddr{s.conf.DNSCryptConfig.UDPListenAddr} proxyConfig.DNSCryptTCPListenAddr = []*net.TCPAddr{s.conf.DNSCryptConfig.TCPListenAddr} proxyConfig.DNSCryptProviderName = s.conf.DNSCryptConfig.ProviderName proxyConfig.DNSCryptResolverCert = s.conf.DNSCryptConfig.ResolverCert } </s> add if tlsConf.PortDNSCrypt != 0 { newconfig.DNSCryptConfig, err = newDNSCrypt(bindHost, tlsConf) if err != nil { // Don't wrap the error, because it's already // wrapped by newDNSCrypt. return dnsforward.ServerConfig{}, err } }
https://github.com/AdguardTeam/AdGuardHome/commit/09b6eba7d9de4ac9522acad8585d9befe7e2cea1
internal/home/dns.go
keep keep keep keep replace keep keep keep keep keep
<mask> dispatch(getVersion()); <mask> dispatch(getTlsStatus()); <mask> } catch (error) { <mask> dispatch(addErrorToast({ error })); <mask> dispatch(initSettingsFailure()); <mask> } <mask> }; <mask> <mask> export const enableDnsRequest = createAction('ENABLE_DNS_REQUEST'); <mask> export const enableDnsFailure = createAction('ENABLE_DNS_FAILURE'); </s> - client: fix upstream DNS servers form Closes #1000 </s> remove dispatch(setUpstreamSuccess()); </s> add dispatch(setUpstreamSuccess(config)); </s> remove const settings = handleActions({ [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; const setting = settingsList[settingKey]; const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), </s> add const settings = handleActions( { [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; </s> remove const { processing, processingSet, ...values } = access; </s> add const { processing, processingSet, ...values } = access; </s> remove [actions.setDhcpConfigRequest]: state => ({ ...state, processingConfig: true }), [actions.setDhcpConfigFailure]: state => ({ ...state, processingConfig: false }), [actions.setDhcpConfigSuccess]: (state, { payload }) => { const { config } = state; const newConfig = { ...config, ...payload }; const newState = { ...state, config: newConfig, processingConfig: false }; return newState; }, </s> add [actions.setDhcpConfigRequest]: state => ({ ...state, processingConfig: true }), [actions.setDhcpConfigFailure]: state => ({ ...state, processingConfig: false }), [actions.setDhcpConfigSuccess]: (state, { payload }) => { const { config } = state; const newConfig = { ...config, ...payload }; const newState = { ...state, config: newConfig, processingConfig: false }; return newState; }, </s> remove [actions.toggleDhcpRequest]: state => ({ ...state, processingDhcp: true }), [actions.toggleDhcpFailure]: state => ({ ...state, processingDhcp: false }), [actions.toggleDhcpSuccess]: (state) => { const { config } = state; const newConfig = { ...config, enabled: !config.enabled }; const newState = { ...state, config: newConfig, check: null, processingDhcp: false, }; return newState; }, </s> add [actions.toggleDhcpRequest]: state => ({ ...state, processingDhcp: true }), [actions.toggleDhcpFailure]: state => ({ ...state, processingDhcp: false }), [actions.toggleDhcpSuccess]: (state) => { const { config } = state; const newConfig = { ...config, enabled: !config.enabled }; const newState = { ...state, config: newConfig, check: null, processingDhcp: false, }; return newState; }, </s> remove const newState = { ...state, check: { otherServer, staticIP, }, processingStatus: false, }; return newState; }, </s> add const newState = { ...state, check: { otherServer, staticIP, }, processingStatus: false, }; return newState; },
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/actions/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> ) || []; <mask> <mask> await apiClient.setUpstream(values); <mask> dispatch(addSuccessToast('updated_upstream_dns_toast')); <mask> dispatch(setUpstreamSuccess()); <mask> } catch (error) { <mask> dispatch(addErrorToast({ error })); <mask> dispatch(setUpstreamFailure()); <mask> } <mask> }; </s> - client: fix upstream DNS servers form Closes #1000 </s> remove dispatch(initSettingsFailure()); </s> add dispatch(dnsStatusFailure()); } }; export const getDnsSettingsRequest = createAction('GET_DNS_SETTINGS_REQUEST'); export const getDnsSettingsFailure = createAction('GET_DNS_SETTINGS_FAILURE'); export const getDnsSettingsSuccess = createAction('GET_DNS_SETTINGS_SUCCESS'); export const getDnsSettings = () => async (dispatch) => { dispatch(getDnsSettingsRequest()); try { const dnsStatus = await apiClient.getGlobalStatus(); dispatch(getDnsSettingsSuccess(dnsStatus)); } catch (error) { dispatch(addErrorToast({ error })); dispatch(getDnsSettingsFailure()); </s> remove [actions.addStaticLeaseRequest]: state => ({ ...state, processingAdding: true }), [actions.addStaticLeaseFailure]: state => ({ ...state, processingAdding: false }), [actions.addStaticLeaseSuccess]: (state, { payload }) => { const { ip, mac, hostname, } = payload; const newLease = { ip, mac, hostname: hostname || '', }; const leases = [...state.staticLeases, newLease]; const newState = { ...state, staticLeases: leases, processingAdding: false, }; return newState; }, </s> add [actions.addStaticLeaseRequest]: state => ({ ...state, processingAdding: true }), [actions.addStaticLeaseFailure]: state => ({ ...state, processingAdding: false }), [actions.addStaticLeaseSuccess]: (state, { payload }) => { const { ip, mac, hostname } = payload; const newLease = { ip, mac, hostname: hostname || '', }; const leases = [...state.staticLeases, newLease]; const newState = { ...state, staticLeases: leases, processingAdding: false, }; return newState; }, </s> remove [actions.getClientsRequest]: state => ({ ...state, processingClients: true }), [actions.getClientsFailure]: state => ({ ...state, processingClients: false }), [actions.getClientsSuccess]: (state, { payload }) => { const newState = { ...state, clients: payload.clients, autoClients: payload.autoClients, processingClients: false, }; return newState; </s> add return { ...state, allServers, upstreamDns: (upstreamDns && upstreamDns.join('\n')) || '', bootstrapDns: (bootstrapDns && bootstrapDns.join('\n')) || '', processingDnsSettings: false, }; }, </s> add const isDataLoading = dashboard.processingDnsSettings || access.processing || rewrites.processing; const isDataReady = !dashboard.processingDnsSettings && !access.processing && !rewrites.processing; </s> remove } </s> add }, </s> remove const settings = handleActions({ [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; const setting = settingsList[settingKey]; const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), </s> add const settings = handleActions( { [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload;
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/actions/index.js
keep keep keep keep replace keep keep keep keep keep
<mask> import { Trans, withNamespaces } from 'react-i18next'; <mask> import flow from 'lodash/flow'; <mask> <mask> const Form = (props) => { <mask> const { handleSubmit, submitting, invalid } = props; <mask> <mask> return ( <mask> <form onSubmit={handleSubmit}> <mask> <div className="form__group mb-5"> <mask> <label className="form__label form__label--with-desc" htmlFor="allowed_clients"> </s> - client: fix upstream DNS servers form Closes #1000 </s> remove import { handleUpstreamChange, setUpstream, testUpstream } from '../actions'; </s> add import { handleUpstreamChange, setUpstream, testUpstream, getDnsSettings } from '../actions'; </s> remove const settings = handleActions({ [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; const setting = settingsList[settingKey]; const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), </s> add const settings = handleActions( { [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; </s> add disabled={processingSet} </s> add disabled={processingSet} </s> remove const { processing, processingSet, ...values } = access; </s> add const { processing, processingSet, ...values } = access; </s> remove <label className="form__label form__label--with-desc" htmlFor="bootstrap_dns"> </s> add <label className="form__label form__label--with-desc" htmlFor="bootstrap_dns" >
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Dns/Access/Form.js
keep add keep keep keep keep
<mask> type="text" <mask> className="form-control form-control--textarea" <mask> /> <mask> </div> <mask> <div className="form__group mb-5"> <mask> <label className="form__label form__label--with-desc" htmlFor="disallowed_clients"> </s> - client: fix upstream DNS servers form Closes #1000 </s> add disabled={processingSet} </s> remove <label className="form__label form__label--with-desc" htmlFor="bootstrap_dns"> </s> add <label className="form__label form__label--with-desc" htmlFor="bootstrap_dns" > </s> add disabled={processingSetUpstream || processingTestUpstream} </s> add disabled={processingSet} </s> remove const { handleSubmit, submitting, invalid } = props; </s> add const { handleSubmit, submitting, invalid, processingSet, } = props; </s> add disabled={processingSetUpstream}
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Dns/Access/Form.js
keep keep keep add keep keep keep keep
<mask> name="disallowed_clients" <mask> component="textarea" <mask> type="text" <mask> className="form-control form-control--textarea" <mask> /> <mask> </div> <mask> <div className="form__group mb-5"> <mask> <label className="form__label form__label--with-desc" htmlFor="blocked_hosts"> </s> - client: fix upstream DNS servers form Closes #1000 </s> add disabled={processingSet} </s> remove <label className="form__label form__label--with-desc" htmlFor="bootstrap_dns"> </s> add <label className="form__label form__label--with-desc" htmlFor="bootstrap_dns" > </s> add disabled={processingSetUpstream || processingTestUpstream} </s> add disabled={processingSet} </s> add disabled={processingSetUpstream} </s> remove className="form-control" </s> add className="form-control form-control--textarea form-control--textarea-small"
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Dns/Access/Form.js
keep add keep keep keep keep keep
<mask> type="text" <mask> className="form-control form-control--textarea" <mask> /> <mask> </div> <mask> <div className="card-actions"> <mask> <div className="btn-list"> <mask> <button </s> - client: fix upstream DNS servers form Closes #1000 </s> add disabled={processingSet} </s> add disabled={processingSet} </s> add disabled={processingSetUpstream || processingTestUpstream} </s> remove disabled={submitting || invalid} </s> add disabled={submitting || invalid || processingSet} </s> add disabled={processingSetUpstream} </s> remove className="form-control" </s> add className="form-control form-control--textarea form-control--textarea-small"
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Dns/Access/Form.js
keep keep keep keep replace keep keep keep keep keep
<mask> <div className="btn-list"> <mask> <button <mask> type="submit" <mask> className="btn btn-success btn-standard" <mask> disabled={submitting || invalid} <mask> > <mask> <Trans>save_config</Trans> <mask> </button> <mask> </div> <mask> </div> </s> - client: fix upstream DNS servers form Closes #1000 </s> add disabled={processingSet} </s> remove <label className="form__label form__label--with-desc" htmlFor="bootstrap_dns"> </s> add <label className="form__label form__label--with-desc" htmlFor="bootstrap_dns" > </s> add disabled={processingSetUpstream || processingTestUpstream} </s> add disabled={processingSetUpstream} </s> add disabled={processingSet} </s> add disabled={processingSet}
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Dns/Access/Form.js
keep keep keep keep replace replace replace replace replace keep keep keep
<mask> ); <mask> }; <mask> <mask> Form.propTypes = { <mask> handleSubmit: PropTypes.func, <mask> submitting: PropTypes.bool, <mask> invalid: PropTypes.bool, <mask> initialValues: PropTypes.object, <mask> t: PropTypes.func, <mask> }; <mask> <mask> export default flow([withNamespaces(), reduxForm({ form: 'accessForm' })])(Form); </s> - client: fix upstream DNS servers form Closes #1000 </s> add getDnsSettings: PropTypes.func.isRequired, </s> remove check: null, leases: [], staticLeases: [], isModalOpen: false, }); </s> add ); </s> add getDnsSettings, </s> remove dispatch(initSettingsFailure()); </s> add dispatch(dnsStatusFailure()); } }; export const getDnsSettingsRequest = createAction('GET_DNS_SETTINGS_REQUEST'); export const getDnsSettingsFailure = createAction('GET_DNS_SETTINGS_FAILURE'); export const getDnsSettingsSuccess = createAction('GET_DNS_SETTINGS_SUCCESS'); export const getDnsSettings = () => async (dispatch) => { dispatch(getDnsSettingsRequest()); try { const dnsStatus = await apiClient.getGlobalStatus(); dispatch(getDnsSettingsSuccess(dnsStatus)); } catch (error) { dispatch(addErrorToast({ error })); dispatch(getDnsSettingsFailure()); </s> remove [actions.setDhcpConfigRequest]: state => ({ ...state, processingConfig: true }), [actions.setDhcpConfigFailure]: state => ({ ...state, processingConfig: false }), [actions.setDhcpConfigSuccess]: (state, { payload }) => { const { config } = state; const newConfig = { ...config, ...payload }; const newState = { ...state, config: newConfig, processingConfig: false }; return newState; }, </s> add [actions.setDhcpConfigRequest]: state => ({ ...state, processingConfig: true }), [actions.setDhcpConfigFailure]: state => ({ ...state, processingConfig: false }), [actions.setDhcpConfigSuccess]: (state, { payload }) => { const { config } = state; const newConfig = { ...config, ...payload }; const newState = { ...state, config: newConfig, processingConfig: false }; return newState; }, </s> remove [actions.toggleProtectionRequest]: state => ({ ...state, processingProtection: true }), [actions.toggleProtectionFailure]: state => ({ ...state, processingProtection: false }), [actions.toggleProtectionSuccess]: (state) => { const newState = { ...state, protectionEnabled: !state.protectionEnabled, processingProtection: false, }; return newState; }, </s> add [actions.getLanguageSuccess]: (state, { payload }) => { const newState = { ...state, language: payload }; return newState; },
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Dns/Access/Form.js
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
<mask> <mask> render() { <mask> const { t, access } = this.props; <mask> <mask> const { <mask> processing, <mask> processingSet, <mask> ...values <mask> } = access; <mask> <mask> return ( <mask> <Card <mask> title={t('access_title')} <mask> subtitle={t('access_desc')} </s> - client: fix upstream DNS servers form Closes #1000 </s> remove const { handleSubmit, submitting, invalid } = props; </s> add const { handleSubmit, submitting, invalid, processingSet, } = props; </s> add const isDataLoading = dashboard.processingDnsSettings || access.processing || rewrites.processing; const isDataReady = !dashboard.processingDnsSettings && !access.processing && !rewrites.processing; </s> remove const dhcp = handleActions({ [actions.getDhcpStatusRequest]: state => ({ ...state, processing: true }), [actions.getDhcpStatusFailure]: state => ({ ...state, processing: false }), [actions.getDhcpStatusSuccess]: (state, { payload }) => { const { static_leases: staticLeases, ...values } = payload; </s> add const dhcp = handleActions( { [actions.getDhcpStatusRequest]: state => ({ ...state, processing: true }), [actions.getDhcpStatusFailure]: state => ({ ...state, processing: false }), [actions.getDhcpStatusSuccess]: (state, { payload }) => { const { static_leases: staticLeases, ...values } = payload; </s> remove const newState = { ...state, staticLeases, processing: false, ...values, }; </s> add const newState = { ...state, staticLeases, processing: false, ...values, }; </s> remove const settings = handleActions({ [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; const setting = settingsList[settingKey]; const newSetting = { ...setting, enabled: !setting.enabled }; const newSettingsList = { ...settingsList, [settingKey]: newSetting }; return { ...state, settingsList: newSettingsList }; }, [actions.setUpstreamRequest]: state => ({ ...state, processingUpstream: true }), [actions.setUpstreamFailure]: state => ({ ...state, processingUpstream: false }), [actions.setUpstreamSuccess]: state => ({ ...state, processingUpstream: false }), </s> add const settings = handleActions( { [actions.initSettingsRequest]: state => ({ ...state, processing: true }), [actions.initSettingsFailure]: state => ({ ...state, processing: false }), [actions.initSettingsSuccess]: (state, { payload }) => { const { settingsList } = payload; const newState = { ...state, settingsList, processing: false }; return newState; }, [actions.toggleSettingStatus]: (state, { payload }) => { const { settingsList } = state; const { settingKey } = payload; </s> remove [actions.setDhcpConfigRequest]: state => ({ ...state, processingConfig: true }), [actions.setDhcpConfigFailure]: state => ({ ...state, processingConfig: false }), [actions.setDhcpConfigSuccess]: (state, { payload }) => { const { config } = state; const newConfig = { ...config, ...payload }; const newState = { ...state, config: newConfig, processingConfig: false }; return newState; }, </s> add [actions.setDhcpConfigRequest]: state => ({ ...state, processingConfig: true }), [actions.setDhcpConfigFailure]: state => ({ ...state, processingConfig: false }), [actions.setDhcpConfigSuccess]: (state, { payload }) => { const { config } = state; const newConfig = { ...config, ...payload }; const newState = { ...state, config: newConfig, processingConfig: false }; return newState; },
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Dns/Access/index.js
keep keep add keep keep keep keep
<mask> <Form <mask> initialValues={values} <mask> onSubmit={this.handleFormSubmit} <mask> /> <mask> </Card> <mask> ); <mask> } </s> - client: fix upstream DNS servers form Closes #1000 </s> remove check: null, leases: [], staticLeases: [], isModalOpen: false, }); </s> add ); </s> add ); </s> remove handleSubmit: PropTypes.func, submitting: PropTypes.bool, invalid: PropTypes.bool, initialValues: PropTypes.object, t: PropTypes.func, </s> add handleSubmit: PropTypes.func.isRequired, submitting: PropTypes.bool.isRequired, invalid: PropTypes.bool.isRequired, initialValues: PropTypes.object.isRequired, processingSet: PropTypes.bool.isRequired, t: PropTypes.func.isRequired, </s> add disabled={processingSetUpstream} </s> add const isDataLoading = dashboard.processingDnsSettings || access.processing || rewrites.processing; const isDataReady = !dashboard.processingDnsSettings && !access.processing && !rewrites.processing; </s> add disabled={processingSetUpstream}
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Dns/Access/index.js
keep add keep keep keep keep keep
<mask> className="form-control form-control--textarea" <mask> placeholder={t('upstream_dns')} <mask> /> <mask> </div> <mask> </div> <mask> <div className="col-12"> <mask> <div className="form__group form__group--settings"> </s> - client: fix upstream DNS servers form Closes #1000 </s> add disabled={processingSet} </s> add disabled={processingSet} </s> add disabled={processingSet} </s> add disabled={processingSetUpstream} </s> remove <label className="form__label form__label--with-desc" htmlFor="bootstrap_dns"> </s> add <label className="form__label form__label--with-desc" htmlFor="bootstrap_dns" > </s> add disabled={processingSetUpstream}
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Dns/Upstream/Form.js
keep keep add keep keep keep keep keep
<mask> type="checkbox" <mask> component={renderSelectField} <mask> placeholder={t('upstream_parallel')} <mask> /> <mask> </div> <mask> </div> <mask> <div className="col-12"> <mask> <Examples /> </s> - client: fix upstream DNS servers form Closes #1000 </s> add disabled={processingSetUpstream || processingTestUpstream} </s> remove <label className="form__label form__label--with-desc" htmlFor="bootstrap_dns"> </s> add <label className="form__label form__label--with-desc" htmlFor="bootstrap_dns" > </s> add disabled={processingSet} </s> add disabled={processingSet} </s> add disabled={processingSet} </s> add disabled={processingSetUpstream}
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Dns/Upstream/Form.js
keep keep keep keep replace keep keep keep keep keep
<mask> <hr /> <mask> </div> <mask> <div className="col-12"> <mask> <div className="form__group"> <mask> <label className="form__label form__label--with-desc" htmlFor="bootstrap_dns"> <mask> <Trans>bootstrap_dns</Trans> <mask> </label> <mask> <div className="form__desc form__desc--top"> <mask> <Trans>bootstrap_dns_desc</Trans> <mask> </div> </s> - client: fix upstream DNS servers form Closes #1000 </s> add disabled={processingSet} </s> add disabled={processingSet} </s> add disabled={processingSetUpstream || processingTestUpstream} </s> add disabled={processingSetUpstream} </s> add disabled={processingSet} </s> remove const { handleSubmit, submitting, invalid } = props; </s> add const { handleSubmit, submitting, invalid, processingSet, } = props;
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Dns/Upstream/Form.js
keep keep keep keep replace keep keep keep keep keep
<mask> id="bootstrap_dns" <mask> name="bootstrap_dns" <mask> component="textarea" <mask> type="text" <mask> className="form-control" <mask> placeholder={t('bootstrap_dns')} <mask> /> <mask> </div> <mask> </div> <mask> </div> </s> - client: fix upstream DNS servers form Closes #1000 </s> add disabled={processingSetUpstream} </s> add disabled={processingSet} </s> add disabled={processingSet} </s> add disabled={processingSet} </s> add disabled={processingSetUpstream} </s> add disabled={processingSetUpstream || processingTestUpstream}
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Dns/Upstream/Form.js
keep keep keep add keep keep keep keep
<mask> component="textarea" <mask> type="text" <mask> className="form-control form-control--textarea form-control--textarea-small" <mask> placeholder={t('bootstrap_dns')} <mask> /> <mask> </div> <mask> </div> <mask> </div> </s> - client: fix upstream DNS servers form Closes #1000 </s> remove className="form-control" </s> add className="form-control form-control--textarea form-control--textarea-small" </s> add disabled={processingSet} </s> add disabled={processingSet} </s> add disabled={processingSet} </s> add disabled={processingSetUpstream || processingTestUpstream} </s> add disabled={processingSetUpstream}
https://github.com/AdguardTeam/AdGuardHome/commit/0a26ee422403d78a1e1ef56270deb11b6e646156
client/src/components/Settings/Dns/Upstream/Form.js