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
fi := zf.FileInfo() name = fi.Name() if name == "" { return "", nil }
<mask> <mask> break <mask> } <mask> <mask> log.Debug("updater: created directory %q", outputName) <mask> <mask> continue <mask> } else if header.Typeflag != tar.TypeReg { <mask> log.Debug("updater: %s: unknown file type %d, skipping", inputNameOnly, header.Typeflag) <mask> continue </...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38
internal/updater/updater.go
outputName := filepath.Join(outDir, name) if fi.IsDir() { if name == "AdGuardHome" { // Top-level AdGuardHome/. Skip it. // // TODO(a.garipov): See the similar todo in // tarGzFileUnpack. return "", nil
<mask> } <mask> <mask> log.Debug("updater: created directory %q", outputName) <mask> <mask> continue <mask> } else if header.Typeflag != tar.TypeReg { <mask> log.Debug("updater: %s: unknown file type %d, skipping", inputNameOnly, header.Typeflag) <mask> continue <mask> } <mask> <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38
internal/updater/updater.go
err = os.Mkdir(outputName, fi.Mode()) if err != nil && !errors.Is(err, os.ErrExist) { return "", fmt.Errorf("os.Mkdir(%q): %w", outputName, err)
<mask> log.Debug("updater: %s: unknown file type %d, skipping", inputNameOnly, header.Typeflag) <mask> continue <mask> } <mask> <mask> var f io.WriteCloser <mask> f, err = os.OpenFile(outputName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, os.FileMode(header.Mode&0o777)) <mask> if err != nil { <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38
internal/updater/updater.go
log.Tracef("created directory %q", outputName) return "", nil
<mask> err2 = fmt.Errorf("f.Close(): %w", err) <mask> break <mask> } <mask> <mask> log.Debug("updater: created file %s", outputName) <mask> files = append(files, header.Name) <mask> } <mask> <mask> _ = gzReader.Close() <mask> return files, err2 <mask> } </s> Pull request: replace agherr wit...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38
internal/updater/updater.go
var wc io.WriteCloser wc, err = os.OpenFile(outputName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, fi.Mode()) if err != nil { return "", fmt.Errorf("os.OpenFile(): %w", err) } defer func() { err = errors.WithDeferred(err, wc.Close()) }() _, err = io.Copy(wc, rc) if err != nil { return "", fmt.Errorf("io.Copy(): %w...
<mask> log.Debug("updater: created file %s", outputName) <mask> files = append(files, header.Name) <mask> } <mask> <mask> _ = gzReader.Close() <mask> return files, err2 <mask> } <mask> <mask> // Unpack all files from .zip file to the specified directory <mask> // Existing files are overwritten <mask...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38
internal/updater/updater.go
// All files are created inside 'outDir', subdirectories are not created
<mask> } <mask> <mask> // Unpack all files from .zip file to the specified directory <mask> // Existing files are overwritten <mask> // All files are created inside 'outdir', subdirectories are not created <mask> // Return the list of files (not directories) written <mask> func zipFileUnpack(zipfile, outdir str...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38
internal/updater/updater.go
func zipFileUnpack(zipfile, outDir string) (files []string, err error) { zrc, err := zip.OpenReader(zipfile)
<mask> // Unpack all files from .zip file to the specified directory <mask> // Existing files are overwritten <mask> // All files are created inside 'outdir', subdirectories are not created <mask> // Return the list of files (not directories) written <mask> func zipFileUnpack(zipfile, outdir string) ([]string, err...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38
internal/updater/updater.go
defer func() { err = errors.WithDeferred(err, zrc.Close()) }()
<mask> r, err := zip.OpenReader(zipfile) <mask> if err != nil { <mask> return nil, fmt.Errorf("zip.OpenReader(): %w", err) <mask> } <mask> defer r.Close() <mask> <mask> var files []string <mask> var err2 error <mask> var zr io.ReadCloser <mask> for _, zf := range r.File { </s> Pull request: replac...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38
internal/updater/updater.go
for _, zf := range zrc.File { var name string name, err = zipFileUnpackOne(outDir, zf)
<mask> return nil, fmt.Errorf("zip.OpenReader(): %w", err) <mask> } <mask> defer r.Close() <mask> <mask> var files []string <mask> var err2 error <mask> var zr io.ReadCloser <mask> for _, zf := range r.File { <mask> zr, err = zf.Open() <mask> if err != nil { <mask> err2 = fmt.Errorf("zip file...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38
internal/updater/updater.go
<mask> var zr io.ReadCloser <mask> for _, zf := range r.File { <mask> zr, err = zf.Open() <mask> if err != nil { <mask> err2 = fmt.Errorf("zip file Open(): %w", err) <mask> break <mask> } <mask> <mask> fi := zf.FileInfo() <mask> inputNameOnly := fi.Name() </s> Pull request: replace agherr ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38
internal/updater/updater.go
if name != "" { files = append(files, name)
<mask> err2 = fmt.Errorf("zip file Open(): %w", err) <mask> break <mask> } <mask> <mask> fi := zf.FileInfo() <mask> inputNameOnly := fi.Name() <mask> if inputNameOnly == "" { <mask> continue <mask> } <mask> <mask> outputName := filepath.Join(outdir, inputNameOnly) <mask> <mask> if...
[ "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/03a828ef5140f232ee755f62d9c3410242833b38
internal/updater/updater.go
<mask> _ = f.Close() <mask> err2 = fmt.Errorf("io.Copy(): %w", err) <mask> break <mask> } <mask> err = f.Close() <mask> if err != nil { <mask> err2 = fmt.Errorf("f.Close(): %w", err) <mask> break <mask> } <mask> <mask> log.Tracef("created file %s", outputName) <mask> files = appe...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38
internal/updater/updater.go
return files, err
<mask> log.Tracef("created file %s", outputName) <mask> files = append(files, inputNameOnly) <mask> } <mask> <mask> _ = zr.Close() <mask> return files, err2 <mask> } <mask> <mask> // Copy file on disk <mask> func copyFile(src, dst string) error { <mask> d, e := os.ReadFile(src) </s> Pull request: ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38
internal/updater/updater.go
err = startDHCPServer() if err != nil { log.Fatal(err) }
<mask> log.Fatal(err) <mask> } <mask> <mask> URL := fmt.Sprintf("http://%s", address) <mask> log.Println("Go to " + URL) <mask> log.Fatal(http.ListenAndServe(address, nil)) <mask> } <mask> </s> Start DHCP on launch if it's enabled in config. </s> remove // implement </s> add
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/03effab345e2bc9e77926a64acd426f71b5004cd
app.go
"github.com/joomcode/errorx"
<mask> "net" <mask> "net/http" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/dhcpd" <mask> ) <mask> <mask> var dhcpServer = dhcpd.Server{} <mask> </s> Start DHCP on launch if it's enabled in config. </s> remove // implement </s> add
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/03effab345e2bc9e77926a64acd426f71b5004cd
dhcp.go
<mask> return <mask> } <mask> } <mask> <mask> // implement <mask> func handleDHCPFindActiveServer(w http.ResponseWriter, r *http.Request) { <mask> found, err := dhcpd.CheckIfOtherDHCPServersPresent(config.DHCP.InterfaceName) <mask> result := map[string]interface{}{} <mask> if err != nil { <mask> resu...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/03effab345e2bc9e77926a64acd426f71b5004cd
dhcp.go
'coverage': 'status': 'project': 'default': 'target': '40%' 'threshold': null 'patch': false 'changes': false
<mask> coverage: <mask> status: <mask> project: <mask> default: <mask> target: 40% <mask> threshold: null <mask> patch: false <mask> changes: false </s> Pull request: all: reformat yaml, add yaml formatting standard Merge in DNS/adguard-home from 2297-yaml to master Closes...
[ "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.codecov.yml
# Number of days of inactivity before an issue becomes stale. 'daysUntilStale': 60 # Number of days of inactivity before a stale issue is closed. 'daysUntilClose': 7 # Issues with these labels will never be considered stale. 'exemptLabels': - 'bug' - 'enhancement' - 'feature request' - 'localization' # Label to use whe...
<mask> # Number of days of inactivity before an issue becomes stale <mask> daysUntilStale: 60 <mask> # Number of days of inactivity before a stale issue is closed <mask> daysUntilClose: 7 <mask> # Issues with these labels will never be considered stale <mask> exemptLabels: <mask> - 'bug' <mask> - 'enhanceme...
[ "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.github/stale.yml
# Comment to post when closing a stale issue. Set to `false` to disable. 'closeComment': false
<mask> markComment: > <mask> This issue has been automatically marked as stale because it has not had <mask> recent activity. It will be closed if no further activity occurs. Thank you <mask> for your contributions. <mask> # Comment to post when closing a stale issue. Set to `false` to disable <mask> closeC...
[ "keep", "keep", "keep", "keep", "replace", "replace" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.github/stale.yml
'name': 'build'
<mask> name: build <mask> <mask> env: <mask> GO_VERSION: 1.14 <mask> NODE_VERSION: 13 <mask> </s> Pull request: all: reformat yaml, add yaml formatting standard Merge in DNS/adguard-home from 2297-yaml to master Closes #2297. Squashed commit of the following: commit 85df3a38a14adb1965944ddf14b197c12a21...
[ "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.github/workflows/build.yml
'env': 'GO_VERSION': '1.14' 'NODE_VERSION': '13'
<mask> name: build <mask> <mask> env: <mask> GO_VERSION: 1.14 <mask> NODE_VERSION: 13 <mask> <mask> on: <mask> push: <mask> branches: <mask> - '*' </s> Pull request: all: reformat yaml, add yaml formatting standard Merge in DNS/adguard-home from 2297-yaml to master Closes #2297. Squashed...
[ "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.github/workflows/build.yml
'on': 'push': 'branches': - '*' 'tags': - 'v*' 'pull_request':
<mask> env: <mask> GO_VERSION: 1.14 <mask> NODE_VERSION: 13 <mask> <mask> on: <mask> push: <mask> branches: <mask> - '*' <mask> tags: <mask> - v* <mask> pull_request: <mask> <mask> jobs: <mask> <mask> test: <mask> runs-on: ${{ matrix.os }} </s> Pull request: all: re...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.github/workflows/build.yml
'jobs': 'test': 'runs-on': '${{ matrix.os }}' 'env': 'GO111MODULE': 'on' 'GOPROXY': 'https://goproxy.io' 'strategy': 'fail-fast': false 'matrix': 'os': - 'ubuntu-latest' - 'macOS-latest' - 'windows-latest' 'steps': - 'name': 'Checkout' ...
<mask> tags: <mask> - v* <mask> pull_request: <mask> <mask> jobs: <mask> <mask> test: <mask> runs-on: ${{ matrix.os }} <mask> env: <mask> GO111MODULE: on </s> Pull request: all: reformat yaml, add yaml formatting standard Merge in DNS/adguard-home from 2297-yaml to master Clos...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.github/workflows/build.yml
'docker': 'runs-on': 'ubuntu-latest' 'needs': 'test' 'steps': - 'name': 'Checkout' 'uses': 'actions/checkout@v2' 'with': 'fetch-depth': 0 - 'name': 'Set up QEMU' 'uses': 'docker/setup-qemu-action@v1' - 'name': 'Set up Docker Buildx' 'uses': 'docker/setup-buildx-...
<mask> pull_request: <mask> <mask> jobs: <mask> <mask> test: <mask> runs-on: ${{ matrix.os }} <mask> env: <mask> GO111MODULE: on <mask> GOPROXY: https://goproxy.io <mask> strategy: <mask> fail-fast: false <mask> matrix: <mask> os: <mask> - ubuntu...
[ "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/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.github/workflows/build.yml
'notify': 'needs': - 'app' - 'docker' # Secrets are not passed to workflows that are triggered by a pull request # from a fork. 'if': "${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}" 'runs-on': 'ubuntu-latest' 'steps': - 'na...
<mask> uses: actions/setup-go@v2 <mask> with: <mask> go-version: ${{ env.GO_VERSION }} <mask> <mask> - <mask> name: Set up Node <mask> uses: actions/setup-node@v1 <mask> with: <mask> node-version: ${{ env.NODE_VERSION }} <mask> - <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/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.github/workflows/build.yml
'name': 'golangci-lint' 'on': 'push': 'tags': - 'v*' 'branches': - '*' 'pull_request': 'jobs': 'golangci': 'runs-on': 'ubuntu-latest' 'steps': - 'uses': 'actions/checkout@v2' - 'name': 'golangci-lint' 'uses': 'golangci/golangci-lint-action@v2.3.0' 'with': # This...
<mask> name: golangci-lint <mask> on: <mask> push: <mask> tags: <mask> - v* <mask> branches: <mask> - '*' <mask> pull_request: <mask> jobs: <mask> golangci: <mask> runs-on: ubuntu-latest <mask> steps: <mask> - uses: actions/checkout@v2 <mask> - name: golangci-...
[ "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "rep...
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.github/workflows/lint.yml
'run':
<mask> # options for analysis running <mask> run: <mask> # default concurrency is a available CPU number <mask> concurrency: 4 <mask> <mask> # timeout for analysis, e.g. 30s, 5m, default is 1m <mask> deadline: 2m </s> Pull request: all: reformat yaml, add yaml formatting standard Merge in DNS/adguard-...
[ "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.golangci.yml
'concurrency': 4
<mask> # options for analysis running <mask> run: <mask> # default concurrency is a available CPU number <mask> concurrency: 4 <mask> <mask> # timeout for analysis, e.g. 30s, 5m, default is 1m <mask> deadline: 2m <mask> <mask> # which files to skip: they will be analyzed, but issues from them </s>...
[ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.golangci.yml
'deadline': '2m'
<mask> # default concurrency is a available CPU number <mask> concurrency: 4 <mask> <mask> # timeout for analysis, e.g. 30s, 5m, default is 1m <mask> deadline: 2m <mask> <mask> # which files to skip: they will be analyzed, but issues from them <mask> # won't be reported. Default value is empty lis...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.golangci.yml
'skip-files': - '.*generated.*' - 'dnsfilter/rule_to_regexp.go' - 'util/pprof.go' - '.*_test.go' - 'client/.*' - 'build/.*' - 'dist/.*'
<mask> # which files to skip: they will be analyzed, but issues from them <mask> # won't be reported. Default value is empty list, but there is <mask> # no need to include all autogenerated files, we confidently recognize <mask> # autogenerated files. If it's not please let us know. <mask> skip-files: <...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.golangci.yml
'linters-settings': 'errcheck':
<mask> - dist/.* <mask> <mask> <mask> # all available settings of specific linters <mask> linters-settings: <mask> errcheck: <mask> # [deprecated] comma-separated list of pairs of the form pkg:regex <mask> # the regex is used to ignore names within pkg. (default "fmt:.*"). <mask> # see http...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.golangci.yml
'ignore': 'fmt:.*,net:SetReadDeadline,net/http:^Write' 'gocyclo': 'min-complexity': 20 'lll': 'line-length': 200
<mask> errcheck: <mask> # [deprecated] comma-separated list of pairs of the form pkg:regex <mask> # the regex is used to ignore names within pkg. (default "fmt:.*"). <mask> # see https://github.com/kisielk/errcheck#the-deprecated-method for details <mask> ignore: fmt:.*,net:SetReadDeadline,net/ht...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.golangci.yml
'linters': 'enable': - 'bodyclose' - 'deadcode' - 'depguard' - 'dupl' - 'errcheck' - 'gocyclo' - 'goimports' - 'golint' - 'gosec' - 'govet' - 'ineffassign' - 'misspell' - 'staticcheck' - 'stylecheck' - 'unconvert' - 'unused' - 'varcheck' 'disable-all': true 'fast': true
<mask> min-complexity: 20 <mask> lll: <mask> line-length: 200 <mask> <mask> linters: <mask> enable: <mask> - deadcode <mask> - errcheck <mask> - govet <mask> - ineffassign <mask> - staticcheck <mask> - unused <mask> - varcheck <mask> - bodyclose <mask> - d...
[ "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", "ke...
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.golangci.yml
'issues':
<mask> - unconvert <mask> disable-all: true <mask> fast: true <mask> <mask> issues: <mask> # List of regexps of issue texts to exclude, empty list by default. <mask> # But independently from this option we use default exclude patterns, <mask> # it can be disabled by `exclude-use-default: false`. ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.golangci.yml
'exclude': # structcheck cannot detect usages while they're there - '.parentalServer. is unused' - '.safeBrowsingServer. is unused' # errcheck - 'Error return value of .s.closeConn. is not checked' - 'Error return value of ..*.Shutdown.' # goconst - 'string .forcesafesearch.google.com. has 3 occurrenc...
<mask> # List of regexps of issue texts to exclude, empty list by default. <mask> # But independently from this option we use default exclude patterns, <mask> # it can be disabled by `exclude-use-default: false`. To list all <mask> # excluded by default patterns execute `golangci-lint run --help` <mask> ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.golangci.yml
'project_name': 'AdGuardHome'
<mask> project_name: AdGuardHome <mask> <mask> env: <mask> - GO111MODULE=on <mask> - GOPROXY=https://goproxy.io <mask> </s> Pull request: all: reformat yaml, add yaml formatting standard Merge in DNS/adguard-home from 2297-yaml to master Closes #2297. Squashed commit of the following: commit 85df3a38a1...
[ "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.goreleaser.yml
'env': - 'GO111MODULE=on' - 'GOPROXY=https://goproxy.io'
<mask> project_name: AdGuardHome <mask> <mask> env: <mask> - GO111MODULE=on <mask> - GOPROXY=https://goproxy.io <mask> <mask> before: <mask> hooks: <mask> - go mod download <mask> - go generate ./... </s> Pull request: all: reformat yaml, add yaml formatting standard Merge in DNS/adguard-hom...
[ "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.goreleaser.yml
'before': 'hooks': - 'go mod download' - 'go generate ./...'
<mask> env: <mask> - GO111MODULE=on <mask> - GOPROXY=https://goproxy.io <mask> <mask> before: <mask> hooks: <mask> - go mod download <mask> - go generate ./... <mask> <mask> builds: <mask> - main: ./main.go <mask> ldflags: <mask> - -s -w -X main.version={{.Version}} -X main.chan...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.goreleaser.yml
'builds': - 'main': './main.go' 'ldflags': - '-s -w -X main.version={{.Version}} -X main.channel={{.Env.CHANNEL}} -X main.goarm={{.Env.GOARM}}' 'env': - 'CGO_ENABLED=0' 'goos': - 'darwin' - 'linux' - 'freebsd' - 'windows' 'goarch': - '386' - 'amd64' - 'arm' - 'arm64' - 'mips' - 'mipsle' ...
<mask> hooks: <mask> - go mod download <mask> - go generate ./... <mask> <mask> builds: <mask> - main: ./main.go <mask> ldflags: <mask> - -s -w -X main.version={{.Version}} -X main.channel={{.Env.CHANNEL}} -X main.goarm={{.Env.GOARM}} <mask> env: <mask> - CGO_ENABLED=0 <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/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.goreleaser.yml
'archives': - # Archive name template. # Defaults: # - if format is `tar.gz`, `tar.xz`, `gz` or `zip`: # - `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}` # - if format is `binary`: # - `{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{...
<mask> goarch: mips <mask> - goos: freebsd <mask> goarch: mipsle <mask> <mask> archives: <mask> - # Archive name template. <mask> # Defaults: <mask> # - if format is `tar.gz`, `tar.xz`, `gz` or `zip`: <mask> # - `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ i...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.goreleaser.yml
'snapcrafts': - 'name': 'adguard-home' 'base': 'core18' 'name_template': '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' 'summary': 'Network-wide ads & trackers blocking DNS server' 'description': | AdGuard Home is a network-wide software for blocking ads & tracking. After you set it u...
<mask> files: <mask> - LICENSE.txt <mask> - README.md <mask> <mask> snapcrafts: <mask> - name: adguard-home <mask> base: core18 <mask> name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' <mask> summary: Network-wide ads & trackers blocking DNS server ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.goreleaser.yml
It operates as a DNS server that re-routes tracking domains to a "black hole," thus preventing your devices from connecting to those servers. It's based on software we use for our public AdGuard DNS servers -- both share a lot of common code. 'grade': 'stable' 'confinement': 'strict' 'publish': fa...
<mask> AdGuard Home is a network-wide software for blocking ads & tracking. After <mask> you set it up, it'll cover ALL your home devices, and you don't need any <mask> client-side software for that. <mask> <mask> It operates as a DNS server that re-routes tracking domains to a "black hole...
[ "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/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.goreleaser.yml
'checksum': 'name_template': 'checksums.txt'
<mask> adguard-home-web: <mask> command: adguard-home-web.sh <mask> plugs: [ desktop ] <mask> <mask> checksum: <mask> name_template: 'checksums.txt' </s> Pull request: all: reformat yaml, add yaml formatting standard Merge in DNS/adguard-home from 2297-yaml to master Closes #2297. Squ...
[ "keep", "keep", "keep", "keep", "replace", "replace" ]
https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c
.goreleaser.yml
UseOwnBlockedServices bool // false: use global settings BlockedServices []string
<mask> SafeSearchEnabled bool <mask> SafeBrowsingEnabled bool <mask> ParentalEnabled bool <mask> } <mask> <mask> type clientJSON struct { <mask> IP string `json:"ip"` <mask> MAC string `json:"mac"` <mask> Name string `json:"name"` </s> + clients: ad...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04a477c14a1eeea6426c07d5ae0434afe0b6b398
home/clients.go
UseGlobalBlockedServices bool `json:"use_global_blocked_services"` BlockedServices []string `json:"blocked_services"`
<mask> ParentalEnabled bool `json:"parental_enabled"` <mask> SafeSearchEnabled bool `json:"safebrowsing_enabled"` <mask> SafeBrowsingEnabled bool `json:"safesearch_enabled"` <mask> } <mask> <mask> type clientSource uint <mask> <mask> const ( </s> + clients: add BlockedServices field
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04a477c14a1eeea6426c07d5ae0434afe0b6b398
home/clients.go
UseGlobalBlockedServices: !c.UseOwnBlockedServices, BlockedServices: c.BlockedServices,
<mask> FilteringEnabled: c.FilteringEnabled, <mask> ParentalEnabled: c.ParentalEnabled, <mask> SafeSearchEnabled: c.SafeSearchEnabled, <mask> SafeBrowsingEnabled: c.SafeBrowsingEnabled, <mask> } <mask> <mask> if len(c.MAC) != 0 { <mask> hwAddr, _ := net.ParseMAC(c.MAC) </s> + clien...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04a477c14a1eeea6426c07d5ae0434afe0b6b398
home/clients.go
UseOwnBlockedServices: !cj.UseGlobalBlockedServices, BlockedServices: cj.BlockedServices,
<mask> FilteringEnabled: cj.FilteringEnabled, <mask> ParentalEnabled: cj.ParentalEnabled, <mask> SafeSearchEnabled: cj.SafeSearchEnabled, <mask> SafeBrowsingEnabled: cj.SafeBrowsingEnabled, <mask> } <mask> return &c, nil <mask> } <mask> </s> + clients: add BlockedServices field
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04a477c14a1eeea6426c07d5ae0434afe0b6b398
home/clients.go
"net/netip"
<mask> "bytes" <mask> "fmt" <mask> "net" <mask> "sync" <mask> <mask> "github.com/AdguardTeam/golibs/errors" <mask> "golang.org/x/exp/slices" <mask> ) <mask> </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squashed commit of the following: commit d1c4493ee4e28d05670c20532ebae1aa809d18da Autho...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb.go
IP netip.Addr
<mask> // implementation of ARP is able to retrieve that. <mask> Name string <mask> <mask> // IP contains either IPv4 or IPv6. <mask> IP net.IP <mask> <mask> // MAC contains the hardware address. <mask> MAC net.HardwareAddr <mask> } <mask> </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb.go
IP: n.IP,
<mask> // Clone returns the deep copy of n. <mask> func (n Neighbor) Clone() (clone Neighbor) { <mask> return Neighbor{ <mask> Name: n.Name, <mask> IP: slices.Clone(n.IP), <mask> MAC: slices.Clone(n.MAC), <mask> } <mask> } <mask> <mask> // neighs is the helper type that stores neighbors to avoid c...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb.go
"net/netip"
<mask> "bufio" <mask> "net" <mask> "strings" <mask> "sync" <mask> <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/netutil" <mask> ) </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squashed commit of the following: commit d1c4493ee4e28d05670c20532ebae1aa809d18da...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_bsd.go
} else if ip, err := netip.ParseAddr(ipStr[1 : len(ipStr)-1]); err != nil { log.Debug("arpdb: parsing arp output: ip: %s", err)
<mask> n := Neighbor{} <mask> <mask> if ipStr := fields[1]; len(ipStr) < 2 { <mask> continue <mask> } else if ip := net.ParseIP(ipStr[1 : len(ipStr)-1]); ip == nil { <mask> continue <mask> } else { <mask> n.IP = ip <mask> } <mask> </s> Pull request: 5035-netip-arp-hosts Updates #5035. ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_bsd.go
mac, err := net.ParseMAC(hwStr) if err != nil { log.Debug("arpdb: parsing arp output: mac: %s", err)
<mask> n.IP = ip <mask> } <mask> <mask> hwStr := fields[3] <mask> if mac, err := net.ParseMAC(hwStr); err != nil { <mask> continue <mask> } else { <mask> n.MAC = mac <mask> } <mask> </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squashed commit of the following: commit d1c4493...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_bsd.go
err = netutil.ValidateDomainName(host) if err != nil { log.Debug("arpdb: parsing arp output: host: %s", err)
<mask> n.MAC = mac <mask> } <mask> <mask> host := fields[0] <mask> if err := netutil.ValidateDomainName(host); err != nil { <mask> log.Debug("parsing arp output: %s", err) <mask> } else { <mask> n.Name = host <mask> } <mask> <mask> ns = append(ns, n) </s> Pull request: 5035-netip-arp-...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_bsd.go
"net/netip"
<mask> import ( <mask> "net" <mask> ) <mask> <mask> const arpAOutput = ` <mask> invalid.mac (1.2.3.4) at 12:34:56:78:910 on el0 ifscope [ethernet] <mask> invalid.ip (1.2.3.4.5) at ab:cd:ef:ab:cd:12 on ek0 ifscope [ethernet] <mask> invalid.fmt 1 at 12:cd:ef:ab:cd:ef on er0 ifscope [ethernet] </s> Pull reques...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_bsd_test.go
IP: netip.MustParseAddr("192.168.1.2"),
<mask> ` <mask> <mask> var wantNeighs = []Neighbor{{ <mask> Name: "hostname.one", <mask> IP: net.IPv4(192, 168, 1, 2), <mask> MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF}, <mask> }, { <mask> Name: "hostname.two", <mask> IP: net.ParseIP("::ffff:ffff"), <mask> MAC: net.HardwareAddr{0xE...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_bsd_test.go
IP: netip.MustParseAddr("::ffff:ffff"),
<mask> IP: net.IPv4(192, 168, 1, 2), <mask> MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF}, <mask> }, { <mask> Name: "hostname.two", <mask> IP: net.ParseIP("::ffff:ffff"), <mask> MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB}, <mask> }, { <mask> Name: "", <mask> IP: net.Par...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_bsd_test.go
IP: netip.MustParseAddr("::1234"),
<mask> IP: net.ParseIP("::ffff:ffff"), <mask> MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB}, <mask> }, { <mask> Name: "", <mask> IP: net.ParseIP("::1234"), <mask> MAC: net.HardwareAddr{0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF}, <mask> }} </s> Pull request: 5035-netip-arp-hosts Updates #5035. ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_bsd_test.go
"net/netip"
<mask> "io/fs" <mask> "net" <mask> "strings" <mask> "sync" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/netutil" </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squashed commit of the followin...
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_linux.go
n.IP, err = netip.ParseAddr(fields[0]) if err != nil || n.IP.IsUnspecified() {
<mask> continue <mask> } <mask> <mask> n := Neighbor{} <mask> if n.IP = net.ParseIP(fields[0]); n.IP == nil || n.IP.IsUnspecified() { <mask> continue <mask> } else if n.MAC, err = net.ParseMAC(fields[3]); err != nil { <mask> continue <mask> } <mask> </s> Pull request: 5035-netip-arp-host...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_linux.go
ip, err := netip.ParseAddr(fields[0]) if err != nil || n.IP.IsUnspecified() { log.Debug("arpdb: parsing arp output: ip: %s", err)
<mask> } <mask> <mask> n := Neighbor{} <mask> <mask> if ip := net.ParseIP(fields[0]); ip == nil || n.IP.IsUnspecified() { <mask> continue <mask> } else { <mask> n.IP = ip <mask> } <mask> </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squashed commit of the following: commit d1c4...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_linux.go
mac, err := net.ParseMAC(hwStr) if err != nil { log.Debug("arpdb: parsing arp output: mac: %s", err)
<mask> n.IP = ip <mask> } <mask> <mask> hwStr := fields[3] <mask> if mac, err := net.ParseMAC(hwStr); err != nil { <mask> log.Debug("parsing arp output: %s", err) <mask> <mask> continue <mask> } else { <mask> n.MAC = mac <mask> } </s> Pull request: 5035-netip-arp-hosts Updates #5035...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_linux.go
} else if ip, err := netip.ParseAddr(ipStr[1 : len(ipStr)-1]); err != nil { log.Debug("arpdb: parsing arp output: ip: %s", err)
<mask> n := Neighbor{} <mask> <mask> if ipStr := fields[1]; len(ipStr) < 2 { <mask> continue <mask> } else if ip := net.ParseIP(ipStr[1 : len(ipStr)-1]); ip == nil { <mask> continue <mask> } else { <mask> n.IP = ip <mask> } <mask> </s> Pull request: 5035-netip-arp-hosts Updates #5035. ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_linux.go
log.Debug("arpdb: parsing arp output: mac: %s", err)
<mask> } <mask> <mask> hwStr := fields[3] <mask> if mac, err := net.ParseMAC(hwStr); err != nil { <mask> log.Debug("parsing arp output: %s", err) <mask> <mask> continue <mask> } else { <mask> n.MAC = mac <mask> } </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squashed commit of...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_linux.go
log.Debug("arpdb: parsing arp output: host: %s", verr)
<mask> } <mask> <mask> host := fields[0] <mask> if verr := netutil.ValidateDomainName(host); verr != nil { <mask> log.Debug("parsing arp output: %s", verr) <mask> } else { <mask> n.Name = host <mask> } <mask> <mask> ns = append(ns, n) </s> Pull request: 5035-netip-arp-hosts Updates #5035...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_linux.go
ip, err := netip.ParseAddr(fields[0]) if err != nil { log.Debug("arpdb: parsing arp output: ip: %s", err)
<mask> } <mask> <mask> n := Neighbor{} <mask> <mask> if ip := net.ParseIP(fields[0]); ip == nil { <mask> continue <mask> } else { <mask> n.IP = ip <mask> } <mask> </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squashed commit of the following: commit d1c4493ee4e28d05670c20532eba...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_linux.go
mac, err := net.ParseMAC(fields[4]) if err != nil { log.Debug("arpdb: parsing arp output: mac: %s", err)
<mask> } else { <mask> n.IP = ip <mask> } <mask> <mask> if mac, err := net.ParseMAC(fields[4]); err != nil { <mask> log.Debug("parsing arp output: %s", err) <mask> <mask> continue <mask> } else { <mask> n.MAC = mac <mask> } </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_linux.go
"net/netip"
<mask> <mask> import ( <mask> "net" <mask> "sync" <mask> "testing" <mask> "testing/fstest" <mask> </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squashed commit of the following: commit d1c4493ee4e28d05670c20532ebae1aa809d18da Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Oct 25 14:...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_linux_test.go
IP: netip.MustParseAddr("192.168.1.2"),
<mask> 192.168.1.2 dev enp0s3 lladdr ab:cd:ef:ab:cd:ef DELAY <mask> ::ffff:ffff dev enp0s3 lladdr ef:cd:ab:ef:cd:ab router STALE` <mask> <mask> var wantNeighs = []Neighbor{{ <mask> IP: net.IPv4(192, 168, 1, 2), <mask> MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF}, <mask> }, { <mask> IP: net.Pa...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_linux_test.go
IP: netip.MustParseAddr("::ffff:ffff"),
<mask> var wantNeighs = []Neighbor{{ <mask> IP: net.IPv4(192, 168, 1, 2), <mask> MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF}, <mask> }, { <mask> IP: net.ParseIP("::ffff:ffff"), <mask> MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB}, <mask> }} <mask> <mask> func TestFSysARPDB(t *t...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_linux_test.go
"net/netip"
<mask> import ( <mask> "bufio" <mask> "net" <mask> "strings" <mask> "sync" <mask> <mask> "github.com/AdguardTeam/golibs/log" <mask> ) </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squashed commit of the following: commit d1c4493ee4e28d05670c20532ebae1aa809d18da Author: Ainar Garipov <A.Garipo...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_openbsd.go
ip, err := netip.ParseAddr(fields[0]) if err != nil { log.Debug("arpdb: parsing arp output: ip: %s", err)
<mask> } <mask> <mask> n := Neighbor{} <mask> <mask> if ip := net.ParseIP(fields[0]); ip == nil { <mask> continue <mask> } else { <mask> n.IP = ip <mask> } <mask> </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squashed commit of the following: commit d1c4493ee4e28d05670c20532eba...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_openbsd.go
mac, err := net.ParseMAC(fields[1]) if err != nil { log.Debug("arpdb: parsing arp output: mac: %s", err)
<mask> } else { <mask> n.IP = ip <mask> } <mask> <mask> if mac, err := net.ParseMAC(fields[1]); err != nil { <mask> log.Debug("parsing arp output: %s", err) <mask> <mask> continue <mask> } else { <mask> n.MAC = mac <mask> } </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squ...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_openbsd.go
"net/netip"
<mask> <mask> import ( <mask> "net" <mask> ) <mask> <mask> const arpAOutput = ` <mask> Host Ethernet Address Netif Expire Flags <mask> 1.2.3.4.5 aa:bb:cc:dd:ee:ff em0 permanent <mask> 1.2.3.4 12:34:56:78:910 em0 permanent </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squas...
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_openbsd_test.go
IP: netip.MustParseAddr("192.168.1.2"),
<mask> ::ffff:ffff ef:cd:ab:ef:cd:ab em0 permanent l <mask> ` <mask> <mask> var wantNeighs = []Neighbor{{ <mask> IP: net.IPv4(192, 168, 1, 2), <mask> MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF}, <mask> }, { <mask> IP: net.ParseIP("::ffff:ffff"), <mask> MAC: net.HardwareAddr{0xEF, 0xCD, 0...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_openbsd_test.go
IP: netip.MustParseAddr("::ffff:ffff"),
<mask> var wantNeighs = []Neighbor{{ <mask> IP: net.IPv4(192, 168, 1, 2), <mask> MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF}, <mask> }, { <mask> IP: net.ParseIP("::ffff:ffff"), <mask> MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB}, <mask> }} </s> Pull request: 5035-netip-arp-hosts...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_openbsd_test.go
"net/netip"
<mask> package aghnet <mask> <mask> import ( <mask> "net" <mask> "sync" <mask> "testing" <mask> <mask> "github.com/AdguardTeam/golibs/errors" <mask> "github.com/AdguardTeam/golibs/testutil" <mask> "github.com/stretchr/testify/assert" </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squashed c...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_test.go
knownIP := netip.MustParseAddr("1.2.3.4")
<mask> return arp.OnNeighbors() <mask> } <mask> <mask> func TestARPDBS(t *testing.T) { <mask> knownIP := net.IP{1, 2, 3, 4} <mask> knownMAC := net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF} <mask> <mask> succRefrCount, failRefrCount := 0, 0 <mask> clnp := func() { <mask> succRefrCount, failRefr...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_test.go
"net/netip"
<mask> <mask> import ( <mask> "bufio" <mask> "net" <mask> "strings" <mask> "sync" <mask> ) <mask> </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squashed commit of the following: commit d1c4493ee4e28d05670c20532ebae1aa809d18da Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Oct 25 14...
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_windows.go
ip, err := netip.ParseAddr(fields[0]) if err != nil {
<mask> } <mask> <mask> n := Neighbor{} <mask> <mask> if ip := net.ParseIP(fields[0]); ip == nil { <mask> continue <mask> } else { <mask> n.IP = ip <mask> } <mask> </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squashed commit of the following: commit d1c4493ee4e28d05670c20532eba...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_windows.go
mac, err := net.ParseMAC(fields[1]) if err != nil {
<mask> } else { <mask> n.IP = ip <mask> } <mask> <mask> if mac, err := net.ParseMAC(fields[1]); err != nil { <mask> continue <mask> } else { <mask> n.MAC = mac <mask> } <mask> </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squashed commit of the following: commit d1c4493ee4e28...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_windows.go
"net/netip"
<mask> import ( <mask> "net" <mask> ) <mask> <mask> const arpAOutput = ` <mask> </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squashed commit of the following: commit d1c4493ee4e28d05670c20532ebae1aa809d18da Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Tue Oct 25 14:26:52 2022 +0300 ...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_windows_test.go
IP: netip.MustParseAddr("192.168.1.2"),
<mask> 192.168.1.2 ab-cd-ef-ab-cd-ef dynamic <mask> ::ffff:ffff ef-cd-ab-ef-cd-ab static` <mask> <mask> var wantNeighs = []Neighbor{{ <mask> IP: net.IPv4(192, 168, 1, 2), <mask> MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF}, <mask> }, { <mask> IP: net.ParseIP(":...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_windows_test.go
IP: netip.MustParseAddr("::ffff:ffff"),
<mask> var wantNeighs = []Neighbor{{ <mask> IP: net.IPv4(192, 168, 1, 2), <mask> MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF}, <mask> }, { <mask> IP: net.ParseIP("::ffff:ffff"), <mask> MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB}, <mask> }} </s> Pull request: 5035-netip-arp-hosts...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/arpdb_windows_test.go
"net/netip"
<mask> "bufio" <mask> "fmt" <mask> "io" <mask> "io/fs" <mask> "net" <mask> "path" <mask> "strings" <mask> "sync" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos" </s> Pull request: 5035-netip-arp-hosts Updates #5035. Squashed commit of the following: commit d1c4493ee4e28d05670c2...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/hostscontainer.go
"golang.org/x/exp/maps"
<mask> "github.com/AdguardTeam/urlfilter/rules" <mask> "github.com/miekg/dns" <mask> ) <mask> <mask> // DefaultHostsPaths returns the slice of paths default for the operating system <mask> // to files and directories which are containing the hosts database. The result </s> Pull request: 5035-netip-arp-hosts ...
[ "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/hostscontainer.go
<mask> "github.com/AdguardTeam/urlfilter/rules" <mask> "github.com/miekg/dns" <mask> ) <mask> <mask> //lint:file-ignore SA1019 TODO(a.garipov): Replace [*netutil.IPMap]. <mask> <mask> // DefaultHostsPaths returns the slice of paths default for the operating system <mask> // to files and directories which a...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/hostscontainer.go
updates chan HostsRecords
<mask> // done is the channel to sign closing the container. <mask> done chan struct{} <mask> <mask> // updates is the channel for receiving updated hosts. <mask> // <mask> // TODO(e.burkov): Use map[netip.Addr]struct{} instead. <mask> updates chan *netutil.IPMap <mask> <mask> // last is the set of h...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/hostscontainer.go
last HostsRecords
<mask> // TODO(e.burkov): Use map[netip.Addr]struct{} instead. <mask> updates chan *netutil.IPMap <mask> <mask> // last is the set of hosts that was cached within last detected change. <mask> // <mask> // TODO(e.burkov): Use map[netip.Addr]struct{} instead. <mask> last *netutil.IPMap <mask> <mask> /...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/hostscontainer.go
updates: make(chan HostsRecords, 1),
<mask> stateLock: &sync.RWMutex{}, <mask> }, <mask> listID: listID, <mask> done: make(chan struct{}, 1), <mask> updates: make(chan *netutil.IPMap, 1), <mask> fsys: fsys, <mask> w: w, <mask> patterns: patterns, <mask> } <mask> </s> Pull request: 5035-netip-arp-hosts Updat...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/hostscontainer.go
// Upd returns the channel into which the updates are sent. func (hc *HostsContainer) Upd() (updates <-chan HostsRecords) {
<mask> <mask> return nil <mask> } <mask> <mask> // Upd returns the channel into which the updates are sent. The receivable <mask> // map's values are guaranteed to be of type of *HostsRecord. <mask> func (hc *HostsContainer) Upd() (updates <-chan *netutil.IPMap) { <mask> return hc.updates <mask> } <mask>...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/hostscontainer.go
table HostsRecords
<mask> translations map[string]string <mask> <mask> // table stores only the unique IP-hostname pairs. It's also sent to the <mask> // updates channel afterwards. <mask> table *netutil.IPMap <mask> } <mask> <mask> // newHostsParser creates a new *hostsParser with buffers of size taken from the <mask> //...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/hostscontainer.go
table: make(HostsRecords, len(hc.last)),
<mask> func (hc *HostsContainer) newHostsParser() (hp *hostsParser) { <mask> return &hostsParser{ <mask> rulesBuilder: &strings.Builder{}, <mask> translations: map[string]string{}, <mask> table: netutil.NewIPMap(hc.last.Len()), <mask> } <mask> } <mask> <mask> // parseFile is a aghos.FileWalker ...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/hostscontainer.go
if ip == (netip.Addr{}) || len(hosts) == 0 {
<mask> func (hp *hostsParser) parseFile(r io.Reader) (patterns []string, cont bool, err error) { <mask> s := bufio.NewScanner(r) <mask> for s.Scan() { <mask> ip, hosts := hp.parseLine(s.Text()) <mask> if ip == nil || len(hosts) == 0 { <mask> continue <mask> } <mask> <mask> hp.addRecord(ip, hosts)...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/hostscontainer.go
func (hp *hostsParser) parseLine(line string) (ip netip.Addr, hosts []string) {
<mask> return nil, true, s.Err() <mask> } <mask> <mask> // parseLine parses the line having the hosts syntax ignoring invalid ones. <mask> func (hp *hostsParser) parseLine(line string) (ip net.IP, hosts []string) { <mask> fields := strings.Fields(line) <mask> if len(fields) < 2 { <mask> return nil, nil <...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/hostscontainer.go
return netip.Addr{}, nil
<mask> // parseLine parses the line having the hosts syntax ignoring invalid ones. <mask> func (hp *hostsParser) parseLine(line string) (ip net.IP, hosts []string) { <mask> fields := strings.Fields(line) <mask> if len(fields) < 2 { <mask> return nil, nil <mask> } <mask> <mask> if ip = net.ParseIP(fields[...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/hostscontainer.go
ip, err := netip.ParseAddr(fields[0]) if err != nil { return netip.Addr{}, nil
<mask> if len(fields) < 2 { <mask> return nil, nil <mask> } <mask> <mask> if ip = net.ParseIP(fields[0]); ip == nil { <mask> return nil, nil <mask> } <mask> <mask> for _, f := range fields[1:] { <mask> hashIdx := strings.IndexByte(f, '#') <mask> if hashIdx == 0 { </s> Pull request: 5035-netip...
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/hostscontainer.go
err = netutil.ValidateDomainName(f)
<mask> // <mask> // See https://github.com/AdguardTeam/AdGuardHome/issues/3946. <mask> // <mask> // TODO(e.burkov): Investigate if hosts may contain DNS-SD domains. <mask> err := netutil.ValidateDomainName(f) <mask> if err != nil { <mask> log.Error("%s: host %q is invalid, ignoring", hostsContain...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/hostscontainer.go
<mask> <mask> return ip, hosts <mask> } <mask> <mask> // HostsRecord represents a single hosts file record. <mask> type HostsRecord struct { <mask> Aliases *stringutil.Set <mask> Canonical string <mask> } <mask> <mask> // Equal returns true if all fields of rec are equal to field in other or they <m...
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/hostscontainer.go
func (hp *hostsParser) addRecord(ip netip.Addr, hosts []string) {
<mask> <mask> // addRecord puts the record for the IP address to the rules builder if needed. <mask> // The first host is considered to be the canonical name for the IP address. <mask> // hosts must have at least one name. <mask> func (hp *hostsParser) addRecord(ip net.IP, hosts []string) { <mask> line := strin...
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca
internal/aghnet/hostscontainer.go