docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
listlengths
4
2.12k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
CacheMinTTL: s.conf.CacheMinTTL, CacheMaxTTL: s.conf.CacheMaxTTL,
<mask> RatelimitWhitelist: s.conf.RatelimitWhitelist, <mask> RefuseAny: s.conf.RefuseAny, <mask> CacheEnabled: true, <mask> CacheSizeBytes: int(s.conf.CacheSize), <mask> Upstreams: s.conf.Upstreams, <mask> DomainsReservedUpstreams: s.conf.Domai...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c8285c41d723e90a7f0f0b7d874731bd534e4202
dnsforward/dnsforward.go
github.com/AdguardTeam/dnsproxy v0.24.0
<mask> <mask> go 1.13 <mask> <mask> require ( <mask> github.com/AdguardTeam/dnsproxy v0.23.7 <mask> github.com/AdguardTeam/golibs v0.3.0 <mask> github.com/AdguardTeam/urlfilter v0.9.1 <mask> github.com/NYTimes/gziphandler v1.1.1 <mask> github.com/etcd-io/bbolt v1.3.3 <mask> github.com/fsnotify/fsnotif...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c8285c41d723e90a7f0f0b7d874731bd534e4202
go.mod
github.com/sparrc/go-ping v0.0.0-20190613174326-4e5b6552494c
<mask> github.com/kardianos/service v0.0.0-20181115005516-4c239ee84e7b <mask> github.com/krolaw/dhcp4 v0.0.0-20180925202202-7cead472c414 <mask> github.com/miekg/dns v1.1.26 <mask> github.com/pkg/errors v0.8.1 <mask> github.com/sparrc/go-ping v0.0.0-20181106165434-ef3ab45e41b0 <mask> github.com/stretchr/test...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c8285c41d723e90a7f0f0b7d874731bd534e4202
go.mod
github.com/AdguardTeam/dnsproxy v0.24.0 h1:GuweAeh9CLCeaNQiXGeuRHi7vWzHXhzZzC7kxRO6YA4= github.com/AdguardTeam/dnsproxy v0.24.0/go.mod h1:TPJqGt5Ys0mSeBnSMlD1VOdSLdjYykoawe+M2qPQc10=
<mask> github.com/AdguardTeam/dnsproxy v0.23.7 h1:RINLso8/CH4Ugfydk+rQLuKVTy4zwZRQKVRymqGDVkQ= <mask> github.com/AdguardTeam/dnsproxy v0.23.7/go.mod h1:2qy8rpdfBzKgMPxkHmPdaNK4XZJ322v4KtVGI8s8Bn0= <mask> github.com/AdguardTeam/golibs v0.2.4 h1:GUssokegKxKF13K67Pgl0ZGwqHjNN6X7sep5ik6ORdY= <mask> github.com/AdguardTe...
[ "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c8285c41d723e90a7f0f0b7d874731bd534e4202
go.sum
github.com/sparrc/go-ping v0.0.0-20190613174326-4e5b6552494c h1:gqEdF4VwBu3lTKGHS9rXE9x1/pEaSwCXRLOZRF6qtlw= github.com/sparrc/go-ping v0.0.0-20190613174326-4e5b6552494c/go.mod h1:eMyUVp6f/5jnzM+3zahzl7q6UXLbgSc3MKg/+ow9QW0=
<mask> github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 h1:udFKJ0aHUL60LboW/A+DfgoHVedieIzIXE8uylPue0U= <mask> github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= <mask> github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJP...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c8285c41d723e90a7f0f0b7d874731bd534e4202
go.sum
MinVersion: tls.VersionTLS12,
<mask> Addr: address, <mask> TLSConfig: &tls.Config{ <mask> Certificates: []tls.Certificate{cert}, <mask> }, <mask> } <mask> <mask> printHTTPAddresses("https") <mask> err = httpsServer.server.ListenAndServeTLS("", "") </s> * app, dnsforward: add MinVersion for TLS configs </s> remove...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c82887d3aa3332cf4d7a7dda22f51b160be306b3
app.go
proxyConfig.TLSConfig = &tls.Config{ Certificates: []tls.Certificate{keypair}, MinVersion: tls.VersionTLS12, }
<mask> keypair, err := tls.X509KeyPair([]byte(s.CertificateChain), []byte(s.PrivateKey)) <mask> if err != nil { <mask> return errorx.Decorate(err, "Failed to parse TLS keypair") <mask> } <mask> proxyConfig.TLSConfig = &tls.Config{Certificates: []tls.Certificate{keypair}} <mask> } <mask> <mask> if ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c82887d3aa3332cf4d7a7dda22f51b160be306b3
dnsforward/dnsforward.go
tlsConfig := &tls.Config{ ServerName: tlsServerName, RootCAs: roots, MinVersion: tls.VersionTLS12, }
<mask> <mask> // Add our self-signed generated config to roots <mask> roots := x509.NewCertPool() <mask> roots.AppendCertsFromPEM(certPem) <mask> tlsConfig := &tls.Config{ServerName: tlsServerName, RootCAs: roots} <mask> <mask> // Create a DNS-over-TLS client connection <mask> addr := s.dnsProxy.Addr(pr...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c82887d3aa3332cf4d7a7dda22f51b160be306b3
dnsforward/dnsforward_test.go
return &tls.Config{Certificates: []tls.Certificate{cert}, ServerName: tlsServerName, MinVersion: tls.VersionTLS12}, certPem, keyPem
<mask> if err != nil { <mask> t.Fatalf("failed to create certificate: %s", err) <mask> } <mask> <mask> return &tls.Config{Certificates: []tls.Certificate{cert}, ServerName: tlsServerName}, certPem, keyPem <mask> } <mask> <mask> func createDataDir(t *testing.T) string { <mask> err := os.MkdirAll(dataDir...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c82887d3aa3332cf4d7a7dda22f51b160be306b3
dnsforward/dnsforward_test.go
d := New(nil)
<mask> } <mask> } <mask> <mask> func NewForTest() *Dnsfilter { <mask> d := New() <mask> purgeCaches() <mask> return d <mask> } <mask> <mask> // </s> dnsfilter -- fix broken tests </s> remove func trace(format string, args ...interface{}) { pc := make([]uintptr, 10) // at least 1 entry needed runtime...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c82a5ac0cb5a2138e8a78386aa4e8387dfd9dece
dnsfilter/dnsfilter_test.go
d.SafeBrowsingEnabled = true
<mask> for _, tc := range testCases { <mask> t.Run(fmt.Sprintf("%s in %s", tc, _Func()), func(t *testing.T) { <mask> d := NewForTest() <mask> defer d.Destroy() <mask> d.EnableSafeBrowsing() <mask> stats.Safebrowsing.Requests = 0 <mask> d.checkMatch(t, "wmconvirus.narod.ru") <mask> d.checkMa...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c82a5ac0cb5a2138e8a78386aa4e8387dfd9dece
dnsfilter/dnsfilter_test.go
d.SafeBrowsingEnabled = true
<mask> <mask> func TestParallelSB(t *testing.T) { <mask> d := NewForTest() <mask> defer d.Destroy() <mask> d.EnableSafeBrowsing() <mask> t.Run("group", func(t *testing.T) { <mask> for i := 0; i < 100; i++ { <mask> t.Run(fmt.Sprintf("aaa%d", i), func(t *testing.T) { <mask> t.Parallel() <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c82a5ac0cb5a2138e8a78386aa4e8387dfd9dece
dnsfilter/dnsfilter_test.go
d.SafeBrowsingEnabled = true
<mask> })) <mask> defer ts.Close() <mask> address := ts.Listener.Addr().String() <mask> <mask> d.EnableSafeBrowsing() <mask> d.SetHTTPTimeout(time.Second * 5) <mask> d.SetSafeBrowsingServer(address) // this will ensure that test fails <mask> d.checkMatchEmpty(t, "wmconvirus.narod.ru") <mask> } <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c82a5ac0cb5a2138e8a78386aa4e8387dfd9dece
dnsfilter/dnsfilter_test.go
d.ParentalEnabled = true d.ParentalSensitivity = 3
<mask> <mask> func TestParentalControl(t *testing.T) { <mask> d := NewForTest() <mask> defer d.Destroy() <mask> d.EnableParental(3) <mask> d.checkMatch(t, "pornhub.com") <mask> d.checkMatch(t, "pornhub.com") <mask> if stats.Parental.Requests != 1 { <mask> t.Errorf("Parental lookup positive cache is no...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c82a5ac0cb5a2138e8a78386aa4e8387dfd9dece
dnsfilter/dnsfilter_test.go
d.SafeSearchEnabled = true
<mask> _, ok := d.SafeSearchDomain("www.google.com") <mask> if ok { <mask> t.Errorf("Expected safesearch to error when disabled") <mask> } <mask> d.EnableSafeSearch() <mask> val, ok := d.SafeSearchDomain("www.google.com") <mask> if !ok { <mask> t.Errorf("Expected safesearch to find result for www.goog...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c82a5ac0cb5a2138e8a78386aa4e8387dfd9dece
dnsfilter/dnsfilter_test.go
d.SafeBrowsingEnabled = true
<mask> <mask> func BenchmarkSafeBrowsing(b *testing.B) { <mask> d := NewForTest() <mask> defer d.Destroy() <mask> d.EnableSafeBrowsing() <mask> for n := 0; n < b.N; n++ { <mask> hostname := "wmconvirus.narod.ru" <mask> ret, err := d.CheckHost(hostname) <mask> if err != nil { <mask> b.Errorf("Err...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c82a5ac0cb5a2138e8a78386aa4e8387dfd9dece
dnsfilter/dnsfilter_test.go
d.SafeBrowsingEnabled = true
<mask> <mask> func BenchmarkSafeBrowsingParallel(b *testing.B) { <mask> d := NewForTest() <mask> defer d.Destroy() <mask> d.EnableSafeBrowsing() <mask> b.RunParallel(func(pb *testing.PB) { <mask> for pb.Next() { <mask> hostname := "wmconvirus.narod.ru" <mask> ret, err := d.CheckHost(hostname) <ma...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c82a5ac0cb5a2138e8a78386aa4e8387dfd9dece
dnsfilter/dnsfilter_test.go
d.SafeSearchEnabled = true
<mask> <mask> func BenchmarkSafeSearch(b *testing.B) { <mask> d := NewForTest() <mask> defer d.Destroy() <mask> d.EnableSafeSearch() <mask> for n := 0; n < b.N; n++ { <mask> val, ok := d.SafeSearchDomain("www.google.com") <mask> if !ok { <mask> b.Errorf("Expected safesearch to find result for www.g...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c82a5ac0cb5a2138e8a78386aa4e8387dfd9dece
dnsfilter/dnsfilter_test.go
d.SafeSearchEnabled = true
<mask> <mask> func BenchmarkSafeSearchParallel(b *testing.B) { <mask> d := NewForTest() <mask> defer d.Destroy() <mask> d.EnableSafeSearch() <mask> b.RunParallel(func(pb *testing.PB) { <mask> for pb.Next() { <mask> val, ok := d.SafeSearchDomain("www.google.com") <mask> if !ok { <mask> b.Error...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c82a5ac0cb5a2138e8a78386aa4e8387dfd9dece
dnsfilter/dnsfilter_test.go
<mask> runtime.Callers(2, pc) <mask> f := runtime.FuncForPC(pc[0]) <mask> return path.Base(f.Name()) <mask> } <mask> <mask> func trace(format string, args ...interface{}) { <mask> pc := make([]uintptr, 10) // at least 1 entry needed <mask> runtime.Callers(2, pc) <mask> f := runtime.FuncForPC(pc[0]) <ma...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c82a5ac0cb5a2138e8a78386aa4e8387dfd9dece
dnsfilter/dnsfilter_test.go
* @param time {string} The time to format * @returns {string} Returns the time in the format HH:mm:ss
<mask> IP_MATCH_LIST_STATUS, <mask> } from './constants'; <mask> <mask> /** <mask> * @param string The time to format <mask> * @returns string Returns the time in the format HH:mm:ss <mask> */ <mask> export const formatTime = (time) => { <mask> const parsedTime = dateParse(time); <mask> return...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c842a68a1b408f06414ac699a088ea9487c0c578
client/src/helpers/helpers.js
* @param dateTime {string} The date to format * @param [options] {object} Date.prototype.toLocaleString([locales[, options]]) options argument * @returns {string} Returns the date and time in the specified format
<mask> return dateFormat(parsedTime, DEFAULT_TIME_FORMAT); <mask> }; <mask> <mask> /** <mask> * @param string The date to format <mask> * @returns string Returns the date and time in the format DD/MM/YYYY, HH:mm <mask> */ <mask> export const formatDateTime = (dateTime, options = DEFAULT_DATE_FORMAT_OPTI...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c842a68a1b408f06414ac699a088ea9487c0c578
client/src/helpers/helpers.js
const { language } = navigator; const currentLanguage = (language.slice(0, 2) === 'en' || !language) ? 'en-GB' : language; const parsedTime = new Date(dateTime);
<mask> * @param string The date to format <mask> * @returns string Returns the date and time in the format DD/MM/YYYY, HH:mm <mask> */ <mask> export const formatDateTime = (dateTime, options = DEFAULT_DATE_FORMAT_OPTIONS) => { <mask> const currentLanguage = i18n.languages[0] || DEFAULT_LANGUAGE; <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c842a68a1b408f06414ac699a088ea9487c0c578
client/src/helpers/helpers.js
/** * @param dateTime {string} The date to format * @returns {string} Returns the date and time in the format with the full month name */
<mask> }; <mask> <mask> export const formatDetailedDateTime = (dateTime) => formatDateTime( <mask> dateTime, DETAILED_DATE_FORMAT_OPTIONS, <mask> ); <mask> </s> - client: Fix beyond 24 hour time format for en locale: Merge pull request #651 in DNS/adguard-home from fix/1766 to master Close #1766 Squashed ...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c842a68a1b408f06414ac699a088ea9487c0c578
client/src/helpers/helpers.js
* @param date {string} * @returns {boolean}
<mask> dateTime, DETAILED_DATE_FORMAT_OPTIONS, <mask> ); <mask> <mask> /** <mask> * @param string <mask> * @returns boolean <mask> */ <mask> export const isToday = (date) => isSameDay(new Date(date), new Date()); <mask> <mask> export const normalizeLogs = (logs) => logs.map((log) => { <mask> con...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c842a68a1b408f06414ac699a088ea9487c0c578
client/src/helpers/helpers.js
(acc, clientObj) => {
<mask> * @returns {Object.<string, number>} normalizedTopClients.configured - configured clients <mask> */ <mask> <mask> export const normalizeTopClients = (topClients) => topClients.reduce( <mask> (nameToCountMap, clientObj) => { <mask> const { name, count, info: { name: infoName } } = clientObj; ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c842a68a1b408f06414ac699a088ea9487c0c578
client/src/helpers/helpers.js
acc.auto[name] = count; acc.configured[infoName] = count; return acc;
<mask> <mask> export const normalizeTopClients = (topClients) => topClients.reduce( <mask> (nameToCountMap, clientObj) => { <mask> const { name, count, info: { name: infoName } } = clientObj; <mask> // eslint-disable-next-line no-param-reassign <mask> nameToCountMap.auto[name] = count...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c842a68a1b408f06414ac699a088ea9487c0c578
client/src/helpers/helpers.js
* @param initialValues {object} * @param values {object}
<mask> }; <mask> }; <mask> <mask> /** <mask> * @param {object} initialValues <mask> * @param {object} values <mask> * @returns {object} Returns different values of objects <mask> */ <mask> export const getObjDiff = (initialValues, values) => Object.entries(values) <mask> .reduce((acc, [key, value...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c842a68a1b408f06414ac699a088ea9487c0c578
client/src/helpers/helpers.js
* @param num {number} to format * @returns {string} Returns a string with a language-sensitive representation of this number
<mask> return acc; <mask> }, {}); <mask> <mask> /** <mask> * @param number Number to format <mask> * @returns string Returns a string with a language-sensitive representation of this number <mask> */ <mask> export const formatNumber = (num) => { <mask> const currentLanguage = i18n.languages...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c842a68a1b408f06414ac699a088ea9487c0c578
client/src/helpers/helpers.js
<mask> .cursor--not-allowed { <mask> cursor: not-allowed; <mask> } <mask> <mask> .select--no-warning { <mask> margin-bottom: 1.375rem; <mask> } <mask> <mask> .button-action { <mask> visibility: hidden; <mask> } <mask> <mask> .logs__row:hover .button-action, </s> + client: 2152 Smartphone co...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/App/index.css
@media (max-width: 500px) { .dashboard .button-action { visibility: visible; } }
<mask> .logs__row:hover .button-action, <mask> .button-action--active { <mask> visibility: visible; <mask> } </s> + client: 2152 Smartphone compatible design for user interface </s> remove .select--no-warning { margin-bottom: 1.375rem; } </s> add </s> remove .page-title__actions { display: block; }...
[ "keep", "keep", "keep", "add" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/App/index.css
import classNames from 'classnames';
<mask> import React, { useEffect } from 'react'; <mask> import PropTypes from 'prop-types'; <mask> import { Trans, useTranslation } from 'react-i18next'; <mask> <mask> import Statistics from './Statistics'; <mask> import Counters from './Counters'; <mask> import Clients from './Clients'; <mask> import QueriedD...
[ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Dashboard/index.js
dashboard: { protectionEnabled, processingProtection },
<mask> getAccessList, <mask> getStats, <mask> getStatsConfig, <mask> dashboard, <mask> toggleProtection, <mask> stats, <mask> access, <mask> }) => { </s> + client: 2152 Smartphone compatible design for user interface </s> remove }) => <div className='d-flex align-items-end col-6'> ...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Dashboard/index.js
const buttonText = protectionEnabled ? 'disable_protection' : 'enable_protection';
<mask> useEffect(() => { <mask> getAllStats(); <mask> }, []); <mask> <mask> const getToggleFilteringButton = () => { <mask> const { protectionEnabled, processingProtection } = dashboard; <mask> const buttonText = protectionEnabled ? 'disable_protection' : 'enable_protection';...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Dashboard/index.js
const buttonClass = classNames('btn btn-sm dashboard-title__button', { 'btn-gray': protectionEnabled, 'btn-success': !protectionEnabled, });
<mask> const { protectionEnabled, processingProtection } = dashboard; <mask> const buttonText = protectionEnabled ? 'disable_protection' : 'enable_protection'; <mask> const buttonClass = protectionEnabled ? 'btn-gray' : 'btn-success'; <mask> <mask> return <button <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Dashboard/index.js
<mask> const subtitle = stats.interval === 1 <mask> ? t('for_last_24_hours') <mask> : t('for_last_days', { count: stats.interval }); <mask> <mask> const refreshFullButton = <button <mask> type="button" <mask> className="btn btn-outline-primary btn-sm" <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Dashboard/index.js
<PageTitle title={t('dashboard')} containerClass="page-title--dashboard"> <button type="button" className={buttonClass} onClick={() => toggleProtection(protectionEnabled)} disabled={processingProtection} > ...
<mask> || stats.processingGetConfig <mask> || access.processing; <mask> <mask> return <> <mask> <PageTitle title={t('dashboard')}> <mask> <div className="page-title__actions"> <mask> {getToggleFilteringButton()} <mask> {refreshFull...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Dashboard/index.js
}) => <div className='d-flex align-items-end col-md'>
<mask> const renderInterfaceValues = ({ <mask> gateway_ip, <mask> hardware_address, <mask> ip_addresses, <mask> }) => <div className='d-flex align-items-end col-6'> <mask> <ul className="list-unstyled m-0"> <mask> {getInterfaceValues({ <mask> gateway_ip, <mask> h...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Settings/Dhcp/Interfaces.js
<div className="col col__dhcp">
<mask> return !processingInterfaces <mask> && interfaces <mask> && <> <mask> <div className="row align-items-center pb-2"> <mask> <div className="col-6"> <mask> <Field <mask> name="interface_na...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Settings/Dhcp/Interfaces.js
className="form-control custom-select pl-4 col-md"
<mask> <div className="col-6"> <mask> <Field <mask> name="interface_name" <mask> component={renderSelectField} <mask> className="form-control custom-select" <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Settings/Dhcp/Interfaces.js
{interfaceValue && renderInterfaceValues(interfaceValue)}
<mask> </option> <mask> {renderInterfaces(interfaces)} <mask> </Field> <mask> </div> <mask> </div> <mask> </>; <mask> }; </s> + client: 2152 Smartphone compatible design for user inter...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Settings/Dhcp/Interfaces.js
<mask> </option> <mask> {renderInterfaces(interfaces)} <mask> </Field> <mask> </div> <mask> {interfaceValue <mask> && renderInterfaceValues(interfaceValue)} <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Settings/Dhcp/Interfaces.js
import './index.css';
<mask> calculateDhcpPlaceholdersIpv4, <mask> calculateDhcpPlaceholdersIpv6, <mask> } from '../../../helpers/helpers'; <mask> <mask> const Dhcp = () => { <mask> const { t } = useTranslation(); <mask> const dispatch = useDispatch(); <mask> const { </s> + client: 2152 Smartphone compatible de...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Settings/Dhcp/index.js
const className = classNames('btn btn-sm', {
<mask> const filledConfig = interface_name && (Object.values(v4) <mask> .every(Boolean) || Object.values(v6) <mask> .every(Boolean)); <mask> <mask> const className = classNames('btn btn-sm mr-2', { <mask> 'btn-gray': enabled, <mask> 'btn-outline-su...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Settings/Dhcp/index.js
const statusButtonClass = classNames('btn btn-sm dhcp-form__button', {
<mask> <Trans>{enabled ? 'dhcp_disable' : 'dhcp_enable'}</Trans> <mask> </button>; <mask> }; <mask> <mask> const statusButtonClass = classNames('btn btn-sm mx-2', { <mask> 'btn-loading btn-primary': processingStatus, <mask> 'btn-outline-primary': !processingStatus, <...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Settings/Dhcp/index.js
<PageTitle title={t('dhcp_settings')} subtitle={t('dhcp_description')} containerClass="page-title--dhcp"> {toggleDhcpButton} <button type="button" className={statusButtonClass} onClick={onClick} disabled={ena...
<mask> <mask> const toggleDhcpButton = getToggleDhcpButton(); <mask> <mask> return <> <mask> <PageTitle title={t('dhcp_settings')} subtitle={t('dhcp_description')}> <mask> <div className="page-title__actions"> <mask> <div className="mb-3"> <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "re...
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Settings/Dhcp/index.js
import '../FormButton.css';
<mask> <mask> import { renderCheckboxField, renderRadioField, toNumber } from '../../../helpers/form'; <mask> import { FORM_NAME, QUERY_LOG_INTERVALS_DAYS } from '../../../helpers/constants'; <mask> <mask> const getIntervalFields = (processing, t, toNumber) => QUERY_LOG_INTERVALS_DAYS.map((interval) => { <mask>...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Settings/LogsConfig/Form.js
className="btn btn-outline-secondary btn-standard form__button"
<mask> <Trans>save_btn</Trans> <mask> </button> <mask> <button <mask> type="button" <mask> className="btn btn-outline-secondary btn-standard ml-5" <mask> onClick={() => handleClear()} <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Settings/LogsConfig/Form.js
import '../FormButton.css';
<mask> import { renderRadioField, toNumber } from '../../../helpers/form'; <mask> import { FORM_NAME, STATS_INTERVALS_DAYS } from '../../../helpers/constants'; <mask> <mask> const getIntervalFields = (processing, t, toNumber) => STATS_INTERVALS_DAYS.map((interval) => { <mask> const title = interval === 1 ? t(...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Settings/StatsConfig/Form.js
className="btn btn-outline-secondary btn-standard form__button"
<mask> <Trans>save_btn</Trans> <mask> </button> <mask> <button <mask> type="button" <mask> className="btn btn-outline-secondary btn-standard ml-5" <mask> onClick={() => handleReset()} <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/Settings/StatsConfig/Form.js
<mask> .page-title--large { <mask> font-size: 36px; <mask> line-height: 46px; <mask> } <mask> <mask> .page-title__actions { <mask> display: block; <mask> } <mask> <mask> @media screen and (min-width: 768px) { <mask> .page-title__actions { <mask> display: inline-block; <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/ui/PageTitle.css
const PageTitle = ({ title, subtitle, children, containerClass, }) => <div className="page-header"> <div className={containerClass}> <h1 className="page-title pr-2">{title}</h1> {children}
<mask> import PropTypes from 'prop-types'; <mask> <mask> import './PageTitle.css'; <mask> <mask> const PageTitle = ({ title, subtitle, children }) => ( <mask> <div className="page-header"> <mask> <h1 className="page-title"> <mask> {title} <mask> {children} <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/ui/PageTitle.js
{subtitle && <div className="page-subtitle"> {subtitle} </div>} </div>;
<mask> {subtitle} <mask> </div> <mask> )} <mask> </div> <mask> ); <mask> <mask> PageTitle.propTypes = { <mask> title: PropTypes.string.isRequired, <mask> subtitle: PropTypes.string, <mask> children: PropTypes.node, </s> + client: 2152 Smartphone compatible...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/ui/PageTitle.js
containerClass: PropTypes.string,
<mask> PageTitle.propTypes = { <mask> title: PropTypes.string.isRequired, <mask> subtitle: PropTypes.string, <mask> children: PropTypes.node, <mask> }; <mask> <mask> export default PageTitle; </s> + client: 2152 Smartphone compatible design for user interface </s> remove ); </s> add {subtitle ...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/components/ui/PageTitle.js
<mask> import React, { Fragment } from 'react'; <mask> import PropTypes from 'prop-types'; <mask> import { Trans } from 'react-i18next'; <mask> import classNames from 'classnames'; <mask> import { createOnBlurHandler } from './helpers'; <mask> import { R_UNIX_ABSOLUTE_PATH, R_WIN_ABSOLUTE_PATH } from './constants...
[ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/helpers/form.js
<mask> children, <mask> label, <mask> }) => { <mask> const showWarning = touched && error; <mask> const selectClass = classNames('form-control custom-select', { <mask> 'select--no-warning': !showWarning, <mask> }); <mask> <mask> return <> <mask> {label && <label><Trans...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/helpers/form.js
<select {...input} className='form-control custom-select'>{children}</select>
<mask> }); <mask> <mask> return <> <mask> {label && <label><Trans>{label}</Trans></label>} <mask> <select {...input} className={selectClass}>{children}</select> <mask> {showWarning <mask> && <span className="form__message form__message--error form__message--left-pad"><Tra...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/c98f18747c5173539560d7f83eef51eb1ef6e4f8
client/src/helpers/form.js
const enableGzip = false
<mask> fileWriteLock sync.Mutex <mask> ) <mask> <mask> func flushToFile(buffer []logEntry) error { <mask> if len(buffer) == 0 { <mask> return nil <mask> } </s> querylog file -- disable gzip compression </s> remove from := queryLogFileName + ".gz" to := queryLogFileName + ".gz.1" </s> add from := query...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ca794aed6344cf0f5570bb359c731a96ca90739f
coredns_plugin/querylog_file.go
<mask> log.Printf("failed to check buffer: %s", err) <mask> return err <mask> } <mask> <mask> filenamegz := queryLogFileName + ".gz" <mask> <mask> var zb bytes.Buffer <mask> <mask> zw := gzip.NewWriter(&zb) <mask> zw.Name = queryLogFileName <mask> zw.ModTime = time.Now() </s> querylog file -- d...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ca794aed6344cf0f5570bb359c731a96ca90739f
coredns_plugin/querylog_file.go
filename := queryLogFileName
<mask> return err <mask> } <mask> <mask> var zb bytes.Buffer <mask> <mask> // gzip enabled? <mask> if enableGzip { <mask> filename += ".gz" <mask> <mask> zw := gzip.NewWriter(&zb) </s> querylog file -- disable gzip compression </s> remove zw := gzip.NewWriter(&zb) zw.Name = queryLogFileName z...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ca794aed6344cf0f5570bb359c731a96ca90739f
coredns_plugin/querylog_file.go
// gzip enabled? if enableGzip { filename += ".gz"
<mask> filenamegz := queryLogFileName + ".gz" <mask> <mask> var zb bytes.Buffer <mask> <mask> zw := gzip.NewWriter(&zb) <mask> zw.Name = queryLogFileName <mask> zw.ModTime = time.Now() <mask> <mask> _, err = zw.Write(b.Bytes()) <mask> if err != nil { <mask> log.Printf("Couldn't compress to gzip: ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ca794aed6344cf0f5570bb359c731a96ca90739f
coredns_plugin/querylog_file.go
zw := gzip.NewWriter(&zb) zw.Name = queryLogFileName zw.ModTime = time.Now()
<mask> zw := gzip.NewWriter(&zb) <mask> zw.Name = queryLogFileName <mask> zw.ModTime = time.Now() <mask> <mask> _, err = zw.Write(b.Bytes()) <mask> if err != nil { <mask> log.Printf("Couldn't compress to gzip: %s", err) <mask> zw.Close() <mask> return err <mask> } <mask> <mask> if err = zw.Cl...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ca794aed6344cf0f5570bb359c731a96ca90739f
coredns_plugin/querylog_file.go
_, err = zw.Write(b.Bytes()) if err != nil { log.Printf("Couldn't compress to gzip: %s", err) zw.Close() return err } if err = zw.Close(); err != nil { log.Printf("Couldn't close gzip writer: %s", err) return err } } else { zb = b
<mask> zw.Close() <mask> return err <mask> } <mask> <mask> if err = zw.Close(); err != nil { <mask> log.Printf("Couldn't close gzip writer: %s", err) <mask> return err <mask> } <mask> <mask> fileWriteLock.Lock() <mask> defer fileWriteLock.Unlock() <mask> f, err := os.OpenFile(filenamegz, os....
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ca794aed6344cf0f5570bb359c731a96ca90739f
coredns_plugin/querylog_file.go
f, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644)
<mask> } <mask> <mask> fileWriteLock.Lock() <mask> defer fileWriteLock.Unlock() <mask> f, err := os.OpenFile(filenamegz, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644) <mask> if err != nil { <mask> log.Printf("failed to create file \"%s\": %s", filenamegz, err) <mask> return err <mask> } <mask> defer ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ca794aed6344cf0f5570bb359c731a96ca90739f
coredns_plugin/querylog_file.go
log.Printf("failed to create file \"%s\": %s", filename, err)
<mask> fileWriteLock.Lock() <mask> defer fileWriteLock.Unlock() <mask> f, err := os.OpenFile(filenamegz, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644) <mask> if err != nil { <mask> log.Printf("failed to create file \"%s\": %s", filenamegz, err) <mask> return err <mask> } <mask> defer f.Close() <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ca794aed6344cf0f5570bb359c731a96ca90739f
coredns_plugin/querylog_file.go
log.Printf("ok \"%s\": %v bytes written", filename, n)
<mask> log.Printf("Couldn't write to file: %s", err) <mask> return err <mask> } <mask> <mask> log.Printf("ok \"%s\": %v bytes written", filenamegz, n) <mask> <mask> return nil <mask> } <mask> <mask> func checkBuffer(buffer []logEntry, b bytes.Buffer) error { </s> querylog file -- disable gzip compr...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ca794aed6344cf0f5570bb359c731a96ca90739f
coredns_plugin/querylog_file.go
from := queryLogFileName to := queryLogFileName + ".1" if enableGzip { from = queryLogFileName + ".gz" to = queryLogFileName + ".gz.1" }
<mask> return nil <mask> } <mask> <mask> func rotateQueryLog() error { <mask> from := queryLogFileName + ".gz" <mask> to := queryLogFileName + ".gz.1" <mask> <mask> if _, err := os.Stat(from); os.IsNotExist(err) { <mask> // do nothing, file doesn't exist <mask> return nil <mask> } </s> querylog f...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ca794aed6344cf0f5570bb359c731a96ca90739f
coredns_plugin/querylog_file.go
files := []string{} if enableGzip { files = []string{ queryLogFileName + ".gz", queryLogFileName + ".gz.1", } } else { files = []string{ queryLogFileName, queryLogFileName + ".1", }
<mask> <mask> func genericLoader(onEntry func(entry *logEntry) error, needMore func() bool, timeWindow time.Duration) error { <mask> now := time.Now() <mask> // read from querylog files, try newest file first <mask> files := []string{ <mask> queryLogFileName + ".gz", <mask> queryLogFileName + ".gz.1", <...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ca794aed6344cf0f5570bb359c731a96ca90739f
coredns_plugin/querylog_file.go
<mask> // do nothing, file doesn't exist <mask> continue <mask> } <mask> <mask> trace("Opening file %s", file) <mask> f, err := os.Open(file) <mask> if err != nil { <mask> log.Printf("Failed to open file \"%s\": %s", file, err) <mask> // try next file <mask> continue </s> querylog fil...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ca794aed6344cf0f5570bb359c731a96ca90739f
coredns_plugin/querylog_file.go
var d *json.Decoder if enableGzip { trace("Creating gzip reader") zr, err := gzip.NewReader(f) if err != nil { log.Printf("Failed to create gzip reader: %s", err) continue } defer zr.Close()
<mask> continue <mask> } <mask> defer f.Close() <mask> <mask> trace("Creating gzip reader") <mask> zr, err := gzip.NewReader(f) <mask> if err != nil { <mask> log.Printf("Failed to create gzip reader: %s", err) <mask> continue <mask> } <mask> defer zr.Close() <mask> <mask> trace("...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ca794aed6344cf0f5570bb359c731a96ca90739f
coredns_plugin/querylog_file.go
trace("Creating json decoder") d = json.NewDecoder(zr) } else { d = json.NewDecoder(f) }
<mask> continue <mask> } <mask> defer zr.Close() <mask> <mask> trace("Creating json decoder") <mask> d := json.NewDecoder(zr) <mask> <mask> i := 0 <mask> // entries on file are in oldest->newest order <mask> // we want maxLen newest <mask> for d.More() { </s> querylog file -- disable gz...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/ca794aed6344cf0f5570bb359c731a96ca90739f
coredns_plugin/querylog_file.go
COMMIT = $$( git rev-parse --short HEAD )
<mask> <mask> CHANNEL = development <mask> CLIENT_BETA_DIR = client2 <mask> CLIENT_DIR = client <mask> COMMIT = $$(git rev-parse --short HEAD) <mask> DIST_DIR = dist <mask> # TODO(a.garipov): Find out a way to make this work in GNU Make. <mask> # <mask> # GO = $${GO:-go} <mask> # </s> Pull request: all: im...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb01eaa7f7332819c8b85119a75f069a92ff7be3
Makefile
# Don't name this macro "GO", because GNU Make apparenly makes it an # exported environment variable with the literal value of "${GO:-go}", # which is not what we need. Use a dot in the name to make sure that # users don't have an environment variable with the same name.
<mask> CLIENT_BETA_DIR = client2 <mask> CLIENT_DIR = client <mask> COMMIT = $$(git rev-parse --short HEAD) <mask> DIST_DIR = dist <mask> # TODO(a.garipov): Find out a way to make this work in GNU Make. <mask> # <mask> # GO = $${GO:-go} <mask> # <mask> GO = go <mask> GOPROXY = https://goproxy.cn|https://proxy...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb01eaa7f7332819c8b85119a75f069a92ff7be3
Makefile
# See https://unix.stackexchange.com/q/646255/105635. GO.MACRO = $${GO:-go}
<mask> COMMIT = $$(git rev-parse --short HEAD) <mask> DIST_DIR = dist <mask> # TODO(a.garipov): Find out a way to make this work in GNU Make. <mask> # <mask> # GO = $${GO:-go} <mask> # <mask> GO = go <mask> GOPROXY = https://goproxy.cn|https://proxy.golang.org|direct <mask> GPG_KEY = devteam@adguard.com <mas...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb01eaa7f7332819c8b85119a75f069a92ff7be3
Makefile
GO="$(GO.MACRO)"\
<mask> CHANNEL='$(CHANNEL)'\ <mask> GPG_KEY='$(GPG_KEY)'\ <mask> GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\ <mask> DIST_DIR='$(DIST_DIR)'\ <mask> GO='$(GO)'\ <mask> GOPROXY='$(GOPROXY)'\ <mask> PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\ <mask> RACE='$(RACE)'\ <mask> SIGN='$(SIGN)'\ <mask>...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb01eaa7f7332819c8b85119a75f069a92ff7be3
Makefile
PATH="$${PWD}/bin:$$( "$(GO.MACRO)" env GOPATH )/bin:$${PATH}"\
<mask> GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\ <mask> DIST_DIR='$(DIST_DIR)'\ <mask> GO='$(GO)'\ <mask> GOPROXY='$(GOPROXY)'\ <mask> PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\ <mask> RACE='$(RACE)'\ <mask> SIGN='$(SIGN)'\ <mask> VERBOSE='$(VERBOSE)'\ <mask> VERSION='$(VERSION)'\ <mask>...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb01eaa7f7332819c8b85119a75f069a92ff7be3
Makefile
env GOOS='darwin' "$(GO.MACRO)" vet ./internal/... env GOOS='freebsd' "$(GO.MACRO)" vet ./internal/... env GOOS='linux' "$(GO.MACRO)" vet ./internal/... env GOOS='windows' "$(GO.MACRO)" vet ./internal/...
<mask> <mask> # A quick check to make sure that all supported operating systems can be <mask> # typechecked and built successfully. <mask> go-os-check: <mask> env GOOS='darwin' $(GO) vet ./internal/... <mask> env GOOS='freebsd' $(GO) vet ./internal/... <mask> env GOOS='linux' $(GO) vet ./internal/... <ma...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb01eaa7f7332819c8b85119a75f069a92ff7be3
Makefile
// suffix matching isSuffix bool suffix string
<mask> <mask> // user-supplied data <mask> listID uint32 <mask> <mask> // compiled regexp <mask> compiled *regexp.Regexp <mask> <mask> sync.RWMutex <mask> } <mask> </s> dnsfilter -- avoid using regexps when simple suffix match is enough. This covers 96.98% of all adguard dns rules. </s> remove con...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb97a254a56e79a5ab14b011f6406bd32331665f
dnsfilter/dnsfilter.go
isCompiled := rule.isSuffix || rule.compiled != nil
<mask> } <mask> <mask> func (rule *rule) compile() error { <mask> rule.RLock() <mask> isCompiled := rule.compiled != nil <mask> rule.RUnlock() <mask> if isCompiled { <mask> return nil <mask> } <mask> </s> dnsfilter -- avoid using regexps when simple suffix match is enough. This covers 96.98% of all...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb97a254a56e79a5ab14b011f6406bd32331665f
dnsfilter/dnsfilter.go
isSuffix, suffix := getSuffix(rule.text) if isSuffix { rule.Lock() rule.isSuffix = isSuffix rule.suffix = suffix rule.Unlock() return nil }
<mask> if isCompiled { <mask> return nil <mask> } <mask> <mask> expr, err := ruleToRegexp(rule.text) <mask> if err != nil { <mask> return err <mask> } <mask> </s> dnsfilter -- avoid using regexps when simple suffix match is enough. This covers 96.98% of all adguard dns rules. </s> remove isCompil...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb97a254a56e79a5ab14b011f6406bd32331665f
dnsfilter/dnsfilter.go
matched := false if rule.isSuffix { if host == rule.suffix { matched = true } else if strings.HasSuffix(host, "."+rule.suffix) { matched = true } } else { matched = rule.compiled.MatchString(host) }
<mask> if err != nil { <mask> return res, err <mask> } <mask> rule.RLock() <mask> matched := rule.compiled.MatchString(host) <mask> rule.RUnlock() <mask> if matched { <mask> res.Reason = FilteredBlackList <mask> res.IsFiltered = true <mask> if rule.isWhitelist { </s> dnsfilter -- avoid using re...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb97a254a56e79a5ab14b011f6406bd32331665f
dnsfilter/dnsfilter.go
{`||doubleclick.net^`, `(?:^|\.)doubleclick\.net$`, nil},
<mask> }{ <mask> {"/doubleclick/", "doubleclick", nil}, <mask> {"/", "", ErrInvalidSyntax}, <mask> {`|double*?.+[]|(){}#$\|`, `^double.*\?\.\+\[\]\|\(\)\{\}\#\$\\$`, nil}, <mask> {`||doubleclick.net^`, `^([a-z0-9-_.]+\.)?doubleclick\.net([^ a-zA-Z0-9.%]|$)`, nil}, <mask> } <mask> for _, testcase := ra...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb97a254a56e79a5ab14b011f6406bd32331665f
dnsfilter/dnsfilter_test.go
const hostStart = `(?:^|\.)` const hostEnd = `$`
<mask> "strings" <mask> ) <mask> <mask> func ruleToRegexp(rule string) (string, error) { <mask> const hostStart = "^([a-z0-9-_.]+\\.)?" <mask> const hostEnd = "([^ a-zA-Z0-9.%]|$)" <mask> <mask> // empty or short rule -- do nothing <mask> if !isValidRule(rule) { <mask> return "", ErrInvalidSyntax <m...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb97a254a56e79a5ab14b011f6406bd32331665f
dnsfilter/rule_to_regexp.go
"time"
<mask> "os" <mask> "path/filepath" <mask> "sync" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/dhcpd" <mask> "github.com/AdguardTeam/AdGuardHome/dnsfilter" <mask> "github.com/AdguardTeam/AdGuardHome/dnsforward" <mask> "github.com/hmage/golibs/log" <mask> yaml "gopkg.in/yaml.v2" </s> /tls/validate...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb97c221fde947fd3449d66717c232b127322b29
config.go
// certificate status ValidChain bool `yaml:"-" json:"valid_chain"` Subject string `yaml:"-" json:"subject,omitempty"` Issuer string `yaml:"-" json:"issuer,omitempty"` NotBefore time.Time `yaml:"-" json:"not_before,omitempty"` NotAfter time.Time `yaml:"-" js...
<mask> } <mask> <mask> // field ordering is not important -- these are for API and are recalculated on each run <mask> type tlsConfigStatus struct { <mask> NotAfter string `yaml:"-" json:"not_after,omitempty"` <mask> StatusCertificate string `yaml:"-" json:"status_cert,omitempty"` <mask> StatusKey ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb97c221fde947fd3449d66717c232b127322b29
config.go
"crypto" "crypto/ecdsa" "crypto/rsa"
<mask> import ( <mask> "bytes" <mask> "context" <mask> "crypto/tls" <mask> "crypto/x509" <mask> "encoding/base64" <mask> "encoding/json" <mask> "encoding/pem" <mask> "errors" </s> /tls/validate and /tls/configure -- do checks on private key, add more fields to certificate status, do keypair check last...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb97c221fde947fd3449d66717c232b127322b29
control.go
"errors"
<mask> "crypto/x509" <mask> "encoding/base64" <mask> "encoding/json" <mask> "encoding/pem" <mask> "fmt" <mask> "io/ioutil" <mask> "net" <mask> "net/http" </s> /tls/validate and /tls/configure -- do checks on private key, add more fields to certificate status, do keypair check last. </s> remove data....
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb97c221fde947fd3449d66717c232b127322b29
control.go
// clear out status for certificates data.tlsConfigStatus = tlsConfigStatus{} // check only public certificate separetely from the key
<mask> var err error <mask> <mask> if data.CertificateChain != "" { <mask> log.Printf("got certificate: %s", data.CertificateChain) <mask> <mask> // now do a more extended validation </s> /tls/validate and /tls/configure -- do checks on private key, add more fields to certificate status, do keypair check...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb97c221fde947fd3449d66717c232b127322b29
control.go
<mask> <mask> if data.CertificateChain != "" { <mask> log.Printf("got certificate: %s", data.CertificateChain) <mask> <mask> if data.PrivateKey != "" { <mask> _, err = tls.X509KeyPair([]byte(data.CertificateChain), []byte(data.PrivateKey)) <mask> if err != nil { <mask> return data, errorx.Decor...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb97c221fde947fd3449d66717c232b127322b29
control.go
} else { data.ValidChain = true
<mask> if err != nil { <mask> // let self-signed certs through <mask> data.WarningValidation = fmt.Sprintf("Your certificate does not verify: %s", err) <mask> } <mask> // spew.Dump(chains) <mask> <mask> // update status <mask> if mainCert != nil { <mask> notAfter := mainCert.NotAfter </s> ...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb97c221fde947fd3449d66717c232b127322b29
control.go
data.Subject = mainCert.Subject.String() data.Issuer = mainCert.Issuer.String() data.NotAfter = notAfter data.NotBefore = mainCert.NotBefore data.DNSNames = mainCert.DNSNames
<mask> <mask> // update status <mask> if mainCert != nil { <mask> notAfter := mainCert.NotAfter <mask> data.NotAfter = notAfter.Format(time.RFC3339) <mask> data.StatusCertificate = fmt.Sprintf("Certificate expires on %s", notAfter) //, valid for hostname %s", mainCert.NotAfter, mainCert.Subject.Comm...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cb97c221fde947fd3449d66717c232b127322b29
control.go
"fmt"
<mask> import ( <mask> "encoding/base64" <mask> "encoding/json" <mask> "io" <mask> "net" <mask> "strings" <mask> "time" <mask> </s> Pull request: querylog imp code Merge in DNS/adguard-home from querylog-imp-code to master Squashed commit of the following: commit a58ad36508a2355b686d314dec51ac0b5e357...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2
internal/querylog/decode.go
"github.com/AdguardTeam/golibs/errors"
<mask> "strings" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/filtering" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/urlfilter/rules" <mask> "github.com/miekg/dns" <mask> ) <mask> </s> Pull request: querylog imp code Merge in DNS/adguard-home ...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2
internal/querylog/decode.go
// logEntryHandler represents a handler for decoding json token to the logEntry // struct.
<mask> "github.com/miekg/dns" <mask> ) <mask> <mask> type logEntryHandler func(t json.Token, ent *logEntry) error <mask> <mask> // logEntryHandlers is the map of log entry decode handlers for various keys. <mask> var logEntryHandlers = map[string]logEntryHandler{ </s> Pull request: querylog imp code Merge i...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2
internal/querylog/decode.go
// logEntryHandlers is the map of log entry decode handlers for various keys.
<mask> // logEntryHandler represents a handler for decoding json token to the logEntry <mask> // struct. <mask> type logEntryHandler func(t json.Token, ent *logEntry) error <mask> <mask> var logEntryHandlers = map[string]logEntryHandler{ <mask> "CID": func(t json.Token, ent *logEntry) error { <mask> v, ok :=...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2
internal/querylog/decode.go
// decodeResultRuleKey decodes the token of "Rules" type to logEntry struct.
<mask> }, <mask> } <mask> <mask> func decodeResultRuleKey(key string, i int, dec *json.Decoder, ent *logEntry) { <mask> var vToken json.Token <mask> switch key { <mask> case "FilterListID": </s> Pull request: querylog imp code Merge in DNS/adguard-home from querylog-imp-code to master Squashed commit of ...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2
internal/querylog/decode.go
// decodeVTokenAndAddRule decodes the "Rules" toke as [filtering.ResultRule] // and then adds the decoded object to the slice of result rules.
<mask> } <mask> } <mask> <mask> func decodeVTokenAndAddRule( <mask> key string, <mask> i int, <mask> dec *json.Decoder, </s> Pull request: querylog imp code Merge in DNS/adguard-home from querylog-imp-code to master Squashed commit of the following: commit a58ad36508a2355b686d314dec51ac0b5e357281 Merge:...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2
internal/querylog/decode.go
// decodeResultRules parses the dec's tokens into logEntry ent interpreting it // as a slice of the result rules.
<mask> return newRules, vToken <mask> } <mask> <mask> func decodeResultRules(dec *json.Decoder, ent *logEntry) { <mask> for { <mask> delimToken, err := dec.Token() <mask> if err != nil { <mask> if err != io.EOF { </s> Pull request: querylog imp code Merge in DNS/adguard-home from querylog-imp-code t...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2
internal/querylog/decode.go
if d, ok := delimToken.(json.Delim); !ok {
<mask> <mask> return <mask> } <mask> <mask> if d, ok := delimToken.(json.Delim); ok { <mask> if d != '[' { <mask> log.Debug("decodeResultRules: unexpected delim %q", d) <mask> } <mask> } else { <mask> return <mask> } <mask> <mask> i := 0 <mask> for { </s> Pull request: quer...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2
internal/querylog/decode.go
} else if d != '[' { log.Debug("decodeResultRules: unexpected delim %q", d)
<mask> } <mask> <mask> if d, ok := delimToken.(json.Delim); !ok { <mask> return <mask> } <mask> <mask> err = decodeResultRuleToken(dec, ent) <mask> if err != nil { <mask> if err != io.EOF && !errors.Is(err, ErrEndOfToken) { </s> Pull request: querylog imp code Merge in DNS/adguard-home from...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/cbc7985e756e40ec6ee290c003ff343f825a89b2
internal/querylog/decode.go