code_before stringlengths 16 1.81M | edits stringlengths 4 328k | next_edit stringlengths 0 76.5k | code_after stringlengths 3 49.9M | label_window listlengths 4 1.81k | instruction stringlengths 20 51.9k | html_url stringlengths 74 116 | file_name stringlengths 3 311 |
|---|---|---|---|---|---|---|---|
break
}
log.Debug("updater: created directory %q", outputName)
continue
} else if header.Typeflag != tar.TypeReg {
log.Debug("updater: %s: unknown file type %d, skipping", inputNameOnly, header.Typeflag)
continue
| </s> remove continue
} else if header.Typeflag != tar.TypeReg {
log.Debug("updater: %s: unknown file type %d, skipping", inputNameOnly, header.Typeflag)
continue
</s> add outputName := filepath.Join(outDir, name)
if fi.IsDir() {
if name == "AdGuardHome" {
// Top-level AdGuardHome/. Skip it.
//
... | fi := zf.FileInfo()
name = fi.Name()
if name == "" {
return "", nil
} |
break
}
fi := zf.FileInfo()
name = fi.Name()
if name == "" {
return "", nil
}
continue
} else if header.Typeflag != tar.TypeReg {
log.Debug("updater: %s: unknown file type %d, skipping", inputNameOnly, header.Typeflag)
continue | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: replace agherr with golibs' errors
Merge in DNS/adguard-home from golibs-errors to master
Squashed commit of the following:
commit 5aba278a31c5a213bd9e08273ce7277c57713b22
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9... | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
}
log.Debug("updater: created directory %q", outputName)
continue
} else if header.Typeflag != tar.TypeReg {
log.Debug("updater: %s: unknown file type %d, skipping", inputNameOnly, header.Typeflag)
continue
}
var f io.WriteCloser
f, err = os.OpenFile(outputName, os.O_WR... | </s> remove log.Debug("updater: created directory %q", outputName)
</s> add fi := zf.FileInfo()
name = fi.Name()
if name == "" {
return "", nil
} </s> remove var f io.WriteCloser
f, err = os.OpenFile(outputName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, os.FileMode(header.Mode&0o777))
if err != nil {
err2 ... | 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 | }
log.Debug("updater: created directory %q", outputName)
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
outputName := filepath.... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: replace agherr with golibs' errors
Merge in DNS/adguard-home from golibs-errors to master
Squashed commit of the following:
commit 5aba278a31c5a213bd9e08273ce7277c57713b22
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9... | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
log.Debug("updater: %s: unknown file type %d, skipping", inputNameOnly, header.Typeflag)
continue
}
var f io.WriteCloser
f, err = os.OpenFile(outputName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, os.FileMode(header.Mode&0o777))
if err != nil {
err2 = fmt.Errorf("os.OpenFile(%s): %w", outputN... | </s> remove err = f.Close()
if err != nil {
err2 = fmt.Errorf("f.Close(): %w", err)
break
}
log.Tracef("created file %s", outputName)
files = append(files, inputNameOnly)
</s> add </s> remove fi := zf.FileInfo()
inputNameOnly := fi.Name()
if inputNameOnly == "" {
continue
}
outputName :... | err = os.Mkdir(outputName, fi.Mode())
if err != nil && !errors.Is(err, os.ErrExist) {
return "", fmt.Errorf("os.Mkdir(%q): %w", outputName, err) | log.Debug("updater: %s: unknown file type %d, skipping", inputNameOnly, header.Typeflag)
continue
}
err = os.Mkdir(outputName, fi.Mode())
if err != nil && !errors.Is(err, os.ErrExist) {
return "", fmt.Errorf("os.Mkdir(%q): %w", outputName, err)
err = os.Mkdir(outputName, fi.Mode())
if err !=... | [
"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"
] | Pull request: replace agherr with golibs' errors
Merge in DNS/adguard-home from golibs-errors to master
Squashed commit of the following:
commit 5aba278a31c5a213bd9e08273ce7277c57713b22
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9... | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
err2 = fmt.Errorf("f.Close(): %w", err)
break
}
log.Debug("updater: created file %s", outputName)
files = append(files, header.Name)
}
_ = gzReader.Close()
return files, err2
}
| </s> remove err = f.Close()
if err != nil {
err2 = fmt.Errorf("f.Close(): %w", err)
break
}
log.Tracef("created file %s", outputName)
files = append(files, inputNameOnly)
</s> add </s> remove var f io.WriteCloser
f, err = os.OpenFile(outputName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, os.FileMode(hea... | log.Tracef("created directory %q", outputName)
return "", nil | err2 = fmt.Errorf("f.Close(): %w", err)
break
}
log.Tracef("created directory %q", outputName)
return "", nil
log.Tracef("created directory %q", outputName)
return "", nil
}
_ = gzReader.Close()
return files, err2
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: replace agherr with golibs' errors
Merge in DNS/adguard-home from golibs-errors to master
Squashed commit of the following:
commit 5aba278a31c5a213bd9e08273ce7277c57713b22
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9... | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
log.Debug("updater: created file %s", outputName)
files = append(files, header.Name)
}
_ = gzReader.Close()
return files, err2
}
// Unpack all files from .zip file to the specified directory
// Existing files are overwritten
// All files are created inside 'outdir', subdirectories are not... | </s> remove // All files are created inside 'outdir', subdirectories are not created
</s> add // All files are created inside 'outDir', subdirectories are not created </s> remove // All files are created inside 'outdir', subdirectories are not created
</s> add // All files are created inside outDir, subdirectories ar... | 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... | log.Debug("updater: created file %s", outputName)
files = append(files, header.Name)
}
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(er... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: replace agherr with golibs' errors
Merge in DNS/adguard-home from golibs-errors to master
Squashed commit of the following:
commit 5aba278a31c5a213bd9e08273ce7277c57713b22
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9... | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
}
// Unpack all files from .zip file to the specified directory
// Existing files are overwritten
// All files are created inside 'outdir', subdirectories are not created
// Return the list of files (not directories) written
func zipFileUnpack(zipfile, outdir string) ([]string, error) {
r, err := zip.... | </s> remove func zipFileUnpack(zipfile, outdir string) ([]string, error) {
r, err := zip.OpenReader(zipfile)
</s> add func zipFileUnpack(zipfile, outDir string) (files []string, err error) {
zrc, err := zip.OpenReader(zipfile) </s> remove // All files are created inside 'outdir', subdirectories are not created
</s>... | // All files are created inside 'outDir', subdirectories are not created | }
// Unpack all files from .zip file to the specified directory
// Existing files are overwritten
// All files are created inside 'outDir', subdirectories are not created
// Return the list of files (not directories) written
func zipFileUnpack(zipfile, outdir string) ([]string, error) {
r, err := zip.Op... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: replace agherr with golibs' errors
Merge in DNS/adguard-home from golibs-errors to master
Squashed commit of the following:
commit 5aba278a31c5a213bd9e08273ce7277c57713b22
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9... | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
// Unpack all files from .zip file to the specified directory
// Existing files are overwritten
// All files are created inside 'outdir', subdirectories are not created
// Return the list of files (not directories) written
func zipFileUnpack(zipfile, outdir string) ([]string, error) {
r, err := zip.OpenRea... | </s> remove // All files are created inside 'outdir', subdirectories are not created
</s> add // All files are created inside 'outDir', subdirectories are not created </s> remove // All files are created inside 'outdir', subdirectories are not created
</s> add // All files are created inside outDir, subdirectories ar... | func zipFileUnpack(zipfile, outDir string) (files []string, err error) {
zrc, err := zip.OpenReader(zipfile) | // Unpack all files from .zip file to the specified directory
// Existing files are overwritten
// All files are created inside 'outdir', subdirectories are not created
// Return the list of files (not directories) written
func zipFileUnpack(zipfile, outDir string) (files []string, err error) {
zrc, err := zip... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: replace agherr with golibs' errors
Merge in DNS/adguard-home from golibs-errors to master
Squashed commit of the following:
commit 5aba278a31c5a213bd9e08273ce7277c57713b22
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9... | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
r, err := zip.OpenReader(zipfile)
if err != nil {
return nil, fmt.Errorf("zip.OpenReader(): %w", err)
}
defer r.Close()
var files []string
var err2 error
var zr io.ReadCloser
for _, zf := range r.File {
| </s> remove var files []string
var err2 error
var zr io.ReadCloser
for _, zf := range r.File {
zr, err = zf.Open()
</s> add for _, zf := range zrc.File {
var name string
name, err = zipFileUnpackOne(outDir, zf) </s> remove err2 = fmt.Errorf("zip file Open(): %w", err)
</s> add </s> remove var files []... | defer func() { err = errors.WithDeferred(err, zrc.Close()) }() | r, err := zip.OpenReader(zipfile)
if err != nil {
return nil, fmt.Errorf("zip.OpenReader(): %w", err)
}
defer func() { err = errors.WithDeferred(err, zrc.Close()) }()
var files []string
var err2 error
var zr io.ReadCloser
for _, zf := range r.File { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: replace agherr with golibs' errors
Merge in DNS/adguard-home from golibs-errors to master
Squashed commit of the following:
commit 5aba278a31c5a213bd9e08273ce7277c57713b22
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9... | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
return nil, fmt.Errorf("zip.OpenReader(): %w", err)
}
defer r.Close()
var files []string
var err2 error
var zr io.ReadCloser
for _, zf := range r.File {
zr, err = zf.Open()
if err != nil {
err2 = fmt.Errorf("zip file Open(): %w", err)
break
}
| </s> remove err2 = fmt.Errorf("zip file Open(): %w", err)
</s> add </s> remove defer r.Close()
</s> add defer func() { err = errors.WithDeferred(err, zrc.Close()) }() </s> remove var header *tar.Header
header, err = tarReader.Next()
if err == io.EOF {
err2 = nil
break
}
if err != nil {
err2 =... | for _, zf := range zrc.File {
var name string
name, err = zipFileUnpackOne(outDir, zf) | return nil, fmt.Errorf("zip.OpenReader(): %w", err)
}
defer r.Close()
for _, zf := range zrc.File {
var name string
name, err = zipFileUnpackOne(outDir, zf)
for _, zf := range zrc.File {
var name string
name, err = zipFileUnpackOne(outDir, zf)
for _, zf := range zrc.File {
var name string
na... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: replace agherr with golibs' errors
Merge in DNS/adguard-home from golibs-errors to master
Squashed commit of the following:
commit 5aba278a31c5a213bd9e08273ce7277c57713b22
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9... | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
var zr io.ReadCloser
for _, zf := range r.File {
zr, err = zf.Open()
if err != nil {
err2 = fmt.Errorf("zip file Open(): %w", err)
break
}
fi := zf.FileInfo()
inputNameOnly := fi.Name()
| </s> remove var files []string
var err2 error
var zr io.ReadCloser
for _, zf := range r.File {
zr, err = zf.Open()
</s> add for _, zf := range zrc.File {
var name string
name, err = zipFileUnpackOne(outDir, zf) </s> remove defer r.Close()
</s> add defer func() { err = errors.WithDeferred(err, zrc.Close()... | var zr io.ReadCloser
for _, zf := range r.File {
zr, err = zf.Open()
if err != nil {
break
}
fi := zf.FileInfo()
inputNameOnly := fi.Name() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: replace agherr with golibs' errors
Merge in DNS/adguard-home from golibs-errors to master
Squashed commit of the following:
commit 5aba278a31c5a213bd9e08273ce7277c57713b22
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9... | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go | |
err2 = fmt.Errorf("zip file Open(): %w", err)
break
}
fi := zf.FileInfo()
inputNameOnly := fi.Name()
if inputNameOnly == "" {
continue
}
outputName := filepath.Join(outdir, inputNameOnly)
if fi.IsDir() {
if inputNameOnly == "AdGuardHome" {
// Top-level AdGu... | </s> remove var f io.WriteCloser
f, err = os.OpenFile(outputName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, os.FileMode(header.Mode&0o777))
if err != nil {
err2 = fmt.Errorf("os.OpenFile(%s): %w", outputName, err)
break
}
_, err = io.Copy(f, tarReader)
if err != nil {
_ = f.Close()
err2 = fmt.Errorf("... | if name != "" {
files = append(files, name) | err2 = fmt.Errorf("zip file Open(): %w", err)
break
}
if name != "" {
files = append(files, name)
if name != "" {
files = append(files, name)
if name != "" {
files = append(files, name)
if name != "" {
files = append(files, name)
if name != "" {
files = append(files, name)
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... | Pull request: replace agherr with golibs' errors
Merge in DNS/adguard-home from golibs-errors to master
Squashed commit of the following:
commit 5aba278a31c5a213bd9e08273ce7277c57713b22
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9... | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
_ = f.Close()
err2 = fmt.Errorf("io.Copy(): %w", err)
break
}
err = f.Close()
if err != nil {
err2 = fmt.Errorf("f.Close(): %w", err)
break
}
log.Tracef("created file %s", outputName)
files = append(files, inputNameOnly)
}
_ = zr.Close()
return files, err2... | </s> remove log.Debug("updater: created file %s", outputName)
files = append(files, header.Name)
</s> add log.Tracef("created directory %q", outputName)
return "", nil </s> remove _ = zr.Close()
return files, err2
</s> add return files, err </s> remove var f io.WriteCloser
f, err = os.OpenFile(outputN... | _ = f.Close()
err2 = fmt.Errorf("io.Copy(): %w", err)
break
}
}
_ = zr.Close()
return files, err2
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: replace agherr with golibs' errors
Merge in DNS/adguard-home from golibs-errors to master
Squashed commit of the following:
commit 5aba278a31c5a213bd9e08273ce7277c57713b22
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9... | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go | |
log.Tracef("created file %s", outputName)
files = append(files, inputNameOnly)
}
_ = zr.Close()
return files, err2
}
// Copy file on disk
func copyFile(src, dst string) error {
d, e := os.ReadFile(src)
| </s> remove err = f.Close()
if err != nil {
err2 = fmt.Errorf("f.Close(): %w", err)
break
}
log.Tracef("created file %s", outputName)
files = append(files, inputNameOnly)
</s> add </s> remove log.Debug("updater: created file %s", outputName)
files = append(files, header.Name)
</s> add log.Trac... | return files, err | log.Tracef("created file %s", outputName)
files = append(files, inputNameOnly)
}
return files, err
return files, err
}
// Copy file on disk
func copyFile(src, dst string) error {
d, e := os.ReadFile(src) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: replace agherr with golibs' errors
Merge in DNS/adguard-home from golibs-errors to master
Squashed commit of the following:
commit 5aba278a31c5a213bd9e08273ce7277c57713b22
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9... | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
log.Fatal(err)
}
URL := fmt.Sprintf("http://%s", address)
log.Println("Go to " + URL)
log.Fatal(http.ListenAndServe(address, nil))
}
| </s> remove // implement
</s> add | err = startDHCPServer()
if err != nil {
log.Fatal(err)
}
| log.Fatal(err)
}
err = startDHCPServer()
if err != nil {
log.Fatal(err)
}
URL := fmt.Sprintf("http://%s", address)
log.Println("Go to " + URL)
log.Fatal(http.ListenAndServe(address, nil))
}
| [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Start DHCP on launch if it's enabled in config. | https://github.com/AdguardTeam/AdGuardHome/commit/03effab345e2bc9e77926a64acd426f71b5004cd | app.go |
"net"
"net/http"
"github.com/AdguardTeam/AdGuardHome/dhcpd"
)
var dhcpServer = dhcpd.Server{}
| </s> remove // implement
</s> add | "github.com/joomcode/errorx" | "net"
"net/http"
"github.com/AdguardTeam/AdGuardHome/dhcpd"
"github.com/joomcode/errorx"
)
var dhcpServer = dhcpd.Server{}
| [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Start DHCP on launch if it's enabled in config. | https://github.com/AdguardTeam/AdGuardHome/commit/03effab345e2bc9e77926a64acd426f71b5004cd | dhcp.go |
return
}
}
// implement
func handleDHCPFindActiveServer(w http.ResponseWriter, r *http.Request) {
found, err := dhcpd.CheckIfOtherDHCPServersPresent(config.DHCP.InterfaceName)
result := map[string]interface{}{}
if err != nil {
result["error"] = err.Error()
| </s> | return
}
}
func handleDHCPFindActiveServer(w http.ResponseWriter, r *http.Request) {
found, err := dhcpd.CheckIfOtherDHCPServersPresent(config.DHCP.InterfaceName)
result := map[string]interface{}{}
if err != nil {
result["error"] = err.Error() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Start DHCP on launch if it's enabled in config. | https://github.com/AdguardTeam/AdGuardHome/commit/03effab345e2bc9e77926a64acd426f71b5004cd | dhcp.go | |
coverage:
status:
project:
default:
target: 40%
threshold: null
patch: false
changes: false
| </s> remove # Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
</s> add # Comment to post when closing a stale issue. Set to `false` to disable.
'closeComment': false </s> remove test:
runs-on: ${{ matrix.os }}
env:
GO111MODULE: on
GOPROXY: https://goproxy... | 'coverage':
'status':
'project':
'default':
'target': '40%'
'threshold': null
'patch': false
'changes': false | 'coverage':
'status':
'project':
'default':
'target': '40%'
'threshold': null
'patch': false
'changes': false
'coverage':
'status':
'project':
'default':
'target': '40%'
'threshold': null
'patch': false
'changes': false
'coverage':
'status':
... | [
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | 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'... | </s> remove # Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
</s> add # Comment to post when closing a stale issue. Set to `false` to disable.
'closeComment': false </s> remove exclude:
# structcheck cannot detect usages while they're there
- .parentalServer. is unu... | # 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... | # 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... | [
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .github/stale.yml |
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
| </s> remove # 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... | # Comment to post when closing a stale issue. Set to `false` to disable.
'closeComment': false | markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable.
'closeComment': false
# Comment to post when ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .github/stale.yml |
name: build
env:
GO_VERSION: 1.14
NODE_VERSION: 13
| </s> remove env:
GO_VERSION: 1.14
NODE_VERSION: 13
</s> add 'env':
'GO_VERSION': '1.14'
'NODE_VERSION': '13' </s> remove on:
push:
branches:
- '*'
tags:
- v*
pull_request:
</s> add 'on':
'push':
'branches':
- '*'
'tags':
- 'v*'
'pull_request': </s> remove -
... | 'name': 'build' | 'name': 'build'
env:
GO_VERSION: 1.14
NODE_VERSION: 13
| [
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .github/workflows/build.yml |
name: build
env:
GO_VERSION: 1.14
NODE_VERSION: 13
on:
push:
branches:
- '*'
| </s> remove on:
push:
branches:
- '*'
tags:
- v*
pull_request:
</s> add 'on':
'push':
'branches':
- '*'
'tags':
- 'v*'
'pull_request': </s> remove name: build
</s> add 'name': 'build' </s> remove name: golangci-lint
on:
push:
tags:
- v*
branches:
- '*'... | 'env':
'GO_VERSION': '1.14'
'NODE_VERSION': '13' | name: build
'env':
'GO_VERSION': '1.14'
'NODE_VERSION': '13'
'env':
'GO_VERSION': '1.14'
'NODE_VERSION': '13'
'env':
'GO_VERSION': '1.14'
'NODE_VERSION': '13'
on:
push:
branches:
- '*' | [
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .github/workflows/build.yml |
env:
GO_VERSION: 1.14
NODE_VERSION: 13
on:
push:
branches:
- '*'
tags:
- v*
pull_request:
jobs:
test:
runs-on: ${{ matrix.os }}
| </s> remove env:
GO_VERSION: 1.14
NODE_VERSION: 13
</s> add 'env':
'GO_VERSION': '1.14'
'NODE_VERSION': '13' </s> remove name: golangci-lint
on:
push:
tags:
- v*
branches:
- '*'
pull_request:
jobs:
golangci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
... | 'on':
'push':
'branches':
- '*'
'tags':
- 'v*'
'pull_request': | env:
GO_VERSION: 1.14
NODE_VERSION: 13
'on':
'push':
'branches':
- '*'
'tags':
- 'v*'
'pull_request':
'on':
'push':
'branches':
- '*'
'tags':
- 'v*'
'pull_request':
'on':
'push':
'branches':
- '*'
'tags':
- 'v*'
'pull_request':
'on':
'push':
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .github/workflows/build.yml |
tags:
- v*
pull_request:
jobs:
test:
runs-on: ${{ matrix.os }}
env:
GO111MODULE: on
| </s> remove on:
push:
branches:
- '*'
tags:
- v*
pull_request:
</s> add 'on':
'push':
'branches':
- '*'
'tags':
- 'v*'
'pull_request': </s> remove test:
runs-on: ${{ matrix.os }}
env:
GO111MODULE: on
GOPROXY: https://goproxy.io
strategy:
fail-... | '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'
... | tags:
- v*
pull_request:
'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... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .github/workflows/build.yml |
pull_request:
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:
... | </s> remove -
name: Set up Node
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
-
name: Set up Go modules cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum... | '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-... | pull_request:
jobs:
'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'
... | [
"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... | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .github/workflows/build.yml |
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
-
name: Set up Node
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
-
name: Set up Go modules cache
uses: actions/cac... | </s> remove 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
uses: actions/... | '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... | uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
'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_reque... | [
"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... | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | 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:
... | </s> remove -
name: Set up Node
uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
-
name: Set up Go modules cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum... | '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... | '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... | [
"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... | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .github/workflows/lint.yml |
# options for analysis running
run:
# default concurrency is a available CPU number
concurrency: 4
# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 2m
| </s> remove concurrency: 4
</s> add 'concurrency': 4 </s> remove deadline: 2m
</s> add 'deadline': '2m' </s> remove issues:
</s> add 'issues': </s> remove linters-settings:
errcheck:
</s> add 'linters-settings':
'errcheck': </s> remove exclude:
# structcheck cannot detect usages while they're ther... | 'run': | # options for analysis running
'run':
# default concurrency is a available CPU number
concurrency: 4
# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 2m | [
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
# options for analysis running
run:
# default concurrency is a available CPU number
concurrency: 4
# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 2m
# which files to skip: they will be analyzed, but issues from them
| </s> remove deadline: 2m
</s> add 'deadline': '2m' </s> remove run:
</s> add 'run': </s> remove skip-files:
- ".*generated.*"
- dnsfilter/rule_to_regexp.go
- util/pprof.go
- ".*_test.go"
- client/.*
- build/.*
- dist/.*
</s> add 'skip-files':
- '.*generated.*'
- 'dnsfilter/ru... | 'concurrency': 4 | # options for analysis running
run:
# default concurrency is a available CPU number
'concurrency': 4
# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 2m
# which files to skip: they will be analyzed, but issues from them | [
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
# default concurrency is a available CPU number
concurrency: 4
# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 2m
# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all aut... | </s> remove skip-files:
- ".*generated.*"
- dnsfilter/rule_to_regexp.go
- util/pprof.go
- ".*_test.go"
- client/.*
- build/.*
- dist/.*
</s> add 'skip-files':
- '.*generated.*'
- 'dnsfilter/rule_to_regexp.go'
- 'util/pprof.go'
- '.*_test.go'
- 'client/.*'
- 'build/.*'
- '... | 'deadline': '2m' | # default concurrency is a available CPU number
concurrency: 4
# timeout for analysis, e.g. 30s, 5m, default is 1m
'deadline': '2m'
# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all a... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
# which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
skip-files:
- ".*generated.*"
- ... | </s> remove deadline: 2m
</s> add 'deadline': '2m' </s> remove linters-settings:
errcheck:
</s> add 'linters-settings':
'errcheck': </s> remove concurrency: 4
</s> add 'concurrency': 4 </s> remove ignore: fmt:.*,net:SetReadDeadline,net/http:^Write
gocyclo:
min-complexity: 20
lll:
line-len... | 'skip-files':
- '.*generated.*'
- 'dnsfilter/rule_to_regexp.go'
- 'util/pprof.go'
- '.*_test.go'
- 'client/.*'
- 'build/.*'
- 'dist/.*' | # which files to skip: they will be analyzed, but issues from them
# won't be reported. Default value is empty list, but there is
# no need to include all autogenerated files, we confidently recognize
# autogenerated files. If it's not please let us know.
'skip-files':
- '.*generated.*'
- 'dnsfilt... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
- dist/.*
# all available settings of specific linters
linters-settings:
errcheck:
# [deprecated] comma-separated list of pairs of the form pkg:regex
# the regex is used to ignore names within pkg. (default "fmt:.*").
# see https://github.com/kisielk/errcheck#the-deprecated-method ... | </s> remove ignore: fmt:.*,net:SetReadDeadline,net/http:^Write
gocyclo:
min-complexity: 20
lll:
line-length: 200
</s> add 'ignore': 'fmt:.*,net:SetReadDeadline,net/http:^Write'
'gocyclo':
'min-complexity': 20
'lll':
'line-length': 200 </s> remove skip-files:
- ".*generated.*"
... | 'linters-settings':
'errcheck': | - dist/.*
# all available settings of specific linters
'linters-settings':
'errcheck':
'linters-settings':
'errcheck':
# [deprecated] comma-separated list of pairs of the form pkg:regex
# the regex is used to ignore names within pkg. (default "fmt:.*").
# see https://github.com/kisie... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
errcheck:
# [deprecated] comma-separated list of pairs of the form pkg:regex
# the regex is used to ignore names within pkg. (default "fmt:.*").
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
ignore: fmt:.*,net:SetReadDeadline,net/http:^Write
gocyclo:
m... | </s> remove linters-settings:
errcheck:
</s> add 'linters-settings':
'errcheck': </s> remove linters:
enable:
- deadcode
- errcheck
- govet
- ineffassign
- staticcheck
- unused
- varcheck
- bodyclose
- depguard
- dupl
- gocyclo
- goimports
- golint
- gosec
... | 'ignore': 'fmt:.*,net:SetReadDeadline,net/http:^Write'
'gocyclo':
'min-complexity': 20
'lll':
'line-length': 200 | errcheck:
# [deprecated] comma-separated list of pairs of the form pkg:regex
# the regex is used to ignore names within pkg. (default "fmt:.*").
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
'ignore': 'fmt:.*,net:SetReadDeadline,net/http:^Write'
'gocyclo':
'... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
min-complexity: 20
lll:
line-length: 200
linters:
enable:
- deadcode
- errcheck
- govet
- ineffassign
- staticcheck
- unused
- varcheck
- bodyclose
- depguard
- dupl
- gocyclo
- goimports
- golint
- gosec
... | </s> remove issues:
</s> add 'issues': </s> remove 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
... | 'linters':
'enable':
- 'bodyclose'
- 'deadcode'
- 'depguard'
- 'dupl'
- 'errcheck'
- 'gocyclo'
- 'goimports'
- 'golint'
- 'gosec'
- 'govet'
- 'ineffassign'
- 'misspell'
- 'staticcheck'
- 'stylecheck'
- 'unconvert'
- 'unused'
- 'varcheck'
'disable-all': true
'fast': true | min-complexity: 20
lll:
line-length: 200
'linters':
'enable':
- 'bodyclose'
- 'deadcode'
- 'depguard'
- 'dupl'
- 'errcheck'
- 'gocyclo'
- 'goimports'
- 'golint'
- 'gosec'
- 'govet'
- 'ineffassign'
- 'misspell'
- 'staticcheck'
- 'stylecheck'
- 'unconvert'
- 'unused'
... | [
"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... | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
- unconvert
disable-all: true
fast: true
issues:
# List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns e... | </s> remove linters:
enable:
- deadcode
- errcheck
- govet
- ineffassign
- staticcheck
- unused
- varcheck
- bodyclose
- depguard
- dupl
- gocyclo
- goimports
- golint
- gosec
- misspell
- stylecheck
- unconvert
disable-all: true
fast: true
</s>... | 'issues': | - unconvert
disable-all: true
fast: true
'issues':
# List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns e... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
# List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
exclude:
# structcheck c... | </s> remove issues:
</s> add 'issues': </s> remove linters:
enable:
- deadcode
- errcheck
- govet
- ineffassign
- staticcheck
- unused
- varcheck
- bodyclose
- depguard
- dupl
- gocyclo
- goimports
- golint
- gosec
- misspell
- stylecheck
- unconver... | '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... | # List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
'exclude':
# structcheck canno... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
project_name: AdGuardHome
env:
- GO111MODULE=on
- GOPROXY=https://goproxy.io
| </s> remove env:
- GO111MODULE=on
- GOPROXY=https://goproxy.io
</s> add 'env':
- 'GO111MODULE=on'
- 'GOPROXY=https://goproxy.io' </s> remove before:
hooks:
- go mod download
- go generate ./...
</s> add 'before':
'hooks':
- 'go mod download'
- 'go generate ./...' </s> remove It operates as a... | 'project_name': 'AdGuardHome' | 'project_name': 'AdGuardHome'
env:
- GO111MODULE=on
- GOPROXY=https://goproxy.io
| [
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .goreleaser.yml |
project_name: AdGuardHome
env:
- GO111MODULE=on
- GOPROXY=https://goproxy.io
before:
hooks:
- go mod download
- go generate ./...
| </s> remove before:
hooks:
- go mod download
- go generate ./...
</s> add 'before':
'hooks':
- 'go mod download'
- 'go generate ./...' </s> remove builds:
- main: ./main.go
ldflags:
- -s -w -X main.version={{.Version}} -X main.channel={{.Env.CHANNEL}} -X main.goarm={{.Env.GOARM}}
env:
... | 'env':
- 'GO111MODULE=on'
- 'GOPROXY=https://goproxy.io' | project_name: AdGuardHome
'env':
- 'GO111MODULE=on'
- 'GOPROXY=https://goproxy.io'
'env':
- 'GO111MODULE=on'
- 'GOPROXY=https://goproxy.io'
'env':
- 'GO111MODULE=on'
- 'GOPROXY=https://goproxy.io'
before:
hooks:
- go mod download
- go generate ./... | [
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .goreleaser.yml |
env:
- GO111MODULE=on
- GOPROXY=https://goproxy.io
before:
hooks:
- go mod download
- go generate ./...
builds:
- main: ./main.go
ldflags:
- -s -w -X main.version={{.Version}} -X main.channel={{.Env.CHANNEL}} -X main.goarm={{.Env.GOARM}}
| </s> remove 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
- ar... | 'before':
'hooks':
- 'go mod download'
- 'go generate ./...' | env:
- GO111MODULE=on
- GOPROXY=https://goproxy.io
'before':
'hooks':
- 'go mod download'
- 'go generate ./...'
'before':
'hooks':
- 'go mod download'
- 'go generate ./...'
'before':
'hooks':
- 'go mod download'
- 'go generate ./...'
'before':
'hooks':
- 'go mod download'
- 'go gene... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .goreleaser.yml |
hooks:
- go mod download
- go generate ./...
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
... | </s> remove before:
hooks:
- go mod download
- go generate ./...
</s> add 'before':
'hooks':
- 'go mod download'
- 'go generate ./...' </s> remove archives:
- # Archive name template.
# Defaults:
# - if format is `tar.gz`, `tar.xz`, `gz` or `zip`:
# - `{{ .ProjectName }}_{{ .Version }}_... | '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'
... | hooks:
- go mod download
- go generate ./...
'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':
- ... | [
"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... | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .goreleaser.yml |
goarch: mips
- goos: freebsd
goarch: mipsle
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 }... | </s> remove 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 ... | '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 }}_{{... | goarch: mips
- goos: freebsd
goarch: mipsle
'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 }}`
# ... | [
"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"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .goreleaser.yml |
files:
- LICENSE.txt
- README.md
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... | </s> remove 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... | '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... | files:
- LICENSE.txt
- README.md
'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 so... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .goreleaser.yml |
AdGuard Home is a network-wide software for blocking ads & tracking. After
you set it up, it'll cover ALL your home devices, and you don't need any
client-side software for that.
It operates as a DNS server that re-routes tracking domains to a "black hole,"
thus preventing you... | </s> remove 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 ... | 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... | AdGuard Home is a network-wide software for blocking ads & tracking. After
you set it up, it'll cover ALL your home devices, and you don't need any
client-side software for that.
It operates as a DNS server that re-routes tracking domains to a "black hole,"
thus preventing your device... | [
"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... | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .goreleaser.yml |
adguard-home-web:
command: adguard-home-web.sh
plugs: [ desktop ]
checksum:
name_template: 'checksums.txt'
| </s> remove 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... | 'checksum':
'name_template': 'checksums.txt' | adguard-home-web:
command: adguard-home-web.sh
plugs: [ desktop ]
'checksum':
'name_template': 'checksums.txt'
'checksum':
'name_template': 'checksums.txt' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace"
] | 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 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HA... | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .goreleaser.yml |
SafeSearchEnabled bool
SafeBrowsingEnabled bool
ParentalEnabled bool
}
type clientJSON struct {
IP string `json:"ip"`
MAC string `json:"mac"`
Name string `json:"name"`
| </s> | UseOwnBlockedServices bool // false: use global settings
BlockedServices []string | SafeSearchEnabled bool
SafeBrowsingEnabled bool
ParentalEnabled bool
UseOwnBlockedServices bool // false: use global settings
BlockedServices []string
}
type clientJSON struct {
IP string `json:"ip"`
MAC string `json:"mac"`
Name stri... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + clients: add BlockedServices field | https://github.com/AdguardTeam/AdGuardHome/commit/04a477c14a1eeea6426c07d5ae0434afe0b6b398 | home/clients.go |
ParentalEnabled bool `json:"parental_enabled"`
SafeSearchEnabled bool `json:"safebrowsing_enabled"`
SafeBrowsingEnabled bool `json:"safesearch_enabled"`
}
type clientSource uint
const (
| </s> | UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
BlockedServices []string `json:"blocked_services"` | ParentalEnabled bool `json:"parental_enabled"`
SafeSearchEnabled bool `json:"safebrowsing_enabled"`
SafeBrowsingEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
BlockedServices []string `json:"blocked_services"`
}
type... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + clients: add BlockedServices field | https://github.com/AdguardTeam/AdGuardHome/commit/04a477c14a1eeea6426c07d5ae0434afe0b6b398 | home/clients.go |
FilteringEnabled: c.FilteringEnabled,
ParentalEnabled: c.ParentalEnabled,
SafeSearchEnabled: c.SafeSearchEnabled,
SafeBrowsingEnabled: c.SafeBrowsingEnabled,
}
if len(c.MAC) != 0 {
hwAddr, _ := net.ParseMAC(c.MAC)
| </s> | UseGlobalBlockedServices: !c.UseOwnBlockedServices,
BlockedServices: c.BlockedServices, | FilteringEnabled: c.FilteringEnabled,
ParentalEnabled: c.ParentalEnabled,
SafeSearchEnabled: c.SafeSearchEnabled,
SafeBrowsingEnabled: c.SafeBrowsingEnabled,
UseGlobalBlockedServices: !c.UseOwnBlockedServices,
BlockedServices: c.BlockedServices,
}
if len(c.MAC) != ... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | + clients: add BlockedServices field | https://github.com/AdguardTeam/AdGuardHome/commit/04a477c14a1eeea6426c07d5ae0434afe0b6b398 | home/clients.go |
FilteringEnabled: cj.FilteringEnabled,
ParentalEnabled: cj.ParentalEnabled,
SafeSearchEnabled: cj.SafeSearchEnabled,
SafeBrowsingEnabled: cj.SafeBrowsingEnabled,
}
return &c, nil
}
| </s> | UseOwnBlockedServices: !cj.UseGlobalBlockedServices,
BlockedServices: cj.BlockedServices, | FilteringEnabled: cj.FilteringEnabled,
ParentalEnabled: cj.ParentalEnabled,
SafeSearchEnabled: cj.SafeSearchEnabled,
SafeBrowsingEnabled: cj.SafeBrowsingEnabled,
UseOwnBlockedServices: !cj.UseGlobalBlockedServices,
BlockedServices: cj.BlockedServices,
}
return &c, nil
}
| [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | + clients: add BlockedServices field | https://github.com/AdguardTeam/AdGuardHome/commit/04a477c14a1eeea6426c07d5ae0434afe0b6b398 | home/clients.go |
"bytes"
"fmt"
"net"
"sync"
"github.com/AdguardTeam/golibs/errors"
"golang.org/x/exp/slices"
)
| </s> remove "net"
</s> add "net/netip" | "net/netip" | "bytes"
"fmt"
"net"
"net/netip"
"sync"
"github.com/AdguardTeam/golibs/errors"
"golang.org/x/exp/slices"
)
| [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb.go |
// implementation of ARP is able to retrieve that.
Name string
// IP contains either IPv4 or IPv6.
IP net.IP
// MAC contains the hardware address.
MAC net.HardwareAddr
}
| </s> remove if ip.To4() != nil {
</s> add if ip.Is4() { </s> remove // HostsRecord represents a single hosts file record.
type HostsRecord struct {
Aliases *stringutil.Set
Canonical string
}
// Equal returns true if all fields of rec are equal to field in other or they
// both are nil.
func (rec *HostsRecord) E... | IP netip.Addr | // implementation of ARP is able to retrieve that.
Name string
// IP contains either IPv4 or IPv6.
IP netip.Addr
// MAC contains the hardware address.
MAC net.HardwareAddr
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb.go |
// Clone returns the deep copy of n.
func (n Neighbor) Clone() (clone Neighbor) {
return Neighbor{
Name: n.Name,
IP: slices.Clone(n.IP),
MAC: slices.Clone(n.MAC),
}
}
// neighs is the helper type that stores neighbors to avoid copying its methods
| </s> remove // Upd returns the channel into which the updates are sent. The receivable
// map's values are guaranteed to be of type of *HostsRecord.
func (hc *HostsContainer) Upd() (updates <-chan *netutil.IPMap) {
</s> add // Upd returns the channel into which the updates are sent.
func (hc *HostsContainer) Upd() (u... | IP: n.IP, | // Clone returns the deep copy of n.
func (n Neighbor) Clone() (clone Neighbor) {
return Neighbor{
Name: n.Name,
IP: n.IP,
MAC: slices.Clone(n.MAC),
}
}
// neighs is the helper type that stores neighbors to avoid copying its methods | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb.go |
"bufio"
"net"
"strings"
"sync"
"github.com/AdguardTeam/golibs/log"
"github.com/AdguardTeam/golibs/netutil"
)
| </s> remove "net"
</s> add "net/netip" | "net/netip" | "bufio"
"net"
"net/netip"
"strings"
"sync"
"github.com/AdguardTeam/golibs/log"
"github.com/AdguardTeam/golibs/netutil"
) | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_bsd.go |
n := Neighbor{}
if ipStr := fields[1]; len(ipStr) < 2 {
continue
} else if ip := net.ParseIP(ipStr[1 : len(ipStr)-1]); ip == nil {
continue
} else {
n.IP = ip
}
| </s> remove } else if ip := net.ParseIP(ipStr[1 : len(ipStr)-1]); ip == nil {
</s> add } else if ip, err := netip.ParseAddr(ipStr[1 : len(ipStr)-1]); err != nil {
log.Debug("arpdb: parsing arp output: ip: %s", err)
</s> remove if ip := net.ParseIP(fields[0]); ip == nil {
</s> add ip, err := netip.ParseAdd... | } else if ip, err := netip.ParseAddr(ipStr[1 : len(ipStr)-1]); err != nil {
log.Debug("arpdb: parsing arp output: ip: %s", err)
| n := Neighbor{}
if ipStr := fields[1]; len(ipStr) < 2 {
continue
} else if ip, err := netip.ParseAddr(ipStr[1 : len(ipStr)-1]); err != nil {
log.Debug("arpdb: parsing arp output: ip: %s", err)
continue
} else {
n.IP = ip
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_bsd.go |
n.IP = ip
}
hwStr := fields[3]
if mac, err := net.ParseMAC(hwStr); err != nil {
continue
} else {
n.MAC = mac
}
| </s> remove if mac, err := net.ParseMAC(hwStr); err != nil {
log.Debug("parsing arp output: %s", err)
</s> add mac, err := net.ParseMAC(hwStr)
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err) </s> remove log.Debug("parsing arp output: %s", err)
</s> add log.Debug("arpdb: parsing ... | mac, err := net.ParseMAC(hwStr)
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err)
| n.IP = ip
}
hwStr := fields[3]
mac, err := net.ParseMAC(hwStr)
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err)
continue
} else {
n.MAC = mac
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_bsd.go |
n.MAC = mac
}
host := fields[0]
if err := netutil.ValidateDomainName(host); err != nil {
log.Debug("parsing arp output: %s", err)
} else {
n.Name = host
}
ns = append(ns, n)
| </s> remove log.Debug("parsing arp output: %s", verr)
</s> add log.Debug("arpdb: parsing arp output: host: %s", verr) </s> remove if mac, err := net.ParseMAC(fields[1]); err != nil {
log.Debug("parsing arp output: %s", err)
</s> add mac, err := net.ParseMAC(fields[1])
if err != nil {
log.Debug("arpd... | err = netutil.ValidateDomainName(host)
if err != nil {
log.Debug("arpdb: parsing arp output: host: %s", err) | n.MAC = mac
}
host := fields[0]
err = netutil.ValidateDomainName(host)
if err != nil {
log.Debug("arpdb: parsing arp output: host: %s", err)
err = netutil.ValidateDomainName(host)
if err != nil {
log.Debug("arpdb: parsing arp output: host: %s", err)
} else {
n.Name = host
}
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_bsd.go |
import (
"net"
)
const arpAOutput = `
invalid.mac (1.2.3.4) at 12:34:56:78:910 on el0 ifscope [ethernet]
invalid.ip (1.2.3.4.5) at ab:cd:ef:ab:cd:12 on ek0 ifscope [ethernet]
invalid.fmt 1 at 12:cd:ef:ab:cd:ef on er0 ifscope [ethernet]
| </s> | "net/netip" | import (
"net"
"net/netip"
)
const arpAOutput = `
invalid.mac (1.2.3.4) at 12:34:56:78:910 on el0 ifscope [ethernet]
invalid.ip (1.2.3.4.5) at ab:cd:ef:ab:cd:12 on ek0 ifscope [ethernet]
invalid.fmt 1 at 12:cd:ef:ab:cd:ef on er0 ifscope [ethernet] | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_bsd_test.go |
`
var wantNeighs = []Neighbor{{
Name: "hostname.one",
IP: net.IPv4(192, 168, 1, 2),
MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
}, {
Name: "hostname.two",
IP: net.ParseIP("::ffff:ffff"),
MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
| </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), </s> remove IP: net.IP... | IP: netip.MustParseAddr("192.168.1.2"), | `
var wantNeighs = []Neighbor{{
Name: "hostname.one",
IP: netip.MustParseAddr("192.168.1.2"),
MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
}, {
Name: "hostname.two",
IP: net.ParseIP("::ffff:ffff"),
MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB}, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_bsd_test.go |
IP: net.IPv4(192, 168, 1, 2),
MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
}, {
Name: "hostname.two",
IP: net.ParseIP("::ffff:ffff"),
MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
}, {
Name: "",
IP: net.ParseIP("::1234"),
MAC: net.HardwareAddr{0xAA, 0xBB, ... | </s> remove IP: net.ParseIP("::1234"),
</s> add IP: netip.MustParseAddr("::1234"), </s> remove IP: net.IPv4(192, 168, 1, 2),
</s> add IP: netip.MustParseAddr("192.168.1.2"), </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), </s> remove IP: net.ParseIP("::f... | IP: netip.MustParseAddr("::ffff:ffff"), | IP: net.IPv4(192, 168, 1, 2),
MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
}, {
Name: "hostname.two",
IP: netip.MustParseAddr("::ffff:ffff"),
MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
}, {
Name: "",
IP: net.ParseIP("::1234"),
MAC: net.HardwareAddr{0xAA, ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_bsd_test.go |
IP: net.ParseIP("::ffff:ffff"),
MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
}, {
Name: "",
IP: net.ParseIP("::1234"),
MAC: net.HardwareAddr{0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF},
}}
| </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), </s> remove IP: net.I... | IP: netip.MustParseAddr("::1234"), | IP: net.ParseIP("::ffff:ffff"),
MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
}, {
Name: "",
IP: netip.MustParseAddr("::1234"),
MAC: net.HardwareAddr{0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF},
}} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_bsd_test.go |
"io/fs"
"net"
"strings"
"sync"
"github.com/AdguardTeam/AdGuardHome/internal/aghos"
"github.com/AdguardTeam/golibs/log"
"github.com/AdguardTeam/golibs/netutil"
| </s> remove "net"
</s> add "net/netip" | "net/netip" | "io/fs"
"net"
"net/netip"
"strings"
"sync"
"github.com/AdguardTeam/AdGuardHome/internal/aghos"
"github.com/AdguardTeam/golibs/log"
"github.com/AdguardTeam/golibs/netutil" | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
continue
}
n := Neighbor{}
if n.IP = net.ParseIP(fields[0]); n.IP == nil || n.IP.IsUnspecified() {
continue
} else if n.MAC, err = net.ParseMAC(fields[3]); err != nil {
continue
}
| </s> remove if ip := net.ParseIP(fields[0]); ip == nil || n.IP.IsUnspecified() {
</s> add ip, err := netip.ParseAddr(fields[0])
if err != nil || n.IP.IsUnspecified() {
log.Debug("arpdb: parsing arp output: ip: %s", err)
</s> remove if ip := net.ParseIP(fields[0]); ip == nil {
</s> add ip, err := netip.P... | n.IP, err = netip.ParseAddr(fields[0])
if err != nil || n.IP.IsUnspecified() { | continue
}
n := Neighbor{}
n.IP, err = netip.ParseAddr(fields[0])
if err != nil || n.IP.IsUnspecified() {
continue
} else if n.MAC, err = net.ParseMAC(fields[3]); err != nil {
continue
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
}
n := Neighbor{}
if ip := net.ParseIP(fields[0]); ip == nil || n.IP.IsUnspecified() {
continue
} else {
n.IP = ip
}
| </s> remove if n.IP = net.ParseIP(fields[0]); n.IP == nil || n.IP.IsUnspecified() {
</s> add n.IP, err = netip.ParseAddr(fields[0])
if err != nil || n.IP.IsUnspecified() { </s> remove if ip := net.ParseIP(fields[0]); ip == nil {
</s> add ip, err := netip.ParseAddr(fields[0])
if err != nil { </s> remove ... | ip, err := netip.ParseAddr(fields[0])
if err != nil || n.IP.IsUnspecified() {
log.Debug("arpdb: parsing arp output: ip: %s", err)
| }
n := Neighbor{}
ip, err := netip.ParseAddr(fields[0])
if err != nil || n.IP.IsUnspecified() {
log.Debug("arpdb: parsing arp output: ip: %s", err)
continue
} else {
n.IP = ip
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
n.IP = ip
}
hwStr := fields[3]
if mac, err := net.ParseMAC(hwStr); err != nil {
log.Debug("parsing arp output: %s", err)
continue
} else {
n.MAC = mac
}
| </s> remove log.Debug("parsing arp output: %s", err)
</s> add log.Debug("arpdb: parsing arp output: mac: %s", err) </s> remove if mac, err := net.ParseMAC(hwStr); err != nil {
</s> add mac, err := net.ParseMAC(hwStr)
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err)
</s> remove if... | mac, err := net.ParseMAC(hwStr)
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err) | n.IP = ip
}
hwStr := fields[3]
mac, err := net.ParseMAC(hwStr)
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err)
mac, err := net.ParseMAC(hwStr)
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err)
continue
} else {
n.MAC = mac
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
n := Neighbor{}
if ipStr := fields[1]; len(ipStr) < 2 {
continue
} else if ip := net.ParseIP(ipStr[1 : len(ipStr)-1]); ip == nil {
continue
} else {
n.IP = ip
}
| </s> | } else if ip, err := netip.ParseAddr(ipStr[1 : len(ipStr)-1]); err != nil {
log.Debug("arpdb: parsing arp output: ip: %s", err)
| n := Neighbor{}
if ipStr := fields[1]; len(ipStr) < 2 {
continue
} else if ip, err := netip.ParseAddr(ipStr[1 : len(ipStr)-1]); err != nil {
log.Debug("arpdb: parsing arp output: ip: %s", err)
continue
} else {
n.IP = ip
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
}
hwStr := fields[3]
if mac, err := net.ParseMAC(hwStr); err != nil {
log.Debug("parsing arp output: %s", err)
continue
} else {
n.MAC = mac
}
| </s> remove if mac, err := net.ParseMAC(hwStr); err != nil {
log.Debug("parsing arp output: %s", err)
</s> add mac, err := net.ParseMAC(hwStr)
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err) </s> remove if mac, err := net.ParseMAC(hwStr); err != nil {
</s> add mac, err := net.Pars... | log.Debug("arpdb: parsing arp output: mac: %s", err) | }
hwStr := fields[3]
if mac, err := net.ParseMAC(hwStr); err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err)
continue
} else {
n.MAC = mac
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
}
host := fields[0]
if verr := netutil.ValidateDomainName(host); verr != nil {
log.Debug("parsing arp output: %s", verr)
} else {
n.Name = host
}
ns = append(ns, n)
| </s> remove if err := netutil.ValidateDomainName(host); err != nil {
log.Debug("parsing arp output: %s", err)
</s> add err = netutil.ValidateDomainName(host)
if err != nil {
log.Debug("arpdb: parsing arp output: host: %s", err) </s> remove if mac, err := net.ParseMAC(fields[4]); err != nil {
log.Debug... | log.Debug("arpdb: parsing arp output: host: %s", verr) | }
host := fields[0]
if verr := netutil.ValidateDomainName(host); verr != nil {
log.Debug("arpdb: parsing arp output: host: %s", verr)
} else {
n.Name = host
}
ns = append(ns, n) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
}
n := Neighbor{}
if ip := net.ParseIP(fields[0]); ip == nil {
continue
} else {
n.IP = ip
}
| </s> remove if ip := net.ParseIP(fields[0]); ip == nil {
</s> add ip, err := netip.ParseAddr(fields[0])
if err != nil { </s> remove if ip := net.ParseIP(fields[0]); ip == nil {
</s> add ip, err := netip.ParseAddr(fields[0])
if err != nil {
log.Debug("arpdb: parsing arp output: ip: %s", err)
</s> remov... | ip, err := netip.ParseAddr(fields[0])
if err != nil {
log.Debug("arpdb: parsing arp output: ip: %s", err)
| }
n := Neighbor{}
ip, err := netip.ParseAddr(fields[0])
if err != nil {
log.Debug("arpdb: parsing arp output: ip: %s", err)
continue
} else {
n.IP = ip
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
} else {
n.IP = ip
}
if mac, err := net.ParseMAC(fields[4]); err != nil {
log.Debug("parsing arp output: %s", err)
continue
} else {
n.MAC = mac
}
| </s> remove if mac, err := net.ParseMAC(fields[1]); err != nil {
log.Debug("parsing arp output: %s", err)
</s> add mac, err := net.ParseMAC(fields[1])
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err) </s> remove if mac, err := net.ParseMAC(hwStr); err != nil {
log.Debug("parsing ar... | mac, err := net.ParseMAC(fields[4])
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err) | } else {
n.IP = ip
}
mac, err := net.ParseMAC(fields[4])
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err)
mac, err := net.ParseMAC(fields[4])
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err)
continue
} else {
n.MAC = mac
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
import (
"net"
"sync"
"testing"
"testing/fstest"
| </s> | "net/netip" |
import (
"net"
"net/netip"
"sync"
"testing"
"testing/fstest"
| [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux_test.go |
192.168.1.2 dev enp0s3 lladdr ab:cd:ef:ab:cd:ef DELAY
::ffff:ffff dev enp0s3 lladdr ef:cd:ab:ef:cd:ab router STALE`
var wantNeighs = []Neighbor{{
IP: net.IPv4(192, 168, 1, 2),
MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
}, {
IP: net.ParseIP("::ffff:ffff"),
MAC: net.HardwareAddr{0... | </s> remove IP: net.IPv4(192, 168, 1, 2),
</s> add IP: netip.MustParseAddr("192.168.1.2"), </s> remove IP: net.IPv4(192, 168, 1, 2),
</s> add IP: netip.MustParseAddr("192.168.1.2"), </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), </s> remove IP: net.ParseIP(... | IP: netip.MustParseAddr("192.168.1.2"), | 192.168.1.2 dev enp0s3 lladdr ab:cd:ef:ab:cd:ef DELAY
::ffff:ffff dev enp0s3 lladdr ef:cd:ab:ef:cd:ab router STALE`
var wantNeighs = []Neighbor{{
IP: netip.MustParseAddr("192.168.1.2"),
MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
}, {
IP: net.ParseIP("::ffff:ffff"),
MAC: net.Hardwa... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux_test.go |
var wantNeighs = []Neighbor{{
IP: net.IPv4(192, 168, 1, 2),
MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
}, {
IP: net.ParseIP("::ffff:ffff"),
MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
}}
func TestFSysARPDB(t *testing.T) {
require.NoError(t, fstest.TestFS(testda... | </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), </s> remove IP: net.IPv4(192, 168, 1, 2),
</s> add IP: netip.MustParseAddr("192.168.1.2"), </s> remove IP: net.IPv4(1... | IP: netip.MustParseAddr("::ffff:ffff"), | var wantNeighs = []Neighbor{{
IP: net.IPv4(192, 168, 1, 2),
MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
}, {
IP: netip.MustParseAddr("::ffff:ffff"),
MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
}}
func TestFSysARPDB(t *testing.T) {
require.NoError(t, fstest.TestFS(... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux_test.go |
import (
"bufio"
"net"
"strings"
"sync"
"github.com/AdguardTeam/golibs/log"
)
| </s> remove "net"
</s> add "net/netip" | "net/netip" | import (
"bufio"
"net"
"net/netip"
"strings"
"sync"
"github.com/AdguardTeam/golibs/log"
) | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_openbsd.go |
}
n := Neighbor{}
if ip := net.ParseIP(fields[0]); ip == nil {
continue
} else {
n.IP = ip
}
| </s> | ip, err := netip.ParseAddr(fields[0])
if err != nil {
log.Debug("arpdb: parsing arp output: ip: %s", err)
| }
n := Neighbor{}
ip, err := netip.ParseAddr(fields[0])
if err != nil {
log.Debug("arpdb: parsing arp output: ip: %s", err)
continue
} else {
n.IP = ip
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_openbsd.go |
} else {
n.IP = ip
}
if mac, err := net.ParseMAC(fields[1]); err != nil {
log.Debug("parsing arp output: %s", err)
continue
} else {
n.MAC = mac
}
| </s> remove if mac, err := net.ParseMAC(fields[4]); err != nil {
log.Debug("parsing arp output: %s", err)
</s> add mac, err := net.ParseMAC(fields[4])
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err) </s> remove if mac, err := net.ParseMAC(hwStr); err != nil {
log.Debug("parsing ar... | mac, err := net.ParseMAC(fields[1])
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err) | } else {
n.IP = ip
}
mac, err := net.ParseMAC(fields[1])
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err)
mac, err := net.ParseMAC(fields[1])
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err)
continue
} else {
n.MAC = mac
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_openbsd.go |
import (
"net"
)
const arpAOutput = `
Host Ethernet Address Netif Expire Flags
1.2.3.4.5 aa:bb:cc:dd:ee:ff em0 permanent
1.2.3.4 12:34:56:78:910 em0 permanent
| </s> remove IP: net.IPv4(192, 168, 1, 2),
</s> add IP: netip.MustParseAddr("192.168.1.2"), | "net/netip" |
import (
"net"
"net/netip"
)
const arpAOutput = `
Host Ethernet Address Netif Expire Flags
1.2.3.4.5 aa:bb:cc:dd:ee:ff em0 permanent
1.2.3.4 12:34:56:78:910 em0 permanent | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_openbsd_test.go |
::ffff:ffff ef:cd:ab:ef:cd:ab em0 permanent l
`
var wantNeighs = []Neighbor{{
IP: net.IPv4(192, 168, 1, 2),
MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
}, {
IP: net.ParseIP("::ffff:ffff"),
MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
}}
| </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), </s> remove IP: net.IPv4(192, 168, 1, 2),
</s> add IP: netip.MustParseAddr("192.168.1.2"), </s> remove IP: net.IPv4(1... | IP: netip.MustParseAddr("192.168.1.2"), | ::ffff:ffff ef:cd:ab:ef:cd:ab em0 permanent l
`
var wantNeighs = []Neighbor{{
IP: netip.MustParseAddr("192.168.1.2"),
MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
}, {
IP: net.ParseIP("::ffff:ffff"),
MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
}} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_openbsd_test.go |
var wantNeighs = []Neighbor{{
IP: net.IPv4(192, 168, 1, 2),
MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
}, {
IP: net.ParseIP("::ffff:ffff"),
MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
}}
| </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), </s> remove IP: net.IPv4(192, 168, 1, 2),
</s> add IP: netip.MustParseAddr("192.168.1.2"), </s> remove IP: net.IPv4(192, 168, 1, 2),
</s> add IP: netip.MustParseAddr("192.168.1.2"), </s> remove IP: net.ParseIP(... | IP: netip.MustParseAddr("::ffff:ffff"), | var wantNeighs = []Neighbor{{
IP: net.IPv4(192, 168, 1, 2),
MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
}, {
IP: netip.MustParseAddr("::ffff:ffff"),
MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
}} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_openbsd_test.go |
package aghnet
import (
"net"
"sync"
"testing"
"github.com/AdguardTeam/golibs/errors"
"github.com/AdguardTeam/golibs/testutil"
"github.com/stretchr/testify/assert"
| </s> | "net/netip" | package aghnet
import (
"net"
"net/netip"
"sync"
"testing"
"github.com/AdguardTeam/golibs/errors"
"github.com/AdguardTeam/golibs/testutil"
"github.com/stretchr/testify/assert" | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_test.go |
return arp.OnNeighbors()
}
func TestARPDBS(t *testing.T) {
knownIP := net.IP{1, 2, 3, 4}
knownMAC := net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF}
succRefrCount, failRefrCount := 0, 0
clnp := func() {
succRefrCount, failRefrCount = 0, 0
| </s> remove assert.True(t, clients.Exists(ip, ClientSourceHostsFile))
</s> add assert.True(t, clients.exists(ip, ClientSourceHostsFile)) </s> remove ip := net.IP{127, 0, 0, 1}
</s> add ip := netutil.IPv4Localhost() </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"),... | knownIP := netip.MustParseAddr("1.2.3.4") | return arp.OnNeighbors()
}
func TestARPDBS(t *testing.T) {
knownIP := netip.MustParseAddr("1.2.3.4")
knownMAC := net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF}
succRefrCount, failRefrCount := 0, 0
clnp := func() {
succRefrCount, failRefrCount = 0, 0 | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_test.go |
import (
"bufio"
"net"
"strings"
"sync"
)
| </s> remove "net"
</s> add "net/netip" | "net/netip" |
import (
"bufio"
"net"
"net/netip"
"strings"
"sync"
)
| [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_windows.go |
}
n := Neighbor{}
if ip := net.ParseIP(fields[0]); ip == nil {
continue
} else {
n.IP = ip
}
| </s> remove if ip := net.ParseIP(fields[0]); ip == nil {
</s> add ip, err := netip.ParseAddr(fields[0])
if err != nil {
log.Debug("arpdb: parsing arp output: ip: %s", err)
</s> remove if ip := net.ParseIP(fields[0]); ip == nil {
</s> add ip, err := netip.ParseAddr(fields[0])
if err != nil {
log.Deb... | ip, err := netip.ParseAddr(fields[0])
if err != nil { | }
n := Neighbor{}
ip, err := netip.ParseAddr(fields[0])
if err != nil {
continue
} else {
n.IP = ip
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_windows.go |
} else {
n.IP = ip
}
if mac, err := net.ParseMAC(fields[1]); err != nil {
continue
} else {
n.MAC = mac
}
| </s> remove if mac, err := net.ParseMAC(fields[1]); err != nil {
log.Debug("parsing arp output: %s", err)
</s> add mac, err := net.ParseMAC(fields[1])
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err) </s> remove if mac, err := net.ParseMAC(fields[4]); err != nil {
log.Debug("parsin... | mac, err := net.ParseMAC(fields[1])
if err != nil { | } else {
n.IP = ip
}
mac, err := net.ParseMAC(fields[1])
if err != nil {
continue
} else {
n.MAC = mac
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_windows.go |
import (
"net"
)
const arpAOutput = `
| </s> | "net/netip" | import (
"net"
"net/netip"
)
const arpAOutput = `
| [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_windows_test.go |
192.168.1.2 ab-cd-ef-ab-cd-ef dynamic
::ffff:ffff ef-cd-ab-ef-cd-ab static`
var wantNeighs = []Neighbor{{
IP: net.IPv4(192, 168, 1, 2),
MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
}, {
IP: net.ParseIP("::ffff:ffff"),
MAC: net.HardwareAddr{0xEF, 0xC... | </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), </s> remove IP: net.IPv4(192, 168, 1, 2),
</s> add IP: netip.MustParseAddr("192.168.1.2"), </s> remove IP: net.IPv4(1... | IP: netip.MustParseAddr("192.168.1.2"), | 192.168.1.2 ab-cd-ef-ab-cd-ef dynamic
::ffff:ffff ef-cd-ab-ef-cd-ab static`
var wantNeighs = []Neighbor{{
IP: netip.MustParseAddr("192.168.1.2"),
MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
}, {
IP: net.ParseIP("::ffff:ffff"),
MAC: net.HardwareAddr{0... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_windows_test.go |
var wantNeighs = []Neighbor{{
IP: net.IPv4(192, 168, 1, 2),
MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
}, {
IP: net.ParseIP("::ffff:ffff"),
MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
}}
| </s> | IP: netip.MustParseAddr("::ffff:ffff"), | var wantNeighs = []Neighbor{{
IP: net.IPv4(192, 168, 1, 2),
MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
}, {
IP: netip.MustParseAddr("::ffff:ffff"),
MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
}} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_windows_test.go |
"bufio"
"fmt"
"io"
"io/fs"
"net"
"path"
"strings"
"sync"
"github.com/AdguardTeam/AdGuardHome/internal/aghos"
| </s> | "net/netip" | "bufio"
"fmt"
"io"
"io/fs"
"net/netip"
"path"
"strings"
"sync"
"github.com/AdguardTeam/AdGuardHome/internal/aghos" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
"github.com/AdguardTeam/urlfilter/rules"
"github.com/miekg/dns"
)
// DefaultHostsPaths returns the slice of paths default for the operating system
// to files and directories which are containing the hosts database. The result
| </s> remove //lint:file-ignore SA1019 TODO(a.garipov): Replace [*netutil.IPMap].
</s> add </s> remove // Upd returns the channel into which the updates are sent. The receivable
// map's values are guaranteed to be of type of *HostsRecord.
func (hc *HostsContainer) Upd() (updates <-chan *netutil.IPMap) {
</s> add ... | "golang.org/x/exp/maps" | "github.com/AdguardTeam/urlfilter/rules"
"github.com/miekg/dns"
"golang.org/x/exp/maps"
)
// DefaultHostsPaths returns the slice of paths default for the operating system
// to files and directories which are containing the hosts database. The result | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
"github.com/AdguardTeam/urlfilter/rules"
"github.com/miekg/dns"
)
//lint:file-ignore SA1019 TODO(a.garipov): Replace [*netutil.IPMap].
// DefaultHostsPaths returns the slice of paths default for the operating system
// to files and directories which are containing the hosts database. The result
... | </s> remove // Upd returns the channel into which the updates are sent. The receivable
// map's values are guaranteed to be of type of *HostsRecord.
func (hc *HostsContainer) Upd() (updates <-chan *netutil.IPMap) {
</s> add // Upd returns the channel into which the updates are sent.
func (hc *HostsContainer) Upd() (u... | "github.com/AdguardTeam/urlfilter/rules"
"github.com/miekg/dns"
)
// DefaultHostsPaths returns the slice of paths default for the operating system
// to files and directories which are containing the hosts database. The result
// is intended to be used within fs.FS so the initial slash is omitted.
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go | |
// done is the channel to sign closing the container.
done chan struct{}
// updates is the channel for receiving updated hosts.
//
// TODO(e.burkov): Use map[netip.Addr]struct{} instead.
updates chan *netutil.IPMap
// last is the set of hosts that was cached within last detected change.
/... | </s> remove //
// TODO(e.burkov): Use map[netip.Addr]struct{} instead.
last *netutil.IPMap
</s> add last HostsRecords </s> remove table *netutil.IPMap
</s> add table HostsRecords </s> remove // Upd returns the channel into which the updates are sent. The receivable
// map's values are guaranteed to be of type... | updates chan HostsRecords | // done is the channel to sign closing the container.
done chan struct{}
// updates is the channel for receiving updated hosts.
updates chan HostsRecords
updates chan HostsRecords
updates chan HostsRecords
// last is the set of hosts that was cached within last detected change.
//
// TODO(e.b... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
// TODO(e.burkov): Use map[netip.Addr]struct{} instead.
updates chan *netutil.IPMap
// last is the set of hosts that was cached within last detected change.
//
// TODO(e.burkov): Use map[netip.Addr]struct{} instead.
last *netutil.IPMap
// fsys is the working file system to read hosts files ... | </s> remove //
// TODO(e.burkov): Use map[netip.Addr]struct{} instead.
updates chan *netutil.IPMap
</s> add updates chan HostsRecords </s> remove //lint:file-ignore SA1019 TODO(a.garipov): Replace [*netutil.IPMap].
</s> add </s> remove rc, ok := clients.FindRuntimeClient(ip)
</s> add rc, ok := clients.find... | last HostsRecords | // TODO(e.burkov): Use map[netip.Addr]struct{} instead.
updates chan *netutil.IPMap
// last is the set of hosts that was cached within last detected change.
last HostsRecords
last HostsRecords
last HostsRecords
// fsys is the working file system to read hosts files from.
fsys fs.FS
// w t... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
stateLock: &sync.RWMutex{},
},
listID: listID,
done: make(chan struct{}, 1),
updates: make(chan *netutil.IPMap, 1),
fsys: fsys,
w: w,
patterns: patterns,
}
| </s> remove rc, ok = clients.FindRuntimeClient(ip)
</s> add rc, ok = clients.findRuntimeClient(ip) </s> remove wantIP: nil,
</s> add wantIP: netip.Addr{}, </s> remove wantIP: nil,
</s> add wantIP: netip.Addr{}, </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr(... | updates: make(chan HostsRecords, 1), | stateLock: &sync.RWMutex{},
},
listID: listID,
done: make(chan struct{}, 1),
updates: make(chan HostsRecords, 1),
fsys: fsys,
w: w,
patterns: patterns,
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
return nil
}
// Upd returns the channel into which the updates are sent. The receivable
// map's values are guaranteed to be of type of *HostsRecord.
func (hc *HostsContainer) Upd() (updates <-chan *netutil.IPMap) {
return hc.updates
}
// pathsToPatterns converts paths into patterns compatib... | </s> remove //lint:file-ignore SA1019 TODO(a.garipov): Replace [*netutil.IPMap].
</s> add </s> remove table *netutil.IPMap
</s> add table HostsRecords </s> remove // HostsRecord represents a single hosts file record.
type HostsRecord struct {
Aliases *stringutil.Set
Canonical string
}
// Equal returns true ... | // Upd returns the channel into which the updates are sent.
func (hc *HostsContainer) Upd() (updates <-chan HostsRecords) { |
return nil
}
// Upd returns the channel into which the updates are sent.
func (hc *HostsContainer) Upd() (updates <-chan HostsRecords) {
// Upd returns the channel into which the updates are sent.
func (hc *HostsContainer) Upd() (updates <-chan HostsRecords) {
// Upd returns the channel into which the update... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
translations map[string]string
// table stores only the unique IP-hostname pairs. It's also sent to the
// updates channel afterwards.
table *netutil.IPMap
}
// newHostsParser creates a new *hostsParser with buffers of size taken from the
// previous parse.
func (hc *HostsContainer) newHostsP... | </s> remove // Upd returns the channel into which the updates are sent. The receivable
// map's values are guaranteed to be of type of *HostsRecord.
func (hc *HostsContainer) Upd() (updates <-chan *netutil.IPMap) {
</s> add // Upd returns the channel into which the updates are sent.
func (hc *HostsContainer) Upd() (u... | table HostsRecords | translations map[string]string
// table stores only the unique IP-hostname pairs. It's also sent to the
// updates channel afterwards.
table HostsRecords
}
// newHostsParser creates a new *hostsParser with buffers of size taken from the
// previous parse.
func (hc *HostsContainer) newHostsParse... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
func (hc *HostsContainer) newHostsParser() (hp *hostsParser) {
return &hostsParser{
rulesBuilder: &strings.Builder{},
translations: map[string]string{},
table: netutil.NewIPMap(hc.last.Len()),
}
}
// parseFile is a aghos.FileWalker for parsing the files with hosts syntax. It
// neve... | </s> remove table *netutil.IPMap
</s> add table HostsRecords </s> remove // Upd returns the channel into which the updates are sent. The receivable
// map's values are guaranteed to be of type of *HostsRecord.
func (hc *HostsContainer) Upd() (updates <-chan *netutil.IPMap) {
</s> add // Upd returns the channel int... | table: make(HostsRecords, len(hc.last)), | func (hc *HostsContainer) newHostsParser() (hp *hostsParser) {
return &hostsParser{
rulesBuilder: &strings.Builder{},
translations: map[string]string{},
table: make(HostsRecords, len(hc.last)),
}
}
// parseFile is a aghos.FileWalker for parsing the files with hosts syntax. It
// never... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
func (hp *hostsParser) parseFile(r io.Reader) (patterns []string, cont bool, err error) {
s := bufio.NewScanner(r)
for s.Scan() {
ip, hosts := hp.parseLine(s.Text())
if ip == nil || len(hosts) == 0 {
continue
}
hp.addRecord(ip, hosts)
}
| </s> remove if ip := net.ParseIP(fields[0]); ip == nil || n.IP.IsUnspecified() {
</s> add ip, err := netip.ParseAddr(fields[0])
if err != nil || n.IP.IsUnspecified() {
log.Debug("arpdb: parsing arp output: ip: %s", err)
</s> remove if ip = net.ParseIP(fields[0]); ip == nil {
return nil, nil
</s> add ip,... | if ip == (netip.Addr{}) || len(hosts) == 0 { | func (hp *hostsParser) parseFile(r io.Reader) (patterns []string, cont bool, err error) {
s := bufio.NewScanner(r)
for s.Scan() {
ip, hosts := hp.parseLine(s.Text())
if ip == (netip.Addr{}) || len(hosts) == 0 {
continue
}
hp.addRecord(ip, hosts)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
return nil, true, s.Err()
}
// parseLine parses the line having the hosts syntax ignoring invalid ones.
func (hp *hostsParser) parseLine(line string) (ip net.IP, hosts []string) {
fields := strings.Fields(line)
if len(fields) < 2 {
return nil, nil
}
| </s> remove return nil, nil
</s> add return netip.Addr{}, nil </s> remove if ip = net.ParseIP(fields[0]); ip == nil {
return nil, nil
</s> add ip, err := netip.ParseAddr(fields[0])
if err != nil {
return netip.Addr{}, nil </s> remove // HostsRecord represents a single hosts file record.
type HostsRecord st... | func (hp *hostsParser) parseLine(line string) (ip netip.Addr, hosts []string) { | return nil, true, s.Err()
}
// parseLine parses the line having the hosts syntax ignoring invalid ones.
func (hp *hostsParser) parseLine(line string) (ip netip.Addr, hosts []string) {
fields := strings.Fields(line)
if len(fields) < 2 {
return nil, nil
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
// parseLine parses the line having the hosts syntax ignoring invalid ones.
func (hp *hostsParser) parseLine(line string) (ip net.IP, hosts []string) {
fields := strings.Fields(line)
if len(fields) < 2 {
return nil, nil
}
if ip = net.ParseIP(fields[0]); ip == nil {
return nil, nil
}
| </s> remove func (hp *hostsParser) parseLine(line string) (ip net.IP, hosts []string) {
</s> add func (hp *hostsParser) parseLine(line string) (ip netip.Addr, hosts []string) { </s> remove if ip = net.ParseIP(fields[0]); ip == nil {
return nil, nil
</s> add ip, err := netip.ParseAddr(fields[0])
if err != nil {
... | return netip.Addr{}, nil | // parseLine parses the line having the hosts syntax ignoring invalid ones.
func (hp *hostsParser) parseLine(line string) (ip net.IP, hosts []string) {
fields := strings.Fields(line)
if len(fields) < 2 {
return netip.Addr{}, nil
}
if ip = net.ParseIP(fields[0]); ip == nil {
return nil, nil
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
if len(fields) < 2 {
return nil, nil
}
if ip = net.ParseIP(fields[0]); ip == nil {
return nil, nil
}
for _, f := range fields[1:] {
hashIdx := strings.IndexByte(f, '#')
if hashIdx == 0 {
| </s> remove return nil, nil
</s> add return netip.Addr{}, nil </s> remove func (hp *hostsParser) parseLine(line string) (ip net.IP, hosts []string) {
</s> add func (hp *hostsParser) parseLine(line string) (ip netip.Addr, hosts []string) { </s> remove if ip == nil || len(hosts) == 0 {
</s> add if ip == (netip... | ip, err := netip.ParseAddr(fields[0])
if err != nil {
return netip.Addr{}, nil | if len(fields) < 2 {
return nil, nil
}
ip, err := netip.ParseAddr(fields[0])
if err != nil {
return netip.Addr{}, nil
ip, err := netip.ParseAddr(fields[0])
if err != nil {
return netip.Addr{}, nil
}
for _, f := range fields[1:] {
hashIdx := strings.IndexByte(f, '#')
if hashIdx == 0... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
//
// See https://github.com/AdguardTeam/AdGuardHome/issues/3946.
//
// TODO(e.burkov): Investigate if hosts may contain DNS-SD domains.
err := netutil.ValidateDomainName(f)
if err != nil {
log.Error("%s: host %q is invalid, ignoring", hostsContainerPref, f)
continue
}
| </s> remove hp.table.Set(ip, rec)
} else {
rec, ok = v.(*HostsRecord)
if !ok {
log.Error("%s: adding pairs: unexpected type %T", hostsContainerPref, v)
return
}
</s> add hp.table[ip] = rec </s> remove if err := netutil.ValidateDomainName(host); err != nil {
log.Debug("parsing arp output: %s", er... | err = netutil.ValidateDomainName(f) | //
// See https://github.com/AdguardTeam/AdGuardHome/issues/3946.
//
// TODO(e.burkov): Investigate if hosts may contain DNS-SD domains.
err = netutil.ValidateDomainName(f)
if err != nil {
log.Error("%s: host %q is invalid, ignoring", hostsContainerPref, f)
continue
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
return ip, hosts
}
// HostsRecord represents a single hosts file record.
type HostsRecord struct {
Aliases *stringutil.Set
Canonical string
}
// Equal returns true if all fields of rec are equal to field in other or they
// both are nil.
func (rec *HostsRecord) Equal(other *HostsRecord... | </s> remove func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
</s> add func (hp *hostsParser) addRecord(ip netip.Addr, hosts []string) { </s> remove var rec *HostsRecord
v, ok := hp.table.Get(ip)
</s> add rec, ok := hp.table[ip] </s> remove return nil, nil
</s> add return netip.Addr{}, nil </s> re... |
return ip, hosts
}
// addRecord puts the record for the IP address to the rules builder if needed.
// The first host is considered to be the canonical name for the IP address.
// hosts must have at least one name.
func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
line :... | [
"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"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go | |
// addRecord puts the record for the IP address to the rules builder if needed.
// The first host is considered to be the canonical name for the IP address.
// hosts must have at least one name.
func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
line := strings.Join(append([]string{ip.String()}... | </s> remove // HostsRecord represents a single hosts file record.
type HostsRecord struct {
Aliases *stringutil.Set
Canonical string
}
// Equal returns true if all fields of rec are equal to field in other or they
// both are nil.
func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) {
if rec == nil {
ret... | func (hp *hostsParser) addRecord(ip netip.Addr, hosts []string) { |
// addRecord puts the record for the IP address to the rules builder if needed.
// The first host is considered to be the canonical name for the IP address.
// hosts must have at least one name.
func (hp *hostsParser) addRecord(ip netip.Addr, hosts []string) {
line := strings.Join(append([]string{ip.String(... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Gar... | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.