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
setts := &FilteringSettings{
<mask> @@||disable-all^$dnsrewrite <mask> ` <mask> <mask> f := newForTest(nil, []Filter{{ID: 0, Data: []byte(text)}}) <mask> setts := &RequestFilteringSettings{ <mask> FilteringEnabled: true, <mask> } <mask> <mask> ipv4p1 := net.IPv4(127, 0, 0, 1) <mask> ipv4p2 := net.IPv4(127, 0, 0, 2) </s> Pull re...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/dnsrewrite_test.go
// TODO(a.garipov): Unify with checkParental. func (d *DNSFilter) checkSafeBrowsing( host string, _ uint16, setts *FilteringSettings, ) (res Result, err error) { if !setts.SafeBrowsingEnabled { return Result{}, nil }
<mask> <mask> return Result{}, nil <mask> } <mask> <mask> func (d *DNSFilter) checkSafeBrowsing(host string) (Result, error) { <mask> if log.GetLevel() >= log.DEBUG { <mask> timer := log.StartTimer() <mask> defer timer.LogElapsed("SafeBrowsing lookup for %s", host) <mask> } <mask> ctx := &sbCtx{ </...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/safebrowsing.go
sctx := &sbCtx{
<mask> if log.GetLevel() >= log.DEBUG { <mask> timer := log.StartTimer() <mask> defer timer.LogElapsed("SafeBrowsing lookup for %s", host) <mask> } <mask> ctx := &sbCtx{ <mask> host: host, <mask> svc: "SafeBrowsing", <mask> cache: gctx.safebrowsingCache, <mask> cacheTime: d.Config...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/safebrowsing.go
res = Result{
<mask> svc: "SafeBrowsing", <mask> cache: gctx.safebrowsingCache, <mask> cacheTime: d.Config.CacheTime, <mask> } <mask> res := Result{ <mask> IsFiltered: true, <mask> Reason: FilteredSafeBrowsing, <mask> Rules: []*ResultRule{{ <mask> Text: "adguard-malware-shavar", <mask> }}, ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/safebrowsing.go
return check(sctx, res, d.safeBrowsingUpstream)
<mask> Rules: []*ResultRule{{ <mask> Text: "adguard-malware-shavar", <mask> }}, <mask> } <mask> return check(ctx, res, d.safeBrowsingUpstream) <mask> } <mask> <mask> func (d *DNSFilter) checkParental(host string) (Result, error) { <mask> if log.GetLevel() >= log.DEBUG { <mask> timer := log.StartT...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/safebrowsing.go
// TODO(a.garipov): Unify with checkSafeBrowsing. func (d *DNSFilter) checkParental( host string, _ uint16, setts *FilteringSettings, ) (res Result, err error) { if !setts.ParentalEnabled { return Result{}, nil }
<mask> } <mask> return check(ctx, res, d.safeBrowsingUpstream) <mask> } <mask> <mask> func (d *DNSFilter) checkParental(host string) (Result, error) { <mask> if log.GetLevel() >= log.DEBUG { <mask> timer := log.StartTimer() <mask> defer timer.LogElapsed("Parental lookup for %s", host) <mask> } <mask>...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/safebrowsing.go
sctx := &sbCtx{
<mask> if log.GetLevel() >= log.DEBUG { <mask> timer := log.StartTimer() <mask> defer timer.LogElapsed("Parental lookup for %s", host) <mask> } <mask> ctx := &sbCtx{ <mask> host: host, <mask> svc: "Parental", <mask> cache: gctx.parentalCache, <mask> cacheTime: d.Config.CacheTime, ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/safebrowsing.go
res = Result{
<mask> svc: "Parental", <mask> cache: gctx.parentalCache, <mask> cacheTime: d.Config.CacheTime, <mask> } <mask> res := Result{ <mask> IsFiltered: true, <mask> Reason: FilteredParental, <mask> Rules: []*ResultRule{{ <mask> Text: "parental CATEGORY_BLACKLISTED", <mask> }}, </s>...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/safebrowsing.go
return check(sctx, res, d.parentalUpstream)
<mask> Rules: []*ResultRule{{ <mask> Text: "parental CATEGORY_BLACKLISTED", <mask> }}, <mask> } <mask> return check(ctx, res, d.parentalUpstream) <mask> } <mask> <mask> func httpError(r *http.Request, w http.ResponseWriter, code int, format string, args ...interface{}) { <mask> text := fmt.Sprintf(f...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/safebrowsing.go
"github.com/miekg/dns"
<mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest" <mask> "github.com/AdguardTeam/golibs/cache" <mask> "github.com/stretchr/testify/assert" <mask> "github.com/stretchr/testify/require" <mask> ) <mask> <mask> func TestSafeBrowsingHash(t *testing.T) { <mask> // test hostnameToHashes() </...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/safebrowsing_test.go
setts := &FilteringSettings{ SafeBrowsingEnabled: true, ParentalEnabled: true, } _, err := d.checkSafeBrowsing("smthng.com", dns.TypeA, setts) assert.Error(t, err)
<mask> <mask> d.SetSafeBrowsingUpstream(ups) <mask> d.SetParentalUpstream(ups) <mask> <mask> _, err := d.checkSafeBrowsing("smthng.com") <mask> assert.NotNil(t, err) <mask> <mask> _, err = d.checkParental("smthng.com") <mask> assert.NotNil(t, err) <mask> } <mask> </s> Pull request: all: imp code, ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/safebrowsing_test.go
_, err = d.checkParental("smthng.com", dns.TypeA, setts) assert.Error(t, err)
<mask> <mask> _, err := d.checkSafeBrowsing("smthng.com") <mask> assert.NotNil(t, err) <mask> <mask> _, err = d.checkParental("smthng.com") <mask> assert.NotNil(t, err) <mask> } <mask> <mask> func TestSBPC(t *testing.T) { <mask> d := newForTest(&Config{SafeBrowsingEnabled: true}, nil) <mask> t.Clean...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/safebrowsing_test.go
setts := &FilteringSettings{ SafeBrowsingEnabled: true, ParentalEnabled: true, }
<mask> const hostname = "example.org" <mask> <mask> testCases := []struct { <mask> name string <mask> block bool <mask> testFunc func(host string, _ uint16, _ *FilteringSettings) (res Result, err error) </s> Pull request: all: imp code, decr cyclo Updates #2646. Squashed commit of the follow...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/safebrowsing_test.go
testFunc func(host string, _ uint16, _ *FilteringSettings) (res Result, err error)
<mask> <mask> testCases := []struct { <mask> name string <mask> block bool <mask> testFunc func(string) (Result, error) <mask> testCache cache.Cache <mask> }{{ <mask> name: "sb_no_block", <mask> block: false, <mask> testFunc: d.checkSafeBrowsing, </s> Pull request: all: i...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/safebrowsing_test.go
res, err := tc.testFunc(hostname, dns.TypeA, setts) require.NoError(t, err)
<mask> <mask> t.Run(tc.name, func(t *testing.T) { <mask> // Firstly, check the request blocking. <mask> hits := 0 <mask> res, err := tc.testFunc(hostname) <mask> require.Nil(t, err) <mask> if tc.block { <mask> assert.True(t, res.IsFiltered) <mask> require.Len(t, res.Rules, 1) <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/safebrowsing_test.go
res, err = tc.testFunc(hostname, dns.TypeA, setts) require.NoError(t, err)
<mask> // There was one request to an upstream. <mask> assert.Equal(t, 1, ups.RequestsCount()) <mask> <mask> // Now make the same request to check the cache was used. <mask> res, err = tc.testFunc(hostname) <mask> require.Nil(t, err) <mask> if tc.block { <mask> assert.True(t, res.IsFilter...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/safebrowsing_test.go
func (d *DNSFilter) checkSafeSearch( host string, _ uint16, setts *FilteringSettings, ) (res Result, err error) { if !setts.SafeSearchEnabled { return Result{}, nil }
<mask> val, ok := safeSearchDomains[host] <mask> return val, ok <mask> } <mask> <mask> func (d *DNSFilter) checkSafeSearch(host string) (Result, error) { <mask> if log.GetLevel() >= log.DEBUG { <mask> timer := log.StartTimer() <mask> defer timer.LogElapsed("SafeSearch: lookup for %s", host) <mask> } ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/safesearch.go
res = Result{
<mask> if !ok { <mask> return Result{}, nil <mask> } <mask> <mask> res := Result{ <mask> IsFiltered: true, <mask> Reason: FilteredSafeSearch, <mask> Rules: []*ResultRule{{}}, <mask> } <mask> </s> Pull request: all: imp code, decr cyclo Updates #2646. Squashed commit of the following:...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsfilter/safesearch.go
FilterHandler func(clientAddr net.IP, clientID string, settings *dnsfilter.FilteringSettings) `yaml:"-"`
<mask> // Callbacks for other modules <mask> // -- <mask> <mask> // FilterHandler is an optional additional filtering callback. <mask> FilterHandler func(clientAddr net.IP, clientID string, settings *dnsfilter.RequestFilteringSettings) `yaml:"-"` <mask> <mask> // GetCustomUpstreamByClient - a callback fun...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsforward/config.go
setts *dnsfilter.FilteringSettings
<mask> // *Server instead. <mask> srv *Server <mask> proxyCtx *proxy.DNSContext <mask> // setts are the filtering settings for the client. <mask> setts *dnsfilter.RequestFilteringSettings <mask> startTime time.Time <mask> result *dnsfilter.Result <mask> // origResp is the response received f...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsforward/dns.go
FilterHandler: func(_ net.IP, _ string, settings *dnsfilter.FilteringSettings) {
<mask> UDPListenAddrs: []*net.UDPAddr{{}}, <mask> TCPListenAddrs: []*net.TCPAddr{{}}, <mask> FilteringConfig: FilteringConfig{ <mask> ProtectionEnabled: true, <mask> FilterHandler: func(_ net.IP, _ string, settings *dnsfilter.RequestFilteringSettings) { <mask> settings.FilteringEnabled = false <m...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsforward/dnsforward_test.go
func (s *Server) getClientRequestFilteringSettings(ctx *dnsContext) *dnsfilter.FilteringSettings {
<mask> } <mask> <mask> // getClientRequestFilteringSettings looks up client filtering settings using <mask> // the client's IP address and ID, if any, from ctx. <mask> func (s *Server) getClientRequestFilteringSettings(ctx *dnsContext) *dnsfilter.RequestFilteringSettings { <mask> setts := s.dnsFilter.GetConfig(...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/dnsforward/filter.go
func applyAdditionalFiltering(clientAddr net.IP, clientID string, setts *dnsfilter.FilteringSettings) {
<mask> } <mask> <mask> // applyAdditionalFiltering adds additional client information and settings if <mask> // the client has them. <mask> func applyAdditionalFiltering(clientAddr net.IP, clientID string, setts *dnsfilter.RequestFilteringSettings) { <mask> Context.dnsFilter.ApplyBlockedServices(setts, nil, tru...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c735d0dd5c2158e2230fa12a140e27960f89e0b
internal/home/dns.go
};
<mask> }; <mask> <mask> handleCheck = (values) => { <mask> this.props.checkHost(values); <mask> } <mask> <mask> render() { <mask> const { <mask> t, <mask> filtering: { </s> - client: Enabling or disabling a filter list triggers a "loading" screen </s>...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c74f983d1c08c03a9f131abdea8e712a5cf7505
client/src/components/Filters/CustomRules.js
const loading = processingConfigFilter || processingFilters
<mask> modalFilterUrl, <mask> }, <mask> } = this.props; <mask> const currentFilterData = getCurrentFilter(modalFilterUrl, whitelistFilters); <mask> const loading = processingFilters <mask> || processingAddFilter <mask> || processingRemov...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c74f983d1c08c03a9f131abdea8e712a5cf7505
client/src/components/Filters/DnsAllowlist.js
const loading = processingConfigFilter || processingFilters
<mask> modalFilterUrl, <mask> }, <mask> } = this.props; <mask> const currentFilterData = getCurrentFilter(modalFilterUrl, filters); <mask> const loading = processingFilters <mask> || processingAddFilter <mask> || processingRemoveFilter ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c74f983d1c08c03a9f131abdea8e712a5cf7505
client/src/components/Filters/DnsBlocklist.js
import apiClient from '../api/Api';
<mask> import { createAction } from 'redux-actions'; <mask> import Api from '../api/Api'; <mask> import { addErrorToast, addSuccessToast } from './index'; <mask> import { normalizeTextarea } from '../helpers/helpers'; <mask> <mask> const apiClient = new Api(); <mask> </s> - client: fix api client export </s> ...
[ "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/actions/access.js
<mask> import Api from '../api/Api'; <mask> import { addErrorToast, addSuccessToast } from './index'; <mask> import { normalizeTextarea } from '../helpers/helpers'; <mask> <mask> const apiClient = new Api(); <mask> <mask> export const getAccessListRequest = createAction('GET_ACCESS_LIST_REQUEST'); <mask> expo...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/actions/access.js
import apiClient from '../api/Api';
<mask> import { createAction } from 'redux-actions'; <mask> import { t } from 'i18next'; <mask> import Api from '../api/Api'; <mask> import { addErrorToast, addSuccessToast, getClients } from './index'; <mask> import { CLIENT_ID } from '../helpers/constants'; <mask> <mask> const apiClient = new Api(); <mask> ...
[ "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/actions/clients.js
<mask> import Api from '../api/Api'; <mask> import { addErrorToast, addSuccessToast, getClients } from './index'; <mask> import { CLIENT_ID } from '../helpers/constants'; <mask> <mask> const apiClient = new Api(); <mask> <mask> export const toggleClientModal = createAction('TOGGLE_CLIENT_MODAL'); <mask> <ma...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/actions/clients.js
import apiClient from '../api/Api';
<mask> import { createAction } from 'redux-actions'; <mask> import Api from '../api/Api'; <mask> import { addErrorToast, addSuccessToast } from './index'; <mask> import { redirectToCurrentProtocol } from '../helpers/helpers'; <mask> <mask> const apiClient = new Api(); <mask> </s> - client: fix api client expo...
[ "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/actions/encryption.js
<mask> import Api from '../api/Api'; <mask> import { addErrorToast, addSuccessToast } from './index'; <mask> import { redirectToCurrentProtocol } from '../helpers/helpers'; <mask> <mask> const apiClient = new Api(); <mask> <mask> export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST'); <mask...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/actions/encryption.js
import apiClient from '../api/Api';
<mask> import versionCompare from '../helpers/versionCompare'; <mask> import { normalizeFilteringStatus, normalizeTextarea, sortClients } from '../helpers/helpers'; <mask> import { SETTINGS_NAMES, CHECK_TIMEOUT } from '../helpers/constants'; <mask> import { getTlsStatus } from './encryption'; <mask> import Api fro...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/actions/index.js
import apiClient from '../api/Api';
<mask> import { createAction } from 'redux-actions'; <mask> import Api from '../api/Api'; <mask> import { addErrorToast, addSuccessToast } from './index'; <mask> <mask> const apiClient = new Api(); <mask> <mask> export const nextStep = createAction('NEXT_STEP'); </s> - client: fix api client export </s> remov...
[ "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/actions/install.js
<mask> import { createAction } from 'redux-actions'; <mask> import Api from '../api/Api'; <mask> import { addErrorToast, addSuccessToast } from './index'; <mask> <mask> const apiClient = new Api(); <mask> <mask> export const nextStep = createAction('NEXT_STEP'); <mask> export const prevStep = createAction('PR...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/actions/install.js
import apiClient from '../api/Api';
<mask> import { createAction } from 'redux-actions'; <mask> <mask> import Api from '../api/Api'; <mask> import { addErrorToast, addSuccessToast } from './index'; <mask> import { normalizeLogs } from '../helpers/helpers'; <mask> <mask> const apiClient = new Api(); <mask> </s> - client: fix api client export ...
[ "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/actions/queryLogs.js
<mask> import Api from '../api/Api'; <mask> import { addErrorToast, addSuccessToast } from './index'; <mask> import { normalizeLogs } from '../helpers/helpers'; <mask> <mask> const apiClient = new Api(); <mask> <mask> export const getLogsRequest = createAction('GET_LOGS_REQUEST'); <mask> export const getLogsF...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/actions/queryLogs.js
import apiClient from '../api/Api';
<mask> import { createAction } from 'redux-actions'; <mask> import { t } from 'i18next'; <mask> import Api from '../api/Api'; <mask> import { addErrorToast, addSuccessToast } from './index'; <mask> <mask> const apiClient = new Api(); <mask> <mask> export const toggleRewritesModal = createAction('TOGGLE_REWRIT...
[ "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/actions/rewrites.js
<mask> import { t } from 'i18next'; <mask> import Api from '../api/Api'; <mask> import { addErrorToast, addSuccessToast } from './index'; <mask> <mask> const apiClient = new Api(); <mask> <mask> export const toggleRewritesModal = createAction('TOGGLE_REWRITES_MODAL'); <mask> <mask> export const getRewritesL...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/actions/rewrites.js
import apiClient from '../api/Api';
<mask> import { createAction } from 'redux-actions'; <mask> import Api from '../api/Api'; <mask> import { addErrorToast, addSuccessToast } from './index'; <mask> <mask> const apiClient = new Api(); <mask> <mask> export const getBlockedServicesRequest = createAction('GET_BLOCKED_SERVICES_REQUEST'); </s> - clie...
[ "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/actions/services.js
<mask> import { createAction } from 'redux-actions'; <mask> import Api from '../api/Api'; <mask> import { addErrorToast, addSuccessToast } from './index'; <mask> <mask> const apiClient = new Api(); <mask> <mask> export const getBlockedServicesRequest = createAction('GET_BLOCKED_SERVICES_REQUEST'); <mask> expo...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/actions/services.js
import apiClient from '../api/Api';
<mask> import { createAction } from 'redux-actions'; <mask> <mask> import Api from '../api/Api'; <mask> import { addErrorToast, addSuccessToast } from './index'; <mask> import { normalizeTopStats, secondsToMilliseconds } from '../helpers/helpers'; <mask> <mask> const apiClient = new Api(); <mask> </s> - cli...
[ "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/actions/stats.js
<mask> import Api from '../api/Api'; <mask> import { addErrorToast, addSuccessToast } from './index'; <mask> import { normalizeTopStats, secondsToMilliseconds } from '../helpers/helpers'; <mask> <mask> const apiClient = new Api(); <mask> <mask> export const getStatsConfigRequest = createAction('GET_STATS_CONFI...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/actions/stats.js
class Api {
<mask> import axios from 'axios'; <mask> <mask> export default class Api { <mask> baseUrl = 'control'; <mask> <mask> async makeRequest(path, method = 'POST', config) { <mask> try { <mask> const response = await axios({ </s> - client: fix api client export </s> remove const apiClie...
[ "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/api/Api.js
const apiClient = new Api(); export default apiClient;
<mask> const { path, method } = this.QUERY_LOG_CLEAR; <mask> return this.makeRequest(path, method); <mask> } <mask> } </s> - client: fix api client export </s> remove import Api from '../api/Api'; </s> add import apiClient from '../api/Api'; </s> remove import { toggleLogStatus, clearLogs, get...
[ "keep", "keep", "keep", "add" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/api/Api.js
{!enabled && !processingGetConfig && (
<mask> {enabled && (processingGetLogs || processingClients || processingGetConfig) && ( <mask> <Loading /> <mask> )} <mask> {enabled && isDataReady && this.renderLogs(queryLogs.logs)} <mask> {!enabled && isDataR...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/components/Logs/index.js
import { clearLogs, getLogsConfig, setLogsConfig } from '../actions/queryLogs';
<mask> import { connect } from 'react-redux'; <mask> import { initSettings, toggleSetting } from '../actions'; <mask> import { getBlockedServices, setBlockedServices } from '../actions/services'; <mask> import { getStatsConfig, setStatsConfig, resetStats } from '../actions/stats'; <mask> import { toggleLogStatus, ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/containers/Settings.js
<mask> setBlockedServices, <mask> getStatsConfig, <mask> setStatsConfig, <mask> resetStats, <mask> toggleLogStatus, <mask> clearLogs, <mask> getLogsConfig, <mask> setLogsConfig, <mask> }; <mask> </s> - client: fix api client export </s> remove import { toggleLogStatus, clearL...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8c89973365e660d47fa5fce88113414011961acb
client/src/containers/Settings.js
<mask> package dnsfilter <mask> <mask> import ( <mask> "bytes" <mask> "fmt" <mask> "io/ioutil" <mask> "net" <mask> "net/http" <mask> "os" </s> * dnsfilter: change DNS answer for host rules When matched by a host rule, return only the IP address specified in rule. Respond with an empty IP list to anoth...
[ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8d2a9ce923eae4673a74f4c4a7e1d9ef840f04d2
dnsfilter/dnsfilter.go
res.IP = net.IP{}
<mask> return res, nil <mask> <mask> } else if hostRule, ok := rule.(*rules.HostRule); ok { <mask> <mask> if qtype == dns.TypeA && hostRule.IP.To4() != nil { <mask> // either IPv4 or IPv4-mapped IPv6 address <mask> res.IP = hostRule.IP.To4() <mask> <mask> } else if qtype == dns.TypeAAAA &...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8d2a9ce923eae4673a74f4c4a7e1d9ef840f04d2
dnsfilter/dnsfilter.go
} else if qtype == dns.TypeAAAA && hostRule.IP.To4() == nil { res.IP = hostRule.IP
<mask> <mask> if qtype == dns.TypeA && hostRule.IP.To4() != nil { <mask> // either IPv4 or IPv4-mapped IPv6 address <mask> res.IP = hostRule.IP.To4() <mask> return res, nil <mask> <mask> } else if qtype == dns.TypeAAAA { <mask> ip4 := hostRule.IP.To4() <mask> if ip4 == nil { <mask>...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8d2a9ce923eae4673a74f4c4a7e1d9ef840f04d2
dnsfilter/dnsfilter.go
return res, nil
<mask> res.IP = net.IPv6zero <mask> return res, nil <mask> } <mask> } <mask> continue <mask> <mask> } else { <mask> log.Tracef("Rule type is unsupported: '%s' list_id: %d", <mask> rule.Text(), rule.GetFilterListID()) <mask> } </s> * dnsfilter: change DNS answer for host rules...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8d2a9ce923eae4673a74f4c4a7e1d9ef840f04d2
dnsfilter/dnsfilter.go
text := fmt.Sprintf(" %s google.com www.google.com # enforce google's safesearch \n%s ipv6.com\n0.0.0.0 block.com\n",
<mask> <mask> func TestEtcHostsMatching(t *testing.T) { <mask> addr := "216.239.38.120" <mask> addr6 := "::1" <mask> text := fmt.Sprintf(" %s google.com www.google.com # enforce google's safesearch \n%s google.com\n0.0.0.0 block.com\n", <mask> addr, addr6) <mask> filters := make(map[int]string) <...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8d2a9ce923eae4673a74f4c4a7e1d9ef840f04d2
dnsfilter/dnsfilter_test.go
// IPv4
<mask> d.checkMatchIP(t, "www.google.com", addr, dns.TypeA) <mask> d.checkMatchEmpty(t, "subdomain.google.com") <mask> d.checkMatchEmpty(t, "example.org") <mask> <mask> // IPv6 address <mask> d.checkMatchIP(t, "google.com", addr6, dns.TypeAAAA) <mask> <mask> // block both IPv4 and IPv6 <mask> d.checkM...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8d2a9ce923eae4673a74f4c4a7e1d9ef840f04d2
dnsfilter/dnsfilter_test.go
// ...but empty IPv6 ret, err := d.CheckHost("block.com", dns.TypeAAAA, &setts) assert.True(t, err == nil && ret.IsFiltered && ret.IP != nil && len(ret.IP) == 0) // IPv6 d.checkMatchIP(t, "ipv6.com", addr6, dns.TypeAAAA) // ...but empty IPv4 ret, err = d.CheckHost("ipv6.com", dns.TypeA, &setts) assert.True(t,...
<mask> d.checkMatchIP(t, "google.com", addr6, dns.TypeAAAA) <mask> <mask> // block both IPv4 and IPv6 <mask> d.checkMatchIP(t, "block.com", "0.0.0.0", dns.TypeA) <mask> d.checkMatchIP(t, "block.com", "::", dns.TypeAAAA) <mask> } <mask> <mask> // SAFE BROWSING <mask> <mask> func TestSafeBrowsing(t *test...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8d2a9ce923eae4673a74f4c4a7e1d9ef840f04d2
dnsfilter/dnsfilter_test.go
} else if req.Question[0].Qtype == dns.TypeAAAA && len(ip) == net.IPv6len && ip.To4() == nil {
<mask> // generate DNS response message with an IP address <mask> func (s *Server) genResponseWithIP(req *dns.Msg, ip net.IP) *dns.Msg { <mask> if req.Question[0].Qtype == dns.TypeA && ip.To4() != nil { <mask> return s.genARecord(req, ip.To4()) <mask> } else if req.Question[0].Qtype == dns.TypeAAAA && ip.To4()...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8d2a9ce923eae4673a74f4c4a7e1d9ef840f04d2
dnsforward/dnsforward.go
'GO_VERSION': '1.18.9'
<mask> 'name': 'build' <mask> <mask> 'env': <mask> 'GO_VERSION': '1.18.8' <mask> 'NODE_VERSION': '14' <mask> <mask> 'on': <mask> 'push': <mask> 'branches': </s> Pull request: 5238-default-filter-urls Updates #5238. Squashed commit of the following: commit 6a1b58bfa0f0bb8cc924e294485e8f650ce7f7a...
[ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8d453e75a457bd0f6048e7e01ce7ca6f73779a0b
.github/workflows/build.yml
'GO_VERSION': '1.18.9'
<mask> 'name': 'lint' <mask> <mask> 'env': <mask> 'GO_VERSION': '1.18.8' <mask> <mask> 'on': <mask> 'push': <mask> 'tags': <mask> - 'v*' </s> Pull request: 5238-default-filter-urls Updates #5238. Squashed commit of the following: commit 6a1b58bfa0f0bb8cc924e294485e8f650ce7f7aa Author: Ainar G...
[ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8d453e75a457bd0f6048e7e01ce7ca6f73779a0b
.github/workflows/lint.yml
// NOTE: Keep these parameters in sync with the one put into // client/src/helpers/filters/filters.js by scripts/vetted-filters. // // TODO(a.garipov): Think of a way to make scripts/vetted-filters update // these as well if necessary.
<mask> PortDNSOverTLS: defaultPortTLS, // needs to be passed through to dnsproxy <mask> PortDNSOverQUIC: defaultPortQUIC, <mask> }, <mask> Filters: []filtering.FilterYAML{{ <mask> Filter: filtering.Filter{ID: 1}, <mask> Enabled: true, <mask> URL: "https://adguardteam.github.io/HostlistsRegistry...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8d453e75a457bd0f6048e7e01ce7ca6f73779a0b
internal/home/config.go
URL: "https://adguardteam.github.io/HostlistsRegistry/assets/filter_1.txt",
<mask> }, <mask> Filters: []filtering.FilterYAML{{ <mask> Filter: filtering.Filter{ID: 1}, <mask> Enabled: true, <mask> URL: "https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt", <mask> Name: "AdGuard DNS filter", <mask> }, { <mask> Filter: filtering.Filter{ID: 2}, <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8d453e75a457bd0f6048e7e01ce7ca6f73779a0b
internal/home/config.go
URL: "https://adguardteam.github.io/HostlistsRegistry/assets/filter_2.txt",
<mask> Name: "AdGuard DNS filter", <mask> }, { <mask> Filter: filtering.Filter{ID: 2}, <mask> Enabled: false, <mask> URL: "https://adaway.org/hosts.txt", <mask> Name: "AdAway Default Blocklist", <mask> }}, <mask> DHCP: &dhcpd.ServerConfig{ <mask> LocalDomainName: "lan", <mask> Conf...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8d453e75a457bd0f6048e7e01ce7ca6f73779a0b
internal/home/config.go
"os/exec"
<mask> "net/http" <mask> "os" <mask> "sort" <mask> "strconv" <mask> "strings" <mask> "sync" <mask> "time" </s> + control: /install/check_config: Check and deactivate DNSStubListener </s> remove if reqData.DNS.Port != 0 && reqData.DNS.Port != config.DNS.Port { </s> add if reqData.DNS.Port != 0 {
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8d936b5756cb93741a4162edb778b86ac1f78e72
control.go
if reqData.DNS.Port != 0 {
<mask> respData.Web.Status = fmt.Sprintf("%v", err) <mask> } <mask> } <mask> <mask> if reqData.DNS.Port != 0 && reqData.DNS.Port != config.DNS.Port { <mask> err = checkPacketPortAvailable(reqData.DNS.IP, reqData.DNS.Port) <mask> if err != nil { <mask> respData.DNS.Status = fmt.Sprintf("%v", err) ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8d936b5756cb93741a4162edb778b86ac1f78e72
control.go
if errorIsAddrInUse(err) { canAutofix := checkDNSStubListener() if canAutofix && reqData.DNS.Autofix { err = disableDNSStubListener() if err != nil { log.Error("Couldn't disable DNSStubListener: %s", err) } err = checkPacketPortAvailable(reqData.DNS.IP, reqData.DNS.Port) canAutofix = ...
<mask> <mask> if reqData.DNS.Port != 0 { <mask> err = checkPacketPortAvailable(reqData.DNS.IP, reqData.DNS.Port) <mask> if err != nil { <mask> respData.DNS.Status = fmt.Sprintf("%v", err) <mask> } <mask> } </s> + control: /install/check_config: Check and deactivate DNSStubListener </s> remove if re...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8d936b5756cb93741a4162edb778b86ac1f78e72
control.go
"syscall"
<mask> "path/filepath" <mask> "runtime" <mask> "strconv" <mask> "strings" <mask> "time" <mask> <mask> "github.com/AdguardTeam/dnsproxy/upstream" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/joomcode/errorx" </s> + control: /install/check_config: Check and deactivate DNSStubListener <...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8d936b5756cb93741a4162edb778b86ac1f78e72
helpers.go
<mask> package home <mask> <mask> import ( <mask> "io/ioutil" <mask> "net/http" <mask> "os" <mask> "path/filepath" <mask> "sync" <mask> "time" <mask> </s> * move HTTP server code </s> remove "github.com/NYTimes/gziphandler" "github.com/gobuffalo/packr" </s> add </s> remove // Stop HTTP server, po...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e4bc29103e5a9093ac277f05bb069e2e7b17db1
home/config.go
<mask> LogFile string `yaml:"log_file"` // Path to the log file. If empty, write to stdout. If "syslog", writes to syslog <mask> Verbose bool `yaml:"verbose"` // If true, verbose logging is enabled <mask> } <mask> <mask> // HTTPSServer - HTTPS Server <mask> type HTTPSServer struct { <mask> server *htt...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e4bc29103e5a9093ac277f05bb069e2e7b17db1
home/config.go
if config.TLS.ForceHTTPS && r.TLS == nil && config.TLS.Enabled && config.TLS.PortHTTPS != 0 && Context.web.httpsServer.server != nil {
<mask> return <mask> } <mask> <mask> // enforce https? <mask> if config.TLS.ForceHTTPS && r.TLS == nil && config.TLS.Enabled && config.TLS.PortHTTPS != 0 && Context.httpsServer.server != nil { <mask> // yes, and we want host from host:port <mask> host, _, err := net.SplitHostPort(r.Host) <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e4bc29103e5a9093ac277f05bb069e2e7b17db1
home/control.go
_ = Context.web.httpServer.Shutdown(context.TODO())
<mask> // this needs to be done in a goroutine because Shutdown() is a blocking call, and it will block <mask> // until all requests are finished, and _we_ are inside a request right now, so it will block indefinitely <mask> if restartHTTP { <mask> go func() { <mask> _ = Context.httpServer.Shutdown(context...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e4bc29103e5a9093ac277f05bb069e2e7b17db1
home/control_install.go
if Context.web.httpsServer.server != nil {
<mask> <mask> // check if port is available <mask> // BUT: if we are already using this port, no need <mask> alreadyRunning := false <mask> if Context.httpsServer.server != nil { <mask> alreadyRunning = true <mask> } <mask> if !alreadyRunning { <mask> err = util.CheckPortAvailable(config.BindHost, d...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e4bc29103e5a9093ac277f05bb069e2e7b17db1
home/control_tls.go
if Context.web.httpsServer.server != nil {
<mask> <mask> // check if port is available <mask> // BUT: if we are already using this port, no need <mask> alreadyRunning := false <mask> if Context.httpsServer.server != nil { <mask> alreadyRunning = true <mask> } <mask> if !alreadyRunning { <mask> err = util.CheckPortAvailable(config.BindHost, d...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e4bc29103e5a9093ac277f05bb069e2e7b17db1
home/control_tls.go
Context.web.httpsServer.cond.L.Lock() Context.web.httpsServer.cond.Broadcast() if Context.web.httpsServer.server != nil { Context.web.httpsServer.server.Shutdown(context.TODO())
<mask> // until all requests are finished, and _we_ are inside a request right now, so it will block indefinitely <mask> if restartHTTPS { <mask> go func() { <mask> time.Sleep(time.Second) // TODO: could not find a way to reliably know that data was fully sent to client by https server, so we wait a bit to l...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e4bc29103e5a9093ac277f05bb069e2e7b17db1
home/control_tls.go
Context.web.httpsServer.cond.L.Unlock()
<mask> Context.httpsServer.cond.Broadcast() <mask> if Context.httpsServer.server != nil { <mask> Context.httpsServer.server.Shutdown(context.TODO()) <mask> } <mask> Context.httpsServer.cond.L.Unlock() <mask> }() <mask> } <mask> } <mask> <mask> func verifyCertChain(data *tlsConfigStatus, ce...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e4bc29103e5a9093ac277f05bb069e2e7b17db1
home/control_tls.go
<mask> "github.com/AdguardTeam/AdGuardHome/dnsforward" <mask> "github.com/AdguardTeam/AdGuardHome/querylog" <mask> "github.com/AdguardTeam/AdGuardHome/stats" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/NYTimes/gziphandler" <mask> "github.com/gobuffalo/packr" <mask> ) <mask> <mask> cons...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e4bc29103e5a9093ac277f05bb069e2e7b17db1
home/home.go
clients clientsContainer // per-client-settings module stats stats.Stats // statistics module queryLog querylog.QueryLog // query log module dnsServer *dnsforward.Server // DNS module rdns *RDNS // rDNS module whois *Whois // WHOIS module dnsFi...
<mask> type homeContext struct { <mask> // Modules <mask> // -- <mask> <mask> clients clientsContainer // per-client-settings module <mask> stats stats.Stats // statistics module <mask> queryLog querylog.QueryLog // query log module <mask> dnsServer *dnsforward.Server // ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e4bc29103e5a9093ac277f05bb069e2e7b17db1
home/home.go
sessFilename := filepath.Join(Context.getDataDir(), "sessions.db") Context.auth = InitAuth(sessFilename, config.Users, config.WebSessionTTLHours*60*60) if Context.auth == nil { log.Fatalf("Couldn't initialize Auth module") } config.Users = nil webConf := WebConfig{ firstRun: Context.firstRun, BindHost: con...
<mask> if err != nil { <mask> log.Fatalf("Cannot create DNS data dir at %s: %s", Context.getDataDir(), err) <mask> } <mask> <mask> err = initWeb() <mask> if err != nil { <mask> log.Fatalf("%s", err) <mask> } <mask> <mask> if !Context.firstRun { <mask> err := initDNSServer() <mask> if err != ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e4bc29103e5a9093ac277f05bb069e2e7b17db1
home/home.go
Context.web.Start()
<mask> log.Fatal(err) <mask> } <mask> } <mask> <mask> startWeb() <mask> <mask> // wait indefinitely for other go-routines to complete their job <mask> select {} <mask> } <mask> </s> * move HTTP server code </s> remove // Initialize Web modules func initWeb() error { sessFilename := filepath.Join...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e4bc29103e5a9093ac277f05bb069e2e7b17db1
home/home.go
<mask> // wait indefinitely for other go-routines to complete their job <mask> select {} <mask> } <mask> <mask> // Initialize Web modules <mask> func initWeb() error { <mask> sessFilename := filepath.Join(Context.getDataDir(), "sessions.db") <mask> Context.auth = InitAuth(sessFilename, config.Users, config...
[ "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/8e4bc29103e5a9093ac277f05bb069e2e7b17db1
home/home.go
if Context.web != nil { Context.web.Close() Context.web = nil } if Context.auth != nil { Context.auth.Close() Context.auth = nil }
<mask> <mask> func cleanup() { <mask> log.Info("Stopping AdGuard Home") <mask> <mask> stopHTTPServer() <mask> <mask> err := stopDNSServer() <mask> if err != nil { <mask> log.Error("Couldn't stop DNS server: %s", err) <mask> } </s> * move HTTP server code </s> remove // Stop HTTP server, possibly wa...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e4bc29103e5a9093ac277f05bb069e2e7b17db1
home/home.go
<mask> log.Error("Couldn't stop DHCP server: %s", err) <mask> } <mask> } <mask> <mask> // Stop HTTP server, possibly waiting for all active connections to be closed <mask> func stopHTTPServer() { <mask> log.Info("Stopping HTTP server...") <mask> Context.httpsServer.shutdown = true <mask> if Context.http...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", ...
https://github.com/AdguardTeam/AdGuardHome/commit/8e4bc29103e5a9093ac277f05bb069e2e7b17db1
home/home.go
overflow-y: auto;
<mask> } <mask> <mask> .modal-body--medium { <mask> max-height: 20rem; <mask> overflow-y: scroll; <mask> } <mask> <mask> .modal-body__item:not(:first-child) { <mask> padding-top: 1.5rem; <mask> } </s> Pull request: 3395 fix table scroll styles Closes #3395 Squashed commit of the following: c...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e667d3cc4551cec2438b4f0f4fdf7749d4a7ed3
client/src/components/App/index.css
overflow-y: auto;
<mask> border-radius: 4px !important; <mask> pointer-events: auto !important; <mask> background-color: var(--white); <mask> z-index: 102; <mask> overflow-y: scroll; <mask> max-height: 100%; <mask> } <mask> <mask> .white-space--nowrap { <mask> white-space: nowrap !important; </s> ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e667d3cc4551cec2438b4f0f4fdf7749d4a7ed3
client/src/components/Logs/Cells/IconTooltip.css
overflow-y: auto;
<mask> width: 100%; <mask> border-collapse: collapse; <mask> contain: layout; <mask> overflow-x: hidden; <mask> overflow-y: scroll; <mask> will-change: scroll-position; <mask> } <mask> <mask> .logs__table .logs__cell--response, <mask> .logs__table .logs__cell--client { </s> Pull requ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e667d3cc4551cec2438b4f0f4fdf7749d4a7ed3
client/src/components/Logs/Logs.css
"form_error_password_length": "Password must be at least {{value}} characters long", "anonymizer_notification": "<0>Note:</0> IP anonymization is enabled. You can disable it in <1>General settings</1>."
<mask> "use_saved_key": "Use the previously saved key", <mask> "parental_control": "Parental Control", <mask> "safe_browsing": "Safe Browsing", <mask> "served_from_cache": "{{value}} <i>(served from cache)</i>", <mask> "form_error_password_length": "Password must be at least {{value}} character...
[ "keep", "keep", "keep", "keep", "replace", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e89cc129cb5b7327975af31dbfaa41f9d7d0dfe
client/src/__locales/en.json
import AnonymizerNotification from './AnonymizerNotification';
<mask> import InfiniteTable from './InfiniteTable'; <mask> import './Logs.css'; <mask> import { BUTTON_PREFIX } from './Cells/helpers'; <mask> <mask> const processContent = (data) => Object.entries(data) <mask> .map(([key, value]) => { <mask> if (!value) { <mask> return null; </s> Pull...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e89cc129cb5b7327975af31dbfaa41f9d7d0dfe
client/src/components/Logs/index.js
anonymize_client_ip: anonymizeClientIp,
<mask> processingGetConfig, <mask> processingAdditionalLogs, <mask> processingGetLogs, <mask> } = useSelector((state) => state.queryLogs, shallowEqual); <mask> const filter = useSelector((state) => state.queryLogs.filter, shallowEqual); <mask> const logs = useSelector((state) =...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e89cc129cb5b7327975af31dbfaa41f9d7d0dfe
client/src/components/Logs/index.js
return ( <> {enabled && ( <> {processingGetConfig && <Loading />} {anonymizeClientIp && <AnonymizerNotification />} {!processingGetConfig && renderPage()} </> )} {!enabled && !proc...
<mask> {processContent(detailedDataCurrent, buttonType)} <mask> </Modal> <mask> </>; <mask> <mask> return <> <mask> {enabled && processingGetConfig && <Loading />} <mask> {enabled && !processingGetConfig && renderPage()} <mask> {!enabled && !processingGetConf...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e89cc129cb5b7327975af31dbfaa41f9d7d0dfe
client/src/components/Logs/index.js
config.Lock()
<mask> log.Fatal(data.WarningValidation) <mask> os.Exit(1) <mask> } <mask> config.TLS = data // update warnings <mask> config.Unlock() <mask> <mask> // prepare certs for HTTPS server </s> Fix data races found by race detector.
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e993cd788d7e5ec4e085e58799b76aa45a393b5
app.go
config.Unlock()
<mask> config.Lock() <mask> config.TLS = data // update warnings <mask> <mask> // prepare certs for HTTPS server <mask> // important -- they have to be copies, otherwise changing the contents in config.TLS will break encryption for in-flight requests <mask> certchain := make([]byte, len(config.TLS...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e993cd788d7e5ec4e085e58799b76aa45a393b5
app.go
httpsServer.cond.L.Lock()
<mask> go func() { <mask> time.Sleep(time.Second) // TODO: could not find a way to reliably know that data was fully sent to client by https server, so we wait a bit to let response through before closing the server <mask> httpsServer.cond.Broadcast() <mask> if httpsServer.server != nil { <mask> htt...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e993cd788d7e5ec4e085e58799b76aa45a393b5
control.go
httpsServer.cond.L.Unlock()
<mask> httpsServer.server.Shutdown(context.TODO()) <mask> } <mask> }() <mask> } <mask> } <mask> <mask> func validateCertificates(data tlsConfig) tlsConfig { </s> Fix data races found by race detector.
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8e993cd788d7e5ec4e085e58799b76aa45a393b5
control.go
const { t } = useTranslation();
<mask> const Form = ({ <mask> submitting, invalid, processingSetConfig, processingTestUpstream, handleSubmit, <mask> }) => { <mask> const dispatch = useDispatch(); <mask> const [t] = useTranslation(); <mask> const upstream_dns = useSelector((store) => store.form[FORM_NAME.UPSTREAM].values.upstream...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8ea1e64c7ba8ab2b9618a6fe8c83f570b88ce124
client/src/components/Settings/Dns/Upstream/Form.js
const bootstrap_dns = useSelector( (store) => store.form[FORM_NAME.UPSTREAM].values.bootstrap_dns, );
<mask> }) => { <mask> const dispatch = useDispatch(); <mask> const [t] = useTranslation(); <mask> const upstream_dns = useSelector((store) => store.form[FORM_NAME.UPSTREAM].values.upstream_dns); <mask> const bootstrap_dns = useSelector((store) => store.form[FORM_NAME.UPSTREAM] <mask> .valu...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8ea1e64c7ba8ab2b9618a6fe8c83f570b88ce124
client/src/components/Settings/Dns/Upstream/Form.js
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
<mask> import React from 'react'; <mask> import { useTranslation } from 'react-i18next'; <mask> import { shallowEqual, useDispatch } from 'react-redux'; <mask> import Form from './Form'; <mask> import Card from '../../../ui/Card'; <mask> import { setDnsConfig } from '../../../../actions/dnsConfig'; <mask> <mas...
[ "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8ea1e64c7ba8ab2b9618a6fe8c83f570b88ce124
client/src/components/Settings/Dns/Upstream/index.js
} = useSelector((state) => state.dnsConfig, shallowEqual);
<mask> upstream_dns, <mask> bootstrap_dns, <mask> upstream_mode, <mask> processingSetConfig, <mask> } = ((state) => state.dnsConfig, shallowEqual); <mask> <mask> const { processingTestUpstream } = ((state) => state.settings, shallowEqual); <mask> <mask> const handl...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8ea1e64c7ba8ab2b9618a6fe8c83f570b88ce124
client/src/components/Settings/Dns/Upstream/index.js
return <Card title={t('upstream_dns')} subtitle={t('upstream_dns_hint')} bodyType="card-body box-body--settings" > <div className="row"> <div className="col"> <Form initialValues={{ upstream_dns, ...
<mask> const handleSubmit = (values) => { <mask> dispatch(setDnsConfig(values)); <mask> }; <mask> <mask> return ( <mask> <Card <mask> title={t('upstream_dns')} <mask> subtitle={t('upstream_dns_hint')} <mask> bodyType="card-body box-body--settings...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", ...
https://github.com/AdguardTeam/AdGuardHome/commit/8ea1e64c7ba8ab2b9618a6fe8c83f570b88ce124
client/src/components/Settings/Dns/Upstream/index.js
</div> </Card>;
<mask> processingSetConfig={processingSetConfig} <mask> /> <mask> </div> <mask> </div> <mask> </Card> <mask> ); <mask> }; <mask> <mask> export default Upstream; </s> - client: Fix DNS settings </s> remove return ( ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8ea1e64c7ba8ab2b9618a6fe8c83f570b88ce124
client/src/components/Settings/Dns/Upstream/index.js
// Default blocking - REFUSED
<mask> } <mask> addr := s.dnsProxy.Addr(proxy.ProtoUDP) <mask> <mask> // <mask> // NXDomain blocking <mask> // <mask> req := dns.Msg{} <mask> req.Id = dns.Id() <mask> req.RecursionDesired = true <mask> req.Question = []dns.Question{ </s> * DNS: use REFUSED DNS error code as the default blocking met...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8f017d2c0e25969bd86eafa4adbc184e41c61dc0
dnsforward/dnsforward_test.go
assert.Equal(t, dns.RcodeRefused, reply.Rcode)
<mask> reply, err := dns.Exchange(&req, addr.String()) <mask> if err != nil { <mask> t.Fatalf("Couldn't talk to server %s: %s", addr, err) <mask> } <mask> if reply.Rcode != dns.RcodeNameError { <mask> t.Fatalf("Wrong response: %s", reply.String()) <mask> } <mask> <mask> err = s.Stop() <mask> if er...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8f017d2c0e25969bd86eafa4adbc184e41c61dc0
dnsforward/dnsforward_test.go
assert.Equal(t, dns.RcodeRefused, reply.Rcode)
<mask> // response is blocked <mask> req := createTestMessage("badhost.") <mask> reply, err := dns.Exchange(req, addr.String()) <mask> assert.Nil(t, err, nil) <mask> assert.Equal(t, dns.RcodeNameError, reply.Rcode) <mask> <mask> // 'whitelist.example.org' has a canonical name 'null.example.org' which is b...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/8f017d2c0e25969bd86eafa4adbc184e41c61dc0
dnsforward/dnsforward_test.go