docstring_tokens
stringlengths 0
76.5k
| code_tokens
stringlengths 75
1.81M
| label_window
sequencelengths 4
2.12k
| html_url
stringlengths 74
116
| file_name
stringlengths 3
311
|
---|---|---|---|---|
fi := zf.FileInfo()
name = fi.Name()
if name == "" {
return "", nil
} | <mask>
<mask> break
<mask> }
<mask>
<mask> log.Debug("updater: created directory %q", outputName)
<mask>
<mask> continue
<mask> } else if header.Typeflag != tar.TypeReg {
<mask> log.Debug("updater: %s: unknown file type %d, skipping", inputNameOnly, header.Typeflag)
<mask> continue
</s> 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 <[email protected]>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9e391d98c31c1eeba7ef323
Author: Ainar Garipov <[email protected]>
Date: Mon May 24 15:33:45 2021 +0300
replace agherr with golibs' errors </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.
//
// TODO(a.garipov): See the similar todo in
// tarGzFileUnpack.
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 = fmt.Errorf("os.OpenFile(%s): %w", outputName, err)
break
}
_, err = io.Copy(f, tarReader)
if err != nil {
_ = f.Close()
err2 = fmt.Errorf("io.Copy(): %w", err)
break
}
err = f.Close()
if err != nil {
err2 = fmt.Errorf("f.Close(): %w", err)
break
</s> add err = os.Mkdir(outputName, fi.Mode())
if err != nil && !errors.Is(err, os.ErrExist) {
return "", fmt.Errorf("os.Mkdir(%q): %w", outputName, err) </s> remove err = os.Mkdir(outputName, os.FileMode(header.Mode&0o777))
if err != nil && !errors.Is(err, os.ErrExist) {
err2 = fmt.Errorf("os.Mkdir(%q): %w", outputName, err)
</s> add return files, err
} </s> remove break
}
</s> add func zipFileUnpackOne(outDir string, zf *zip.File) (name string, err error) {
var rc io.ReadCloser
rc, err = zf.Open()
if err != nil {
return "", fmt.Errorf("zip file Open(): %w", err)
}
defer func() { err = errors.WithDeferred(err, rc.Close()) }() </s> remove log.Debug("updater: created file %s", outputName)
files = append(files, header.Name)
</s> add log.Tracef("created directory %q", outputName)
return "", nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
outputName := filepath.Join(outDir, name)
if fi.IsDir() {
if name == "AdGuardHome" {
// Top-level AdGuardHome/. Skip it.
//
// TODO(a.garipov): See the similar todo in
// tarGzFileUnpack.
return "", nil | <mask> }
<mask>
<mask> log.Debug("updater: created directory %q", outputName)
<mask>
<mask> continue
<mask> } else if header.Typeflag != tar.TypeReg {
<mask> log.Debug("updater: %s: unknown file type %d, skipping", inputNameOnly, header.Typeflag)
<mask> continue
<mask> }
<mask>
<mask> var f io.WriteCloser
<mask> f, err = os.OpenFile(outputName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, os.FileMode(header.Mode&0o777))
<mask> if err != nil {
</s> 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 <[email protected]>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9e391d98c31c1eeba7ef323
Author: Ainar Garipov <[email protected]>
Date: Mon May 24 15:33:45 2021 +0300
replace agherr with golibs' errors </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 = fmt.Errorf("os.OpenFile(%s): %w", outputName, err)
break
}
_, err = io.Copy(f, tarReader)
if err != nil {
_ = f.Close()
err2 = fmt.Errorf("io.Copy(): %w", err)
break
}
err = f.Close()
if err != nil {
err2 = fmt.Errorf("f.Close(): %w", err)
break
</s> add err = os.Mkdir(outputName, fi.Mode())
if err != nil && !errors.Is(err, os.ErrExist) {
return "", fmt.Errorf("os.Mkdir(%q): %w", outputName, err) </s> remove break
}
</s> add func zipFileUnpackOne(outDir string, zf *zip.File) (name string, err error) {
var rc io.ReadCloser
rc, err = zf.Open()
if err != nil {
return "", fmt.Errorf("zip file Open(): %w", err)
}
defer func() { err = errors.WithDeferred(err, rc.Close()) }() </s> remove err = os.Mkdir(outputName, os.FileMode(header.Mode&0o777))
if err != nil && !errors.Is(err, os.ErrExist) {
err2 = fmt.Errorf("os.Mkdir(%q): %w", outputName, err)
</s> add return files, err
} </s> remove _ = gzReader.Close()
return files, err2
</s> add 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", err)
}
log.Tracef("created file %s", outputName)
return name, nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
err = os.Mkdir(outputName, fi.Mode())
if err != nil && !errors.Is(err, os.ErrExist) {
return "", fmt.Errorf("os.Mkdir(%q): %w", outputName, err) | <mask> log.Debug("updater: %s: unknown file type %d, skipping", inputNameOnly, header.Typeflag)
<mask> continue
<mask> }
<mask>
<mask> var f io.WriteCloser
<mask> f, err = os.OpenFile(outputName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, os.FileMode(header.Mode&0o777))
<mask> if err != nil {
<mask> err2 = fmt.Errorf("os.OpenFile(%s): %w", outputName, err)
<mask> break
<mask> }
<mask> _, err = io.Copy(f, tarReader)
<mask> if err != nil {
<mask> _ = f.Close()
<mask> err2 = fmt.Errorf("io.Copy(): %w", err)
<mask> break
<mask> }
<mask> err = f.Close()
<mask> if err != nil {
<mask> err2 = fmt.Errorf("f.Close(): %w", err)
<mask> break
<mask> }
<mask>
<mask> log.Debug("updater: created file %s", outputName)
<mask> files = append(files, header.Name)
<mask> }
</s> 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 <[email protected]>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9e391d98c31c1eeba7ef323
Author: Ainar Garipov <[email protected]>
Date: Mon May 24 15:33:45 2021 +0300
replace agherr with golibs' errors </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 := filepath.Join(outdir, inputNameOnly)
if fi.IsDir() {
if inputNameOnly == "AdGuardHome" {
// Top-level AdGuardHome/. Skip it.
//
// TODO(a.garipov): See the similar todo in
// tarGzFileUnpack.
continue
}
err = os.Mkdir(outputName, fi.Mode())
if err != nil && !errors.Is(err, os.ErrExist) {
err2 = fmt.Errorf("os.Mkdir(%q): %w", outputName, err)
break
}
log.Tracef("created directory %q", outputName)
continue
}
var f io.WriteCloser
f, err = os.OpenFile(outputName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, fi.Mode())
if err != nil {
err2 = fmt.Errorf("os.OpenFile(): %w", err)
break
}
_, err = io.Copy(f, zr)
if err != nil {
_ = f.Close()
err2 = fmt.Errorf("io.Copy(): %w", err)
break
</s> add if name != "" {
files = append(files, name) </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 log.Debug("updater: created directory %q", outputName)
</s> add fi := zf.FileInfo()
name = fi.Name()
if name == "" {
return "", nil
} </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.
//
// TODO(a.garipov): See the similar todo in
// tarGzFileUnpack.
return "", nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
log.Tracef("created directory %q", outputName)
return "", nil | <mask> err2 = fmt.Errorf("f.Close(): %w", err)
<mask> break
<mask> }
<mask>
<mask> log.Debug("updater: created file %s", outputName)
<mask> files = append(files, header.Name)
<mask> }
<mask>
<mask> _ = gzReader.Close()
<mask> return files, err2
<mask> }
</s> Pull request: replace agherr with golibs' errors
Merge in DNS/adguard-home from golibs-errors to master
Squashed commit of the following:
commit 5aba278a31c5a213bd9e08273ce7277c57713b22
Author: Ainar Garipov <[email protected]>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9e391d98c31c1eeba7ef323
Author: Ainar Garipov <[email protected]>
Date: Mon May 24 15:33:45 2021 +0300
replace agherr with golibs' errors </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(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("io.Copy(): %w", err)
break
}
err = f.Close()
if err != nil {
err2 = fmt.Errorf("f.Close(): %w", err)
break
</s> add err = os.Mkdir(outputName, fi.Mode())
if err != nil && !errors.Is(err, os.ErrExist) {
return "", fmt.Errorf("os.Mkdir(%q): %w", outputName, err) </s> remove _ = gzReader.Close()
return files, err2
</s> add 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", err)
}
log.Tracef("created file %s", outputName)
return name, nil </s> remove _ = zr.Close()
return files, err2
</s> add return files, err </s> remove err = os.Mkdir(outputName, os.FileMode(header.Mode&0o777))
if err != nil && !errors.Is(err, os.ErrExist) {
err2 = fmt.Errorf("os.Mkdir(%q): %w", outputName, err)
</s> add return files, err
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
var wc io.WriteCloser
wc, err = os.OpenFile(outputName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, fi.Mode())
if err != nil {
return "", fmt.Errorf("os.OpenFile(): %w", err)
}
defer func() { err = errors.WithDeferred(err, wc.Close()) }()
_, err = io.Copy(wc, rc)
if err != nil {
return "", fmt.Errorf("io.Copy(): %w", err)
}
log.Tracef("created file %s", outputName)
return name, nil | <mask> log.Debug("updater: created file %s", outputName)
<mask> files = append(files, header.Name)
<mask> }
<mask>
<mask> _ = gzReader.Close()
<mask> return files, err2
<mask> }
<mask>
<mask> // Unpack all files from .zip file to the specified directory
<mask> // Existing files are overwritten
<mask> // All files are created inside 'outdir', subdirectories are not created
</s> 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 <[email protected]>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9e391d98c31c1eeba7ef323
Author: Ainar Garipov <[email protected]>
Date: Mon May 24 15:33:45 2021 +0300
replace agherr with golibs' errors </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 are not created </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 func tarGzFileUnpack(tarfile, outdir string) ([]string, error) {
</s> add func tarGzFileUnpack(tarfile, outDir string) (files []string, err error) { </s> remove log.Debug("updater: created file %s", outputName)
files = append(files, header.Name)
</s> add log.Tracef("created directory %q", outputName)
return "", nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
// All files are created inside 'outDir', subdirectories are not created | <mask> }
<mask>
<mask> // Unpack all files from .zip file to the specified directory
<mask> // Existing files are overwritten
<mask> // All files are created inside 'outdir', subdirectories are not created
<mask> // Return the list of files (not directories) written
<mask> func zipFileUnpack(zipfile, outdir string) ([]string, error) {
<mask> r, err := zip.OpenReader(zipfile)
<mask> if err != nil {
<mask> return nil, fmt.Errorf("zip.OpenReader(): %w", err)
</s> 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 <[email protected]>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9e391d98c31c1eeba7ef323
Author: Ainar Garipov <[email protected]>
Date: Mon May 24 15:33:45 2021 +0300
replace agherr with golibs' errors </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> add // All files are created inside outDir, subdirectories are not created </s> remove func tarGzFileUnpack(tarfile, outdir string) ([]string, error) {
</s> add func tarGzFileUnpack(tarfile, outDir string) (files []string, err error) { </s> remove _ = gzReader.Close()
return files, err2
</s> add 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", err)
}
log.Tracef("created file %s", outputName)
return name, nil </s> remove defer r.Close()
</s> add defer func() { err = errors.WithDeferred(err, zrc.Close()) }() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
func zipFileUnpack(zipfile, outDir string) (files []string, err error) {
zrc, err := zip.OpenReader(zipfile) | <mask> // Unpack all files from .zip file to the specified directory
<mask> // Existing files are overwritten
<mask> // All files are created inside 'outdir', subdirectories are not created
<mask> // Return the list of files (not directories) written
<mask> func zipFileUnpack(zipfile, outdir string) ([]string, error) {
<mask> r, err := zip.OpenReader(zipfile)
<mask> if err != nil {
<mask> return nil, fmt.Errorf("zip.OpenReader(): %w", err)
<mask> }
<mask> defer r.Close()
<mask>
</s> 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 <[email protected]>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9e391d98c31c1eeba7ef323
Author: Ainar Garipov <[email protected]>
Date: Mon May 24 15:33:45 2021 +0300
replace agherr with golibs' errors </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 are not created </s> remove func tarGzFileUnpack(tarfile, outdir string) ([]string, error) {
</s> add func tarGzFileUnpack(tarfile, outDir string) (files []string, err error) { </s> remove _ = gzReader.Close()
return files, err2
</s> add 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", err)
}
log.Tracef("created file %s", outputName)
return name, nil </s> remove defer r.Close()
</s> add defer func() { err = errors.WithDeferred(err, zrc.Close()) }() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
defer func() { err = errors.WithDeferred(err, zrc.Close()) }() | <mask> r, err := zip.OpenReader(zipfile)
<mask> if err != nil {
<mask> return nil, fmt.Errorf("zip.OpenReader(): %w", err)
<mask> }
<mask> defer r.Close()
<mask>
<mask> var files []string
<mask> var err2 error
<mask> var zr io.ReadCloser
<mask> for _, zf := range r.File {
</s> Pull request: 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 <[email protected]>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9e391d98c31c1eeba7ef323
Author: Ainar Garipov <[email protected]>
Date: Mon May 24 15:33:45 2021 +0300
replace agherr with golibs' errors </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 []string
var err2 error
</s> add </s> remove var header *tar.Header
header, err = tarReader.Next()
if err == io.EOF {
err2 = nil
break
}
if err != nil {
err2 = fmt.Errorf("tarReader.Next(): %w", err)
</s> add var hdr *tar.Header
hdr, err = tarReader.Next()
if errors.Is(err, io.EOF) {
err = nil
</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) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
for _, zf := range zrc.File {
var name string
name, err = zipFileUnpackOne(outDir, zf) | <mask> return nil, fmt.Errorf("zip.OpenReader(): %w", err)
<mask> }
<mask> defer r.Close()
<mask>
<mask> var files []string
<mask> var err2 error
<mask> var zr io.ReadCloser
<mask> for _, zf := range r.File {
<mask> zr, err = zf.Open()
<mask> if err != nil {
<mask> err2 = fmt.Errorf("zip file Open(): %w", err)
<mask> break
<mask> }
<mask>
</s> 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 <[email protected]>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9e391d98c31c1eeba7ef323
Author: Ainar Garipov <[email protected]>
Date: Mon May 24 15:33:45 2021 +0300
replace agherr with golibs' errors </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 = fmt.Errorf("tarReader.Next(): %w", err)
</s> add var hdr *tar.Header
hdr, err = tarReader.Next()
if errors.Is(err, io.EOF) {
err = nil
</s> remove var files []string
var err2 error
</s> add </s> remove break
}
</s> add func zipFileUnpackOne(outDir string, zf *zip.File) (name string, err error) {
var rc io.ReadCloser
rc, err = zf.Open()
if err != nil {
return "", fmt.Errorf("zip file Open(): %w", err)
}
defer func() { err = errors.WithDeferred(err, rc.Close()) }() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
<mask> var zr io.ReadCloser
<mask> for _, zf := range r.File {
<mask> zr, err = zf.Open()
<mask> if err != nil {
<mask> err2 = fmt.Errorf("zip file Open(): %w", err)
<mask> break
<mask> }
<mask>
<mask> fi := zf.FileInfo()
<mask> inputNameOnly := fi.Name()
</s> Pull request: replace agherr with golibs' errors
Merge in DNS/adguard-home from golibs-errors to master
Squashed commit of the following:
commit 5aba278a31c5a213bd9e08273ce7277c57713b22
Author: Ainar Garipov <[email protected]>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9e391d98c31c1eeba7ef323
Author: Ainar Garipov <[email protected]>
Date: Mon May 24 15:33:45 2021 +0300
replace agherr with golibs' errors </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()) }() </s> remove fi := zf.FileInfo()
inputNameOnly := fi.Name()
if inputNameOnly == "" {
continue
}
outputName := filepath.Join(outdir, inputNameOnly)
if fi.IsDir() {
if inputNameOnly == "AdGuardHome" {
// Top-level AdGuardHome/. Skip it.
//
// TODO(a.garipov): See the similar todo in
// tarGzFileUnpack.
continue
}
err = os.Mkdir(outputName, fi.Mode())
if err != nil && !errors.Is(err, os.ErrExist) {
err2 = fmt.Errorf("os.Mkdir(%q): %w", outputName, err)
break
}
log.Tracef("created directory %q", outputName)
continue
}
var f io.WriteCloser
f, err = os.OpenFile(outputName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, fi.Mode())
if err != nil {
err2 = fmt.Errorf("os.OpenFile(): %w", err)
break
}
_, err = io.Copy(f, zr)
if err != nil {
_ = f.Close()
err2 = fmt.Errorf("io.Copy(): %w", err)
break
</s> add if name != "" {
files = append(files, name) </s> remove break
}
</s> add func zipFileUnpackOne(outDir string, zf *zip.File) (name string, err error) {
var rc io.ReadCloser
rc, err = zf.Open()
if err != nil {
return "", fmt.Errorf("zip file Open(): %w", err)
}
defer func() { err = errors.WithDeferred(err, rc.Close()) }() </s> remove var header *tar.Header
header, err = tarReader.Next()
if err == io.EOF {
err2 = nil
break
}
if err != nil {
err2 = fmt.Errorf("tarReader.Next(): %w", err)
</s> add var hdr *tar.Header
hdr, err = tarReader.Next()
if errors.Is(err, io.EOF) {
err = nil
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
|
if name != "" {
files = append(files, name) | <mask> err2 = fmt.Errorf("zip file Open(): %w", err)
<mask> break
<mask> }
<mask>
<mask> fi := zf.FileInfo()
<mask> inputNameOnly := fi.Name()
<mask> if inputNameOnly == "" {
<mask> continue
<mask> }
<mask>
<mask> outputName := filepath.Join(outdir, inputNameOnly)
<mask>
<mask> if fi.IsDir() {
<mask> if inputNameOnly == "AdGuardHome" {
<mask> // Top-level AdGuardHome/. Skip it.
<mask> //
<mask> // TODO(a.garipov): See the similar todo in
<mask> // tarGzFileUnpack.
<mask> continue
<mask> }
<mask>
<mask> err = os.Mkdir(outputName, fi.Mode())
<mask> if err != nil && !errors.Is(err, os.ErrExist) {
<mask> err2 = fmt.Errorf("os.Mkdir(%q): %w", outputName, err)
<mask>
<mask> break
<mask> }
<mask>
<mask> log.Tracef("created directory %q", outputName)
<mask>
<mask> continue
<mask> }
<mask>
<mask> var f io.WriteCloser
<mask> f, err = os.OpenFile(outputName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, fi.Mode())
<mask> if err != nil {
<mask> err2 = fmt.Errorf("os.OpenFile(): %w", err)
<mask> break
<mask> }
<mask> _, err = io.Copy(f, zr)
<mask> if err != nil {
<mask> _ = f.Close()
<mask> err2 = fmt.Errorf("io.Copy(): %w", err)
<mask> break
<mask> }
<mask> err = f.Close()
<mask> if err != nil {
<mask> err2 = fmt.Errorf("f.Close(): %w", err)
<mask> break
</s> 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 <[email protected]>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9e391d98c31c1eeba7ef323
Author: Ainar Garipov <[email protected]>
Date: Mon May 24 15:33:45 2021 +0300
replace agherr with golibs' errors </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("io.Copy(): %w", err)
break
}
err = f.Close()
if err != nil {
err2 = fmt.Errorf("f.Close(): %w", err)
break
</s> add err = os.Mkdir(outputName, fi.Mode())
if err != nil && !errors.Is(err, os.ErrExist) {
return "", fmt.Errorf("os.Mkdir(%q): %w", outputName, err) </s> remove _, inputNameOnly := filepath.Split(header.Name)
if inputNameOnly == "" {
continue
</s> add break </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 }
</s> add } else if err != nil {
err = fmt.Errorf("tarReader.Next(): %w", err) </s> remove err = os.Mkdir(outputName, os.FileMode(header.Mode&0o777))
if err != nil && !errors.Is(err, os.ErrExist) {
err2 = fmt.Errorf("os.Mkdir(%q): %w", outputName, err)
</s> add return files, err
} | [
"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",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
<mask> _ = f.Close()
<mask> err2 = fmt.Errorf("io.Copy(): %w", err)
<mask> break
<mask> }
<mask> err = f.Close()
<mask> if err != nil {
<mask> err2 = fmt.Errorf("f.Close(): %w", err)
<mask> break
<mask> }
<mask>
<mask> log.Tracef("created file %s", outputName)
<mask> files = append(files, inputNameOnly)
<mask> }
<mask>
<mask> _ = zr.Close()
<mask> return files, err2
<mask> }
</s> 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 <[email protected]>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9e391d98c31c1eeba7ef323
Author: Ainar Garipov <[email protected]>
Date: Mon May 24 15:33:45 2021 +0300
replace agherr with golibs' errors </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(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("io.Copy(): %w", err)
break
}
err = f.Close()
if err != nil {
err2 = fmt.Errorf("f.Close(): %w", err)
break
</s> add err = os.Mkdir(outputName, fi.Mode())
if err != nil && !errors.Is(err, os.ErrExist) {
return "", fmt.Errorf("os.Mkdir(%q): %w", outputName, err) </s> remove fi := zf.FileInfo()
inputNameOnly := fi.Name()
if inputNameOnly == "" {
continue
}
outputName := filepath.Join(outdir, inputNameOnly)
if fi.IsDir() {
if inputNameOnly == "AdGuardHome" {
// Top-level AdGuardHome/. Skip it.
//
// TODO(a.garipov): See the similar todo in
// tarGzFileUnpack.
continue
}
err = os.Mkdir(outputName, fi.Mode())
if err != nil && !errors.Is(err, os.ErrExist) {
err2 = fmt.Errorf("os.Mkdir(%q): %w", outputName, err)
break
}
log.Tracef("created directory %q", outputName)
continue
}
var f io.WriteCloser
f, err = os.OpenFile(outputName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, fi.Mode())
if err != nil {
err2 = fmt.Errorf("os.OpenFile(): %w", err)
break
}
_, err = io.Copy(f, zr)
if err != nil {
_ = f.Close()
err2 = fmt.Errorf("io.Copy(): %w", err)
break
</s> add if name != "" {
files = append(files, name) </s> remove _ = gzReader.Close()
return files, err2
</s> add 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", err)
}
log.Tracef("created file %s", outputName)
return name, nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
|
return files, err | <mask> log.Tracef("created file %s", outputName)
<mask> files = append(files, inputNameOnly)
<mask> }
<mask>
<mask> _ = zr.Close()
<mask> return files, err2
<mask> }
<mask>
<mask> // Copy file on disk
<mask> func copyFile(src, dst string) error {
<mask> d, e := os.ReadFile(src)
</s> Pull request: 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 <[email protected]>
Date: Mon May 24 17:05:18 2021 +0300
all: imp code
commit f447eb875b81779fa9e391d98c31c1eeba7ef323
Author: Ainar Garipov <[email protected]>
Date: Mon May 24 15:33:45 2021 +0300
replace agherr with golibs' errors </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.Tracef("created directory %q", outputName)
return "", nil </s> remove _ = gzReader.Close()
return files, err2
</s> add 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", err)
}
log.Tracef("created file %s", outputName)
return name, 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 = fmt.Errorf("os.OpenFile(%s): %w", outputName, err)
break
}
_, err = io.Copy(f, tarReader)
if err != nil {
_ = f.Close()
err2 = fmt.Errorf("io.Copy(): %w", err)
break
}
err = f.Close()
if err != nil {
err2 = fmt.Errorf("f.Close(): %w", err)
break
</s> add err = os.Mkdir(outputName, fi.Mode())
if err != nil && !errors.Is(err, os.ErrExist) {
return "", fmt.Errorf("os.Mkdir(%q): %w", outputName, err) </s> remove fi := zf.FileInfo()
inputNameOnly := fi.Name()
if inputNameOnly == "" {
continue
}
outputName := filepath.Join(outdir, inputNameOnly)
if fi.IsDir() {
if inputNameOnly == "AdGuardHome" {
// Top-level AdGuardHome/. Skip it.
//
// TODO(a.garipov): See the similar todo in
// tarGzFileUnpack.
continue
}
err = os.Mkdir(outputName, fi.Mode())
if err != nil && !errors.Is(err, os.ErrExist) {
err2 = fmt.Errorf("os.Mkdir(%q): %w", outputName, err)
break
}
log.Tracef("created directory %q", outputName)
continue
}
var f io.WriteCloser
f, err = os.OpenFile(outputName, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, fi.Mode())
if err != nil {
err2 = fmt.Errorf("os.OpenFile(): %w", err)
break
}
_, err = io.Copy(f, zr)
if err != nil {
_ = f.Close()
err2 = fmt.Errorf("io.Copy(): %w", err)
break
</s> add if name != "" {
files = append(files, name) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/03a828ef5140f232ee755f62d9c3410242833b38 | internal/updater/updater.go |
err = startDHCPServer()
if err != nil {
log.Fatal(err)
}
| <mask> log.Fatal(err)
<mask> }
<mask>
<mask> URL := fmt.Sprintf("http://%s", address)
<mask> log.Println("Go to " + URL)
<mask> log.Fatal(http.ListenAndServe(address, nil))
<mask> }
<mask>
</s> Start DHCP on launch if it's enabled in config. </s> remove // implement
</s> add | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/03effab345e2bc9e77926a64acd426f71b5004cd | app.go |
"github.com/joomcode/errorx" | <mask> "net"
<mask> "net/http"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/dhcpd"
<mask> )
<mask>
<mask> var dhcpServer = dhcpd.Server{}
<mask>
</s> Start DHCP on launch if it's enabled in config. </s> remove // implement
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/03effab345e2bc9e77926a64acd426f71b5004cd | dhcp.go |
<mask> return
<mask> }
<mask> }
<mask>
<mask> // implement
<mask> func handleDHCPFindActiveServer(w http.ResponseWriter, r *http.Request) {
<mask> found, err := dhcpd.CheckIfOtherDHCPServersPresent(config.DHCP.InterfaceName)
<mask> result := map[string]interface{}{}
<mask> if err != nil {
<mask> result["error"] = err.Error()
</s> Start DHCP on launch if it's enabled in config. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/03effab345e2bc9e77926a64acd426f71b5004cd | dhcp.go |
|
'coverage':
'status':
'project':
'default':
'target': '40%'
'threshold': null
'patch': false
'changes': false | <mask> coverage:
<mask> status:
<mask> project:
<mask> default:
<mask> target: 40%
<mask> threshold: null
<mask> patch: false
<mask> changes: false
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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.io
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
</s> add '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-action@v1'
- 'name': 'Docker Buildx (build)'
'run': 'make docker-multi-arch' </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
publish: false
license: GPL-3.0
extra_files:
- source: scripts/snap/local/adguard-home-web.sh
destination: adguard-home-web.sh
mode: 0755
- source: scripts/snap/gui/adguard-home-web.desktop
destination: meta/gui/adguard-home-web.desktop
mode: 0644
- source: scripts/snap/gui/adguard-home-web.png
destination: meta/gui/adguard-home-web.png
mode: 0644
apps:
adguard-home:
command: AdGuardHome -w $SNAP_DATA --no-check-update
plugs:
# Add the "netrwork-bind" plug to bind to interfaces.
- network-bind
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- network-control
daemon: simple
adguard-home-web:
command: adguard-home-web.sh
plugs: [ desktop ]
</s> add 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': false
'license': 'GPL-3.0'
'extra_files':
- 'source': 'scripts/snap/local/adguard-home-web.sh'
'destination': 'adguard-home-web.sh'
'mode': 0755
- 'source': 'scripts/snap/gui/adguard-home-web.desktop'
'destination': 'meta/gui/adguard-home-web.desktop'
'mode': 0644
- 'source': 'scripts/snap/gui/adguard-home-web.png'
'destination': 'meta/gui/adguard-home-web.png'
'mode': 0644
'apps':
'adguard-home':
'command': 'AdGuardHome -w $SNAP_DATA --no-check-update'
'plugs':
# Add the "netrwork-bind" plug to bind to interfaces.
- 'network-bind'
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- 'network-control'
'daemon': 'simple'
'adguard-home-web':
'command': 'adguard-home-web.sh'
'plugs':
- 'desktop' </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 to use when marking an issue as stale
staleLabel: 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
</s> add # 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 when marking an issue as stale.
'staleLabel': 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable.
'markComment': > </s> remove jobs:
</s> add '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'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
- 'name': 'Set up Go'
'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/cache@v2'
'with':
'path': '~/go/pkg/mod'
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
'restore-keys': '${{ runner.os }}-go-'
- 'name': 'Get npm cache directory'
'id': 'npm-cache'
'run': 'echo "::set-output name=dir::$(npm config get cache)"'
- 'name': 'Set up npm cache'
'uses': 'actions/cache@v2'
'with':
'path': '${{ steps.npm-cache.outputs.dir }}'
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Run make ci'
'shell': 'bash'
'run': 'make ci'
- 'name': 'Upload coverage'
'uses': 'codecov/codecov-action@v1'
'if': "success() && matrix.os == 'ubuntu-latest'"
'with':
'token': '${{ secrets.CODECOV_TOKEN }}'
'file': './coverage.txt'
'app':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
- 'name': 'Set up Go'
'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/cache@v2'
'with':
'path': '~/go/pkg/mod'
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
'restore-keys': '${{ runner.os }}-go-'
- 'name': 'Get npm cache directory'
'id': 'npm-cache'
'run': 'echo "::set-output name=dir::$(npm config get cache)"'
- 'name': 'Set up node_modules cache'
'uses': 'actions/cache@v2'
'with':
'path': '${{ steps.npm-cache.outputs.dir }}'
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Set up Snapcraft'
'run': 'sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft'
- 'name': 'Set up GoReleaser'
'run': 'curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh'
- 'name': 'Run snapshot build'
'run': 'make release' | [
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .codecov.yml |
# Number of days of inactivity before an issue becomes stale.
'daysUntilStale': 60
# Number of days of inactivity before a stale issue is closed.
'daysUntilClose': 7
# Issues with these labels will never be considered stale.
'exemptLabels':
- 'bug'
- 'enhancement'
- 'feature request'
- 'localization'
# Label to use when marking an issue as stale.
'staleLabel': 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable.
'markComment': > | <mask> # Number of days of inactivity before an issue becomes stale
<mask> daysUntilStale: 60
<mask> # Number of days of inactivity before a stale issue is closed
<mask> daysUntilClose: 7
<mask> # Issues with these labels will never be considered stale
<mask> exemptLabels:
<mask> - 'bug'
<mask> - 'enhancement'
<mask> - 'feature request'
<mask> - 'localization'
<mask> # Label to use when marking an issue as stale
<mask> staleLabel: 'wontfix'
<mask> # Comment to post when marking an issue as stale. Set to `false` to disable
<mask> markComment: >
<mask> This issue has been automatically marked as stale because it has not had
<mask> recent activity. It will be closed if no further activity occurs. Thank you
<mask> for your contributions.
<mask> # Comment to post when closing a stale issue. Set to `false` to disable
<mask> closeComment: false
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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 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 occurrences
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- G108
# gosec: Subprocess launched with function call as argument or cmd arguments
- G204
# gosec: Potential DoS vulnerability via decompression bomb
- G110
# gosec: Expect WriteFile permissions to be 0600 or less
- G306
</s> add '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 occurrences'
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- 'G108'
# gosec: Subprocess launched with function call as argument or cmd arguments
- 'G204'
# gosec: Potential DoS vulnerability via decompression bomb
- 'G110'
# gosec: Expect WriteFile permissions to be 0600 or less
- 'G306' </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
publish: false
license: GPL-3.0
extra_files:
- source: scripts/snap/local/adguard-home-web.sh
destination: adguard-home-web.sh
mode: 0755
- source: scripts/snap/gui/adguard-home-web.desktop
destination: meta/gui/adguard-home-web.desktop
mode: 0644
- source: scripts/snap/gui/adguard-home-web.png
destination: meta/gui/adguard-home-web.png
mode: 0644
apps:
adguard-home:
command: AdGuardHome -w $SNAP_DATA --no-check-update
plugs:
# Add the "netrwork-bind" plug to bind to interfaces.
- network-bind
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- network-control
daemon: simple
adguard-home-web:
command: adguard-home-web.sh
plugs: [ desktop ]
</s> add 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': false
'license': 'GPL-3.0'
'extra_files':
- 'source': 'scripts/snap/local/adguard-home-web.sh'
'destination': 'adguard-home-web.sh'
'mode': 0755
- 'source': 'scripts/snap/gui/adguard-home-web.desktop'
'destination': 'meta/gui/adguard-home-web.desktop'
'mode': 0644
- 'source': 'scripts/snap/gui/adguard-home-web.png'
'destination': 'meta/gui/adguard-home-web.png'
'mode': 0644
'apps':
'adguard-home':
'command': 'AdGuardHome -w $SNAP_DATA --no-check-update'
'plugs':
# Add the "netrwork-bind" plug to bind to interfaces.
- 'network-bind'
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- 'network-control'
'daemon': 'simple'
'adguard-home-web':
'command': 'adguard-home-web.sh'
'plugs':
- 'desktop' </s> remove issues:
</s> add 'issues': </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/.*'
- 'dist/.*' | [
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .github/stale.yml |
# Comment to post when closing a stale issue. Set to `false` to disable.
'closeComment': false | <mask> markComment: >
<mask> This issue has been automatically marked as stale because it has not had
<mask> recent activity. It will be closed if no further activity occurs. Thank you
<mask> for your contributions.
<mask> # Comment to post when closing a stale issue. Set to `false` to disable
<mask> closeComment: false
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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 to use when marking an issue as stale
staleLabel: 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
</s> add # 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 when marking an issue as stale.
'staleLabel': 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable.
'markComment': > </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
publish: false
license: GPL-3.0
extra_files:
- source: scripts/snap/local/adguard-home-web.sh
destination: adguard-home-web.sh
mode: 0755
- source: scripts/snap/gui/adguard-home-web.desktop
destination: meta/gui/adguard-home-web.desktop
mode: 0644
- source: scripts/snap/gui/adguard-home-web.png
destination: meta/gui/adguard-home-web.png
mode: 0644
apps:
adguard-home:
command: AdGuardHome -w $SNAP_DATA --no-check-update
plugs:
# Add the "netrwork-bind" plug to bind to interfaces.
- network-bind
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- network-control
daemon: simple
adguard-home-web:
command: adguard-home-web.sh
plugs: [ desktop ]
</s> add 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': false
'license': 'GPL-3.0'
'extra_files':
- 'source': 'scripts/snap/local/adguard-home-web.sh'
'destination': 'adguard-home-web.sh'
'mode': 0755
- 'source': 'scripts/snap/gui/adguard-home-web.desktop'
'destination': 'meta/gui/adguard-home-web.desktop'
'mode': 0644
- 'source': 'scripts/snap/gui/adguard-home-web.png'
'destination': 'meta/gui/adguard-home-web.png'
'mode': 0644
'apps':
'adguard-home':
'command': 'AdGuardHome -w $SNAP_DATA --no-check-update'
'plugs':
# Add the "netrwork-bind" plug to bind to interfaces.
- 'network-bind'
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- 'network-control'
'daemon': 'simple'
'adguard-home-web':
'command': 'adguard-home-web.sh'
'plugs':
- 'desktop' </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 set it up, it'll cover ALL your home devices, and you don't need any
client-side software for that.
</s> add '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 up, it'll cover ALL your home devices, and you don't need any
client-side software for that. </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
- string .forcesafesearch.google.com. has 3 occurrences
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- G108
# gosec: Subprocess launched with function call as argument or cmd arguments
- G204
# gosec: Potential DoS vulnerability via decompression bomb
- G110
# gosec: Expect WriteFile permissions to be 0600 or less
- G306
</s> add '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 occurrences'
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- 'G108'
# gosec: Subprocess launched with function call as argument or cmd arguments
- 'G204'
# gosec: Potential DoS vulnerability via decompression bomb
- 'G110'
# gosec: Expect WriteFile permissions to be 0600 or less
- 'G306' </s> remove deadline: 2m
</s> add 'deadline': '2m' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .github/stale.yml |
'name': 'build' | <mask> name: build
<mask>
<mask> env:
<mask> GO_VERSION: 1.14
<mask> NODE_VERSION: 13
<mask>
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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: 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') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
-
name: Set up npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
-
name: Run make ci
shell: bash
run: |
make ci
-
name: Upload coverage
uses: codecov/codecov-action@v1
if: success() && matrix.os == 'ubuntu-latest'
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
app:
runs-on: ubuntu-latest
needs: test
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
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/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
-
name: Set up node_modules cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
-
name: Set up Snapcraft
run: |
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
-
name: Set up GoReleaser
run: |
curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh
-
name: Run snapshot build
run: |
make release
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-action@v1
-
name: Docker Buildx (build)
run: |
make docker-multi-arch
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:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> add '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':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' </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/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
</s> add '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-action@v1'
- 'name': 'Docker Buildx (build)'
'run': 'make docker-multi-arch' </s> remove 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/[email protected]
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.32
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm --prefix client ci
- name: Run ESLint
run: npm --prefix client run lint
notify:
needs: [golangci,eslint]
# 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:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> add '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/[email protected]'
'with':
# This field is required. Don't set the patch version to always use
# the latest patch version.
'version': 'v1.32'
'eslint':
'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
'run': 'npm --prefix client ci'
- 'name': 'Run ESLint'
'run': 'npm --prefix client run lint'
'notify':
'needs':
- 'golangci'
- 'eslint'
# 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':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' | [
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .github/workflows/build.yml |
'env':
'GO_VERSION': '1.14'
'NODE_VERSION': '13' | <mask> name: build
<mask>
<mask> env:
<mask> GO_VERSION: 1.14
<mask> NODE_VERSION: 13
<mask>
<mask> on:
<mask> push:
<mask> branches:
<mask> - '*'
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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:
- '*'
pull_request:
jobs:
golangci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/[email protected]
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.32
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm --prefix client ci
- name: Run ESLint
run: npm --prefix client run lint
notify:
needs: [golangci,eslint]
# 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:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> add '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/[email protected]'
'with':
# This field is required. Don't set the patch version to always use
# the latest patch version.
'version': 'v1.32'
'eslint':
'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
'run': 'npm --prefix client ci'
- 'name': 'Run ESLint'
'run': 'npm --prefix client run lint'
'notify':
'needs':
- 'golangci'
- 'eslint'
# 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':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' </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') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
-
name: Set up npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
-
name: Run make ci
shell: bash
run: |
make ci
-
name: Upload coverage
uses: codecov/codecov-action@v1
if: success() && matrix.os == 'ubuntu-latest'
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
app:
runs-on: ubuntu-latest
needs: test
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
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/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
-
name: Set up node_modules cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
-
name: Set up Snapcraft
run: |
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
-
name: Set up GoReleaser
run: |
curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh
-
name: Run snapshot build
run: |
make release
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-action@v1
-
name: Docker Buildx (build)
run: |
make docker-multi-arch
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:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> add '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':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' </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/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
</s> add '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-action@v1'
- 'name': 'Docker Buildx (build)'
'run': 'make docker-multi-arch' | [
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .github/workflows/build.yml |
'on':
'push':
'branches':
- '*'
'tags':
- 'v*'
'pull_request': | <mask> env:
<mask> GO_VERSION: 1.14
<mask> NODE_VERSION: 13
<mask>
<mask> on:
<mask> push:
<mask> branches:
<mask> - '*'
<mask> tags:
<mask> - v*
<mask> pull_request:
<mask>
<mask> jobs:
<mask>
<mask> test:
<mask> runs-on: ${{ matrix.os }}
</s> Pull request: all: 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 <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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
- name: golangci-lint
uses: golangci/[email protected]
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.32
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm --prefix client ci
- name: Run ESLint
run: npm --prefix client run lint
notify:
needs: [golangci,eslint]
# 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:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> add '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/[email protected]'
'with':
# This field is required. Don't set the patch version to always use
# the latest patch version.
'version': 'v1.32'
'eslint':
'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
'run': 'npm --prefix client ci'
- 'name': 'Run ESLint'
'run': 'npm --prefix client run lint'
'notify':
'needs':
- 'golangci'
- 'eslint'
# 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':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' </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/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
</s> add '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-action@v1'
- 'name': 'Docker Buildx (build)'
'run': 'make docker-multi-arch' </s> remove name: build
</s> add 'name': 'build' </s> remove jobs:
</s> add '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'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
- 'name': 'Set up Go'
'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/cache@v2'
'with':
'path': '~/go/pkg/mod'
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
'restore-keys': '${{ runner.os }}-go-'
- 'name': 'Get npm cache directory'
'id': 'npm-cache'
'run': 'echo "::set-output name=dir::$(npm config get cache)"'
- 'name': 'Set up npm cache'
'uses': 'actions/cache@v2'
'with':
'path': '${{ steps.npm-cache.outputs.dir }}'
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Run make ci'
'shell': 'bash'
'run': 'make ci'
- 'name': 'Upload coverage'
'uses': 'codecov/codecov-action@v1'
'if': "success() && matrix.os == 'ubuntu-latest'"
'with':
'token': '${{ secrets.CODECOV_TOKEN }}'
'file': './coverage.txt'
'app':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
- 'name': 'Set up Go'
'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/cache@v2'
'with':
'path': '~/go/pkg/mod'
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
'restore-keys': '${{ runner.os }}-go-'
- 'name': 'Get npm cache directory'
'id': 'npm-cache'
'run': 'echo "::set-output name=dir::$(npm config get cache)"'
- 'name': 'Set up node_modules cache'
'uses': 'actions/cache@v2'
'with':
'path': '${{ steps.npm-cache.outputs.dir }}'
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Set up Snapcraft'
'run': 'sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft'
- 'name': 'Set up GoReleaser'
'run': 'curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh'
- 'name': 'Run snapshot build'
'run': 'make release' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .github/workflows/build.yml |
'jobs':
'test':
'runs-on': '${{ matrix.os }}'
'env':
'GO111MODULE': 'on'
'GOPROXY': 'https://goproxy.io'
'strategy':
'fail-fast': false
'matrix':
'os':
- 'ubuntu-latest'
- 'macOS-latest'
- 'windows-latest'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
- 'name': 'Set up Go'
'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/cache@v2'
'with':
'path': '~/go/pkg/mod'
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
'restore-keys': '${{ runner.os }}-go-'
- 'name': 'Get npm cache directory'
'id': 'npm-cache'
'run': 'echo "::set-output name=dir::$(npm config get cache)"'
- 'name': 'Set up npm cache'
'uses': 'actions/cache@v2'
'with':
'path': '${{ steps.npm-cache.outputs.dir }}'
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Run make ci'
'shell': 'bash'
'run': 'make ci'
- 'name': 'Upload coverage'
'uses': 'codecov/codecov-action@v1'
'if': "success() && matrix.os == 'ubuntu-latest'"
'with':
'token': '${{ secrets.CODECOV_TOKEN }}'
'file': './coverage.txt'
'app':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
- 'name': 'Set up Go'
'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/cache@v2'
'with':
'path': '~/go/pkg/mod'
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
'restore-keys': '${{ runner.os }}-go-'
- 'name': 'Get npm cache directory'
'id': 'npm-cache'
'run': 'echo "::set-output name=dir::$(npm config get cache)"'
- 'name': 'Set up node_modules cache'
'uses': 'actions/cache@v2'
'with':
'path': '${{ steps.npm-cache.outputs.dir }}'
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Set up Snapcraft'
'run': 'sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft'
- 'name': 'Set up GoReleaser'
'run': 'curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh'
- 'name': 'Run snapshot build'
'run': 'make release' | <mask> tags:
<mask> - v*
<mask> pull_request:
<mask>
<mask> jobs:
<mask>
<mask> test:
<mask> runs-on: ${{ matrix.os }}
<mask> env:
<mask> GO111MODULE: on
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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-fast: false
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
</s> add '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-action@v1'
- 'name': 'Docker Buildx (build)'
'run': 'make docker-multi-arch' </s> remove 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/[email protected]
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.32
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm --prefix client ci
- name: Run ESLint
run: npm --prefix client run lint
notify:
needs: [golangci,eslint]
# 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:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> add '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/[email protected]'
'with':
# This field is required. Don't set the patch version to always use
# the latest patch version.
'version': 'v1.32'
'eslint':
'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
'run': 'npm --prefix client ci'
- 'name': 'Run ESLint'
'run': 'npm --prefix client run lint'
'notify':
'needs':
- 'golangci'
- 'eslint'
# 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':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' </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') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
-
name: Set up npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
-
name: Run make ci
shell: bash
run: |
make ci
-
name: Upload coverage
uses: codecov/codecov-action@v1
if: success() && matrix.os == 'ubuntu-latest'
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
app:
runs-on: ubuntu-latest
needs: test
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
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/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
-
name: Set up node_modules cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
-
name: Set up Snapcraft
run: |
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
-
name: Set up GoReleaser
run: |
curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh
-
name: Run snapshot build
run: |
make release
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-action@v1
-
name: Docker Buildx (build)
run: |
make docker-multi-arch
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:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> add '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':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' </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
- string .forcesafesearch.google.com. has 3 occurrences
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- G108
# gosec: Subprocess launched with function call as argument or cmd arguments
- G204
# gosec: Potential DoS vulnerability via decompression bomb
- G110
# gosec: Expect WriteFile permissions to be 0600 or less
- G306
</s> add '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 occurrences'
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- 'G108'
# gosec: Subprocess launched with function call as argument or cmd arguments
- 'G204'
# gosec: Potential DoS vulnerability via decompression bomb
- 'G110'
# gosec: Expect WriteFile permissions to be 0600 or less
- 'G306' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .github/workflows/build.yml |
'docker':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
- 'name': 'Set up QEMU'
'uses': 'docker/setup-qemu-action@v1'
- 'name': 'Set up Docker Buildx'
'uses': 'docker/setup-buildx-action@v1'
- 'name': 'Docker Buildx (build)'
'run': 'make docker-multi-arch' | <mask> pull_request:
<mask>
<mask> jobs:
<mask>
<mask> test:
<mask> runs-on: ${{ matrix.os }}
<mask> env:
<mask> GO111MODULE: on
<mask> GOPROXY: https://goproxy.io
<mask> strategy:
<mask> fail-fast: false
<mask> matrix:
<mask> os:
<mask> - ubuntu-latest
<mask> - macOS-latest
<mask> - windows-latest
<mask> steps:
<mask> -
<mask> name: Checkout
<mask> uses: actions/checkout@v2
<mask> with:
<mask> fetch-depth: 0
<mask> -
<mask> name: Set up Go
<mask> uses: actions/setup-go@v2
<mask> with:
<mask> go-version: ${{ env.GO_VERSION }}
<mask>
<mask> -
<mask> name: Set up Node
<mask> uses: actions/setup-node@v1
<mask> with:
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
-
name: Set up npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
-
name: Run make ci
shell: bash
run: |
make ci
-
name: Upload coverage
uses: codecov/codecov-action@v1
if: success() && matrix.os == 'ubuntu-latest'
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
app:
runs-on: ubuntu-latest
needs: test
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
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/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
-
name: Set up node_modules cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
-
name: Set up Snapcraft
run: |
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
-
name: Set up GoReleaser
run: |
curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh
-
name: Run snapshot build
run: |
make release
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-action@v1
-
name: Docker Buildx (build)
run: |
make docker-multi-arch
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:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> add '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':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' </s> remove 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/[email protected]
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.32
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm --prefix client ci
- name: Run ESLint
run: npm --prefix client run lint
notify:
needs: [golangci,eslint]
# 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:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> add '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/[email protected]'
'with':
# This field is required. Don't set the patch version to always use
# the latest patch version.
'version': 'v1.32'
'eslint':
'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
'run': 'npm --prefix client ci'
- 'name': 'Run ESLint'
'run': 'npm --prefix client run lint'
'notify':
'needs':
- 'golangci'
- 'eslint'
# 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':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' </s> remove jobs:
</s> add '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'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
- 'name': 'Set up Go'
'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/cache@v2'
'with':
'path': '~/go/pkg/mod'
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
'restore-keys': '${{ runner.os }}-go-'
- 'name': 'Get npm cache directory'
'id': 'npm-cache'
'run': 'echo "::set-output name=dir::$(npm config get cache)"'
- 'name': 'Set up npm cache'
'uses': 'actions/cache@v2'
'with':
'path': '${{ steps.npm-cache.outputs.dir }}'
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Run make ci'
'shell': 'bash'
'run': 'make ci'
- 'name': 'Upload coverage'
'uses': 'codecov/codecov-action@v1'
'if': "success() && matrix.os == 'ubuntu-latest'"
'with':
'token': '${{ secrets.CODECOV_TOKEN }}'
'file': './coverage.txt'
'app':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
- 'name': 'Set up Go'
'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/cache@v2'
'with':
'path': '~/go/pkg/mod'
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
'restore-keys': '${{ runner.os }}-go-'
- 'name': 'Get npm cache directory'
'id': 'npm-cache'
'run': 'echo "::set-output name=dir::$(npm config get cache)"'
- 'name': 'Set up node_modules cache'
'uses': 'actions/cache@v2'
'with':
'path': '${{ steps.npm-cache.outputs.dir }}'
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Set up Snapcraft'
'run': 'sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft'
- 'name': 'Set up GoReleaser'
'run': 'curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh'
- 'name': 'Run snapshot build'
'run': 'make release' </s> remove on:
push:
branches:
- '*'
tags:
- v*
pull_request:
</s> add 'on':
'push':
'branches':
- '*'
'tags':
- 'v*'
'pull_request': </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 to use when marking an issue as stale
staleLabel: 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
</s> add # 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 when marking an issue as stale.
'staleLabel': 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable.
'markComment': > | [
"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",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .github/workflows/build.yml |
'notify':
'needs':
- 'app'
- 'docker'
# Secrets are not passed to workflows that are triggered by a pull request
# from a fork.
'if': "${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}"
'runs-on': 'ubuntu-latest'
'steps':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' | <mask> uses: actions/setup-go@v2
<mask> with:
<mask> go-version: ${{ env.GO_VERSION }}
<mask>
<mask> -
<mask> name: Set up Node
<mask> uses: actions/setup-node@v1
<mask> with:
<mask> node-version: ${{ env.NODE_VERSION }}
<mask> -
<mask> name: Set up Go modules cache
<mask> uses: actions/cache@v2
<mask> with:
<mask> path: ~/go/pkg/mod
<mask> key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
<mask> restore-keys: |
<mask> ${{ runner.os }}-go-
<mask> -
<mask> name: Get npm cache directory
<mask> id: npm-cache
<mask> run: |
<mask> echo "::set-output name=dir::$(npm config get cache)"
<mask> -
<mask> name: Set up npm cache
<mask> uses: actions/cache@v2
<mask> with:
<mask> path: ${{ steps.npm-cache.outputs.dir }}
<mask> key: ${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}
<mask> restore-keys: |
<mask> ${{ runner.os }}-node-
<mask> -
<mask> name: Run make ci
<mask> shell: bash
<mask> run: |
<mask> make ci
<mask> -
<mask> name: Upload coverage
<mask> uses: codecov/codecov-action@v1
<mask> if: success() && matrix.os == 'ubuntu-latest'
<mask> with:
<mask> token: ${{ secrets.CODECOV_TOKEN }}
<mask> file: ./coverage.txt
<mask>
<mask> app:
<mask> runs-on: ubuntu-latest
<mask> needs: test
<mask> steps:
<mask> -
<mask> name: Checkout
<mask> uses: actions/checkout@v2
<mask> with:
<mask> fetch-depth: 0
<mask> -
<mask> name: Set up Go
<mask> uses: actions/setup-go@v2
<mask> with:
<mask> go-version: ${{ env.GO_VERSION }}
<mask> -
<mask> name: Set up Node
<mask> uses: actions/setup-node@v1
<mask> with:
<mask> node-version: ${{ env.NODE_VERSION }}
<mask> -
<mask> name: Set up Go modules cache
<mask> uses: actions/cache@v2
<mask> with:
<mask> path: ~/go/pkg/mod
<mask> key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
<mask> restore-keys: |
<mask> ${{ runner.os }}-go-
<mask> -
<mask> name: Get npm cache directory
<mask> id: npm-cache
<mask> run: |
<mask> echo "::set-output name=dir::$(npm config get cache)"
<mask> -
<mask> name: Set up node_modules cache
<mask> uses: actions/cache@v2
<mask> with:
<mask> path: ${{ steps.npm-cache.outputs.dir }}
<mask> key: ${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}
<mask> restore-keys: |
<mask> ${{ runner.os }}-node-
<mask> -
<mask> name: Set up Snapcraft
<mask> run: |
<mask> sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
<mask> -
<mask> name: Set up GoReleaser
<mask> run: |
<mask> curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh
<mask> -
<mask> name: Run snapshot build
<mask> run: |
<mask> make release
<mask>
<mask> docker:
<mask> runs-on: ubuntu-latest
<mask> needs: test
<mask> steps:
<mask> -
<mask> name: Checkout
<mask> uses: actions/checkout@v2
<mask> with:
<mask> fetch-depth: 0
<mask> -
<mask> name: Set up QEMU
<mask> uses: docker/setup-qemu-action@v1
<mask> -
<mask> name: Set up Docker Buildx
<mask> uses: docker/setup-buildx-action@v1
<mask> -
<mask> name: Docker Buildx (build)
<mask> run: |
<mask> make docker-multi-arch
<mask>
<mask> notify:
<mask> needs: [app, docker]
<mask> # Secrets are not passed to workflows that are triggered by a pull request from a fork
<mask> if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
<mask> runs-on: ubuntu-latest
<mask> steps:
<mask> -
<mask> name: Conclusion
<mask> uses: technote-space/workflow-conclusion-action@v1
<mask> -
<mask> name: Send Slack notif
<mask> uses: 8398a7/action-slack@v3
<mask> with:
<mask> status: ${{ env.WORKFLOW_CONCLUSION }}
<mask> fields: repo,message,commit,author
<mask> env:
<mask> GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
<mask> SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
</s> add '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-action@v1'
- 'name': 'Docker Buildx (build)'
'run': 'make docker-multi-arch' </s> remove 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/[email protected]
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.32
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm --prefix client ci
- name: Run ESLint
run: npm --prefix client run lint
notify:
needs: [golangci,eslint]
# 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:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> add '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/[email protected]'
'with':
# This field is required. Don't set the patch version to always use
# the latest patch version.
'version': 'v1.32'
'eslint':
'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
'run': 'npm --prefix client ci'
- 'name': 'Run ESLint'
'run': 'npm --prefix client run lint'
'notify':
'needs':
- 'golangci'
- 'eslint'
# 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':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' </s> remove jobs:
</s> add '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'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
- 'name': 'Set up Go'
'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/cache@v2'
'with':
'path': '~/go/pkg/mod'
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
'restore-keys': '${{ runner.os }}-go-'
- 'name': 'Get npm cache directory'
'id': 'npm-cache'
'run': 'echo "::set-output name=dir::$(npm config get cache)"'
- 'name': 'Set up npm cache'
'uses': 'actions/cache@v2'
'with':
'path': '${{ steps.npm-cache.outputs.dir }}'
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Run make ci'
'shell': 'bash'
'run': 'make ci'
- 'name': 'Upload coverage'
'uses': 'codecov/codecov-action@v1'
'if': "success() && matrix.os == 'ubuntu-latest'"
'with':
'token': '${{ secrets.CODECOV_TOKEN }}'
'file': './coverage.txt'
'app':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
- 'name': 'Set up Go'
'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/cache@v2'
'with':
'path': '~/go/pkg/mod'
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
'restore-keys': '${{ runner.os }}-go-'
- 'name': 'Get npm cache directory'
'id': 'npm-cache'
'run': 'echo "::set-output name=dir::$(npm config get cache)"'
- 'name': 'Set up node_modules cache'
'uses': 'actions/cache@v2'
'with':
'path': '${{ steps.npm-cache.outputs.dir }}'
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Set up Snapcraft'
'run': 'sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft'
- 'name': 'Set up GoReleaser'
'run': 'curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh'
- 'name': 'Run snapshot build'
'run': 'make release' </s> remove on:
push:
branches:
- '*'
tags:
- v*
pull_request:
</s> add 'on':
'push':
'branches':
- '*'
'tags':
- 'v*'
'pull_request': </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 set it up, it'll cover ALL your home devices, and you don't need any
client-side software for that.
</s> add '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 up, it'll cover ALL your home devices, and you don't need any
client-side software for that. | [
"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",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace"
] | 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/[email protected]'
'with':
# This field is required. Don't set the patch version to always use
# the latest patch version.
'version': 'v1.32'
'eslint':
'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
'run': 'npm --prefix client ci'
- 'name': 'Run ESLint'
'run': 'npm --prefix client run lint'
'notify':
'needs':
- 'golangci'
- 'eslint'
# 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':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' | <mask> name: golangci-lint
<mask> on:
<mask> push:
<mask> tags:
<mask> - v*
<mask> branches:
<mask> - '*'
<mask> pull_request:
<mask> jobs:
<mask> golangci:
<mask> runs-on: ubuntu-latest
<mask> steps:
<mask> - uses: actions/checkout@v2
<mask> - name: golangci-lint
<mask> uses: golangci/[email protected]
<mask> with:
<mask> # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
<mask> version: v1.32
<mask>
<mask> eslint:
<mask> runs-on: ubuntu-latest
<mask> steps:
<mask> - uses: actions/checkout@v2
<mask> - name: Install modules
<mask> run: npm --prefix client ci
<mask> - name: Run ESLint
<mask> run: npm --prefix client run lint
<mask>
<mask>
<mask> notify:
<mask> needs: [golangci,eslint]
<mask> # Secrets are not passed to workflows that are triggered by a pull request from a fork
<mask> if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
<mask> runs-on: ubuntu-latest
<mask> steps:
<mask> -
<mask> name: Conclusion
<mask> uses: technote-space/workflow-conclusion-action@v1
<mask> -
<mask> name: Send Slack notif
<mask> uses: 8398a7/action-slack@v3
<mask> with:
<mask> status: ${{ env.WORKFLOW_CONCLUSION }}
<mask> fields: repo,message,commit,author
<mask> env:
<mask> GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
<mask> SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
-
name: Set up npm cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
-
name: Run make ci
shell: bash
run: |
make ci
-
name: Upload coverage
uses: codecov/codecov-action@v1
if: success() && matrix.os == 'ubuntu-latest'
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
app:
runs-on: ubuntu-latest
needs: test
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
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/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
restore-keys: |
${{ runner.os }}-go-
-
name: Get npm cache directory
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
-
name: Set up node_modules cache
uses: actions/cache@v2
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
-
name: Set up Snapcraft
run: |
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
-
name: Set up GoReleaser
run: |
curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh
-
name: Run snapshot build
run: |
make release
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-action@v1
-
name: Docker Buildx (build)
run: |
make docker-multi-arch
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:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> add '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':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' </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/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
</s> add '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-action@v1'
- 'name': 'Docker Buildx (build)'
'run': 'make docker-multi-arch' </s> remove on:
push:
branches:
- '*'
tags:
- v*
pull_request:
</s> add 'on':
'push':
'branches':
- '*'
'tags':
- 'v*'
'pull_request': </s> remove jobs:
</s> add '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'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
- 'name': 'Set up Go'
'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/cache@v2'
'with':
'path': '~/go/pkg/mod'
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
'restore-keys': '${{ runner.os }}-go-'
- 'name': 'Get npm cache directory'
'id': 'npm-cache'
'run': 'echo "::set-output name=dir::$(npm config get cache)"'
- 'name': 'Set up npm cache'
'uses': 'actions/cache@v2'
'with':
'path': '${{ steps.npm-cache.outputs.dir }}'
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Run make ci'
'shell': 'bash'
'run': 'make ci'
- 'name': 'Upload coverage'
'uses': 'codecov/codecov-action@v1'
'if': "success() && matrix.os == 'ubuntu-latest'"
'with':
'token': '${{ secrets.CODECOV_TOKEN }}'
'file': './coverage.txt'
'app':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
- 'name': 'Set up Go'
'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/cache@v2'
'with':
'path': '~/go/pkg/mod'
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
'restore-keys': '${{ runner.os }}-go-'
- 'name': 'Get npm cache directory'
'id': 'npm-cache'
'run': 'echo "::set-output name=dir::$(npm config get cache)"'
- 'name': 'Set up node_modules cache'
'uses': 'actions/cache@v2'
'with':
'path': '${{ steps.npm-cache.outputs.dir }}'
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Set up Snapcraft'
'run': 'sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft'
- 'name': 'Set up GoReleaser'
'run': 'curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh'
- 'name': 'Run snapshot build'
'run': 'make release' </s> remove env:
GO_VERSION: 1.14
NODE_VERSION: 13
</s> add 'env':
'GO_VERSION': '1.14'
'NODE_VERSION': '13' | [
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .github/workflows/lint.yml |
'run': | <mask> # options for analysis running
<mask> run:
<mask> # default concurrency is a available CPU number
<mask> concurrency: 4
<mask>
<mask> # timeout for analysis, e.g. 30s, 5m, default is 1m
<mask> deadline: 2m
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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 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 occurrences
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- G108
# gosec: Subprocess launched with function call as argument or cmd arguments
- G204
# gosec: Potential DoS vulnerability via decompression bomb
- G110
# gosec: Expect WriteFile permissions to be 0600 or less
- G306
</s> add '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 occurrences'
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- 'G108'
# gosec: Subprocess launched with function call as argument or cmd arguments
- 'G204'
# gosec: Potential DoS vulnerability via decompression bomb
- 'G110'
# gosec: Expect WriteFile permissions to be 0600 or less
- 'G306' | [
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
'concurrency': 4 | <mask> # options for analysis running
<mask> run:
<mask> # default concurrency is a available CPU number
<mask> concurrency: 4
<mask>
<mask> # timeout for analysis, e.g. 30s, 5m, default is 1m
<mask> deadline: 2m
<mask>
<mask> # which files to skip: they will be analyzed, but issues from them
</s> 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 <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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/rule_to_regexp.go'
- 'util/pprof.go'
- '.*_test.go'
- 'client/.*'
- 'build/.*'
- 'dist/.*' </s> remove issues:
</s> add 'issues': </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 to use when marking an issue as stale
staleLabel: 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
</s> add # 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 when marking an issue as stale.
'staleLabel': 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable.
'markComment': > | [
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
'deadline': '2m' | <mask> # default concurrency is a available CPU number
<mask> concurrency: 4
<mask>
<mask> # timeout for analysis, e.g. 30s, 5m, default is 1m
<mask> deadline: 2m
<mask>
<mask> # which files to skip: they will be analyzed, but issues from them
<mask> # won't be reported. Default value is empty list, but there is
<mask> # no need to include all autogenerated files, we confidently recognize
<mask> # autogenerated files. If it's not please let us know.
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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/.*'
- 'dist/.*' </s> remove concurrency: 4
</s> add 'concurrency': 4 </s> remove run:
</s> add 'run': </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
- string .forcesafesearch.google.com. has 3 occurrences
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- G108
# gosec: Subprocess launched with function call as argument or cmd arguments
- G204
# gosec: Potential DoS vulnerability via decompression bomb
- G110
# gosec: Expect WriteFile permissions to be 0600 or less
- G306
</s> add '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 occurrences'
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- 'G108'
# gosec: Subprocess launched with function call as argument or cmd arguments
- 'G204'
# gosec: Potential DoS vulnerability via decompression bomb
- 'G110'
# gosec: Expect WriteFile permissions to be 0600 or less
- 'G306' </s> remove issues:
</s> add 'issues': | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
'skip-files':
- '.*generated.*'
- 'dnsfilter/rule_to_regexp.go'
- 'util/pprof.go'
- '.*_test.go'
- 'client/.*'
- 'build/.*'
- 'dist/.*' | <mask> # which files to skip: they will be analyzed, but issues from them
<mask> # won't be reported. Default value is empty list, but there is
<mask> # no need to include all autogenerated files, we confidently recognize
<mask> # autogenerated files. If it's not please let us know.
<mask> skip-files:
<mask> - ".*generated.*"
<mask> - dnsfilter/rule_to_regexp.go
<mask> - util/pprof.go
<mask> - ".*_test.go"
<mask> - client/.*
<mask> - build/.*
<mask> - dist/.*
<mask>
<mask>
<mask> # all available settings of specific linters
<mask> linters-settings:
<mask> errcheck:
<mask> # [deprecated] comma-separated list of pairs of the form pkg:regex
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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-length: 200
</s> add 'ignore': 'fmt:.*,net:SetReadDeadline,net/http:^Write'
'gocyclo':
'min-complexity': 20
'lll':
'line-length': 200 </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
- string .forcesafesearch.google.com. has 3 occurrences
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- G108
# gosec: Subprocess launched with function call as argument or cmd arguments
- G204
# gosec: Potential DoS vulnerability via decompression bomb
- G110
# gosec: Expect WriteFile permissions to be 0600 or less
- G306
</s> add '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 occurrences'
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- 'G108'
# gosec: Subprocess launched with function call as argument or cmd arguments
- 'G204'
# gosec: Potential DoS vulnerability via decompression bomb
- 'G110'
# gosec: Expect WriteFile permissions to be 0600 or less
- 'G306' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
'linters-settings':
'errcheck': | <mask> - dist/.*
<mask>
<mask>
<mask> # all available settings of specific linters
<mask> linters-settings:
<mask> errcheck:
<mask> # [deprecated] comma-separated list of pairs of the form pkg:regex
<mask> # the regex is used to ignore names within pkg. (default "fmt:.*").
<mask> # see https://github.com/kisielk/errcheck#the-deprecated-method for details
<mask> ignore: fmt:.*,net:SetReadDeadline,net/http:^Write
<mask> gocyclo:
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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.*"
- 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/.*'
- 'dist/.*' </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
publish: false
license: GPL-3.0
extra_files:
- source: scripts/snap/local/adguard-home-web.sh
destination: adguard-home-web.sh
mode: 0755
- source: scripts/snap/gui/adguard-home-web.desktop
destination: meta/gui/adguard-home-web.desktop
mode: 0644
- source: scripts/snap/gui/adguard-home-web.png
destination: meta/gui/adguard-home-web.png
mode: 0644
apps:
adguard-home:
command: AdGuardHome -w $SNAP_DATA --no-check-update
plugs:
# Add the "netrwork-bind" plug to bind to interfaces.
- network-bind
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- network-control
daemon: simple
adguard-home-web:
command: adguard-home-web.sh
plugs: [ desktop ]
</s> add 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': false
'license': 'GPL-3.0'
'extra_files':
- 'source': 'scripts/snap/local/adguard-home-web.sh'
'destination': 'adguard-home-web.sh'
'mode': 0755
- 'source': 'scripts/snap/gui/adguard-home-web.desktop'
'destination': 'meta/gui/adguard-home-web.desktop'
'mode': 0644
- 'source': 'scripts/snap/gui/adguard-home-web.png'
'destination': 'meta/gui/adguard-home-web.png'
'mode': 0644
'apps':
'adguard-home':
'command': 'AdGuardHome -w $SNAP_DATA --no-check-update'
'plugs':
# Add the "netrwork-bind" plug to bind to interfaces.
- 'network-bind'
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- 'network-control'
'daemon': 'simple'
'adguard-home-web':
'command': 'adguard-home-web.sh'
'plugs':
- 'desktop' </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
- string .forcesafesearch.google.com. has 3 occurrences
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- G108
# gosec: Subprocess launched with function call as argument or cmd arguments
- G204
# gosec: Potential DoS vulnerability via decompression bomb
- G110
# gosec: Expect WriteFile permissions to be 0600 or less
- G306
</s> add '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 occurrences'
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- 'G108'
# gosec: Subprocess launched with function call as argument or cmd arguments
- 'G204'
# gosec: Potential DoS vulnerability via decompression bomb
- 'G110'
# gosec: Expect WriteFile permissions to be 0600 or less
- 'G306' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
'ignore': 'fmt:.*,net:SetReadDeadline,net/http:^Write'
'gocyclo':
'min-complexity': 20
'lll':
'line-length': 200 | <mask> errcheck:
<mask> # [deprecated] comma-separated list of pairs of the form pkg:regex
<mask> # the regex is used to ignore names within pkg. (default "fmt:.*").
<mask> # see https://github.com/kisielk/errcheck#the-deprecated-method for details
<mask> ignore: fmt:.*,net:SetReadDeadline,net/http:^Write
<mask> gocyclo:
<mask> min-complexity: 20
<mask> lll:
<mask> line-length: 200
<mask>
<mask> linters:
<mask> enable:
<mask> - deadcode
<mask> - errcheck
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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
- misspell
- stylecheck
- unconvert
disable-all: true
fast: true
</s> add 'linters':
'enable':
- 'bodyclose'
- 'deadcode'
- 'depguard'
- 'dupl'
- 'errcheck'
- 'gocyclo'
- 'goimports'
- 'golint'
- 'gosec'
- 'govet'
- 'ineffassign'
- 'misspell'
- 'staticcheck'
- 'stylecheck'
- 'unconvert'
- 'unused'
- 'varcheck'
'disable-all': true
'fast': true </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/.*'
- 'dist/.*' </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
- string .forcesafesearch.google.com. has 3 occurrences
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- G108
# gosec: Subprocess launched with function call as argument or cmd arguments
- G204
# gosec: Potential DoS vulnerability via decompression bomb
- G110
# gosec: Expect WriteFile permissions to be 0600 or less
- G306
</s> add '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 occurrences'
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- 'G108'
# gosec: Subprocess launched with function call as argument or cmd arguments
- 'G204'
# gosec: Potential DoS vulnerability via decompression bomb
- 'G110'
# gosec: Expect WriteFile permissions to be 0600 or less
- 'G306' </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
publish: false
license: GPL-3.0
extra_files:
- source: scripts/snap/local/adguard-home-web.sh
destination: adguard-home-web.sh
mode: 0755
- source: scripts/snap/gui/adguard-home-web.desktop
destination: meta/gui/adguard-home-web.desktop
mode: 0644
- source: scripts/snap/gui/adguard-home-web.png
destination: meta/gui/adguard-home-web.png
mode: 0644
apps:
adguard-home:
command: AdGuardHome -w $SNAP_DATA --no-check-update
plugs:
# Add the "netrwork-bind" plug to bind to interfaces.
- network-bind
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- network-control
daemon: simple
adguard-home-web:
command: adguard-home-web.sh
plugs: [ desktop ]
</s> add 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': false
'license': 'GPL-3.0'
'extra_files':
- 'source': 'scripts/snap/local/adguard-home-web.sh'
'destination': 'adguard-home-web.sh'
'mode': 0755
- 'source': 'scripts/snap/gui/adguard-home-web.desktop'
'destination': 'meta/gui/adguard-home-web.desktop'
'mode': 0644
- 'source': 'scripts/snap/gui/adguard-home-web.png'
'destination': 'meta/gui/adguard-home-web.png'
'mode': 0644
'apps':
'adguard-home':
'command': 'AdGuardHome -w $SNAP_DATA --no-check-update'
'plugs':
# Add the "netrwork-bind" plug to bind to interfaces.
- 'network-bind'
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- 'network-control'
'daemon': 'simple'
'adguard-home-web':
'command': 'adguard-home-web.sh'
'plugs':
- 'desktop' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
'linters':
'enable':
- 'bodyclose'
- 'deadcode'
- 'depguard'
- 'dupl'
- 'errcheck'
- 'gocyclo'
- 'goimports'
- 'golint'
- 'gosec'
- 'govet'
- 'ineffassign'
- 'misspell'
- 'staticcheck'
- 'stylecheck'
- 'unconvert'
- 'unused'
- 'varcheck'
'disable-all': true
'fast': true | <mask> min-complexity: 20
<mask> lll:
<mask> line-length: 200
<mask>
<mask> linters:
<mask> enable:
<mask> - deadcode
<mask> - errcheck
<mask> - govet
<mask> - ineffassign
<mask> - staticcheck
<mask> - unused
<mask> - varcheck
<mask> - bodyclose
<mask> - depguard
<mask> - dupl
<mask> - gocyclo
<mask> - goimports
<mask> - golint
<mask> - gosec
<mask> - misspell
<mask> - stylecheck
<mask> - unconvert
<mask> disable-all: true
<mask> fast: true
<mask>
<mask> issues:
<mask> # List of regexps of issue texts to exclude, empty list by default.
<mask> # But independently from this option we use default exclude patterns,
<mask> # it can be disabled by `exclude-use-default: false`. To list all
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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
- string .forcesafesearch.google.com. has 3 occurrences
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- G108
# gosec: Subprocess launched with function call as argument or cmd arguments
- G204
# gosec: Potential DoS vulnerability via decompression bomb
- G110
# gosec: Expect WriteFile permissions to be 0600 or less
- G306
</s> add '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 occurrences'
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- 'G108'
# gosec: Subprocess launched with function call as argument or cmd arguments
- 'G204'
# gosec: Potential DoS vulnerability via decompression bomb
- 'G110'
# gosec: Expect WriteFile permissions to be 0600 or less
- 'G306' </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.*"
- 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/.*'
- 'dist/.*' </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 to use when marking an issue as stale
staleLabel: 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
</s> add # 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 when marking an issue as stale.
'staleLabel': 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable.
'markComment': > | [
"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",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
'issues': | <mask> - unconvert
<mask> disable-all: true
<mask> fast: true
<mask>
<mask> issues:
<mask> # List of regexps of issue texts to exclude, empty list by default.
<mask> # But independently from this option we use default exclude patterns,
<mask> # it can be disabled by `exclude-use-default: false`. To list all
<mask> # excluded by default patterns execute `golangci-lint run --help`
<mask> exclude:
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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> add 'linters':
'enable':
- 'bodyclose'
- 'deadcode'
- 'depguard'
- 'dupl'
- 'errcheck'
- 'gocyclo'
- 'goimports'
- 'golint'
- 'gosec'
- 'govet'
- 'ineffassign'
- 'misspell'
- 'staticcheck'
- 'stylecheck'
- 'unconvert'
- 'unused'
- 'varcheck'
'disable-all': true
'fast': true </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
- string .forcesafesearch.google.com. has 3 occurrences
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- G108
# gosec: Subprocess launched with function call as argument or cmd arguments
- G204
# gosec: Potential DoS vulnerability via decompression bomb
- G110
# gosec: Expect WriteFile permissions to be 0600 or less
- G306
</s> add '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 occurrences'
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- 'G108'
# gosec: Subprocess launched with function call as argument or cmd arguments
- 'G204'
# gosec: Potential DoS vulnerability via decompression bomb
- 'G110'
# gosec: Expect WriteFile permissions to be 0600 or less
- 'G306' </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/.*'
- 'dist/.*' </s> remove deadline: 2m
</s> add 'deadline': '2m' </s> remove 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/[email protected]
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.32
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm --prefix client ci
- name: Run ESLint
run: npm --prefix client run lint
notify:
needs: [golangci,eslint]
# 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:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> add '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/[email protected]'
'with':
# This field is required. Don't set the patch version to always use
# the latest patch version.
'version': 'v1.32'
'eslint':
'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
'run': 'npm --prefix client ci'
- 'name': 'Run ESLint'
'run': 'npm --prefix client run lint'
'notify':
'needs':
- 'golangci'
- 'eslint'
# 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':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
'exclude':
# structcheck cannot detect usages while they're there
- '.parentalServer. is unused'
- '.safeBrowsingServer. is unused'
# errcheck
- 'Error return value of .s.closeConn. is not checked'
- 'Error return value of ..*.Shutdown.'
# goconst
- 'string .forcesafesearch.google.com. has 3 occurrences'
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- 'G108'
# gosec: Subprocess launched with function call as argument or cmd arguments
- 'G204'
# gosec: Potential DoS vulnerability via decompression bomb
- 'G110'
# gosec: Expect WriteFile permissions to be 0600 or less
- 'G306' | <mask> # List of regexps of issue texts to exclude, empty list by default.
<mask> # But independently from this option we use default exclude patterns,
<mask> # it can be disabled by `exclude-use-default: false`. To list all
<mask> # excluded by default patterns execute `golangci-lint run --help`
<mask> exclude:
<mask> # structcheck cannot detect usages while they're there
<mask> - .parentalServer. is unused
<mask> - .safeBrowsingServer. is unused
<mask> # errcheck
<mask> - Error return value of .s.closeConn. is not checked
<mask> - Error return value of ..*.Shutdown.
<mask> # goconst
<mask> - string .forcesafesearch.google.com. has 3 occurrences
<mask> # gosec: Profiling endpoint is automatically exposed on /debug/pprof
<mask> - G108
<mask> # gosec: Subprocess launched with function call as argument or cmd arguments
<mask> - G204
<mask> # gosec: Potential DoS vulnerability via decompression bomb
<mask> - G110
<mask> # gosec: Expect WriteFile permissions to be 0600 or less
<mask> - G306
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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
- unconvert
disable-all: true
fast: true
</s> add 'linters':
'enable':
- 'bodyclose'
- 'deadcode'
- 'depguard'
- 'dupl'
- 'errcheck'
- 'gocyclo'
- 'goimports'
- 'golint'
- 'gosec'
- 'govet'
- 'ineffassign'
- 'misspell'
- 'staticcheck'
- 'stylecheck'
- 'unconvert'
- 'unused'
- 'varcheck'
'disable-all': true
'fast': true </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/.*'
- 'dist/.*' </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 to use when marking an issue as stale
staleLabel: 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
</s> add # 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 when marking an issue as stale.
'staleLabel': 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable.
'markComment': > </s> remove 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/[email protected]
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.32
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm --prefix client ci
- name: Run ESLint
run: npm --prefix client run lint
notify:
needs: [golangci,eslint]
# 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:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> add '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/[email protected]'
'with':
# This field is required. Don't set the patch version to always use
# the latest patch version.
'version': 'v1.32'
'eslint':
'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
'run': 'npm --prefix client ci'
- 'name': 'Run ESLint'
'run': 'npm --prefix client run lint'
'notify':
'needs':
- 'golangci'
- 'eslint'
# 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':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .golangci.yml |
'project_name': 'AdGuardHome' | <mask> project_name: AdGuardHome
<mask>
<mask> env:
<mask> - GO111MODULE=on
<mask> - GOPROXY=https://goproxy.io
<mask>
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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 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: false
license: GPL-3.0
extra_files:
- source: scripts/snap/local/adguard-home-web.sh
destination: adguard-home-web.sh
mode: 0755
- source: scripts/snap/gui/adguard-home-web.desktop
destination: meta/gui/adguard-home-web.desktop
mode: 0644
- source: scripts/snap/gui/adguard-home-web.png
destination: meta/gui/adguard-home-web.png
mode: 0644
apps:
adguard-home:
command: AdGuardHome -w $SNAP_DATA --no-check-update
plugs:
# Add the "netrwork-bind" plug to bind to interfaces.
- network-bind
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- network-control
daemon: simple
adguard-home-web:
command: adguard-home-web.sh
plugs: [ desktop ]
</s> add 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': false
'license': 'GPL-3.0'
'extra_files':
- 'source': 'scripts/snap/local/adguard-home-web.sh'
'destination': 'adguard-home-web.sh'
'mode': 0755
- 'source': 'scripts/snap/gui/adguard-home-web.desktop'
'destination': 'meta/gui/adguard-home-web.desktop'
'mode': 0644
- 'source': 'scripts/snap/gui/adguard-home-web.png'
'destination': 'meta/gui/adguard-home-web.png'
'mode': 0644
'apps':
'adguard-home':
'command': 'AdGuardHome -w $SNAP_DATA --no-check-update'
'plugs':
# Add the "netrwork-bind" plug to bind to interfaces.
- 'network-bind'
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- 'network-control'
'daemon': 'simple'
'adguard-home-web':
'command': 'adguard-home-web.sh'
'plugs':
- 'desktop' </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
- arm64
- mips
- mipsle
- mips64
- mips64le
goarm:
- 5
- 6
- 7
gomips:
- softfloat
ignore:
- goos: freebsd
goarch: mips
- goos: freebsd
goarch: mipsle
</s> add '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'
- 'mips64'
- 'mips64le'
'goarm':
- '5'
- '6'
- '7'
'gomips':
- 'softfloat'
'ignore':
- 'goos': 'freebsd'
'goarch': 'mips'
- 'goos': 'freebsd'
'goarch': 'mipsle' </s> remove on:
push:
branches:
- '*'
tags:
- v*
pull_request:
</s> add 'on':
'push':
'branches':
- '*'
'tags':
- 'v*'
'pull_request': | [
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .goreleaser.yml |
'env':
- 'GO111MODULE=on'
- 'GOPROXY=https://goproxy.io' | <mask> project_name: AdGuardHome
<mask>
<mask> env:
<mask> - GO111MODULE=on
<mask> - GOPROXY=https://goproxy.io
<mask>
<mask> before:
<mask> hooks:
<mask> - go mod download
<mask> - go generate ./...
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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:
- CGO_ENABLED=0
goos:
- darwin
- linux
- freebsd
- windows
goarch:
- 386
- amd64
- arm
- arm64
- mips
- mipsle
- mips64
- mips64le
goarm:
- 5
- 6
- 7
gomips:
- softfloat
ignore:
- goos: freebsd
goarch: mips
- goos: freebsd
goarch: mipsle
</s> add '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'
- 'mips64'
- 'mips64le'
'goarm':
- '5'
- '6'
- '7'
'gomips':
- 'softfloat'
'ignore':
- 'goos': 'freebsd'
'goarch': 'mips'
- 'goos': 'freebsd'
'goarch': 'mipsle' </s> remove project_name: AdGuardHome
</s> add 'project_name': 'AdGuardHome' </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> add 'linters':
'enable':
- 'bodyclose'
- 'deadcode'
- 'depguard'
- 'dupl'
- 'errcheck'
- 'gocyclo'
- 'goimports'
- 'golint'
- 'gosec'
- 'govet'
- 'ineffassign'
- 'misspell'
- 'staticcheck'
- 'stylecheck'
- 'unconvert'
- 'unused'
- 'varcheck'
'disable-all': true
'fast': true </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/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
</s> add '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-action@v1'
- 'name': 'Docker Buildx (build)'
'run': 'make docker-multi-arch' | [
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .goreleaser.yml |
'before':
'hooks':
- 'go mod download'
- 'go generate ./...' | <mask> env:
<mask> - GO111MODULE=on
<mask> - GOPROXY=https://goproxy.io
<mask>
<mask> before:
<mask> hooks:
<mask> - go mod download
<mask> - go generate ./...
<mask>
<mask> builds:
<mask> - main: ./main.go
<mask> ldflags:
<mask> - -s -w -X main.version={{.Version}} -X main.channel={{.Env.CHANNEL}} -X main.goarm={{.Env.GOARM}}
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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
- arm64
- mips
- mipsle
- mips64
- mips64le
goarm:
- 5
- 6
- 7
gomips:
- softfloat
ignore:
- goos: freebsd
goarch: mips
- goos: freebsd
goarch: mipsle
</s> add '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'
- 'mips64'
- 'mips64le'
'goarm':
- '5'
- '6'
- '7'
'gomips':
- 'softfloat'
'ignore':
- 'goos': 'freebsd'
'goarch': 'mips'
- 'goos': 'freebsd'
'goarch': 'mipsle' </s> remove env:
- GO111MODULE=on
- GOPROXY=https://goproxy.io
</s> add 'env':
- 'GO111MODULE=on'
- 'GOPROXY=https://goproxy.io' </s> remove project_name: AdGuardHome
</s> add 'project_name': 'AdGuardHome' </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
publish: false
license: GPL-3.0
extra_files:
- source: scripts/snap/local/adguard-home-web.sh
destination: adguard-home-web.sh
mode: 0755
- source: scripts/snap/gui/adguard-home-web.desktop
destination: meta/gui/adguard-home-web.desktop
mode: 0644
- source: scripts/snap/gui/adguard-home-web.png
destination: meta/gui/adguard-home-web.png
mode: 0644
apps:
adguard-home:
command: AdGuardHome -w $SNAP_DATA --no-check-update
plugs:
# Add the "netrwork-bind" plug to bind to interfaces.
- network-bind
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- network-control
daemon: simple
adguard-home-web:
command: adguard-home-web.sh
plugs: [ desktop ]
</s> add 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': false
'license': 'GPL-3.0'
'extra_files':
- 'source': 'scripts/snap/local/adguard-home-web.sh'
'destination': 'adguard-home-web.sh'
'mode': 0755
- 'source': 'scripts/snap/gui/adguard-home-web.desktop'
'destination': 'meta/gui/adguard-home-web.desktop'
'mode': 0644
- 'source': 'scripts/snap/gui/adguard-home-web.png'
'destination': 'meta/gui/adguard-home-web.png'
'mode': 0644
'apps':
'adguard-home':
'command': 'AdGuardHome -w $SNAP_DATA --no-check-update'
'plugs':
# Add the "netrwork-bind" plug to bind to interfaces.
- 'network-bind'
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- 'network-control'
'daemon': 'simple'
'adguard-home-web':
'command': 'adguard-home-web.sh'
'plugs':
- 'desktop' </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> add 'linters':
'enable':
- 'bodyclose'
- 'deadcode'
- 'depguard'
- 'dupl'
- 'errcheck'
- 'gocyclo'
- 'goimports'
- 'golint'
- 'gosec'
- 'govet'
- 'ineffassign'
- 'misspell'
- 'staticcheck'
- 'stylecheck'
- 'unconvert'
- 'unused'
- 'varcheck'
'disable-all': true
'fast': true | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .goreleaser.yml |
'builds':
- 'main': './main.go'
'ldflags':
- '-s -w -X main.version={{.Version}} -X main.channel={{.Env.CHANNEL}} -X main.goarm={{.Env.GOARM}}'
'env':
- 'CGO_ENABLED=0'
'goos':
- 'darwin'
- 'linux'
- 'freebsd'
- 'windows'
'goarch':
- '386'
- 'amd64'
- 'arm'
- 'arm64'
- 'mips'
- 'mipsle'
- 'mips64'
- 'mips64le'
'goarm':
- '5'
- '6'
- '7'
'gomips':
- 'softfloat'
'ignore':
- 'goos': 'freebsd'
'goarch': 'mips'
- 'goos': 'freebsd'
'goarch': 'mipsle' | <mask> hooks:
<mask> - go mod download
<mask> - go generate ./...
<mask>
<mask> builds:
<mask> - main: ./main.go
<mask> ldflags:
<mask> - -s -w -X main.version={{.Version}} -X main.channel={{.Env.CHANNEL}} -X main.goarm={{.Env.GOARM}}
<mask> env:
<mask> - CGO_ENABLED=0
<mask> goos:
<mask> - darwin
<mask> - linux
<mask> - freebsd
<mask> - windows
<mask> goarch:
<mask> - 386
<mask> - amd64
<mask> - arm
<mask> - arm64
<mask> - mips
<mask> - mipsle
<mask> - mips64
<mask> - mips64le
<mask> goarm:
<mask> - 5
<mask> - 6
<mask> - 7
<mask> gomips:
<mask> - softfloat
<mask> ignore:
<mask> - goos: freebsd
<mask> goarch: mips
<mask> - goos: freebsd
<mask> goarch: mipsle
<mask>
<mask> archives:
<mask> - # Archive name template.
<mask> # Defaults:
<mask> # - if format is `tar.gz`, `tar.xz`, `gz` or `zip`:
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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 }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
# - if format is `binary`:
# - `{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
wrap_in_directory: "AdGuardHome"
format_overrides:
- goos: windows
format: zip
- goos: darwin
format: zip
files:
- LICENSE.txt
- README.md
</s> add '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 }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
'name_template': '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}'
'wrap_in_directory': 'AdGuardHome'
'format_overrides':
- 'goos': 'windows'
'format': 'zip'
- 'goos': 'darwin'
'format': 'zip'
'files':
- 'LICENSE.txt'
- 'README.md' </s> remove env:
- GO111MODULE=on
- GOPROXY=https://goproxy.io
</s> add 'env':
- 'GO111MODULE=on'
- 'GOPROXY=https://goproxy.io' </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
- string .forcesafesearch.google.com. has 3 occurrences
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- G108
# gosec: Subprocess launched with function call as argument or cmd arguments
- G204
# gosec: Potential DoS vulnerability via decompression bomb
- G110
# gosec: Expect WriteFile permissions to be 0600 or less
- G306
</s> add '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 occurrences'
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- 'G108'
# gosec: Subprocess launched with function call as argument or cmd arguments
- 'G204'
# gosec: Potential DoS vulnerability via decompression bomb
- 'G110'
# gosec: Expect WriteFile permissions to be 0600 or less
- 'G306' </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> add 'linters':
'enable':
- 'bodyclose'
- 'deadcode'
- 'depguard'
- 'dupl'
- 'errcheck'
- 'gocyclo'
- 'goimports'
- 'golint'
- 'gosec'
- 'govet'
- 'ineffassign'
- 'misspell'
- 'staticcheck'
- 'stylecheck'
- 'unconvert'
- 'unused'
- 'varcheck'
'disable-all': true
'fast': true | [
"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",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .goreleaser.yml |
'archives':
- # Archive name template.
# Defaults:
# - if format is `tar.gz`, `tar.xz`, `gz` or `zip`:
# - `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
# - if format is `binary`:
# - `{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
'name_template': '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}'
'wrap_in_directory': 'AdGuardHome'
'format_overrides':
- 'goos': 'windows'
'format': 'zip'
- 'goos': 'darwin'
'format': 'zip'
'files':
- 'LICENSE.txt'
- 'README.md' | <mask> goarch: mips
<mask> - goos: freebsd
<mask> goarch: mipsle
<mask>
<mask> archives:
<mask> - # Archive name template.
<mask> # Defaults:
<mask> # - if format is `tar.gz`, `tar.xz`, `gz` or `zip`:
<mask> # - `{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
<mask> # - if format is `binary`:
<mask> # - `{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
<mask> name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
<mask> wrap_in_directory: "AdGuardHome"
<mask> format_overrides:
<mask> - goos: windows
<mask> format: zip
<mask> - goos: darwin
<mask> format: zip
<mask> files:
<mask> - LICENSE.txt
<mask> - README.md
<mask>
<mask> snapcrafts:
<mask> - name: adguard-home
<mask> base: core18
<mask> name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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 set it up, it'll cover ALL your home devices, and you don't need any
client-side software for that.
</s> add '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 up, it'll cover ALL your home devices, and you don't need any
client-side software for that. </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
- arm64
- mips
- mipsle
- mips64
- mips64le
goarm:
- 5
- 6
- 7
gomips:
- softfloat
ignore:
- goos: freebsd
goarch: mips
- goos: freebsd
goarch: mipsle
</s> add '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'
- 'mips64'
- 'mips64le'
'goarm':
- '5'
- '6'
- '7'
'gomips':
- 'softfloat'
'ignore':
- 'goos': 'freebsd'
'goarch': 'mips'
- 'goos': 'freebsd'
'goarch': 'mipsle' </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 to use when marking an issue as stale
staleLabel: 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
</s> add # 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 when marking an issue as stale.
'staleLabel': 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable.
'markComment': > </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
- string .forcesafesearch.google.com. has 3 occurrences
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- G108
# gosec: Subprocess launched with function call as argument or cmd arguments
- G204
# gosec: Potential DoS vulnerability via decompression bomb
- G110
# gosec: Expect WriteFile permissions to be 0600 or less
- G306
</s> add '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 occurrences'
# gosec: Profiling endpoint is automatically exposed on /debug/pprof
- 'G108'
# gosec: Subprocess launched with function call as argument or cmd arguments
- 'G204'
# gosec: Potential DoS vulnerability via decompression bomb
- 'G110'
# gosec: Expect WriteFile permissions to be 0600 or less
- 'G306' </s> remove 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/[email protected]
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.32
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm --prefix client ci
- name: Run ESLint
run: npm --prefix client run lint
notify:
needs: [golangci,eslint]
# 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:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> add '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/[email protected]'
'with':
# This field is required. Don't set the patch version to always use
# the latest patch version.
'version': 'v1.32'
'eslint':
'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
'run': 'npm --prefix client ci'
- 'name': 'Run ESLint'
'run': 'npm --prefix client run lint'
'notify':
'needs':
- 'golangci'
- 'eslint'
# 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':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .goreleaser.yml |
'snapcrafts':
- 'name': 'adguard-home'
'base': 'core18'
'name_template': '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
'summary': 'Network-wide ads & trackers blocking DNS server'
'description': |
AdGuard Home is a network-wide software for blocking ads & tracking. After
you set it up, it'll cover ALL your home devices, and you don't need any
client-side software for that. | <mask> files:
<mask> - LICENSE.txt
<mask> - README.md
<mask>
<mask> snapcrafts:
<mask> - name: adguard-home
<mask> base: core18
<mask> name_template: '{{ .ProjectName }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
<mask> summary: Network-wide ads & trackers blocking DNS server
<mask> description: |
<mask> AdGuard Home is a network-wide software for blocking ads & tracking. After
<mask> you set it up, it'll cover ALL your home devices, and you don't need any
<mask> client-side software for that.
<mask>
<mask> It operates as a DNS server that re-routes tracking domains to a "black hole,"
<mask> thus preventing your devices from connecting to those servers. It's based
<mask> on software we use for our public AdGuard DNS servers -- both share a lot
<mask> of common code.
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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
publish: false
license: GPL-3.0
extra_files:
- source: scripts/snap/local/adguard-home-web.sh
destination: adguard-home-web.sh
mode: 0755
- source: scripts/snap/gui/adguard-home-web.desktop
destination: meta/gui/adguard-home-web.desktop
mode: 0644
- source: scripts/snap/gui/adguard-home-web.png
destination: meta/gui/adguard-home-web.png
mode: 0644
apps:
adguard-home:
command: AdGuardHome -w $SNAP_DATA --no-check-update
plugs:
# Add the "netrwork-bind" plug to bind to interfaces.
- network-bind
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- network-control
daemon: simple
adguard-home-web:
command: adguard-home-web.sh
plugs: [ desktop ]
</s> add 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': false
'license': 'GPL-3.0'
'extra_files':
- 'source': 'scripts/snap/local/adguard-home-web.sh'
'destination': 'adguard-home-web.sh'
'mode': 0755
- 'source': 'scripts/snap/gui/adguard-home-web.desktop'
'destination': 'meta/gui/adguard-home-web.desktop'
'mode': 0644
- 'source': 'scripts/snap/gui/adguard-home-web.png'
'destination': 'meta/gui/adguard-home-web.png'
'mode': 0644
'apps':
'adguard-home':
'command': 'AdGuardHome -w $SNAP_DATA --no-check-update'
'plugs':
# Add the "netrwork-bind" plug to bind to interfaces.
- 'network-bind'
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- 'network-control'
'daemon': 'simple'
'adguard-home-web':
'command': 'adguard-home-web.sh'
'plugs':
- 'desktop' </s> remove 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 }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
wrap_in_directory: "AdGuardHome"
format_overrides:
- goos: windows
format: zip
- goos: darwin
format: zip
files:
- LICENSE.txt
- README.md
</s> add '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 }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
'name_template': '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}'
'wrap_in_directory': 'AdGuardHome'
'format_overrides':
- 'goos': 'windows'
'format': 'zip'
- 'goos': 'darwin'
'format': 'zip'
'files':
- 'LICENSE.txt'
- 'README.md' </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 # 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 when marking an issue as stale
staleLabel: 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
</s> add # 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 when marking an issue as stale.
'staleLabel': 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable.
'markComment': > </s> remove 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/[email protected]
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.32
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm --prefix client ci
- name: Run ESLint
run: npm --prefix client run lint
notify:
needs: [golangci,eslint]
# 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:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> add '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/[email protected]'
'with':
# This field is required. Don't set the patch version to always use
# the latest patch version.
'version': 'v1.32'
'eslint':
'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
'run': 'npm --prefix client ci'
- 'name': 'Run ESLint'
'run': 'npm --prefix client run lint'
'notify':
'needs':
- 'golangci'
- 'eslint'
# 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':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .goreleaser.yml |
It operates as a DNS server that re-routes tracking domains to a "black hole,"
thus preventing your devices from connecting to those servers. It's based
on software we use for our public AdGuard DNS servers -- both share a lot
of common code.
'grade': 'stable'
'confinement': 'strict'
'publish': false
'license': 'GPL-3.0'
'extra_files':
- 'source': 'scripts/snap/local/adguard-home-web.sh'
'destination': 'adguard-home-web.sh'
'mode': 0755
- 'source': 'scripts/snap/gui/adguard-home-web.desktop'
'destination': 'meta/gui/adguard-home-web.desktop'
'mode': 0644
- 'source': 'scripts/snap/gui/adguard-home-web.png'
'destination': 'meta/gui/adguard-home-web.png'
'mode': 0644
'apps':
'adguard-home':
'command': 'AdGuardHome -w $SNAP_DATA --no-check-update'
'plugs':
# Add the "netrwork-bind" plug to bind to interfaces.
- 'network-bind'
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- 'network-control'
'daemon': 'simple'
'adguard-home-web':
'command': 'adguard-home-web.sh'
'plugs':
- 'desktop' | <mask> AdGuard Home is a network-wide software for blocking ads & tracking. After
<mask> you set it up, it'll cover ALL your home devices, and you don't need any
<mask> client-side software for that.
<mask>
<mask> It operates as a DNS server that re-routes tracking domains to a "black hole,"
<mask> thus preventing your devices from connecting to those servers. It's based
<mask> on software we use for our public AdGuard DNS servers -- both share a lot
<mask> of common code.
<mask> grade: stable
<mask> confinement: strict
<mask> publish: false
<mask> license: GPL-3.0
<mask> extra_files:
<mask> - source: scripts/snap/local/adguard-home-web.sh
<mask> destination: adguard-home-web.sh
<mask> mode: 0755
<mask> - source: scripts/snap/gui/adguard-home-web.desktop
<mask> destination: meta/gui/adguard-home-web.desktop
<mask> mode: 0644
<mask> - source: scripts/snap/gui/adguard-home-web.png
<mask> destination: meta/gui/adguard-home-web.png
<mask> mode: 0644
<mask> apps:
<mask> adguard-home:
<mask> command: AdGuardHome -w $SNAP_DATA --no-check-update
<mask> plugs:
<mask> # Add the "netrwork-bind" plug to bind to interfaces.
<mask> - network-bind
<mask> # Add the "netrwork-control" plug to be able to bind to ports below
<mask> # 1024 (cap_net_bind_service) and also to bind to a particular
<mask> # interface using SO_BINDTODEVICE (cap_net_raw).
<mask> - network-control
<mask> daemon: simple
<mask> adguard-home-web:
<mask> command: adguard-home-web.sh
<mask> plugs: [ desktop ]
<mask>
<mask> checksum:
<mask> name_template: 'checksums.txt'
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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 set it up, it'll cover ALL your home devices, and you don't need any
client-side software for that.
</s> add '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 up, it'll cover ALL your home devices, and you don't need any
client-side software for that. </s> remove checksum:
name_template: 'checksums.txt'
</s> add 'checksum':
'name_template': 'checksums.txt' </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 to use when marking an issue as stale
staleLabel: 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
</s> add # 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 when marking an issue as stale.
'staleLabel': 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable.
'markComment': > </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 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/[email protected]
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.32
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: npm --prefix client ci
- name: Run ESLint
run: npm --prefix client run lint
notify:
needs: [golangci,eslint]
# 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:
-
name: Conclusion
uses: technote-space/workflow-conclusion-action@v1
-
name: Send Slack notif
uses: 8398a7/action-slack@v3
with:
status: ${{ env.WORKFLOW_CONCLUSION }}
fields: repo,message,commit,author
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
</s> add '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/[email protected]'
'with':
# This field is required. Don't set the patch version to always use
# the latest patch version.
'version': 'v1.32'
'eslint':
'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
'run': 'npm --prefix client ci'
- 'name': 'Run ESLint'
'run': 'npm --prefix client run lint'
'notify':
'needs':
- 'golangci'
- 'eslint'
# 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':
- 'name': 'Conclusion'
'uses': 'technote-space/workflow-conclusion-action@v1'
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' | [
"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",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .goreleaser.yml |
'checksum':
'name_template': 'checksums.txt' | <mask> adguard-home-web:
<mask> command: adguard-home-web.sh
<mask> plugs: [ desktop ]
<mask>
<mask> checksum:
<mask> name_template: 'checksums.txt'
</s> Pull request: all: reformat yaml, add yaml formatting standard
Merge in DNS/adguard-home from 2297-yaml to master
Closes #2297.
Squashed commit of the following:
commit 85df3a38a14adb1965944ddf14b197c12a213057
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:52:22 2020 +0300
all: improve HACKING.md
commit 079acdfe41cc12ab6aa13d7c28dcbf7b7b3c8380
Merge: 202ea078e 3045da174
Author: Ainar Garipov <[email protected]>
Date: Fri Nov 20 17:50:34 2020 +0300
Merge branch 'master' into 2297-yaml
commit 202ea078e29d88871a32ac6e668dfae6db802bab
Author: Ainar Garipov <[email protected]>
Date: Thu Nov 12 20:25:42 2020 +0300
all: reformat yaml, add yaml formatting standard </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
publish: false
license: GPL-3.0
extra_files:
- source: scripts/snap/local/adguard-home-web.sh
destination: adguard-home-web.sh
mode: 0755
- source: scripts/snap/gui/adguard-home-web.desktop
destination: meta/gui/adguard-home-web.desktop
mode: 0644
- source: scripts/snap/gui/adguard-home-web.png
destination: meta/gui/adguard-home-web.png
mode: 0644
apps:
adguard-home:
command: AdGuardHome -w $SNAP_DATA --no-check-update
plugs:
# Add the "netrwork-bind" plug to bind to interfaces.
- network-bind
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- network-control
daemon: simple
adguard-home-web:
command: adguard-home-web.sh
plugs: [ desktop ]
</s> add 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': false
'license': 'GPL-3.0'
'extra_files':
- 'source': 'scripts/snap/local/adguard-home-web.sh'
'destination': 'adguard-home-web.sh'
'mode': 0755
- 'source': 'scripts/snap/gui/adguard-home-web.desktop'
'destination': 'meta/gui/adguard-home-web.desktop'
'mode': 0644
- 'source': 'scripts/snap/gui/adguard-home-web.png'
'destination': 'meta/gui/adguard-home-web.png'
'mode': 0644
'apps':
'adguard-home':
'command': 'AdGuardHome -w $SNAP_DATA --no-check-update'
'plugs':
# Add the "netrwork-bind" plug to bind to interfaces.
- 'network-bind'
# Add the "netrwork-control" plug to be able to bind to ports below
# 1024 (cap_net_bind_service) and also to bind to a particular
# interface using SO_BINDTODEVICE (cap_net_raw).
- 'network-control'
'daemon': 'simple'
'adguard-home-web':
'command': 'adguard-home-web.sh'
'plugs':
- 'desktop' </s> remove 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 }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}"
wrap_in_directory: "AdGuardHome"
format_overrides:
- goos: windows
format: zip
- goos: darwin
format: zip
files:
- LICENSE.txt
- README.md
</s> add '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 }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}`
'name_template': '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}'
'wrap_in_directory': 'AdGuardHome'
'format_overrides':
- 'goos': 'windows'
'format': 'zip'
- 'goos': 'darwin'
'format': 'zip'
'files':
- 'LICENSE.txt'
- 'README.md' </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 set it up, it'll cover ALL your home devices, and you don't need any
client-side software for that.
</s> add '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 up, it'll cover ALL your home devices, and you don't need any
client-side software for that. </s> remove concurrency: 4
</s> add 'concurrency': 4 </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 to use when marking an issue as stale
staleLabel: 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
</s> add # 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 when marking an issue as stale.
'staleLabel': 'wontfix'
# Comment to post when marking an issue as stale. Set to `false` to disable.
'markComment': > | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace"
] | https://github.com/AdguardTeam/AdGuardHome/commit/046ec13fdc5ec008fd4ac9b77cc943a96be2605c | .goreleaser.yml |
UseOwnBlockedServices bool // false: use global settings
BlockedServices []string | <mask> SafeSearchEnabled bool
<mask> SafeBrowsingEnabled bool
<mask> ParentalEnabled bool
<mask> }
<mask>
<mask> type clientJSON struct {
<mask> IP string `json:"ip"`
<mask> MAC string `json:"mac"`
<mask> Name string `json:"name"`
</s> + clients: add BlockedServices field | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04a477c14a1eeea6426c07d5ae0434afe0b6b398 | home/clients.go |
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
BlockedServices []string `json:"blocked_services"` | <mask> ParentalEnabled bool `json:"parental_enabled"`
<mask> SafeSearchEnabled bool `json:"safebrowsing_enabled"`
<mask> SafeBrowsingEnabled bool `json:"safesearch_enabled"`
<mask> }
<mask>
<mask> type clientSource uint
<mask>
<mask> const (
</s> + clients: add BlockedServices field | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04a477c14a1eeea6426c07d5ae0434afe0b6b398 | home/clients.go |
UseGlobalBlockedServices: !c.UseOwnBlockedServices,
BlockedServices: c.BlockedServices, | <mask> FilteringEnabled: c.FilteringEnabled,
<mask> ParentalEnabled: c.ParentalEnabled,
<mask> SafeSearchEnabled: c.SafeSearchEnabled,
<mask> SafeBrowsingEnabled: c.SafeBrowsingEnabled,
<mask> }
<mask>
<mask> if len(c.MAC) != 0 {
<mask> hwAddr, _ := net.ParseMAC(c.MAC)
</s> + clients: add BlockedServices field | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04a477c14a1eeea6426c07d5ae0434afe0b6b398 | home/clients.go |
UseOwnBlockedServices: !cj.UseGlobalBlockedServices,
BlockedServices: cj.BlockedServices, | <mask> FilteringEnabled: cj.FilteringEnabled,
<mask> ParentalEnabled: cj.ParentalEnabled,
<mask> SafeSearchEnabled: cj.SafeSearchEnabled,
<mask> SafeBrowsingEnabled: cj.SafeBrowsingEnabled,
<mask> }
<mask> return &c, nil
<mask> }
<mask>
</s> + clients: add BlockedServices field | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04a477c14a1eeea6426c07d5ae0434afe0b6b398 | home/clients.go |
"net/netip" | <mask> "bytes"
<mask> "fmt"
<mask> "net"
<mask> "sync"
<mask>
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "golang.org/x/exp/slices"
<mask> )
<mask>
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </s> remove "net"
</s> add "net/netip" | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb.go |
IP netip.Addr | <mask> // implementation of ARP is able to retrieve that.
<mask> Name string
<mask>
<mask> // IP contains either IPv4 or IPv6.
<mask> IP net.IP
<mask>
<mask> // MAC contains the hardware address.
<mask> MAC net.HardwareAddr
<mask> }
<mask>
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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) Equal(other *HostsRecord) (ok bool) {
if rec == nil {
return other == nil
}
return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
</s> add </s> remove rc, ok := clients.FindRuntimeClient(ip)
</s> add rc, ok := clients.findRuntimeClient(ip) </s> remove func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
</s> add func (hp *hostsParser) addRecord(ip netip.Addr, hosts []string) { </s> remove //
// TODO(e.burkov): Use map[netip.Addr]struct{} instead.
updates chan *netutil.IPMap
</s> add updates chan HostsRecords | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb.go |
IP: n.IP, | <mask> // Clone returns the deep copy of n.
<mask> func (n Neighbor) Clone() (clone Neighbor) {
<mask> return Neighbor{
<mask> Name: n.Name,
<mask> IP: slices.Clone(n.IP),
<mask> MAC: slices.Clone(n.MAC),
<mask> }
<mask> }
<mask>
<mask> // neighs is the helper type that stores neighbors to avoid copying its methods
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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() (updates <-chan HostsRecords) { </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 {
return other == nil
}
return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
</s> add </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 // equalSet returns true if the internal hosts table just parsed equals target.
// target's values must be of type *HostsRecord.
func (hp *hostsParser) equalSet(target *netutil.IPMap) (ok bool) {
if target == nil {
// hp.table shouldn't appear nil since it's initialized on each refresh.
return target == hp.table
}
if hp.table.Len() != target.Len() {
return false
}
hp.table.Range(func(ip net.IP, recVal any) (cont bool) {
var targetVal any
targetVal, ok = target.Get(ip)
if !ok {
return false
}
var rec *HostsRecord
rec, ok = recVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal)
return false
}
var targetRec *HostsRecord
targetRec, ok = targetVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal)
return false
}
ok = rec.Equal(targetRec)
return ok
})
return ok
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb.go |
"net/netip" | <mask> "bufio"
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/AdguardTeam/golibs/netutil"
<mask> )
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </s> remove "net"
</s> add "net/netip" | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_bsd.go |
} else if ip, err := netip.ParseAddr(ipStr[1 : len(ipStr)-1]); err != nil {
log.Debug("arpdb: parsing arp output: ip: %s", err)
| <mask> n := Neighbor{}
<mask>
<mask> if ipStr := fields[1]; len(ipStr) < 2 {
<mask> continue
<mask> } else if ip := net.ParseIP(ipStr[1 : len(ipStr)-1]); ip == nil {
<mask> continue
<mask> } else {
<mask> n.IP = ip
<mask> }
<mask>
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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.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> 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 || 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)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_bsd.go |
mac, err := net.ParseMAC(hwStr)
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err)
| <mask> n.IP = ip
<mask> }
<mask>
<mask> hwStr := fields[3]
<mask> if mac, err := net.ParseMAC(hwStr); err != nil {
<mask> continue
<mask> } else {
<mask> n.MAC = mac
<mask> }
<mask>
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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 arp output: mac: %s", err) </s> remove if mac, err := net.ParseMAC(fields[1]); err != nil {
</s> add mac, err := net.ParseMAC(fields[1])
if err != nil { </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("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) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_bsd.go |
err = netutil.ValidateDomainName(host)
if err != nil {
log.Debug("arpdb: parsing arp output: host: %s", err) | <mask> n.MAC = mac
<mask> }
<mask>
<mask> host := fields[0]
<mask> if err := netutil.ValidateDomainName(host); err != nil {
<mask> log.Debug("parsing arp output: %s", err)
<mask> } else {
<mask> n.Name = host
<mask> }
<mask>
<mask> ns = append(ns, n)
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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("arpdb: parsing arp output: mac: %s", err) </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 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 {
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) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_bsd.go |
"net/netip" | <mask> import (
<mask> "net"
<mask> )
<mask>
<mask> const arpAOutput = `
<mask> invalid.mac (1.2.3.4) at 12:34:56:78:910 on el0 ifscope [ethernet]
<mask> invalid.ip (1.2.3.4.5) at ab:cd:ef:ab:cd:12 on ek0 ifscope [ethernet]
<mask> invalid.fmt 1 at 12:cd:ef:ab:cd:ef on er0 ifscope [ethernet]
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_bsd_test.go |
IP: netip.MustParseAddr("192.168.1.2"), | <mask> `
<mask>
<mask> var wantNeighs = []Neighbor{{
<mask> Name: "hostname.one",
<mask> IP: net.IPv4(192, 168, 1, 2),
<mask> MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
<mask> }, {
<mask> Name: "hostname.two",
<mask> IP: net.ParseIP("::ffff:ffff"),
<mask> MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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.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"), | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_bsd_test.go |
IP: netip.MustParseAddr("::ffff:ffff"), | <mask> IP: net.IPv4(192, 168, 1, 2),
<mask> MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
<mask> }, {
<mask> Name: "hostname.two",
<mask> IP: net.ParseIP("::ffff:ffff"),
<mask> MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
<mask> }, {
<mask> Name: "",
<mask> IP: net.ParseIP("::1234"),
<mask> MAC: net.HardwareAddr{0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF},
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_bsd_test.go |
IP: netip.MustParseAddr("::1234"), | <mask> IP: net.ParseIP("::ffff:ffff"),
<mask> MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
<mask> }, {
<mask> Name: "",
<mask> IP: net.ParseIP("::1234"),
<mask> MAC: net.HardwareAddr{0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF},
<mask> }}
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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.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"), | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_bsd_test.go |
"net/netip" | <mask> "io/fs"
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/AdguardTeam/golibs/netutil"
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </s> remove "net"
</s> add "net/netip" | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
n.IP, err = netip.ParseAddr(fields[0])
if err != nil || n.IP.IsUnspecified() { | <mask> continue
<mask> }
<mask>
<mask> n := Neighbor{}
<mask> if n.IP = net.ParseIP(fields[0]); n.IP == nil || n.IP.IsUnspecified() {
<mask> continue
<mask> } else if n.MAC, err = net.ParseMAC(fields[3]); err != nil {
<mask> continue
<mask> }
<mask>
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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.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> 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 } 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)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
ip, err := netip.ParseAddr(fields[0])
if err != nil || n.IP.IsUnspecified() {
log.Debug("arpdb: parsing arp output: ip: %s", err)
| <mask> }
<mask>
<mask> n := Neighbor{}
<mask>
<mask> if ip := net.ParseIP(fields[0]); ip == nil || n.IP.IsUnspecified() {
<mask> continue
<mask> } else {
<mask> n.IP = ip
<mask> }
<mask>
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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 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.Debug("arpdb: parsing arp output: ip: %s", err)
</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)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
mac, err := net.ParseMAC(hwStr)
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err) | <mask> n.IP = ip
<mask> }
<mask>
<mask> hwStr := fields[3]
<mask> if mac, err := net.ParseMAC(hwStr); err != nil {
<mask> log.Debug("parsing arp output: %s", err)
<mask>
<mask> continue
<mask> } else {
<mask> n.MAC = mac
<mask> }
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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(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(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[1]); err != nil {
</s> add mac, err := net.ParseMAC(fields[1])
if err != nil { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
} else if ip, err := netip.ParseAddr(ipStr[1 : len(ipStr)-1]); err != nil {
log.Debug("arpdb: parsing arp output: ip: %s", err)
| <mask> n := Neighbor{}
<mask>
<mask> if ipStr := fields[1]; len(ipStr) < 2 {
<mask> continue
<mask> } else if ip := net.ParseIP(ipStr[1 : len(ipStr)-1]); ip == nil {
<mask> continue
<mask> } else {
<mask> n.IP = ip
<mask> }
<mask>
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
log.Debug("arpdb: parsing arp output: mac: %s", err) | <mask> }
<mask>
<mask> hwStr := fields[3]
<mask> if mac, err := net.ParseMAC(hwStr); err != nil {
<mask> log.Debug("parsing arp output: %s", err)
<mask>
<mask> continue
<mask> } else {
<mask> n.MAC = mac
<mask> }
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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.ParseMAC(hwStr)
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("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(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 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) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
log.Debug("arpdb: parsing arp output: host: %s", verr) | <mask> }
<mask>
<mask> host := fields[0]
<mask> if verr := netutil.ValidateDomainName(host); verr != nil {
<mask> log.Debug("parsing arp output: %s", verr)
<mask> } else {
<mask> n.Name = host
<mask> }
<mask>
<mask> ns = append(ns, n)
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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("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(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 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 {
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) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
ip, err := netip.ParseAddr(fields[0])
if err != nil {
log.Debug("arpdb: parsing arp output: ip: %s", err)
| <mask> }
<mask>
<mask> n := Neighbor{}
<mask>
<mask> if ip := net.ParseIP(fields[0]); ip == nil {
<mask> continue
<mask> } else {
<mask> n.IP = ip
<mask> }
<mask>
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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> 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 } 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 } 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)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
mac, err := net.ParseMAC(fields[4])
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err) | <mask> } else {
<mask> n.IP = ip
<mask> }
<mask>
<mask> if mac, err := net.ParseMAC(fields[4]); err != nil {
<mask> log.Debug("parsing arp output: %s", err)
<mask>
<mask> continue
<mask> } else {
<mask> n.MAC = mac
<mask> }
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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 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 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(fields[1]); err != nil {
</s> add mac, err := net.ParseMAC(fields[1])
if err != nil { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux.go |
"net/netip" | <mask>
<mask> import (
<mask> "net"
<mask> "sync"
<mask> "testing"
<mask> "testing/fstest"
<mask>
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux_test.go |
IP: netip.MustParseAddr("192.168.1.2"), | <mask> 192.168.1.2 dev enp0s3 lladdr ab:cd:ef:ab:cd:ef DELAY
<mask> ::ffff:ffff dev enp0s3 lladdr ef:cd:ab:ef:cd:ab router STALE`
<mask>
<mask> var wantNeighs = []Neighbor{{
<mask> IP: net.IPv4(192, 168, 1, 2),
<mask> MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
<mask> }, {
<mask> IP: net.ParseIP("::ffff:ffff"),
<mask> MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
<mask> }}
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), </s> remove IP: net.ParseIP("::ffff:ffff"),
</s> add IP: netip.MustParseAddr("::ffff:ffff"), | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux_test.go |
IP: netip.MustParseAddr("::ffff:ffff"), | <mask> var wantNeighs = []Neighbor{{
<mask> IP: net.IPv4(192, 168, 1, 2),
<mask> MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
<mask> }, {
<mask> IP: net.ParseIP("::ffff:ffff"),
<mask> MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
<mask> }}
<mask>
<mask> func TestFSysARPDB(t *testing.T) {
<mask> require.NoError(t, fstest.TestFS(testdata, "proc_net_arp"))
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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(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"), | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_linux_test.go |
"net/netip" | <mask> import (
<mask> "bufio"
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask>
<mask> "github.com/AdguardTeam/golibs/log"
<mask> )
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </s> remove "net"
</s> add "net/netip" | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_openbsd.go |
ip, err := netip.ParseAddr(fields[0])
if err != nil {
log.Debug("arpdb: parsing arp output: ip: %s", err)
| <mask> }
<mask>
<mask> n := Neighbor{}
<mask>
<mask> if ip := net.ParseIP(fields[0]); ip == nil {
<mask> continue
<mask> } else {
<mask> n.IP = ip
<mask> }
<mask>
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_openbsd.go |
mac, err := net.ParseMAC(fields[1])
if err != nil {
log.Debug("arpdb: parsing arp output: mac: %s", err) | <mask> } else {
<mask> n.IP = ip
<mask> }
<mask>
<mask> if mac, err := net.ParseMAC(fields[1]); err != nil {
<mask> log.Debug("parsing arp output: %s", err)
<mask>
<mask> continue
<mask> } else {
<mask> n.MAC = mac
<mask> }
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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 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(fields[1]); err != nil {
</s> add mac, err := net.ParseMAC(fields[1])
if err != nil { </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)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_openbsd.go |
"net/netip" | <mask>
<mask> import (
<mask> "net"
<mask> )
<mask>
<mask> const arpAOutput = `
<mask> Host Ethernet Address Netif Expire Flags
<mask> 1.2.3.4.5 aa:bb:cc:dd:ee:ff em0 permanent
<mask> 1.2.3.4 12:34:56:78:910 em0 permanent
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </s> remove IP: net.IPv4(192, 168, 1, 2),
</s> add IP: netip.MustParseAddr("192.168.1.2"), | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_openbsd_test.go |
IP: netip.MustParseAddr("192.168.1.2"), | <mask> ::ffff:ffff ef:cd:ab:ef:cd:ab em0 permanent l
<mask> `
<mask>
<mask> var wantNeighs = []Neighbor{{
<mask> IP: net.IPv4(192, 168, 1, 2),
<mask> MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
<mask> }, {
<mask> IP: net.ParseIP("::ffff:ffff"),
<mask> MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
<mask> }}
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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(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"), | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_openbsd_test.go |
IP: netip.MustParseAddr("::ffff:ffff"), | <mask> var wantNeighs = []Neighbor{{
<mask> IP: net.IPv4(192, 168, 1, 2),
<mask> MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
<mask> }, {
<mask> IP: net.ParseIP("::ffff:ffff"),
<mask> MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
<mask> }}
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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("::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"), | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_openbsd_test.go |
"net/netip" | <mask> package aghnet
<mask>
<mask> import (
<mask> "net"
<mask> "sync"
<mask> "testing"
<mask>
<mask> "github.com/AdguardTeam/golibs/errors"
<mask> "github.com/AdguardTeam/golibs/testutil"
<mask> "github.com/stretchr/testify/assert"
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_test.go |
knownIP := netip.MustParseAddr("1.2.3.4") | <mask> return arp.OnNeighbors()
<mask> }
<mask>
<mask> func TestARPDBS(t *testing.T) {
<mask> knownIP := net.IP{1, 2, 3, 4}
<mask> knownMAC := net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF}
<mask>
<mask> succRefrCount, failRefrCount := 0, 0
<mask> clnp := func() {
<mask> succRefrCount, failRefrCount = 0, 0
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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"), </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"), | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_test.go |
"net/netip" | <mask>
<mask> import (
<mask> "bufio"
<mask> "net"
<mask> "strings"
<mask> "sync"
<mask> )
<mask>
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </s> remove "net"
</s> add "net/netip" | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_windows.go |
ip, err := netip.ParseAddr(fields[0])
if err != nil { | <mask> }
<mask>
<mask> n := Neighbor{}
<mask>
<mask> if ip := net.ParseIP(fields[0]); ip == nil {
<mask> continue
<mask> } else {
<mask> n.IP = ip
<mask> }
<mask>
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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.Debug("arpdb: parsing arp output: ip: %s", err)
</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 } 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 } 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)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_windows.go |
mac, err := net.ParseMAC(fields[1])
if err != nil { | <mask> } else {
<mask> n.IP = ip
<mask> }
<mask>
<mask> if mac, err := net.ParseMAC(fields[1]); err != nil {
<mask> continue
<mask> } else {
<mask> n.MAC = mac
<mask> }
<mask>
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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("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 {
</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 {
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 arp output: mac: %s", err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_windows.go |
"net/netip" | <mask> import (
<mask> "net"
<mask> )
<mask>
<mask> const arpAOutput = `
<mask>
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_windows_test.go |
IP: netip.MustParseAddr("192.168.1.2"), | <mask> 192.168.1.2 ab-cd-ef-ab-cd-ef dynamic
<mask> ::ffff:ffff ef-cd-ab-ef-cd-ab static`
<mask>
<mask> var wantNeighs = []Neighbor{{
<mask> IP: net.IPv4(192, 168, 1, 2),
<mask> MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
<mask> }, {
<mask> IP: net.ParseIP("::ffff:ffff"),
<mask> MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
<mask> }}
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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(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"), | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_windows_test.go |
IP: netip.MustParseAddr("::ffff:ffff"), | <mask> var wantNeighs = []Neighbor{{
<mask> IP: net.IPv4(192, 168, 1, 2),
<mask> MAC: net.HardwareAddr{0xAB, 0xCD, 0xEF, 0xAB, 0xCD, 0xEF},
<mask> }, {
<mask> IP: net.ParseIP("::ffff:ffff"),
<mask> MAC: net.HardwareAddr{0xEF, 0xCD, 0xAB, 0xEF, 0xCD, 0xAB},
<mask> }}
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/arpdb_windows_test.go |
"net/netip" | <mask> "bufio"
<mask> "fmt"
<mask> "io"
<mask> "io/fs"
<mask> "net"
<mask> "path"
<mask> "strings"
<mask> "sync"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghos"
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
"golang.org/x/exp/maps" | <mask> "github.com/AdguardTeam/urlfilter/rules"
<mask> "github.com/miekg/dns"
<mask> )
<mask>
<mask> // DefaultHostsPaths returns the slice of paths default for the operating system
<mask> // to files and directories which are containing the hosts database. The result
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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 // Upd returns the channel into which the updates are sent.
func (hc *HostsContainer) Upd() (updates <-chan HostsRecords) { </s> remove //
// TODO(e.burkov): Use map[netip.Addr]struct{} instead.
last *netutil.IPMap
</s> add last HostsRecords </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 {
return other == nil
}
return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
</s> add </s> remove table: netutil.NewIPMap(hc.last.Len()),
</s> add table: make(HostsRecords, len(hc.last)), | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
<mask> "github.com/AdguardTeam/urlfilter/rules"
<mask> "github.com/miekg/dns"
<mask> )
<mask>
<mask> //lint:file-ignore SA1019 TODO(a.garipov): Replace [*netutil.IPMap].
<mask>
<mask> // DefaultHostsPaths returns the slice of paths default for the operating system
<mask> // to files and directories which are containing the hosts database. The result
<mask> // is intended to be used within fs.FS so the initial slash is omitted.
<mask> func DefaultHostsPaths() (paths []string) {
<mask> return defaultHostsPaths()
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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() (updates <-chan HostsRecords) { </s> remove //
// TODO(e.burkov): Use map[netip.Addr]struct{} instead.
last *netutil.IPMap
</s> add last HostsRecords </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 {
return other == nil
}
return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
</s> add </s> remove func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
</s> add func (hp *hostsParser) addRecord(ip netip.Addr, hosts []string) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
|
updates chan HostsRecords | <mask> // done is the channel to sign closing the container.
<mask> done chan struct{}
<mask>
<mask> // updates is the channel for receiving updated hosts.
<mask> //
<mask> // TODO(e.burkov): Use map[netip.Addr]struct{} instead.
<mask> updates chan *netutil.IPMap
<mask>
<mask> // last is the set of hosts that was cached within last detected change.
<mask> //
<mask> // TODO(e.burkov): Use map[netip.Addr]struct{} instead.
<mask> last *netutil.IPMap
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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 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() (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.findRuntimeClient(ip) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
last HostsRecords | <mask> // TODO(e.burkov): Use map[netip.Addr]struct{} instead.
<mask> updates chan *netutil.IPMap
<mask>
<mask> // last is the set of hosts that was cached within last detected change.
<mask> //
<mask> // TODO(e.burkov): Use map[netip.Addr]struct{} instead.
<mask> last *netutil.IPMap
<mask>
<mask> // fsys is the working file system to read hosts files from.
<mask> fsys fs.FS
<mask>
<mask> // w tracks the changes in specified files and directories.
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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.findRuntimeClient(ip) </s> remove table *netutil.IPMap
</s> add table HostsRecords | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
updates: make(chan HostsRecords, 1), | <mask> stateLock: &sync.RWMutex{},
<mask> },
<mask> listID: listID,
<mask> done: make(chan struct{}, 1),
<mask> updates: make(chan *netutil.IPMap, 1),
<mask> fsys: fsys,
<mask> w: w,
<mask> patterns: patterns,
<mask> }
<mask>
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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("::ffff:ffff"), </s> remove wantIP: nil,
</s> add wantIP: netip.Addr{}, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
// Upd returns the channel into which the updates are sent.
func (hc *HostsContainer) Upd() (updates <-chan HostsRecords) { | <mask>
<mask> return nil
<mask> }
<mask>
<mask> // Upd returns the channel into which the updates are sent. The receivable
<mask> // map's values are guaranteed to be of type of *HostsRecord.
<mask> func (hc *HostsContainer) Upd() (updates <-chan *netutil.IPMap) {
<mask> return hc.updates
<mask> }
<mask>
<mask> // pathsToPatterns converts paths into patterns compatible with fs.Glob.
<mask> func pathsToPatterns(fsys fs.FS, paths []string) (patterns []string, err error) {
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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 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 {
return other == nil
}
return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
</s> add </s> remove // equalSet returns true if the internal hosts table just parsed equals target.
// target's values must be of type *HostsRecord.
func (hp *hostsParser) equalSet(target *netutil.IPMap) (ok bool) {
if target == nil {
// hp.table shouldn't appear nil since it's initialized on each refresh.
return target == hp.table
}
if hp.table.Len() != target.Len() {
return false
}
hp.table.Range(func(ip net.IP, recVal any) (cont bool) {
var targetVal any
targetVal, ok = target.Get(ip)
if !ok {
return false
}
var rec *HostsRecord
rec, ok = recVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal)
return false
}
var targetRec *HostsRecord
targetRec, ok = targetVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal)
return false
}
ok = rec.Equal(targetRec)
return ok
})
return ok
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
table HostsRecords | <mask> translations map[string]string
<mask>
<mask> // table stores only the unique IP-hostname pairs. It's also sent to the
<mask> // updates channel afterwards.
<mask> table *netutil.IPMap
<mask> }
<mask>
<mask> // newHostsParser creates a new *hostsParser with buffers of size taken from the
<mask> // previous parse.
<mask> func (hc *HostsContainer) newHostsParser() (hp *hostsParser) {
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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() (updates <-chan HostsRecords) { </s> remove table: netutil.NewIPMap(hc.last.Len()),
</s> add table: make(HostsRecords, len(hc.last)), </s> remove //
// TODO(e.burkov): Use map[netip.Addr]struct{} instead.
updates chan *netutil.IPMap
</s> add updates chan HostsRecords </s> remove
return true
})
</s> add } </s> remove //
// TODO(e.burkov): Use map[netip.Addr]struct{} instead.
last *netutil.IPMap
</s> add last HostsRecords | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
table: make(HostsRecords, len(hc.last)), | <mask> func (hc *HostsContainer) newHostsParser() (hp *hostsParser) {
<mask> return &hostsParser{
<mask> rulesBuilder: &strings.Builder{},
<mask> translations: map[string]string{},
<mask> table: netutil.NewIPMap(hc.last.Len()),
<mask> }
<mask> }
<mask>
<mask> // parseFile is a aghos.FileWalker for parsing the files with hosts syntax. It
<mask> // never signs to stop walking and never returns any additional patterns.
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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 into which the updates are sent.
func (hc *HostsContainer) Upd() (updates <-chan HostsRecords) { </s> remove //lint:file-ignore SA1019 TODO(a.garipov): Replace [*netutil.IPMap].
</s> add </s> remove func (hp *hostsParser) writeRules(host string, ip net.IP) (rule, rulePtr string) {
arpa, err := netutil.IPToReversedAddr(ip)
</s> add func (hp *hostsParser) writeRules(host string, ip netip.Addr) (rule, rulePtr string) {
// TODO(a.garipov): Add a netip.Addr version to netutil.
arpa, err := netutil.IPToReversedAddr(ip.AsSlice()) </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 {
return other == nil
}
return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
if ip == (netip.Addr{}) || len(hosts) == 0 { | <mask> func (hp *hostsParser) parseFile(r io.Reader) (patterns []string, cont bool, err error) {
<mask> s := bufio.NewScanner(r)
<mask> for s.Scan() {
<mask> ip, hosts := hp.parseLine(s.Text())
<mask> if ip == nil || len(hosts) == 0 {
<mask> continue
<mask> }
<mask>
<mask> hp.addRecord(ip, hosts)
<mask> }
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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, err := netip.ParseAddr(fields[0])
if err != nil {
return netip.Addr{}, nil </s> remove if ip := net.ParseIP(fields[0]); ip == nil {
</s> add ip, err := netip.ParseAddr(fields[0])
if err != nil { </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 {
log.Debug("arpdb: parsing arp output: ip: %s", err)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
func (hp *hostsParser) parseLine(line string) (ip netip.Addr, hosts []string) { | <mask> return nil, true, s.Err()
<mask> }
<mask>
<mask> // parseLine parses the line having the hosts syntax ignoring invalid ones.
<mask> func (hp *hostsParser) parseLine(line string) (ip net.IP, hosts []string) {
<mask> fields := strings.Fields(line)
<mask> if len(fields) < 2 {
<mask> return nil, nil
<mask> }
<mask>
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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 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 {
return other == nil
}
return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
</s> add </s> remove func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
</s> add func (hp *hostsParser) addRecord(ip netip.Addr, hosts []string) { </s> remove func (hp *hostsParser) addRules(ip net.IP, host, line string) {
</s> add func (hp *hostsParser) addRules(ip netip.Addr, host, line string) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
return netip.Addr{}, nil | <mask> // parseLine parses the line having the hosts syntax ignoring invalid ones.
<mask> func (hp *hostsParser) parseLine(line string) (ip net.IP, hosts []string) {
<mask> fields := strings.Fields(line)
<mask> if len(fields) < 2 {
<mask> return nil, nil
<mask> }
<mask>
<mask> if ip = net.ParseIP(fields[0]); ip == nil {
<mask> return nil, nil
<mask> }
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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 </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 {
return other == nil
}
return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
</s> add </s> remove func (hp *hostsParser) writeRules(host string, ip net.IP) (rule, rulePtr string) {
arpa, err := netutil.IPToReversedAddr(ip)
</s> add func (hp *hostsParser) writeRules(host string, ip netip.Addr) (rule, rulePtr string) {
// TODO(a.garipov): Add a netip.Addr version to netutil.
arpa, err := netutil.IPToReversedAddr(ip.AsSlice()) </s> remove func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
</s> add func (hp *hostsParser) addRecord(ip netip.Addr, hosts []string) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
ip, err := netip.ParseAddr(fields[0])
if err != nil {
return netip.Addr{}, nil | <mask> if len(fields) < 2 {
<mask> return nil, nil
<mask> }
<mask>
<mask> if ip = net.ParseIP(fields[0]); ip == nil {
<mask> return nil, nil
<mask> }
<mask>
<mask> for _, f := range fields[1:] {
<mask> hashIdx := strings.IndexByte(f, '#')
<mask> if hashIdx == 0 {
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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.Addr{}) || len(hosts) == 0 { </s> remove if ip := net.ParseIP(fields[0]); ip == nil {
</s> add ip, err := netip.ParseAddr(fields[0])
if err != nil { </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)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
err = netutil.ValidateDomainName(f) | <mask> //
<mask> // See https://github.com/AdguardTeam/AdGuardHome/issues/3946.
<mask> //
<mask> // TODO(e.burkov): Investigate if hosts may contain DNS-SD domains.
<mask> err := netutil.ValidateDomainName(f)
<mask> if err != nil {
<mask> log.Error("%s: host %q is invalid, ignoring", hostsContainerPref, f)
<mask>
<mask> continue
<mask> }
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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", err)
</s> add err = netutil.ValidateDomainName(host)
if err != nil {
log.Debug("arpdb: parsing arp output: host: %s", err) </s> remove //
// TODO(e.burkov): Use map[netip.Addr]struct{} instead.
updates chan *netutil.IPMap
</s> add updates chan HostsRecords </s> remove //
// TODO(e.burkov): Use map[netip.Addr]struct{} instead.
last *netutil.IPMap
</s> add last HostsRecords </s> remove ok := clients.addHostLocked(l.IP, l.Hostname, ClientSourceDHCP)
</s> add // TODO(a.garipov): Remove once we switch to netip.Addr more fully.
ipAddr, err := netutil.IPToAddrNoMapped(l.IP)
if err != nil {
log.Error("clients: bad client ip %v from dhcp: %s", l.IP, err)
continue
}
ok := clients.addHostLocked(ipAddr, l.Hostname, ClientSourceDHCP) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
<mask>
<mask> return ip, hosts
<mask> }
<mask>
<mask> // HostsRecord represents a single hosts file record.
<mask> type HostsRecord struct {
<mask> Aliases *stringutil.Set
<mask> Canonical string
<mask> }
<mask>
<mask> // Equal returns true if all fields of rec are equal to field in other or they
<mask> // both are nil.
<mask> func (rec *HostsRecord) Equal(other *HostsRecord) (ok bool) {
<mask> if rec == nil {
<mask> return other == nil
<mask> }
<mask>
<mask> return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
<mask> }
<mask>
<mask> // addRecord puts the record for the IP address to the rules builder if needed.
<mask> // The first host is considered to be the canonical name for the IP address.
<mask> // hosts must have at least one name.
<mask> func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
<mask> line := strings.Join(append([]string{ip.String()}, hosts...), " ")
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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> 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 // equalSet returns true if the internal hosts table just parsed equals target.
// target's values must be of type *HostsRecord.
func (hp *hostsParser) equalSet(target *netutil.IPMap) (ok bool) {
if target == nil {
// hp.table shouldn't appear nil since it's initialized on each refresh.
return target == hp.table
}
if hp.table.Len() != target.Len() {
return false
}
hp.table.Range(func(ip net.IP, recVal any) (cont bool) {
var targetVal any
targetVal, ok = target.Get(ip)
if !ok {
return false
}
var rec *HostsRecord
rec, ok = recVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: unexpected type %T", hostsContainerPref, recVal)
return false
}
var targetRec *HostsRecord
targetRec, ok = targetVal.(*HostsRecord)
if !ok {
log.Error("%s: comparing: target: unexpected type %T", hostsContainerPref, targetVal)
return false
}
ok = rec.Equal(targetRec)
return ok
})
return ok
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |
|
func (hp *hostsParser) addRecord(ip netip.Addr, hosts []string) { | <mask>
<mask> // addRecord puts the record for the IP address to the rules builder if needed.
<mask> // The first host is considered to be the canonical name for the IP address.
<mask> // hosts must have at least one name.
<mask> func (hp *hostsParser) addRecord(ip net.IP, hosts []string) {
<mask> line := strings.Join(append([]string{ip.String()}, hosts...), " ")
<mask>
<mask> var rec *HostsRecord
<mask> v, ok := hp.table.Get(ip)
<mask> if !ok {
</s> Pull request: 5035-netip-arp-hosts
Updates #5035.
Squashed commit of the following:
commit d1c4493ee4e28d05670c20532ebae1aa809d18da
Author: Ainar Garipov <[email protected]>
Date: Tue Oct 25 14:26:52 2022 +0300
aghnet: imp hosts rec equal
commit 0a7f40a64a819245fba20d3b481b0fc34e0c60e6
Author: Ainar Garipov <[email protected]>
Date: Mon Oct 24 18:10:09 2022 +0300
aghnet: move arp and hosts to netip.Addr </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 {
return other == nil
}
return rec.Canonical == other.Canonical && rec.Aliases.Equal(other.Aliases)
}
</s> add </s> remove var rec *HostsRecord
v, ok := hp.table.Get(ip)
</s> add rec, ok := hp.table[ip] </s> remove rc, ok := clients.FindRuntimeClient(ip)
</s> add rc, ok := clients.findRuntimeClient(ip) </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 //lint:file-ignore SA1019 TODO(a.garipov): Replace [*netutil.IPMap].
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/04c8e3b2886bb02866ace61f796733c82b3e9aca | internal/aghnet/hostscontainer.go |