docstring_tokens stringlengths 0 76.5k | code_tokens stringlengths 75 1.81M | label_window listlengths 4 2.12k | html_url stringlengths 74 116 | file_name stringlengths 3 311 |
|---|---|---|---|---|
parsedCerts, err := parsePEMCerts(certs)
if err != nil {
return err | <mask> certs = append(certs, decoded)
<mask> }
<mask> }
<mask>
<mask> var parsedCerts []*x509.Certificate
<mask>
<mask> for _, cert := range certs {
<mask> parsed, err := x509.ParseCertificate(cert.Bytes)
<mask> if err != nil {
<mask> data.WarningValidation = fmt.Sprintf("Failed to parse certificate: %s", err)
<mask> return errors.Error(data.WarningValidation)
<mask> }
<mask> parsedCerts = append(parsedCerts, parsed)
<mask> }
<mask>
<mask> if len(parsedCerts) == 0 {
<mask> data.WarningValidation = "You have specified an empty certificate"
<mask> return errors.Error(data.WarningValidation)
<mask> }
<mask>
<mask> data.ValidCert = true
<mask>
<mask> // spew.Dump(parsedCerts)
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove data.ValidCert = true
// spew.Dump(parsedCerts)
</s> add status.ValidCert = true </s> remove data.WarningValidation = fmt.Sprintf("Failed to parse private key: %s", err)
return errors.Error(data.WarningValidation)
} else if keyType == keyTypeED25519 {
data.WarningValidation = "ED25519 keys are not supported by browsers; " +
"did you mean to use X25519 for key exchange?"
</s> add return fmt.Errorf("parsing private key: %w", err)
} </s> remove // parse the decoded key
</s> add </s> remove data.WarningValidation = "No valid keys were found"
return errors.Error(data.WarningValidation)
</s> add return errors.Error("no valid keys were found") </s> remove log.Printf("number of certs - %d", len(parsedCerts))
if len(parsedCerts) > 1 {
// set up an intermediate
pool := x509.NewCertPool()
for _, cert := range parsedCerts[1:] {
log.Printf("got an intermediate cert")
pool.AddCert(cert)
}
opts.Intermediates = pool
</s> add log.Info("tls: number of certs: %d", len(parsedCerts))
pool := x509.NewCertPool()
for _, cert := range parsedCerts[1:] {
log.Info("tls: got an intermediate cert")
pool.AddCert(cert) | [
"keep",
"keep",
"keep",
"keep",
"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/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
status.ValidCert = true | <mask> data.WarningValidation = "You have specified an empty certificate"
<mask> return errors.Error(data.WarningValidation)
<mask> }
<mask>
<mask> data.ValidCert = true
<mask>
<mask> // spew.Dump(parsedCerts)
<mask>
<mask> opts := x509.VerifyOptions{
<mask> DNSName: serverName,
<mask> Roots: Context.tlsRoots,
<mask> }
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove var parsedCerts []*x509.Certificate
for _, cert := range certs {
parsed, err := x509.ParseCertificate(cert.Bytes)
if err != nil {
data.WarningValidation = fmt.Sprintf("Failed to parse certificate: %s", err)
return errors.Error(data.WarningValidation)
}
parsedCerts = append(parsedCerts, parsed)
}
if len(parsedCerts) == 0 {
data.WarningValidation = "You have specified an empty certificate"
return errors.Error(data.WarningValidation)
</s> add parsedCerts, err := parsePEMCerts(certs)
if err != nil {
return err </s> remove log.Printf("number of certs - %d", len(parsedCerts))
if len(parsedCerts) > 1 {
// set up an intermediate
pool := x509.NewCertPool()
for _, cert := range parsedCerts[1:] {
log.Printf("got an intermediate cert")
pool.AddCert(cert)
}
opts.Intermediates = pool
</s> add log.Info("tls: number of certs: %d", len(parsedCerts))
pool := x509.NewCertPool()
for _, cert := range parsedCerts[1:] {
log.Info("tls: got an intermediate cert")
pool.AddCert(cert) </s> remove data.WarningValidation = fmt.Sprintf("Failed to parse private key: %s", err)
return errors.Error(data.WarningValidation)
} else if keyType == keyTypeED25519 {
data.WarningValidation = "ED25519 keys are not supported by browsers; " +
"did you mean to use X25519 for key exchange?"
</s> add return fmt.Errorf("parsing private key: %w", err)
} </s> remove // parse the decoded key
</s> add </s> remove data.ValidKey = true
data.KeyType = keyType
</s> add status.ValidKey = true
status.KeyType = keyType | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
log.Info("tls: number of certs: %d", len(parsedCerts))
pool := x509.NewCertPool()
for _, cert := range parsedCerts[1:] {
log.Info("tls: got an intermediate cert")
pool.AddCert(cert) | <mask> DNSName: serverName,
<mask> Roots: Context.tlsRoots,
<mask> }
<mask>
<mask> log.Printf("number of certs - %d", len(parsedCerts))
<mask> if len(parsedCerts) > 1 {
<mask> // set up an intermediate
<mask> pool := x509.NewCertPool()
<mask> for _, cert := range parsedCerts[1:] {
<mask> log.Printf("got an intermediate cert")
<mask> pool.AddCert(cert)
<mask> }
<mask> opts.Intermediates = pool
<mask> }
<mask>
<mask> // TODO: save it as a warning rather than error it out -- shouldn't be a big problem
<mask> mainCert := parsedCerts[0]
<mask> _, err := mainCert.Verify(opts)
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove // TODO: save it as a warning rather than error it out -- shouldn't be a big problem
</s> add opts.Intermediates = pool
</s> remove _, err := mainCert.Verify(opts)
</s> add _, err = mainCert.Verify(opts) </s> remove // let self-signed certs through
data.WarningValidation = fmt.Sprintf("Your certificate does not verify: %s", err)
</s> add // Let self-signed certs through and don't return this error.
status.WarningValidation = fmt.Sprintf("certificate does not verify: %s", err) </s> remove var parsedCerts []*x509.Certificate
for _, cert := range certs {
parsed, err := x509.ParseCertificate(cert.Bytes)
if err != nil {
data.WarningValidation = fmt.Sprintf("Failed to parse certificate: %s", err)
return errors.Error(data.WarningValidation)
}
parsedCerts = append(parsedCerts, parsed)
}
if len(parsedCerts) == 0 {
data.WarningValidation = "You have specified an empty certificate"
return errors.Error(data.WarningValidation)
</s> add parsedCerts, err := parsePEMCerts(certs)
if err != nil {
return err </s> remove data.ValidCert = true
// spew.Dump(parsedCerts)
</s> add status.ValidCert = true | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
opts.Intermediates = pool
| <mask> }
<mask> opts.Intermediates = pool
<mask> }
<mask>
<mask> // TODO: save it as a warning rather than error it out -- shouldn't be a big problem
<mask> mainCert := parsedCerts[0]
<mask> _, err := mainCert.Verify(opts)
<mask> if err != nil {
<mask> // let self-signed certs through
<mask> data.WarningValidation = fmt.Sprintf("Your certificate does not verify: %s", err)
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove _, err := mainCert.Verify(opts)
</s> add _, err = mainCert.Verify(opts) </s> remove // let self-signed certs through
data.WarningValidation = fmt.Sprintf("Your certificate does not verify: %s", err)
</s> add // Let self-signed certs through and don't return this error.
status.WarningValidation = fmt.Sprintf("certificate does not verify: %s", err) </s> remove log.Printf("number of certs - %d", len(parsedCerts))
if len(parsedCerts) > 1 {
// set up an intermediate
pool := x509.NewCertPool()
for _, cert := range parsedCerts[1:] {
log.Printf("got an intermediate cert")
pool.AddCert(cert)
}
opts.Intermediates = pool
</s> add log.Info("tls: number of certs: %d", len(parsedCerts))
pool := x509.NewCertPool()
for _, cert := range parsedCerts[1:] {
log.Info("tls: got an intermediate cert")
pool.AddCert(cert) </s> remove data.ValidChain = true
</s> add status.ValidChain = true </s> remove // spew.Dump(chains)
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
_, err = mainCert.Verify(opts) | <mask> }
<mask>
<mask> // TODO: save it as a warning rather than error it out -- shouldn't be a big problem
<mask> mainCert := parsedCerts[0]
<mask> _, err := mainCert.Verify(opts)
<mask> if err != nil {
<mask> // let self-signed certs through
<mask> data.WarningValidation = fmt.Sprintf("Your certificate does not verify: %s", err)
<mask> } else {
<mask> data.ValidChain = true
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove // let self-signed certs through
data.WarningValidation = fmt.Sprintf("Your certificate does not verify: %s", err)
</s> add // Let self-signed certs through and don't return this error.
status.WarningValidation = fmt.Sprintf("certificate does not verify: %s", err) </s> remove // TODO: save it as a warning rather than error it out -- shouldn't be a big problem
</s> add opts.Intermediates = pool
</s> remove log.Printf("number of certs - %d", len(parsedCerts))
if len(parsedCerts) > 1 {
// set up an intermediate
pool := x509.NewCertPool()
for _, cert := range parsedCerts[1:] {
log.Printf("got an intermediate cert")
pool.AddCert(cert)
}
opts.Intermediates = pool
</s> add log.Info("tls: number of certs: %d", len(parsedCerts))
pool := x509.NewCertPool()
for _, cert := range parsedCerts[1:] {
log.Info("tls: got an intermediate cert")
pool.AddCert(cert) </s> remove data.ValidChain = true
</s> add status.ValidChain = true </s> remove // spew.Dump(chains)
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
// Let self-signed certs through and don't return this error.
status.WarningValidation = fmt.Sprintf("certificate does not verify: %s", err) | <mask> // TODO: save it as a warning rather than error it out -- shouldn't be a big problem
<mask> mainCert := parsedCerts[0]
<mask> _, err := mainCert.Verify(opts)
<mask> if err != nil {
<mask> // let self-signed certs through
<mask> data.WarningValidation = fmt.Sprintf("Your certificate does not verify: %s", err)
<mask> } else {
<mask> data.ValidChain = true
<mask> }
<mask> // spew.Dump(chains)
<mask>
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove _, err := mainCert.Verify(opts)
</s> add _, err = mainCert.Verify(opts) </s> remove // TODO: save it as a warning rather than error it out -- shouldn't be a big problem
</s> add opts.Intermediates = pool
</s> remove log.Printf("number of certs - %d", len(parsedCerts))
if len(parsedCerts) > 1 {
// set up an intermediate
pool := x509.NewCertPool()
for _, cert := range parsedCerts[1:] {
log.Printf("got an intermediate cert")
pool.AddCert(cert)
}
opts.Intermediates = pool
</s> add log.Info("tls: number of certs: %d", len(parsedCerts))
pool := x509.NewCertPool()
for _, cert := range parsedCerts[1:] {
log.Info("tls: got an intermediate cert")
pool.AddCert(cert) </s> remove data.ValidChain = true
</s> add status.ValidChain = true </s> remove // spew.Dump(chains)
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
status.ValidChain = true | <mask> if err != nil {
<mask> // let self-signed certs through
<mask> data.WarningValidation = fmt.Sprintf("Your certificate does not verify: %s", err)
<mask> } else {
<mask> data.ValidChain = true
<mask> }
<mask> // spew.Dump(chains)
<mask>
<mask> // update status
<mask> if mainCert != nil {
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove // let self-signed certs through
data.WarningValidation = fmt.Sprintf("Your certificate does not verify: %s", err)
</s> add // Let self-signed certs through and don't return this error.
status.WarningValidation = fmt.Sprintf("certificate does not verify: %s", err) </s> remove // spew.Dump(chains)
</s> add </s> remove _, err := mainCert.Verify(opts)
</s> add _, err = mainCert.Verify(opts) </s> remove // TODO: save it as a warning rather than error it out -- shouldn't be a big problem
</s> add opts.Intermediates = pool
</s> remove // update status
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
<mask> data.WarningValidation = fmt.Sprintf("Your certificate does not verify: %s", err)
<mask> } else {
<mask> data.ValidChain = true
<mask> }
<mask> // spew.Dump(chains)
<mask>
<mask> // update status
<mask> if mainCert != nil {
<mask> notAfter := mainCert.NotAfter
<mask> data.Subject = mainCert.Subject.String()
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove // update status
</s> add </s> remove data.ValidChain = true
</s> add status.ValidChain = true </s> remove notAfter := mainCert.NotAfter
data.Subject = mainCert.Subject.String()
data.Issuer = mainCert.Issuer.String()
data.NotAfter = notAfter
data.NotBefore = mainCert.NotBefore
data.DNSNames = mainCert.DNSNames
</s> add status.Subject = mainCert.Subject.String()
status.Issuer = mainCert.Issuer.String()
status.NotAfter = mainCert.NotAfter
status.NotBefore = mainCert.NotBefore
status.DNSNames = mainCert.DNSNames </s> remove // let self-signed certs through
data.WarningValidation = fmt.Sprintf("Your certificate does not verify: %s", err)
</s> add // Let self-signed certs through and don't return this error.
status.WarningValidation = fmt.Sprintf("certificate does not verify: %s", err) </s> remove _, err := mainCert.Verify(opts)
</s> add _, err = mainCert.Verify(opts) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go | |
<mask> data.ValidChain = true
<mask> }
<mask> // spew.Dump(chains)
<mask>
<mask> // update status
<mask> if mainCert != nil {
<mask> notAfter := mainCert.NotAfter
<mask> data.Subject = mainCert.Subject.String()
<mask> data.Issuer = mainCert.Issuer.String()
<mask> data.NotAfter = notAfter
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove notAfter := mainCert.NotAfter
data.Subject = mainCert.Subject.String()
data.Issuer = mainCert.Issuer.String()
data.NotAfter = notAfter
data.NotBefore = mainCert.NotBefore
data.DNSNames = mainCert.DNSNames
</s> add status.Subject = mainCert.Subject.String()
status.Issuer = mainCert.Issuer.String()
status.NotAfter = mainCert.NotAfter
status.NotBefore = mainCert.NotBefore
status.DNSNames = mainCert.DNSNames </s> remove // spew.Dump(chains)
</s> add </s> remove data.ValidChain = true
</s> add status.ValidChain = true </s> remove // let self-signed certs through
data.WarningValidation = fmt.Sprintf("Your certificate does not verify: %s", err)
</s> add // Let self-signed certs through and don't return this error.
status.WarningValidation = fmt.Sprintf("certificate does not verify: %s", err) </s> remove _, err := mainCert.Verify(opts)
</s> add _, err = mainCert.Verify(opts) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go | |
status.Subject = mainCert.Subject.String()
status.Issuer = mainCert.Issuer.String()
status.NotAfter = mainCert.NotAfter
status.NotBefore = mainCert.NotBefore
status.DNSNames = mainCert.DNSNames | <mask> // spew.Dump(chains)
<mask>
<mask> // update status
<mask> if mainCert != nil {
<mask> notAfter := mainCert.NotAfter
<mask> data.Subject = mainCert.Subject.String()
<mask> data.Issuer = mainCert.Issuer.String()
<mask> data.NotAfter = notAfter
<mask> data.NotBefore = mainCert.NotBefore
<mask> data.DNSNames = mainCert.DNSNames
<mask> }
<mask>
<mask> return nil
<mask> }
<mask>
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove // update status
</s> add </s> remove // spew.Dump(chains)
</s> add </s> remove data.ValidChain = true
</s> add status.ValidChain = true </s> remove // let self-signed certs through
data.WarningValidation = fmt.Sprintf("Your certificate does not verify: %s", err)
</s> add // Let self-signed certs through and don't return this error.
status.WarningValidation = fmt.Sprintf("certificate does not verify: %s", err) </s> remove var parsedCerts []*x509.Certificate
for _, cert := range certs {
parsed, err := x509.ParseCertificate(cert.Bytes)
if err != nil {
data.WarningValidation = fmt.Sprintf("Failed to parse certificate: %s", err)
return errors.Error(data.WarningValidation)
}
parsedCerts = append(parsedCerts, parsed)
}
if len(parsedCerts) == 0 {
data.WarningValidation = "You have specified an empty certificate"
return errors.Error(data.WarningValidation)
</s> add parsedCerts, err := parsePEMCerts(certs)
if err != nil {
return err | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
// parsePEMCerts parses multiple PEM-encoded certificates.
func parsePEMCerts(certs []*pem.Block) (parsedCerts []*x509.Certificate, err error) {
for i, cert := range certs {
var parsed *x509.Certificate
parsed, err = x509.ParseCertificate(cert.Bytes)
if err != nil {
return nil, fmt.Errorf("parsing certificate at index %d: %w", i, err)
} | <mask>
<mask> return nil
<mask> }
<mask>
<mask> func validatePkey(data *tlsConfigStatus, pkey string) error {
<mask> // now do a more extended validation
<mask> var key *pem.Block // PEM-encoded certificates
<mask>
<mask> // go through all pem blocks, but take first valid pem block and drop the rest
<mask> pemblock := []byte(pkey)
<mask> for {
<mask> var decoded *pem.Block
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove // go through all pem blocks, but take first valid pem block and drop the rest
</s> add parsedCerts = append(parsedCerts, parsed)
}
if len(parsedCerts) == 0 {
return nil, errors.Error("empty certificate")
}
return parsedCerts, nil
}
// validatePKey validates the private key and sets data in status. The returned
// error is also set in status.WarningValidation.
func validatePKey(status *tlsConfigStatus, pkey []byte) (err error) {
defer func() {
if err != nil {
status.WarningValidation = err.Error()
}
}()
var key *pem.Block
// Go through all pem blocks, but take first valid pem block and drop the
// rest. </s> remove // now do a more extended validation
var certs []*pem.Block // PEM-encoded certificates
</s> add log.Debug("tls: got certificate chain: %d bytes", len(certChain)) </s> remove pemblock := []byte(certChain)
</s> add var certs []*pem.Block
pemblock := certChain </s> remove func verifyCertChain(data *tlsConfigStatus, certChain, serverName string) error {
log.Tracef("TLS: got certificate: %d bytes", len(certChain))
</s> add // validateCertChain validates the certificate chain and sets data in status.
// The returned error is also set in status.WarningValidation.
func validateCertChain(status *tlsConfigStatus, certChain []byte, serverName string) (err error) {
defer func() {
if err != nil {
status.WarningValidation = err.Error()
}
}() </s> remove // parameters are optional. On error, validateCertificates returns a partially
// set object with field WarningValidation containing error description.
func validateCertificates(certChain, pkey, serverName string) tlsConfigStatus {
var data tlsConfigStatus
// check only public certificate separately from the key
if certChain != "" {
if verifyCertChain(&data, certChain, serverName) != nil {
return data
</s> add // parameters are optional. status must not be nil. The returned error is also
// set in status.WarningValidation.
func validateCertificates(
status *tlsConfigStatus,
certChain []byte,
pkey []byte,
serverName string,
) (err error) {
defer func() {
// Capitalize the warning for the UI. Assume that warnings are all
// ASCII-only.
//
// TODO(a.garipov): Figure out a better way to do this. Perhaps a
// custom string or error type.
if w := status.WarningValidation; w != "" {
status.WarningValidation = strings.ToUpper(w[:1]) + w[1:]
}
}()
// Check only the public certificate separately from the key.
if len(certChain) > 0 {
err = validateCertChain(status, certChain, serverName)
if err != nil {
return err | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
parsedCerts = append(parsedCerts, parsed)
}
if len(parsedCerts) == 0 {
return nil, errors.Error("empty certificate")
}
return parsedCerts, nil
}
// validatePKey validates the private key and sets data in status. The returned
// error is also set in status.WarningValidation.
func validatePKey(status *tlsConfigStatus, pkey []byte) (err error) {
defer func() {
if err != nil {
status.WarningValidation = err.Error()
}
}()
var key *pem.Block
// Go through all pem blocks, but take first valid pem block and drop the
// rest. | <mask> func validatePkey(data *tlsConfigStatus, pkey string) error {
<mask> // now do a more extended validation
<mask> var key *pem.Block // PEM-encoded certificates
<mask>
<mask> // go through all pem blocks, but take first valid pem block and drop the rest
<mask> pemblock := []byte(pkey)
<mask> for {
<mask> var decoded *pem.Block
<mask> decoded, pemblock = pem.Decode(pemblock)
<mask> if decoded == nil {
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove func validatePkey(data *tlsConfigStatus, pkey string) error {
// now do a more extended validation
var key *pem.Block // PEM-encoded certificates
</s> add // parsePEMCerts parses multiple PEM-encoded certificates.
func parsePEMCerts(certs []*pem.Block) (parsedCerts []*x509.Certificate, err error) {
for i, cert := range certs {
var parsed *x509.Certificate
parsed, err = x509.ParseCertificate(cert.Bytes)
if err != nil {
return nil, fmt.Errorf("parsing certificate at index %d: %w", i, err)
} </s> remove pemblock := []byte(certChain)
</s> add var certs []*pem.Block
pemblock := certChain </s> remove // now do a more extended validation
var certs []*pem.Block // PEM-encoded certificates
</s> add log.Debug("tls: got certificate chain: %d bytes", len(certChain)) </s> remove func verifyCertChain(data *tlsConfigStatus, certChain, serverName string) error {
log.Tracef("TLS: got certificate: %d bytes", len(certChain))
</s> add // validateCertChain validates the certificate chain and sets data in status.
// The returned error is also set in status.WarningValidation.
func validateCertChain(status *tlsConfigStatus, certChain []byte, serverName string) (err error) {
defer func() {
if err != nil {
status.WarningValidation = err.Error()
}
}() </s> remove // parameters are optional. On error, validateCertificates returns a partially
// set object with field WarningValidation containing error description.
func validateCertificates(certChain, pkey, serverName string) tlsConfigStatus {
var data tlsConfigStatus
// check only public certificate separately from the key
if certChain != "" {
if verifyCertChain(&data, certChain, serverName) != nil {
return data
</s> add // parameters are optional. status must not be nil. The returned error is also
// set in status.WarningValidation.
func validateCertificates(
status *tlsConfigStatus,
certChain []byte,
pkey []byte,
serverName string,
) (err error) {
defer func() {
// Capitalize the warning for the UI. Assume that warnings are all
// ASCII-only.
//
// TODO(a.garipov): Figure out a better way to do this. Perhaps a
// custom string or error type.
if w := status.WarningValidation; w != "" {
status.WarningValidation = strings.ToUpper(w[:1]) + w[1:]
}
}()
// Check only the public certificate separately from the key.
if len(certChain) > 0 {
err = validateCertChain(status, certChain, serverName)
if err != nil {
return err | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
return errors.Error("no valid keys were found") | <mask> }
<mask> }
<mask>
<mask> if key == nil {
<mask> data.WarningValidation = "No valid keys were found"
<mask>
<mask> return errors.Error(data.WarningValidation)
<mask> }
<mask>
<mask> // parse the decoded key
<mask> _, keyType, err := parsePrivateKey(key.Bytes)
<mask> if err != nil {
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove // parse the decoded key
</s> add </s> remove data.WarningValidation = fmt.Sprintf("Failed to parse private key: %s", err)
return errors.Error(data.WarningValidation)
} else if keyType == keyTypeED25519 {
data.WarningValidation = "ED25519 keys are not supported by browsers; " +
"did you mean to use X25519 for key exchange?"
</s> add return fmt.Errorf("parsing private key: %w", err)
} </s> remove var parsedCerts []*x509.Certificate
for _, cert := range certs {
parsed, err := x509.ParseCertificate(cert.Bytes)
if err != nil {
data.WarningValidation = fmt.Sprintf("Failed to parse certificate: %s", err)
return errors.Error(data.WarningValidation)
}
parsedCerts = append(parsedCerts, parsed)
}
if len(parsedCerts) == 0 {
data.WarningValidation = "You have specified an empty certificate"
return errors.Error(data.WarningValidation)
</s> add parsedCerts, err := parsePEMCerts(certs)
if err != nil {
return err </s> remove return errors.Error(data.WarningValidation)
</s> add if keyType == keyTypeED25519 {
return errors.Error(
"ED25519 keys are not supported by browsers; " +
"did you mean to use X25519 for key exchange?",
) </s> remove // go through all pem blocks, but take first valid pem block and drop the rest
</s> add parsedCerts = append(parsedCerts, parsed)
}
if len(parsedCerts) == 0 {
return nil, errors.Error("empty certificate")
}
return parsedCerts, nil
}
// validatePKey validates the private key and sets data in status. The returned
// error is also set in status.WarningValidation.
func validatePKey(status *tlsConfigStatus, pkey []byte) (err error) {
defer func() {
if err != nil {
status.WarningValidation = err.Error()
}
}()
var key *pem.Block
// Go through all pem blocks, but take first valid pem block and drop the
// rest. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
<mask>
<mask> return errors.Error(data.WarningValidation)
<mask> }
<mask>
<mask> // parse the decoded key
<mask> _, keyType, err := parsePrivateKey(key.Bytes)
<mask> if err != nil {
<mask> data.WarningValidation = fmt.Sprintf("Failed to parse private key: %s", err)
<mask>
<mask> return errors.Error(data.WarningValidation)
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove data.WarningValidation = fmt.Sprintf("Failed to parse private key: %s", err)
return errors.Error(data.WarningValidation)
} else if keyType == keyTypeED25519 {
data.WarningValidation = "ED25519 keys are not supported by browsers; " +
"did you mean to use X25519 for key exchange?"
</s> add return fmt.Errorf("parsing private key: %w", err)
} </s> remove data.WarningValidation = "No valid keys were found"
return errors.Error(data.WarningValidation)
</s> add return errors.Error("no valid keys were found") </s> remove var parsedCerts []*x509.Certificate
for _, cert := range certs {
parsed, err := x509.ParseCertificate(cert.Bytes)
if err != nil {
data.WarningValidation = fmt.Sprintf("Failed to parse certificate: %s", err)
return errors.Error(data.WarningValidation)
}
parsedCerts = append(parsedCerts, parsed)
}
if len(parsedCerts) == 0 {
data.WarningValidation = "You have specified an empty certificate"
return errors.Error(data.WarningValidation)
</s> add parsedCerts, err := parsePEMCerts(certs)
if err != nil {
return err </s> remove data.WarningValidation = fmt.Sprintf("Invalid certificate or key: %s", err)
return data
</s> add err = fmt.Errorf("certificate-key pair: %w", err)
status.WarningValidation = err.Error()
return err </s> remove // if both are set, validate both in unison
if pkey != "" && certChain != "" {
_, err := tls.X509KeyPair([]byte(certChain), []byte(pkey))
</s> add // If both are set, validate together.
if len(certChain) > 0 && len(pkey) > 0 {
_, err = tls.X509KeyPair(certChain, pkey) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go | |
return fmt.Errorf("parsing private key: %w", err)
} | <mask>
<mask> // parse the decoded key
<mask> _, keyType, err := parsePrivateKey(key.Bytes)
<mask> if err != nil {
<mask> data.WarningValidation = fmt.Sprintf("Failed to parse private key: %s", err)
<mask>
<mask> return errors.Error(data.WarningValidation)
<mask> } else if keyType == keyTypeED25519 {
<mask> data.WarningValidation = "ED25519 keys are not supported by browsers; " +
<mask> "did you mean to use X25519 for key exchange?"
<mask>
<mask> return errors.Error(data.WarningValidation)
<mask> }
<mask>
<mask> data.ValidKey = true
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove return errors.Error(data.WarningValidation)
</s> add if keyType == keyTypeED25519 {
return errors.Error(
"ED25519 keys are not supported by browsers; " +
"did you mean to use X25519 for key exchange?",
) </s> remove // parse the decoded key
</s> add </s> remove data.WarningValidation = "No valid keys were found"
return errors.Error(data.WarningValidation)
</s> add return errors.Error("no valid keys were found") </s> remove var parsedCerts []*x509.Certificate
for _, cert := range certs {
parsed, err := x509.ParseCertificate(cert.Bytes)
if err != nil {
data.WarningValidation = fmt.Sprintf("Failed to parse certificate: %s", err)
return errors.Error(data.WarningValidation)
}
parsedCerts = append(parsedCerts, parsed)
}
if len(parsedCerts) == 0 {
data.WarningValidation = "You have specified an empty certificate"
return errors.Error(data.WarningValidation)
</s> add parsedCerts, err := parsePEMCerts(certs)
if err != nil {
return err </s> remove data.WarningValidation = fmt.Sprintf("Invalid certificate or key: %s", err)
return data
</s> add err = fmt.Errorf("certificate-key pair: %w", err)
status.WarningValidation = err.Error()
return err | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
if keyType == keyTypeED25519 {
return errors.Error(
"ED25519 keys are not supported by browsers; " +
"did you mean to use X25519 for key exchange?",
) | <mask> } else if keyType == keyTypeED25519 {
<mask> data.WarningValidation = "ED25519 keys are not supported by browsers; " +
<mask> "did you mean to use X25519 for key exchange?"
<mask>
<mask> return errors.Error(data.WarningValidation)
<mask> }
<mask>
<mask> data.ValidKey = true
<mask> data.KeyType = keyType
<mask>
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove data.WarningValidation = fmt.Sprintf("Failed to parse private key: %s", err)
return errors.Error(data.WarningValidation)
} else if keyType == keyTypeED25519 {
data.WarningValidation = "ED25519 keys are not supported by browsers; " +
"did you mean to use X25519 for key exchange?"
</s> add return fmt.Errorf("parsing private key: %w", err)
} </s> remove data.ValidKey = true
data.KeyType = keyType
</s> add status.ValidKey = true
status.KeyType = keyType </s> remove data.WarningValidation = "No valid keys were found"
return errors.Error(data.WarningValidation)
</s> add return errors.Error("no valid keys were found") </s> remove var parsedCerts []*x509.Certificate
for _, cert := range certs {
parsed, err := x509.ParseCertificate(cert.Bytes)
if err != nil {
data.WarningValidation = fmt.Sprintf("Failed to parse certificate: %s", err)
return errors.Error(data.WarningValidation)
}
parsedCerts = append(parsedCerts, parsed)
}
if len(parsedCerts) == 0 {
data.WarningValidation = "You have specified an empty certificate"
return errors.Error(data.WarningValidation)
</s> add parsedCerts, err := parsePEMCerts(certs)
if err != nil {
return err </s> remove // parse the decoded key
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
status.ValidKey = true
status.KeyType = keyType | <mask>
<mask> return errors.Error(data.WarningValidation)
<mask> }
<mask>
<mask> data.ValidKey = true
<mask> data.KeyType = keyType
<mask>
<mask> return nil
<mask> }
<mask>
<mask> // validateCertificates processes certificate data and its private key. All
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove return errors.Error(data.WarningValidation)
</s> add if keyType == keyTypeED25519 {
return errors.Error(
"ED25519 keys are not supported by browsers; " +
"did you mean to use X25519 for key exchange?",
) </s> remove data.WarningValidation = fmt.Sprintf("Failed to parse private key: %s", err)
return errors.Error(data.WarningValidation)
} else if keyType == keyTypeED25519 {
data.WarningValidation = "ED25519 keys are not supported by browsers; " +
"did you mean to use X25519 for key exchange?"
</s> add return fmt.Errorf("parsing private key: %w", err)
} </s> remove // parameters are optional. On error, validateCertificates returns a partially
// set object with field WarningValidation containing error description.
func validateCertificates(certChain, pkey, serverName string) tlsConfigStatus {
var data tlsConfigStatus
// check only public certificate separately from the key
if certChain != "" {
if verifyCertChain(&data, certChain, serverName) != nil {
return data
</s> add // parameters are optional. status must not be nil. The returned error is also
// set in status.WarningValidation.
func validateCertificates(
status *tlsConfigStatus,
certChain []byte,
pkey []byte,
serverName string,
) (err error) {
defer func() {
// Capitalize the warning for the UI. Assume that warnings are all
// ASCII-only.
//
// TODO(a.garipov): Figure out a better way to do this. Perhaps a
// custom string or error type.
if w := status.WarningValidation; w != "" {
status.WarningValidation = strings.ToUpper(w[:1]) + w[1:]
}
}()
// Check only the public certificate separately from the key.
if len(certChain) > 0 {
err = validateCertChain(status, certChain, serverName)
if err != nil {
return err </s> remove // parse the decoded key
</s> add </s> remove data.ValidCert = true
// spew.Dump(parsedCerts)
</s> add status.ValidCert = true | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
// parameters are optional. status must not be nil. The returned error is also
// set in status.WarningValidation.
func validateCertificates(
status *tlsConfigStatus,
certChain []byte,
pkey []byte,
serverName string,
) (err error) {
defer func() {
// Capitalize the warning for the UI. Assume that warnings are all
// ASCII-only.
//
// TODO(a.garipov): Figure out a better way to do this. Perhaps a
// custom string or error type.
if w := status.WarningValidation; w != "" {
status.WarningValidation = strings.ToUpper(w[:1]) + w[1:]
}
}()
// Check only the public certificate separately from the key.
if len(certChain) > 0 {
err = validateCertChain(status, certChain, serverName)
if err != nil {
return err | <mask> return nil
<mask> }
<mask>
<mask> // validateCertificates processes certificate data and its private key. All
<mask> // parameters are optional. On error, validateCertificates returns a partially
<mask> // set object with field WarningValidation containing error description.
<mask> func validateCertificates(certChain, pkey, serverName string) tlsConfigStatus {
<mask> var data tlsConfigStatus
<mask>
<mask> // check only public certificate separately from the key
<mask> if certChain != "" {
<mask> if verifyCertChain(&data, certChain, serverName) != nil {
<mask> return data
<mask> }
<mask> }
<mask>
<mask> // validate private key (right now the only validation possible is just parsing it)
<mask> if pkey != "" {
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove // validate private key (right now the only validation possible is just parsing it)
if pkey != "" {
if validatePkey(&data, pkey) != nil {
return data
</s> add // Validate the private key by parsing it.
if len(pkey) > 0 {
err = validatePKey(status, pkey)
if err != nil {
return err </s> remove data.ValidKey = true
data.KeyType = keyType
</s> add status.ValidKey = true
status.KeyType = keyType </s> remove func verifyCertChain(data *tlsConfigStatus, certChain, serverName string) error {
log.Tracef("TLS: got certificate: %d bytes", len(certChain))
</s> add // validateCertChain validates the certificate chain and sets data in status.
// The returned error is also set in status.WarningValidation.
func validateCertChain(status *tlsConfigStatus, certChain []byte, serverName string) (err error) {
defer func() {
if err != nil {
status.WarningValidation = err.Error()
}
}() </s> remove // go through all pem blocks, but take first valid pem block and drop the rest
</s> add parsedCerts = append(parsedCerts, parsed)
}
if len(parsedCerts) == 0 {
return nil, errors.Error("empty certificate")
}
return parsedCerts, nil
}
// validatePKey validates the private key and sets data in status. The returned
// error is also set in status.WarningValidation.
func validatePKey(status *tlsConfigStatus, pkey []byte) (err error) {
defer func() {
if err != nil {
status.WarningValidation = err.Error()
}
}()
var key *pem.Block
// Go through all pem blocks, but take first valid pem block and drop the
// rest. </s> remove ValidCert bool `json:"valid_cert"` // ValidCert is true if the specified certificates chain is a valid chain of X509 certificates
ValidChain bool `json:"valid_chain"` // ValidChain is true if the specified certificates chain is verified and issued by a known CA
Subject string `json:"subject,omitempty"` // Subject is the subject of the first certificate in the chain
Issuer string `json:"issuer,omitempty"` // Issuer is the issuer of the first certificate in the chain
NotBefore time.Time `json:"not_before,omitempty"` // NotBefore is the NotBefore field of the first certificate in the chain
NotAfter time.Time `json:"not_after,omitempty"` // NotAfter is the NotAfter field of the first certificate in the chain
DNSNames []string `json:"dns_names"` // DNSNames is the value of SubjectAltNames field of the first certificate in the chain
// key status
ValidKey bool `json:"valid_key"` // ValidKey is true if the key is a valid private key
KeyType string `json:"key_type,omitempty"` // KeyType is one of RSA or ECDSA
// is usable? set by validator
ValidPair bool `json:"valid_pair"` // ValidPair is true if both certificate and private key are correct
// warnings
WarningValidation string `json:"warning_validation,omitempty"` // WarningValidation is a validation warning message with the issue description
</s> add // Subject is the subject of the first certificate in the chain.
Subject string `json:"subject,omitempty"`
// Issuer is the issuer of the first certificate in the chain.
Issuer string `json:"issuer,omitempty"`
// KeyType is the type of the private key.
KeyType string `json:"key_type,omitempty"`
// NotBefore is the NotBefore field of the first certificate in the chain.
NotBefore time.Time `json:"not_before,omitempty"`
// NotAfter is the NotAfter field of the first certificate in the chain.
NotAfter time.Time `json:"not_after,omitempty"`
// WarningValidation is a validation warning message with the issue
// description.
WarningValidation string `json:"warning_validation,omitempty"`
// DNSNames is the value of SubjectAltNames field of the first certificate
// in the chain.
DNSNames []string `json:"dns_names"`
// ValidCert is true if the specified certificate chain is a valid chain of
// X509 certificates.
ValidCert bool `json:"valid_cert"`
// ValidChain is true if the specified certificate chain is verified and
// issued by a known CA.
ValidChain bool `json:"valid_chain"`
// ValidKey is true if the key is a valid private key.
ValidKey bool `json:"valid_key"`
// ValidPair is true if both certificate and private key are correct for
// each other.
ValidPair bool `json:"valid_pair"` | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
// Validate the private key by parsing it.
if len(pkey) > 0 {
err = validatePKey(status, pkey)
if err != nil {
return err | <mask> return data
<mask> }
<mask> }
<mask>
<mask> // validate private key (right now the only validation possible is just parsing it)
<mask> if pkey != "" {
<mask> if validatePkey(&data, pkey) != nil {
<mask> return data
<mask> }
<mask> }
<mask>
<mask> // if both are set, validate both in unison
<mask> if pkey != "" && certChain != "" {
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove // if both are set, validate both in unison
if pkey != "" && certChain != "" {
_, err := tls.X509KeyPair([]byte(certChain), []byte(pkey))
</s> add // If both are set, validate together.
if len(certChain) > 0 && len(pkey) > 0 {
_, err = tls.X509KeyPair(certChain, pkey) </s> remove data.WarningValidation = fmt.Sprintf("Invalid certificate or key: %s", err)
return data
</s> add err = fmt.Errorf("certificate-key pair: %w", err)
status.WarningValidation = err.Error()
return err </s> remove // parameters are optional. On error, validateCertificates returns a partially
// set object with field WarningValidation containing error description.
func validateCertificates(certChain, pkey, serverName string) tlsConfigStatus {
var data tlsConfigStatus
// check only public certificate separately from the key
if certChain != "" {
if verifyCertChain(&data, certChain, serverName) != nil {
return data
</s> add // parameters are optional. status must not be nil. The returned error is also
// set in status.WarningValidation.
func validateCertificates(
status *tlsConfigStatus,
certChain []byte,
pkey []byte,
serverName string,
) (err error) {
defer func() {
// Capitalize the warning for the UI. Assume that warnings are all
// ASCII-only.
//
// TODO(a.garipov): Figure out a better way to do this. Perhaps a
// custom string or error type.
if w := status.WarningValidation; w != "" {
status.WarningValidation = strings.ToUpper(w[:1]) + w[1:]
}
}()
// Check only the public certificate separately from the key.
if len(certChain) > 0 {
err = validateCertChain(status, certChain, serverName)
if err != nil {
return err </s> remove if tls.PrivateKeyPath != "" {
if tls.PrivateKey != "" {
status.WarningValidation = "private key data and file can't be set together"
return false
</s> add if tlsConf.PrivateKeyPath != "" {
if tlsConf.PrivateKey != "" {
return errors.Error("private key data and file can't be set together") </s> remove // go through all pem blocks, but take first valid pem block and drop the rest
</s> add parsedCerts = append(parsedCerts, parsed)
}
if len(parsedCerts) == 0 {
return nil, errors.Error("empty certificate")
}
return parsedCerts, nil
}
// validatePKey validates the private key and sets data in status. The returned
// error is also set in status.WarningValidation.
func validatePKey(status *tlsConfigStatus, pkey []byte) (err error) {
defer func() {
if err != nil {
status.WarningValidation = err.Error()
}
}()
var key *pem.Block
// Go through all pem blocks, but take first valid pem block and drop the
// rest. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
// If both are set, validate together.
if len(certChain) > 0 && len(pkey) > 0 {
_, err = tls.X509KeyPair(certChain, pkey) | <mask> return data
<mask> }
<mask> }
<mask>
<mask> // if both are set, validate both in unison
<mask> if pkey != "" && certChain != "" {
<mask> _, err := tls.X509KeyPair([]byte(certChain), []byte(pkey))
<mask> if err != nil {
<mask> data.WarningValidation = fmt.Sprintf("Invalid certificate or key: %s", err)
<mask> return data
<mask> }
<mask> data.ValidPair = true
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove data.WarningValidation = fmt.Sprintf("Invalid certificate or key: %s", err)
return data
</s> add err = fmt.Errorf("certificate-key pair: %w", err)
status.WarningValidation = err.Error()
return err </s> remove // validate private key (right now the only validation possible is just parsing it)
if pkey != "" {
if validatePkey(&data, pkey) != nil {
return data
</s> add // Validate the private key by parsing it.
if len(pkey) > 0 {
err = validatePKey(status, pkey)
if err != nil {
return err </s> remove data.ValidPair = true
</s> add status.ValidPair = true </s> remove // parameters are optional. On error, validateCertificates returns a partially
// set object with field WarningValidation containing error description.
func validateCertificates(certChain, pkey, serverName string) tlsConfigStatus {
var data tlsConfigStatus
// check only public certificate separately from the key
if certChain != "" {
if verifyCertChain(&data, certChain, serverName) != nil {
return data
</s> add // parameters are optional. status must not be nil. The returned error is also
// set in status.WarningValidation.
func validateCertificates(
status *tlsConfigStatus,
certChain []byte,
pkey []byte,
serverName string,
) (err error) {
defer func() {
// Capitalize the warning for the UI. Assume that warnings are all
// ASCII-only.
//
// TODO(a.garipov): Figure out a better way to do this. Perhaps a
// custom string or error type.
if w := status.WarningValidation; w != "" {
status.WarningValidation = strings.ToUpper(w[:1]) + w[1:]
}
}()
// Check only the public certificate separately from the key.
if len(certChain) > 0 {
err = validateCertChain(status, certChain, serverName)
if err != nil {
return err </s> remove data.WarningValidation = fmt.Sprintf("Failed to parse private key: %s", err)
return errors.Error(data.WarningValidation)
} else if keyType == keyTypeED25519 {
data.WarningValidation = "ED25519 keys are not supported by browsers; " +
"did you mean to use X25519 for key exchange?"
</s> add return fmt.Errorf("parsing private key: %w", err)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
err = fmt.Errorf("certificate-key pair: %w", err)
status.WarningValidation = err.Error()
return err | <mask> // if both are set, validate both in unison
<mask> if pkey != "" && certChain != "" {
<mask> _, err := tls.X509KeyPair([]byte(certChain), []byte(pkey))
<mask> if err != nil {
<mask> data.WarningValidation = fmt.Sprintf("Invalid certificate or key: %s", err)
<mask> return data
<mask> }
<mask> data.ValidPair = true
<mask> }
<mask>
<mask> return data
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove // if both are set, validate both in unison
if pkey != "" && certChain != "" {
_, err := tls.X509KeyPair([]byte(certChain), []byte(pkey))
</s> add // If both are set, validate together.
if len(certChain) > 0 && len(pkey) > 0 {
_, err = tls.X509KeyPair(certChain, pkey) </s> remove // validate private key (right now the only validation possible is just parsing it)
if pkey != "" {
if validatePkey(&data, pkey) != nil {
return data
</s> add // Validate the private key by parsing it.
if len(pkey) > 0 {
err = validatePKey(status, pkey)
if err != nil {
return err </s> remove data.ValidPair = true
</s> add status.ValidPair = true </s> remove // parameters are optional. On error, validateCertificates returns a partially
// set object with field WarningValidation containing error description.
func validateCertificates(certChain, pkey, serverName string) tlsConfigStatus {
var data tlsConfigStatus
// check only public certificate separately from the key
if certChain != "" {
if verifyCertChain(&data, certChain, serverName) != nil {
return data
</s> add // parameters are optional. status must not be nil. The returned error is also
// set in status.WarningValidation.
func validateCertificates(
status *tlsConfigStatus,
certChain []byte,
pkey []byte,
serverName string,
) (err error) {
defer func() {
// Capitalize the warning for the UI. Assume that warnings are all
// ASCII-only.
//
// TODO(a.garipov): Figure out a better way to do this. Perhaps a
// custom string or error type.
if w := status.WarningValidation; w != "" {
status.WarningValidation = strings.ToUpper(w[:1]) + w[1:]
}
}()
// Check only the public certificate separately from the key.
if len(certChain) > 0 {
err = validateCertChain(status, certChain, serverName)
if err != nil {
return err </s> remove data.WarningValidation = fmt.Sprintf("Failed to parse private key: %s", err)
return errors.Error(data.WarningValidation)
} else if keyType == keyTypeED25519 {
data.WarningValidation = "ED25519 keys are not supported by browsers; " +
"did you mean to use X25519 for key exchange?"
</s> add return fmt.Errorf("parsing private key: %w", err)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
status.ValidPair = true | <mask> if err != nil {
<mask> data.WarningValidation = fmt.Sprintf("Invalid certificate or key: %s", err)
<mask> return data
<mask> }
<mask> data.ValidPair = true
<mask> }
<mask>
<mask> return data
<mask> }
<mask>
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove data.WarningValidation = fmt.Sprintf("Invalid certificate or key: %s", err)
return data
</s> add err = fmt.Errorf("certificate-key pair: %w", err)
status.WarningValidation = err.Error()
return err </s> remove // if both are set, validate both in unison
if pkey != "" && certChain != "" {
_, err := tls.X509KeyPair([]byte(certChain), []byte(pkey))
</s> add // If both are set, validate together.
if len(certChain) > 0 && len(pkey) > 0 {
_, err = tls.X509KeyPair(certChain, pkey) </s> remove data.WarningValidation = fmt.Sprintf("Failed to parse private key: %s", err)
return errors.Error(data.WarningValidation)
} else if keyType == keyTypeED25519 {
data.WarningValidation = "ED25519 keys are not supported by browsers; " +
"did you mean to use X25519 for key exchange?"
</s> add return fmt.Errorf("parsing private key: %w", err)
} </s> remove // parse the decoded key
</s> add </s> remove return data
</s> add return nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
return nil | <mask> }
<mask> data.ValidPair = true
<mask> }
<mask>
<mask> return data
<mask> }
<mask>
<mask> // Key types.
<mask> const (
<mask> keyTypeECDSA = "ECDSA"
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove data.ValidPair = true
</s> add status.ValidPair = true </s> remove data.WarningValidation = fmt.Sprintf("Invalid certificate or key: %s", err)
return data
</s> add err = fmt.Errorf("certificate-key pair: %w", err)
status.WarningValidation = err.Error()
return err </s> remove // if both are set, validate both in unison
if pkey != "" && certChain != "" {
_, err := tls.X509KeyPair([]byte(certChain), []byte(pkey))
</s> add // If both are set, validate together.
if len(certChain) > 0 && len(pkey) > 0 {
_, err = tls.X509KeyPair(certChain, pkey) </s> remove const (
CertificateChain = `-----BEGIN CERTIFICATE-----
</s> add var testCertChainData = []byte(`-----BEGIN CERTIFICATE----- </s> remove data.ValidKey = true
data.KeyType = keyType
</s> add status.ValidKey = true
status.KeyType = keyType | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
// registerWebHandlers registers HTTP handlers for TLS configuration.
func (m *tlsManager) registerWebHandlers() {
httpRegister(http.MethodGet, "/control/tls/status", m.handleTLSStatus)
httpRegister(http.MethodPost, "/control/tls/configure", m.handleTLSConfigure)
httpRegister(http.MethodPost, "/control/tls/validate", m.handleTLSValidate) | <mask>
<mask> _ = aghhttp.WriteJSONResponse(w, r, data)
<mask> }
<mask>
<mask> // registerWebHandlers registers HTTP handlers for TLS configuration
<mask> func (t *TLSMod) registerWebHandlers() {
<mask> httpRegister(http.MethodGet, "/control/tls/status", t.handleTLSStatus)
<mask> httpRegister(http.MethodPost, "/control/tls/configure", t.handleTLSConfigure)
<mask> httpRegister(http.MethodPost, "/control/tls/validate", t.handleTLSValidate)
<mask> }
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove // Close - close module
func (t *TLSMod) Close() {
</s> add // load reloads the TLS configuration from files or data from the config file.
func (m *tlsManager) load() (err error) {
err = loadTLSConf(&m.conf, m.status)
if err != nil {
return fmt.Errorf("loading config: %w", err)
}
return nil </s> remove marshalTLS(w, r, data)
</s> add marshalTLS(w, r, resp) </s> remove func (t *TLSMod) handleTLSValidate(w http.ResponseWriter, r *http.Request) {
</s> add func (m *tlsManager) handleTLSValidate(w http.ResponseWriter, r *http.Request) { </s> remove t.confLock.Unlock()
</s> add m.confLock.Unlock()
</s> remove // Start updates the configuration of TLSMod and starts it.
func (t *TLSMod) Start() {
if !tlsWebHandlersRegistered {
tlsWebHandlersRegistered = true
t.registerWebHandlers()
}
</s> add // start updates the configuration of t and starts it.
func (m *tlsManager) start() {
m.registerWebHandlers() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls.go |
var testCertChainData = []byte(`-----BEGIN CERTIFICATE----- | <mask>
<mask> "github.com/stretchr/testify/assert"
<mask> )
<mask>
<mask> const (
<mask> CertificateChain = `-----BEGIN CERTIFICATE-----
<mask> MIICKzCCAZSgAwIBAgIJAMT9kPVJdM7LMA0GCSqGSIb3DQEBCwUAMC0xFDASBgNV
<mask> BAoMC0FkR3VhcmQgTHRkMRUwEwYDVQQDDAxBZEd1YXJkIEhvbWUwHhcNMTkwMjI3
<mask> MDkyNDIzWhcNNDYwNzE0MDkyNDIzWjAtMRQwEgYDVQQKDAtBZEd1YXJkIEx0ZDEV
<mask> MBMGA1UEAwwMQWRHdWFyZCBIb21lMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB
<mask> gQCwvwUnPJiOvLcOaWmGu6Y68ksFr13nrXBcsDlhxlXy8PaohVi3XxEmt2OrVjKW
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove return data
</s> add return nil </s> remove -----END CERTIFICATE-----`
PrivateKey = `-----BEGIN PRIVATE KEY-----
</s> add -----END CERTIFICATE-----`)
var testPrivateKeyData = []byte(`-----BEGIN PRIVATE KEY----- </s> remove tcpPort(data.PortHTTPS),
tcpPort(data.PortDNSOverTLS),
tcpPort(data.PortDNSCrypt),
</s> add tcpPort(req.PortHTTPS),
tcpPort(req.PortDNSOverTLS),
tcpPort(req.PortDNSCrypt), </s> remove return errors.Error(data.WarningValidation)
</s> add if keyType == keyTypeED25519 {
return errors.Error(
"ED25519 keys are not supported by browsers; " +
"did you mean to use X25519 for key exchange?",
) </s> remove udpPort(data.PortDNSOverQUIC),
</s> add udpPort(req.PortDNSOverQUIC), | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls_internal_test.go |
-----END CERTIFICATE-----`)
var testPrivateKeyData = []byte(`-----BEGIN PRIVATE KEY----- | <mask> eKO029jYd2AAZEQwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOBgQB8
<mask> LwlXfbakf7qkVTlCNXgoY7RaJ8rJdPgOZPoCTVToEhT6u/cb1c2qp8QB0dNExDna
<mask> b0Z+dnODTZqQOJo6z/wIXlcUrnR4cQVvytXt8lFn+26l6Y6EMI26twC/xWr+1swq
<mask> Muj4FeWHVDerquH4yMr1jsYLD3ci+kc5sbIX6TfVxQ==
<mask> -----END CERTIFICATE-----`
<mask> PrivateKey = `-----BEGIN PRIVATE KEY-----
<mask> MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBALC/BSc8mI68tw5p
<mask> aYa7pjrySwWvXeetcFywOWHGVfLw9qiFWLdfESa3Y6tWMpZAXD9t1Xh9n211YUBV
<mask> FGSB4ZshnM/tgEPU6t787lJD4NsIIRp++MkJxdAitN4oUTqL0bdpIwezQ/CrYuBX
<mask> xTmZii0uu/IWITxA8iclsMMyloVjAgMBAAECgYEAmjzoG1h27UDkIlB9BVWl95TP
<mask> QVPLB81D267xNFDnWk1Lgr5zL/pnNjkdYjyjgpkBp1yKyE4gHV4skv5sAFWTcOCU
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove -----END PRIVATE KEY-----`
)
</s> add -----END PRIVATE KEY-----`) </s> remove const (
CertificateChain = `-----BEGIN CERTIFICATE-----
</s> add var testCertChainData = []byte(`-----BEGIN CERTIFICATE----- </s> remove t.conf.Enabled = newConf.Enabled
t.conf.ServerName = newConf.ServerName
t.conf.ForceHTTPS = newConf.ForceHTTPS
t.conf.PortHTTPS = newConf.PortHTTPS
t.conf.PortDNSOverTLS = newConf.PortDNSOverTLS
t.conf.PortDNSOverQUIC = newConf.PortDNSOverQUIC
t.conf.CertificateChain = newConf.CertificateChain
t.conf.CertificatePath = newConf.CertificatePath
t.conf.CertificateChainData = newConf.CertificateChainData
t.conf.PrivateKey = newConf.PrivateKey
t.conf.PrivateKeyPath = newConf.PrivateKeyPath
t.conf.PrivateKeyData = newConf.PrivateKeyData
t.status = status
</s> add m.conf.Enabled = newConf.Enabled
m.conf.ServerName = newConf.ServerName
m.conf.ForceHTTPS = newConf.ForceHTTPS
m.conf.PortHTTPS = newConf.PortHTTPS
m.conf.PortDNSOverTLS = newConf.PortDNSOverTLS
m.conf.PortDNSOverQUIC = newConf.PortDNSOverQUIC
m.conf.CertificateChain = newConf.CertificateChain
m.conf.CertificatePath = newConf.CertificatePath
m.conf.CertificateChainData = newConf.CertificateChainData
m.conf.PrivateKey = newConf.PrivateKey
m.conf.PrivateKeyPath = newConf.PrivateKeyPath
m.conf.PrivateKeyData = newConf.PrivateKeyData
m.status = status </s> remove notAfter := mainCert.NotAfter
data.Subject = mainCert.Subject.String()
data.Issuer = mainCert.Issuer.String()
data.NotAfter = notAfter
data.NotBefore = mainCert.NotBefore
data.DNSNames = mainCert.DNSNames
</s> add status.Subject = mainCert.Subject.String()
status.Issuer = mainCert.Issuer.String()
status.NotAfter = mainCert.NotAfter
status.NotBefore = mainCert.NotBefore
status.DNSNames = mainCert.DNSNames </s> remove t.certLastMod = fi.ModTime().UTC()
</s> add m.certLastMod = fi.ModTime().UTC() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls_internal_test.go |
-----END PRIVATE KEY-----`) | <mask> An/jMjZSMCxNl6UyFcqt5Et1EGVhuFECQQCZLXxaT+qcyHjlHJTMzuMgkz1QFbEp
<mask> O5EX70gpeGQMPDK0QSWpaazg956njJSDbNCFM4BccrdQbJu1cW4qOsfBAkAMgZuG
<mask> O88slmgTRHX4JGFmy3rrLiHNI2BbJSuJ++Yllz8beVzh6NfvuY+HKRCmPqoBPATU
<mask> kXS9jgARhhiWXJrk
<mask> -----END PRIVATE KEY-----`
<mask> )
<mask>
<mask> func TestValidateCertificates(t *testing.T) {
<mask> t.Run("bad_certificate", func(t *testing.T) {
<mask> data := validateCertificates("bad cert", "", "")
<mask> assert.NotEmpty(t, data.WarningValidation)
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove data := validateCertificates("bad cert", "", "")
assert.NotEmpty(t, data.WarningValidation)
assert.False(t, data.ValidCert)
assert.False(t, data.ValidChain)
</s> add status := &tlsConfigStatus{}
err := validateCertificates(status, []byte("bad cert"), nil, "")
assert.Error(t, err)
assert.NotEmpty(t, status.WarningValidation)
assert.False(t, status.ValidCert)
assert.False(t, status.ValidChain) </s> remove data := validateCertificates("", "bad priv key", "")
assert.NotEmpty(t, data.WarningValidation)
assert.False(t, data.ValidKey)
</s> add status := &tlsConfigStatus{}
err := validateCertificates(status, nil, []byte("bad priv key"), "")
assert.Error(t, err)
assert.NotEmpty(t, status.WarningValidation)
assert.False(t, status.ValidKey) </s> remove data := validateCertificates(CertificateChain, PrivateKey, "")
notBefore, _ := time.Parse(time.RFC3339, "2019-02-27T09:24:23Z")
notAfter, _ := time.Parse(time.RFC3339, "2046-07-14T09:24:23Z")
assert.NotEmpty(t, data.WarningValidation)
assert.True(t, data.ValidCert)
assert.False(t, data.ValidChain)
assert.True(t, data.ValidKey)
assert.Equal(t, "RSA", data.KeyType)
assert.Equal(t, "CN=AdGuard Home,O=AdGuard Ltd", data.Subject)
assert.Equal(t, "CN=AdGuard Home,O=AdGuard Ltd", data.Issuer)
assert.Equal(t, notBefore, data.NotBefore)
assert.Equal(t, notAfter, data.NotAfter)
assert.True(t, data.ValidPair)
</s> add status := &tlsConfigStatus{}
err := validateCertificates(status, testCertChainData, testPrivateKeyData, "")
assert.NoError(t, err)
notBefore := time.Date(2019, 2, 27, 9, 24, 23, 0, time.UTC)
notAfter := time.Date(2046, 7, 14, 9, 24, 23, 0, time.UTC)
assert.NotEmpty(t, status.WarningValidation)
assert.True(t, status.ValidCert)
assert.False(t, status.ValidChain)
assert.True(t, status.ValidKey)
assert.Equal(t, "RSA", status.KeyType)
assert.Equal(t, "CN=AdGuard Home,O=AdGuard Ltd", status.Subject)
assert.Equal(t, "CN=AdGuard Home,O=AdGuard Ltd", status.Issuer)
assert.Equal(t, notBefore, status.NotBefore)
assert.Equal(t, notAfter, status.NotAfter)
assert.True(t, status.ValidPair) </s> remove Context.tls = &TLSMod{conf: tlsConfigSettings{}}
</s> add Context.tls = &tlsManager{conf: tlsConfigSettings{}} </s> remove Context.tls = &TLSMod{conf: tlsConfigSettings{}}
</s> add Context.tls = &tlsManager{conf: tlsConfigSettings{}} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls_internal_test.go |
status := &tlsConfigStatus{}
err := validateCertificates(status, []byte("bad cert"), nil, "")
assert.Error(t, err)
assert.NotEmpty(t, status.WarningValidation)
assert.False(t, status.ValidCert)
assert.False(t, status.ValidChain) | <mask> )
<mask>
<mask> func TestValidateCertificates(t *testing.T) {
<mask> t.Run("bad_certificate", func(t *testing.T) {
<mask> data := validateCertificates("bad cert", "", "")
<mask> assert.NotEmpty(t, data.WarningValidation)
<mask> assert.False(t, data.ValidCert)
<mask> assert.False(t, data.ValidChain)
<mask> })
<mask>
<mask> t.Run("bad_private_key", func(t *testing.T) {
<mask> data := validateCertificates("", "bad priv key", "")
<mask> assert.NotEmpty(t, data.WarningValidation)
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove data := validateCertificates("", "bad priv key", "")
assert.NotEmpty(t, data.WarningValidation)
assert.False(t, data.ValidKey)
</s> add status := &tlsConfigStatus{}
err := validateCertificates(status, nil, []byte("bad priv key"), "")
assert.Error(t, err)
assert.NotEmpty(t, status.WarningValidation)
assert.False(t, status.ValidKey) </s> remove -----END PRIVATE KEY-----`
)
</s> add -----END PRIVATE KEY-----`) </s> remove data := validateCertificates(CertificateChain, PrivateKey, "")
notBefore, _ := time.Parse(time.RFC3339, "2019-02-27T09:24:23Z")
notAfter, _ := time.Parse(time.RFC3339, "2046-07-14T09:24:23Z")
assert.NotEmpty(t, data.WarningValidation)
assert.True(t, data.ValidCert)
assert.False(t, data.ValidChain)
assert.True(t, data.ValidKey)
assert.Equal(t, "RSA", data.KeyType)
assert.Equal(t, "CN=AdGuard Home,O=AdGuard Ltd", data.Subject)
assert.Equal(t, "CN=AdGuard Home,O=AdGuard Ltd", data.Issuer)
assert.Equal(t, notBefore, data.NotBefore)
assert.Equal(t, notAfter, data.NotAfter)
assert.True(t, data.ValidPair)
</s> add status := &tlsConfigStatus{}
err := validateCertificates(status, testCertChainData, testPrivateKeyData, "")
assert.NoError(t, err)
notBefore := time.Date(2019, 2, 27, 9, 24, 23, 0, time.UTC)
notAfter := time.Date(2046, 7, 14, 9, 24, 23, 0, time.UTC)
assert.NotEmpty(t, status.WarningValidation)
assert.True(t, status.ValidCert)
assert.False(t, status.ValidChain)
assert.True(t, status.ValidKey)
assert.Equal(t, "RSA", status.KeyType)
assert.Equal(t, "CN=AdGuard Home,O=AdGuard Ltd", status.Subject)
assert.Equal(t, "CN=AdGuard Home,O=AdGuard Ltd", status.Issuer)
assert.Equal(t, notBefore, status.NotBefore)
assert.Equal(t, notAfter, status.NotAfter)
assert.True(t, status.ValidPair) </s> remove Context.tls = &TLSMod{conf: tlsConfigSettings{}}
</s> add Context.tls = &tlsManager{conf: tlsConfigSettings{}} </s> remove Context.tls = &TLSMod{conf: tlsConfigSettings{}}
</s> add Context.tls = &tlsManager{conf: tlsConfigSettings{}} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls_internal_test.go |
status := &tlsConfigStatus{}
err := validateCertificates(status, nil, []byte("bad priv key"), "")
assert.Error(t, err)
assert.NotEmpty(t, status.WarningValidation)
assert.False(t, status.ValidKey) | <mask> assert.False(t, data.ValidChain)
<mask> })
<mask>
<mask> t.Run("bad_private_key", func(t *testing.T) {
<mask> data := validateCertificates("", "bad priv key", "")
<mask> assert.NotEmpty(t, data.WarningValidation)
<mask> assert.False(t, data.ValidKey)
<mask> })
<mask>
<mask> t.Run("valid", func(t *testing.T) {
<mask> data := validateCertificates(CertificateChain, PrivateKey, "")
<mask> notBefore, _ := time.Parse(time.RFC3339, "2019-02-27T09:24:23Z")
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove data := validateCertificates("bad cert", "", "")
assert.NotEmpty(t, data.WarningValidation)
assert.False(t, data.ValidCert)
assert.False(t, data.ValidChain)
</s> add status := &tlsConfigStatus{}
err := validateCertificates(status, []byte("bad cert"), nil, "")
assert.Error(t, err)
assert.NotEmpty(t, status.WarningValidation)
assert.False(t, status.ValidCert)
assert.False(t, status.ValidChain) </s> remove data := validateCertificates(CertificateChain, PrivateKey, "")
notBefore, _ := time.Parse(time.RFC3339, "2019-02-27T09:24:23Z")
notAfter, _ := time.Parse(time.RFC3339, "2046-07-14T09:24:23Z")
assert.NotEmpty(t, data.WarningValidation)
assert.True(t, data.ValidCert)
assert.False(t, data.ValidChain)
assert.True(t, data.ValidKey)
assert.Equal(t, "RSA", data.KeyType)
assert.Equal(t, "CN=AdGuard Home,O=AdGuard Ltd", data.Subject)
assert.Equal(t, "CN=AdGuard Home,O=AdGuard Ltd", data.Issuer)
assert.Equal(t, notBefore, data.NotBefore)
assert.Equal(t, notAfter, data.NotAfter)
assert.True(t, data.ValidPair)
</s> add status := &tlsConfigStatus{}
err := validateCertificates(status, testCertChainData, testPrivateKeyData, "")
assert.NoError(t, err)
notBefore := time.Date(2019, 2, 27, 9, 24, 23, 0, time.UTC)
notAfter := time.Date(2046, 7, 14, 9, 24, 23, 0, time.UTC)
assert.NotEmpty(t, status.WarningValidation)
assert.True(t, status.ValidCert)
assert.False(t, status.ValidChain)
assert.True(t, status.ValidKey)
assert.Equal(t, "RSA", status.KeyType)
assert.Equal(t, "CN=AdGuard Home,O=AdGuard Ltd", status.Subject)
assert.Equal(t, "CN=AdGuard Home,O=AdGuard Ltd", status.Issuer)
assert.Equal(t, notBefore, status.NotBefore)
assert.Equal(t, notAfter, status.NotAfter)
assert.True(t, status.ValidPair) </s> remove -----END PRIVATE KEY-----`
)
</s> add -----END PRIVATE KEY-----`) </s> remove Context.tls = &TLSMod{conf: tlsConfigSettings{}}
</s> add Context.tls = &tlsManager{conf: tlsConfigSettings{}} </s> remove Context.tls = &TLSMod{conf: tlsConfigSettings{}}
</s> add Context.tls = &tlsManager{conf: tlsConfigSettings{}} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls_internal_test.go |
status := &tlsConfigStatus{}
err := validateCertificates(status, testCertChainData, testPrivateKeyData, "")
assert.NoError(t, err)
notBefore := time.Date(2019, 2, 27, 9, 24, 23, 0, time.UTC)
notAfter := time.Date(2046, 7, 14, 9, 24, 23, 0, time.UTC)
assert.NotEmpty(t, status.WarningValidation)
assert.True(t, status.ValidCert)
assert.False(t, status.ValidChain)
assert.True(t, status.ValidKey)
assert.Equal(t, "RSA", status.KeyType)
assert.Equal(t, "CN=AdGuard Home,O=AdGuard Ltd", status.Subject)
assert.Equal(t, "CN=AdGuard Home,O=AdGuard Ltd", status.Issuer)
assert.Equal(t, notBefore, status.NotBefore)
assert.Equal(t, notAfter, status.NotAfter)
assert.True(t, status.ValidPair) | <mask> assert.False(t, data.ValidKey)
<mask> })
<mask>
<mask> t.Run("valid", func(t *testing.T) {
<mask> data := validateCertificates(CertificateChain, PrivateKey, "")
<mask> notBefore, _ := time.Parse(time.RFC3339, "2019-02-27T09:24:23Z")
<mask> notAfter, _ := time.Parse(time.RFC3339, "2046-07-14T09:24:23Z")
<mask> assert.NotEmpty(t, data.WarningValidation)
<mask> assert.True(t, data.ValidCert)
<mask> assert.False(t, data.ValidChain)
<mask> assert.True(t, data.ValidKey)
<mask> assert.Equal(t, "RSA", data.KeyType)
<mask> assert.Equal(t, "CN=AdGuard Home,O=AdGuard Ltd", data.Subject)
<mask> assert.Equal(t, "CN=AdGuard Home,O=AdGuard Ltd", data.Issuer)
<mask> assert.Equal(t, notBefore, data.NotBefore)
<mask> assert.Equal(t, notAfter, data.NotAfter)
<mask> assert.True(t, data.ValidPair)
<mask> })
<mask> }
</s> Pull request: 4925-refactor-tls-vol-2
Updates #4925.
Squashed commit of the following:
commit 4b221936ea6c2a244c404e95fa2a033571e07168
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Oct 14 19:03:42 2022 +0300
all: refactor tls </s> remove data := validateCertificates("", "bad priv key", "")
assert.NotEmpty(t, data.WarningValidation)
assert.False(t, data.ValidKey)
</s> add status := &tlsConfigStatus{}
err := validateCertificates(status, nil, []byte("bad priv key"), "")
assert.Error(t, err)
assert.NotEmpty(t, status.WarningValidation)
assert.False(t, status.ValidKey) </s> remove data := validateCertificates("bad cert", "", "")
assert.NotEmpty(t, data.WarningValidation)
assert.False(t, data.ValidCert)
assert.False(t, data.ValidChain)
</s> add status := &tlsConfigStatus{}
err := validateCertificates(status, []byte("bad cert"), nil, "")
assert.Error(t, err)
assert.NotEmpty(t, status.WarningValidation)
assert.False(t, status.ValidCert)
assert.False(t, status.ValidChain) </s> remove -----END PRIVATE KEY-----`
)
</s> add -----END PRIVATE KEY-----`) </s> remove Context.tls = &TLSMod{conf: tlsConfigSettings{}}
</s> add Context.tls = &tlsManager{conf: tlsConfigSettings{}} </s> remove Context.tls = &TLSMod{conf: tlsConfigSettings{}}
</s> add Context.tls = &tlsManager{conf: tlsConfigSettings{}} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/fee81b31eca6b1593aad6fe2c2780b0531998dec | internal/home/tls_internal_test.go |
<mask> /dist/
<mask> /client/node_modules/
<mask> /querylog.json
<mask> /querylog.json.1
<mask> /a_main-packr.go
<mask> coverage.txt
<mask>
<mask> # Test output
<mask> dnsfilter/tests/top-1m.csv
<mask> dnsfilter/tests/dnsfilter.TestLotsOfRules*.pprof
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
</s> add </s> remove github.com/AdguardTeam/golibs v0.4.0 h1:4VX6LoOqFe9p9Gf55BeD8BvJD6M6RDYmgEiHrENE9KU=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | .gitignore | |
<mask> github.com/AdguardTeam/dnsproxy v0.29.1 h1:Stc+JLh67C9K38vbrH2920+3FnbXKkFzYQqRiu5auUo=
<mask> github.com/AdguardTeam/dnsproxy v0.29.1/go.mod h1:hOYFV9TW+pd5XKYz7KZf2FFD8SvSPqjyGTxUae86s58=
<mask> github.com/AdguardTeam/golibs v0.4.0 h1:4VX6LoOqFe9p9Gf55BeD8BvJD6M6RDYmgEiHrENE9KU=
<mask> github.com/AdguardTeam/golibs v0.4.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
<mask> github.com/AdguardTeam/golibs v0.4.2 h1:7M28oTZFoFwNmp8eGPb3ImmYbxGaJLyQXeIFVHjME0o=
<mask> github.com/AdguardTeam/golibs v0.4.2/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4=
<mask> github.com/AdguardTeam/gomitmproxy v0.2.0/go.mod h1:Qdv0Mktnzer5zpdpi5rAwixNJzW2FN91LjKJCkVbYGU=
<mask> github.com/AdguardTeam/urlfilter v0.11.0 h1:tgZss6uZs1UZAaxpovD/QuX+VVIQLDOlKc7rdF8dwNw=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
</s> add </s> remove gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
</s> add </s> remove golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
</s> add | [
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum | |
github.com/gobuffalo/logger v1.0.0 h1:xw9Ko9EcC5iAFprrjJ6oZco9UpzS5MQ4jAwghsLHdy4= | <mask> github.com/gobuffalo/envy v1.7.0 h1:GlXgaiBkmrYMHco6t4j7SacKO4XUjvh5pwXh0f4uxXU=
<mask> github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI=
<mask> github.com/gobuffalo/logger v1.0.0/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs=
<mask> github.com/gobuffalo/packd v0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4=
<mask> github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q=
<mask> github.com/gobuffalo/packr v1.30.1 h1:hu1fuVR3fXEZR7rXNW3h8rqSML8EVAf6KNm0NKO/wKg=
<mask> github.com/gobuffalo/packr v1.30.1/go.mod h1:ljMyFO2EcrnzsHsN99cvbq055Y9OhRrIaviy289eRuk=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
</s> add </s> remove golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
</s> add </s> remove golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0=
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum |
github.com/gobuffalo/packr/v2 v2.5.1 h1:TFOeY2VoGamPjQLiNDT3mn//ytzk236VMO2j7iHxJR4= | <mask> github.com/gobuffalo/packd v0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4=
<mask> github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q=
<mask> github.com/gobuffalo/packr v1.30.1 h1:hu1fuVR3fXEZR7rXNW3h8rqSML8EVAf6KNm0NKO/wKg=
<mask> github.com/gobuffalo/packr v1.30.1/go.mod h1:ljMyFO2EcrnzsHsN99cvbq055Y9OhRrIaviy289eRuk=
<mask> github.com/gobuffalo/packr/v2 v2.5.1/go.mod h1:8f9c96ITobJlPzI44jj+4tHnEKNt0xXWSVlXRN9X1Iw=
<mask> github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
<mask> github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
<mask> github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
<mask> github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
<mask> github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
</s> add </s> remove golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum |
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= | <mask> github.com/gobuffalo/packr/v2 v2.5.1/go.mod h1:8f9c96ITobJlPzI44jj+4tHnEKNt0xXWSVlXRN9X1Iw=
<mask> github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
<mask> github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
<mask> github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
<mask> github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
<mask> github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
</s> add </s> remove github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
</s> add </s> remove github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum |
<mask> github.com/gobuffalo/packr v1.30.1/go.mod h1:ljMyFO2EcrnzsHsN99cvbq055Y9OhRrIaviy289eRuk=
<mask> github.com/gobuffalo/packr/v2 v2.5.1/go.mod h1:8f9c96ITobJlPzI44jj+4tHnEKNt0xXWSVlXRN9X1Iw=
<mask> github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
<mask> github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
<mask> github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
<mask> github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
<mask> github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
<mask> github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
<mask> github.com/joomcode/errorx v1.0.1 h1:CalpDWz14ZHd68fIqluJasJosAewpz2TFaJALrUxjrk=
<mask> github.com/joomcode/errorx v1.0.1/go.mod h1:kgco15ekB6cs+4Xjzo7SPeXzx38PbJzBwbnu9qfVNHQ=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum | |
github.com/karrick/godirwalk v1.10.12 h1:BqUm+LuJcXjGv1d2mj3gBiQyrQ57a0rYoAmhvJQ7RDU= | <mask> github.com/joomcode/errorx v1.0.1 h1:CalpDWz14ZHd68fIqluJasJosAewpz2TFaJALrUxjrk=
<mask> github.com/joomcode/errorx v1.0.1/go.mod h1:kgco15ekB6cs+4Xjzo7SPeXzx38PbJzBwbnu9qfVNHQ=
<mask> github.com/kardianos/service v1.0.0 h1:HgQS3mFfOlyntWX8Oke98JcJLqt1DBcHR4kxShpYef0=
<mask> github.com/kardianos/service v1.0.0/go.mod h1:8CzDhVuCuugtsHyZoTvsOBuvonN/UDBvl0kH+BUxvbo=
<mask> github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
<mask> github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
<mask> github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=
<mask> github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
<mask> github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
<mask> github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
</s> add </s> remove github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
</s> add </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum |
github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= | <mask> github.com/kardianos/service v1.0.0/go.mod h1:8CzDhVuCuugtsHyZoTvsOBuvonN/UDBvl0kH+BUxvbo=
<mask> github.com/karrick/godirwalk v1.10.12 h1:BqUm+LuJcXjGv1d2mj3gBiQyrQ57a0rYoAmhvJQ7RDU=
<mask> github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
<mask> github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
<mask> github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
<mask> github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
<mask> github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
<mask> github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
<mask> github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
<mask> github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
</s> add </s> remove github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
</s> add </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum |
<mask> github.com/kardianos/service v1.0.0/go.mod h1:8CzDhVuCuugtsHyZoTvsOBuvonN/UDBvl0kH+BUxvbo=
<mask> github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
<mask> github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
<mask> github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
<mask> github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
<mask> github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
<mask> github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
<mask> github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
<mask> github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
<mask> github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
</s> add </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum | |
<mask> github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
<mask> github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
<mask> github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
<mask> github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
<mask> github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
<mask> github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
<mask> github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
<mask> github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
<mask> github.com/krolaw/dhcp4 v0.0.0-20180925202202-7cead472c414 h1:6wnYc2S/lVM7BvR32BM74ph7bPgqMztWopMYKgVyEho=
<mask> github.com/krolaw/dhcp4 v0.0.0-20180925202202-7cead472c414/go.mod h1:0AqAH3ZogsCrvrtUpvc6EtVKbc3w6xwZhkvGLuqyi3o=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
</s> add </s> remove github.com/AdguardTeam/golibs v0.4.0 h1:4VX6LoOqFe9p9Gf55BeD8BvJD6M6RDYmgEiHrENE9KU=
</s> add </s> remove github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum | |
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= | <mask> github.com/shirou/gopsutil v2.20.3+incompatible h1:0JVooMPsT7A7HqEYdydp/OfjSOYSjhXV7w1hkKj/NPQ=
<mask> github.com/shirou/gopsutil v2.20.3+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
<mask> github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
<mask> github.com/sparrc/go-ping v0.0.0-20190613174326-4e5b6552494c h1:gqEdF4VwBu3lTKGHS9rXE9x1/pEaSwCXRLOZRF6qtlw=
<mask> github.com/sparrc/go-ping v0.0.0-20190613174326-4e5b6552494c/go.mod h1:eMyUVp6f/5jnzM+3zahzl7q6UXLbgSc3MKg/+ow9QW0=
<mask> github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
</s> add </s> remove github.com/AdguardTeam/golibs v0.4.0 h1:4VX6LoOqFe9p9Gf55BeD8BvJD6M6RDYmgEiHrENE9KU=
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum |
github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= | <mask> github.com/sparrc/go-ping v0.0.0-20190613174326-4e5b6552494c h1:gqEdF4VwBu3lTKGHS9rXE9x1/pEaSwCXRLOZRF6qtlw=
<mask> github.com/sparrc/go-ping v0.0.0-20190613174326-4e5b6552494c/go.mod h1:eMyUVp6f/5jnzM+3zahzl7q6UXLbgSc3MKg/+ow9QW0=
<mask> github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
<mask> github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
<mask> github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
<mask> github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
<mask> github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
<mask> github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
<mask> github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
<mask> github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
</s> add </s> remove github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
</s> add </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum |
<mask> github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
<mask> github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
<mask> github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
<mask> github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
<mask> github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
<mask> github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
<mask> github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
<mask> github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
<mask> github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
<mask> github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
</s> add </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum | |
<mask> github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
<mask> github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
<mask> github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
<mask> github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
<mask> github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
<mask> github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
<mask> github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
<mask> github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
<mask> github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
<mask> github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
</s> add </s> remove golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0=
</s> add </s> remove github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum | |
<mask> github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
<mask> github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
<mask> go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg=
<mask> go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
<mask> golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0=
<mask> golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
<mask> golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
<mask> golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
<mask> golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
<mask> golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
</s> add </s> remove github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
</s> add </s> remove golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
</s> add </s> remove gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
</s> add </s> remove github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum | |
<mask> go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg=
<mask> go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
<mask> golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0=
<mask> golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
<mask> golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
<mask> golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
<mask> golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
<mask> golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
<mask> golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
<mask> golang.org/x/crypto v0.0.0-20200403201458-baeed622b8d8 h1:fpnn/HnJONpIu6hkXi1u/7rR0NzilgWr4T0JmWkEitk=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0=
</s> add </s> remove golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
</s> add </s> remove gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
</s> add </s> remove github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
</s> add </s> remove github.com/AdguardTeam/golibs v0.4.0 h1:4VX6LoOqFe9p9Gf55BeD8BvJD6M6RDYmgEiHrENE9KU=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum | |
<mask> golang.org/x/crypto v0.0.0-20200403201458-baeed622b8d8/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
<mask> golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
<mask> golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
<mask> golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
<mask> golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
<mask> golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
<mask> golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
<mask> golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k=
<mask> golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
<mask> golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
</s> add </s> remove golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
</s> add </s> remove golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0=
</s> add </s> remove golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
</s> add </s> remove gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum | |
<mask> golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
<mask> golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
<mask> golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k=
<mask> golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
<mask> golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
<mask> golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
<mask> golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o=
<mask> golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
<mask> golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
<mask> golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
</s> add </s> remove golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
</s> add </s> remove golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0=
</s> add </s> remove golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
</s> add </s> remove gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum | |
<mask> golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o=
<mask> golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
<mask> golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
<mask> golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
<mask> golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
<mask> golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
<mask> golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0=
</s> add </s> remove golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
</s> add </s> remove golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
</s> add </s> remove golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
</s> add </s> remove gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum | |
<mask> golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0=
<mask> golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20200331124033-c3d80250170d h1:nc5K6ox/4lTFbMVSL9WRR81ixkcwXThoiF6yf+R9scA=
<mask> golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
</s> add </s> remove golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
</s> add </s> remove golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum | |
<mask> golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20200331124033-c3d80250170d h1:nc5K6ox/4lTFbMVSL9WRR81ixkcwXThoiF6yf+R9scA=
<mask> golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
<mask> golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
<mask> golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
<mask> golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
<mask> golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
<mask> golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5 h1:LfCXLvNmTYH9kEmVgqbnsWfruoXZIrh4YBgqVHtDvw0=
</s> add </s> remove golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
</s> add </s> remove gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
</s> add </s> remove golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum | |
<mask> golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
<mask> golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
<mask> golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
<mask> golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
<mask> gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
<mask> gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
<mask> gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
<mask> gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
<mask> gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
<mask> gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
</s> CI Revamp by @crazy-max (#1873)
* CI revamped and other enhancements
GoReleaser for multi-arch binaries
Switch to GitHub Actions (more versatile) with 2 workflows
Docker multi-manifest image with buildx
Fix eslint run script
Go sum fixer
Use tools.go paradigm for external dependencies (packr)
Use go generate for packr
* Update workflows
* Add Slack notification
* Rebase
* Enhanced Dockerfile
* Fix go generate
* Fix Golangci lint
* Fix npm cache with v2 cache action
* Fix Dockerfile
* Trigger notif
* Issue with packr
* s390x platform not supported by packr
* Enhance layers
* Fix go modules
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com> </s> remove golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
</s> add </s> remove github.com/AdguardTeam/golibs v0.4.0 h1:4VX6LoOqFe9p9Gf55BeD8BvJD6M6RDYmgEiHrENE9KU=
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff23d7b6d73b2a138774ca0919692246f62c0177 | go.sum | |
github.com/miekg/dns v1.1.45 | <mask> github.com/lucas-clemente/quic-go v0.24.0
<mask> github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7
<mask> github.com/mdlayher/netlink v1.5.0
<mask> github.com/mdlayher/raw v0.0.0-20211126142749-4eae47f3d54b
<mask> github.com/miekg/dns v1.1.43
<mask> github.com/satori/go.uuid v1.2.0
<mask> github.com/stretchr/testify v1.7.0
<mask> github.com/ti-mo/netfilter v0.4.0
<mask> go.etcd.io/bbolt v1.3.6
<mask> golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3
</s> Pull request: Update miekg/dns
Merge in DNS/adguard-home from upd-dns-lib to master
Updates #2275.
Squashed commit of the following:
commit 54d0485157ac4f08830ad7d8ca9be49eef87d678
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Thu Dec 23 13:31:34 2021 +0300
all: upd dns lib </s> remove
// TODO(a.garipov): Return to the main repo once miekg/dns#1317 is merged.
replace github.com/miekg/dns => github.com/ameshkov/dns v1.1.32-0.20211214123418-7a5e0dc5f1b0
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff3df0ec334d62832d2d23fda358c361ac14b4ca | go.mod |
<mask> gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
<mask> gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
<mask> honnef.co/go/tools v0.2.2 // indirect
<mask> )
<mask>
<mask> // TODO(a.garipov): Return to the main repo once miekg/dns#1317 is merged.
<mask> replace github.com/miekg/dns => github.com/ameshkov/dns v1.1.32-0.20211214123418-7a5e0dc5f1b0
</s> Pull request: Update miekg/dns
Merge in DNS/adguard-home from upd-dns-lib to master
Updates #2275.
Squashed commit of the following:
commit 54d0485157ac4f08830ad7d8ca9be49eef87d678
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Thu Dec 23 13:31:34 2021 +0300
all: upd dns lib </s> remove github.com/ameshkov/dns v1.1.32-0.20211214123418-7a5e0dc5f1b0 h1:a6ca3WlDG4zvUWqVFpVu48b9NZJ0fUFlRhiZKKkq+aw=
github.com/ameshkov/dns v1.1.32-0.20211214123418-7a5e0dc5f1b0/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME=
</s> add </s> remove github.com/miekg/dns v1.1.43
</s> add github.com/miekg/dns v1.1.45 | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff3df0ec334d62832d2d23fda358c361ac14b4ca | go.mod | |
<mask> github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY=
<mask> github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA=
<mask> github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635 h1:52m0LGchQBBVqJRyYYufQuIbVqRawmubW3OFGqK1ekw=
<mask> github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635/go.mod h1:lmLxL+FV291OopO93Bwf9fQLQeLyt33VJRUg5VJ30us=
<mask> github.com/ameshkov/dns v1.1.32-0.20211214123418-7a5e0dc5f1b0 h1:a6ca3WlDG4zvUWqVFpVu48b9NZJ0fUFlRhiZKKkq+aw=
<mask> github.com/ameshkov/dns v1.1.32-0.20211214123418-7a5e0dc5f1b0/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME=
<mask> github.com/ameshkov/dnscrypt/v2 v2.2.2/go.mod h1:+8SbPbVXpxxcUsgGi8eodkqWPo1MyNHxKYC8hDpqLSo=
<mask> github.com/ameshkov/dnscrypt/v2 v2.2.3 h1:X9UP5AHtwp46Ji+sGFfF/1Is6OPI/SjxLqhKpx0P5UI=
<mask> github.com/ameshkov/dnscrypt/v2 v2.2.3/go.mod h1:xJB9cE1/GF+NB6EEQqRlkoa4bjcV2w7VYn1G+zVq7Bs=
<mask> github.com/ameshkov/dnsstamps v1.0.1/go.mod h1:Ii3eUu73dx4Vw5O4wjzmT5+lkCwovjzaEZZ4gKyIH5A=
<mask> github.com/ameshkov/dnsstamps v1.0.3 h1:Srzik+J9mivH1alRACTbys2xOxs0lRH9qnTA7Y1OYVo=
</s> Pull request: Update miekg/dns
Merge in DNS/adguard-home from upd-dns-lib to master
Updates #2275.
Squashed commit of the following:
commit 54d0485157ac4f08830ad7d8ca9be49eef87d678
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Thu Dec 23 13:31:34 2021 +0300
all: upd dns lib </s> remove
// TODO(a.garipov): Return to the main repo once miekg/dns#1317 is merged.
replace github.com/miekg/dns => github.com/ameshkov/dns v1.1.32-0.20211214123418-7a5e0dc5f1b0
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff3df0ec334d62832d2d23fda358c361ac14b4ca | go.sum | |
github.com/miekg/dns v1.1.40/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4=
github.com/miekg/dns v1.1.45 h1:g5fRIhm9nx7g8osrAvgb16QJfmyMsyOCb+J7LSv+Qzk=
github.com/miekg/dns v1.1.45/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= | <mask> github.com/mdlayher/socket v0.1.0/go.mod h1:mYV5YIZAfHh4dzDVzI8x8tWLWCliuX8Mon5Awbj+qDs=
<mask> github.com/mdlayher/socket v0.1.1 h1:q3uOGirUPfAV2MUoaC7BavjQ154J7+JOkTWyiV+intI=
<mask> github.com/mdlayher/socket v0.1.1/go.mod h1:mYV5YIZAfHh4dzDVzI8x8tWLWCliuX8Mon5Awbj+qDs=
<mask> github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4=
<mask> github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
<mask> github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
<mask> github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
<mask> github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
<mask> github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
<mask> github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
</s> Pull request: Update miekg/dns
Merge in DNS/adguard-home from upd-dns-lib to master
Updates #2275.
Squashed commit of the following:
commit 54d0485157ac4f08830ad7d8ca9be49eef87d678
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Thu Dec 23 13:31:34 2021 +0300
all: upd dns lib </s> remove github.com/ameshkov/dns v1.1.32-0.20211214123418-7a5e0dc5f1b0 h1:a6ca3WlDG4zvUWqVFpVu48b9NZJ0fUFlRhiZKKkq+aw=
github.com/ameshkov/dns v1.1.32-0.20211214123418-7a5e0dc5f1b0/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME=
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff3df0ec334d62832d2d23fda358c361ac14b4ca | go.sum |
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= | <mask> golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
<mask> golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
<mask> golang.org/x/net v0.0.0-20191007182048-72f939374954/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
<mask> golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
<mask> golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
<mask> golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
</s> Pull request: Update miekg/dns
Merge in DNS/adguard-home from upd-dns-lib to master
Updates #2275.
Squashed commit of the following:
commit 54d0485157ac4f08830ad7d8ca9be49eef87d678
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Thu Dec 23 13:31:34 2021 +0300
all: upd dns lib </s> remove github.com/ameshkov/dns v1.1.32-0.20211214123418-7a5e0dc5f1b0 h1:a6ca3WlDG4zvUWqVFpVu48b9NZJ0fUFlRhiZKKkq+aw=
github.com/ameshkov/dns v1.1.32-0.20211214123418-7a5e0dc5f1b0/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME=
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff3df0ec334d62832d2d23fda358c361ac14b4ca | go.sum |
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | <mask> golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
</s> Pull request: Update miekg/dns
Merge in DNS/adguard-home from upd-dns-lib to master
Updates #2275.
Squashed commit of the following:
commit 54d0485157ac4f08830ad7d8ca9be49eef87d678
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Thu Dec 23 13:31:34 2021 +0300
all: upd dns lib </s> remove github.com/ameshkov/dns v1.1.32-0.20211214123418-7a5e0dc5f1b0 h1:a6ca3WlDG4zvUWqVFpVu48b9NZJ0fUFlRhiZKKkq+aw=
github.com/ameshkov/dns v1.1.32-0.20211214123418-7a5e0dc5f1b0/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME=
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff3df0ec334d62832d2d23fda358c361ac14b4ca | go.sum |
golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | <mask> golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20210123111255-9b0068b26619/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20210216163648-f7da38b97c65/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
<mask> golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
</s> Pull request: Update miekg/dns
Merge in DNS/adguard-home from upd-dns-lib to master
Updates #2275.
Squashed commit of the following:
commit 54d0485157ac4f08830ad7d8ca9be49eef87d678
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Thu Dec 23 13:31:34 2021 +0300
all: upd dns lib </s> remove github.com/ameshkov/dns v1.1.32-0.20211214123418-7a5e0dc5f1b0 h1:a6ca3WlDG4zvUWqVFpVu48b9NZJ0fUFlRhiZKKkq+aw=
github.com/ameshkov/dns v1.1.32-0.20211214123418-7a5e0dc5f1b0/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME=
</s> add | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff3df0ec334d62832d2d23fda358c361ac14b4ca | go.sum |
golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= | <mask> golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
<mask> golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
<mask> golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
<mask> golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
<mask> golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
<mask> golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
</s> Pull request: Update miekg/dns
Merge in DNS/adguard-home from upd-dns-lib to master
Updates #2275.
Squashed commit of the following:
commit 54d0485157ac4f08830ad7d8ca9be49eef87d678
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Thu Dec 23 13:31:34 2021 +0300
all: upd dns lib </s> remove github.com/ameshkov/dns v1.1.32-0.20211214123418-7a5e0dc5f1b0 h1:a6ca3WlDG4zvUWqVFpVu48b9NZJ0fUFlRhiZKKkq+aw=
github.com/ameshkov/dns v1.1.32-0.20211214123418-7a5e0dc5f1b0/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME=
</s> add | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff3df0ec334d62832d2d23fda358c361ac14b4ca | go.sum |
var defaultDNS = []string{"tls://1.1.1.1", "tls://1.0.0.1"} | <mask> contents []byte
<mask> LastUpdated time.Time `json:"last_updated" yaml:"-"`
<mask> }
<mask>
<mask> var defaultDNS = []string{"1.1.1.1", "1.0.0.1"}
<mask>
<mask> // initialize to default values, will be changed later when reading config or parsing command line
<mask> var config = configuration{
<mask> ourConfigFilename: "AdguardDNS.yaml",
<mask> BindPort: 3000,
</s> Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API </s> remove hosts := parseIPsOptionalPort(string(body))
</s> add hosts, err := sanitiseDNSServers(string(body))
if err != nil {
httpError(w, http.StatusBadRequest, "Invalid DNS servers were given: %s", err)
return
} </s> remove http.Error(w, errortext, 400)
</s> add http.Error(w, errortext, http.StatusBadRequest) </s> remove hosts = append(hosts, field)
</s> add hosts = append(hosts, sanitized)
}
return hosts, nil
}
func getDNSServerPrefix(input string) string {
prefix := ""
switch {
case strings.HasPrefix(input, "dns://"):
prefix = "dns://"
case strings.HasPrefix(input, "tls://"):
prefix = "tls://"
}
return prefix
}
func splitDNSServerPrefixServer(input string) (string, string) {
prefix := getDNSServerPrefix(input)
host := strings.TrimPrefix(input, prefix)
return prefix, host
}
func sanitizeDNSServer(input string) (string, error) {
prefix, host := splitDNSServerPrefixServer(input)
host = appendPortIfMissing(prefix, host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return "", err
}
ip := net.ParseIP(h)
if ip == nil {
return "", fmt.Errorf("Invalid DNS server field: %s", h)
}
}
return prefix + host, nil
}
func appendPortIfMissing(prefix, input string) string {
port := "53"
switch prefix {
case "tls://":
port = "853"
}
_, _, err := net.SplitHostPort(input)
if err == nil {
return input </s> remove func checkDNS(host string) error {
host = appendPortIfMissing(host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return err
}
ip := net.ParseIP(h)
if ip == nil {
return fmt.Errorf("Invalid DNS server field: %s", h)
}
</s> add func checkDNS(input string) error {
input, err := sanitizeDNSServer(input)
if err != nil {
return err | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff86d6b7dc31e463651c11f02330630e35676e05 | config.go |
func httpError(w http.ResponseWriter, code int, format string, args ...interface{}) {
text := fmt.Sprintf(format, args...)
http.Error(w, text, code)
}
| <mask> }
<mask> }
<mask>
<mask> func handleSetUpstreamDNS(w http.ResponseWriter, r *http.Request) {
<mask> body, err := ioutil.ReadAll(r.Body)
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Failed to read request body: %s", err)
</s> Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API </s> remove http.Error(w, errortext, 400)
</s> add http.Error(w, errortext, http.StatusBadRequest) </s> remove return hosts
</s> add return net.JoinHostPort(input, port) </s> remove hosts = append(hosts, field)
</s> add hosts = append(hosts, sanitized)
}
return hosts, nil
}
func getDNSServerPrefix(input string) string {
prefix := ""
switch {
case strings.HasPrefix(input, "dns://"):
prefix = "dns://"
case strings.HasPrefix(input, "tls://"):
prefix = "tls://"
}
return prefix
}
func splitDNSServerPrefixServer(input string) (string, string) {
prefix := getDNSServerPrefix(input)
host := strings.TrimPrefix(input, prefix)
return prefix, host
}
func sanitizeDNSServer(input string) (string, error) {
prefix, host := splitDNSServerPrefixServer(input)
host = appendPortIfMissing(prefix, host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return "", err
}
ip := net.ParseIP(h)
if ip == nil {
return "", fmt.Errorf("Invalid DNS server field: %s", h)
}
}
return prefix + host, nil
}
func appendPortIfMissing(prefix, input string) string {
port := "53"
switch prefix {
case "tls://":
port = "853"
}
_, _, err := net.SplitHostPort(input)
if err == nil {
return input </s> remove func checkDNS(host string) error {
host = appendPortIfMissing(host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return err
}
ip := net.ParseIP(h)
if ip == nil {
return fmt.Errorf("Invalid DNS server field: %s", h)
}
</s> add func checkDNS(input string) error {
input, err := sanitizeDNSServer(input)
if err != nil {
return err </s> remove func appendPortIfMissing(input string) string {
_, _, err := net.SplitHostPort(input)
if err == nil {
return input
}
return net.JoinHostPort(input, "53")
}
func parseIPsOptionalPort(input string) []string {
</s> add func sanitiseDNSServers(input string) ([]string, error) { | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff86d6b7dc31e463651c11f02330630e35676e05 | control.go |
http.Error(w, errortext, http.StatusBadRequest) | <mask> body, err := ioutil.ReadAll(r.Body)
<mask> if err != nil {
<mask> errortext := fmt.Sprintf("Failed to read request body: %s", err)
<mask> log.Println(errortext)
<mask> http.Error(w, errortext, 400)
<mask> return
<mask> }
<mask> // if empty body -- user is asking for default servers
<mask> hosts := parseIPsOptionalPort(string(body))
<mask> if len(hosts) == 0 {
</s> Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API </s> remove hosts := parseIPsOptionalPort(string(body))
</s> add hosts, err := sanitiseDNSServers(string(body))
if err != nil {
httpError(w, http.StatusBadRequest, "Invalid DNS servers were given: %s", err)
return
} </s> remove func checkDNS(host string) error {
host = appendPortIfMissing(host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return err
}
ip := net.ParseIP(h)
if ip == nil {
return fmt.Errorf("Invalid DNS server field: %s", h)
}
</s> add func checkDNS(input string) error {
input, err := sanitizeDNSServer(input)
if err != nil {
return err </s> remove ip := net.ParseIP(field)
if ip == nil {
log.Printf("Invalid DNS server field: %s\n", field)
continue
}
</s> add return hosts, err </s> remove func appendPortIfMissing(input string) string {
_, _, err := net.SplitHostPort(input)
if err == nil {
return input
}
return net.JoinHostPort(input, "53")
}
func parseIPsOptionalPort(input string) []string {
</s> add func sanitiseDNSServers(input string) ([]string, error) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff86d6b7dc31e463651c11f02330630e35676e05 | control.go |
hosts, err := sanitiseDNSServers(string(body))
if err != nil {
httpError(w, http.StatusBadRequest, "Invalid DNS servers were given: %s", err)
return
} | <mask> http.Error(w, errortext, 400)
<mask> return
<mask> }
<mask> // if empty body -- user is asking for default servers
<mask> hosts := parseIPsOptionalPort(string(body))
<mask> if len(hosts) == 0 {
<mask> config.CoreDNS.UpstreamDNS = defaultDNS
<mask> } else {
<mask> config.CoreDNS.UpstreamDNS = hosts
<mask> }
</s> Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API </s> remove http.Error(w, errortext, 400)
</s> add http.Error(w, errortext, http.StatusBadRequest) </s> remove func checkDNS(host string) error {
host = appendPortIfMissing(host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return err
}
ip := net.ParseIP(h)
if ip == nil {
return fmt.Errorf("Invalid DNS server field: %s", h)
}
</s> add func checkDNS(input string) error {
input, err := sanitizeDNSServer(input)
if err != nil {
return err </s> remove return hosts
</s> add return net.JoinHostPort(input, port) </s> remove ip := net.ParseIP(field)
if ip == nil {
log.Printf("Invalid DNS server field: %s\n", field)
continue
}
</s> add return hosts, err </s> remove hosts = append(hosts, field)
</s> add hosts = append(hosts, sanitized)
}
return hosts, nil
}
func getDNSServerPrefix(input string) string {
prefix := ""
switch {
case strings.HasPrefix(input, "dns://"):
prefix = "dns://"
case strings.HasPrefix(input, "tls://"):
prefix = "tls://"
}
return prefix
}
func splitDNSServerPrefixServer(input string) (string, string) {
prefix := getDNSServerPrefix(input)
host := strings.TrimPrefix(input, prefix)
return prefix, host
}
func sanitizeDNSServer(input string) (string, error) {
prefix, host := splitDNSServerPrefixServer(input)
host = appendPortIfMissing(prefix, host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return "", err
}
ip := net.ParseIP(h)
if ip == nil {
return "", fmt.Errorf("Invalid DNS server field: %s", h)
}
}
return prefix + host, nil
}
func appendPortIfMissing(prefix, input string) string {
port := "53"
switch prefix {
case "tls://":
port = "853"
}
_, _, err := net.SplitHostPort(input)
if err == nil {
return input | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff86d6b7dc31e463651c11f02330630e35676e05 | control.go |
func checkDNS(input string) error {
input, err := sanitizeDNSServer(input)
if err != nil {
return err | <mask> http.Error(w, errortext, http.StatusInternalServerError)
<mask> }
<mask> }
<mask>
<mask> func checkDNS(host string) error {
<mask> host = appendPortIfMissing(host)
<mask> {
<mask> h, _, err := net.SplitHostPort(host)
<mask> if err != nil {
<mask> return err
<mask> }
<mask> ip := net.ParseIP(h)
<mask> if ip == nil {
<mask> return fmt.Errorf("Invalid DNS server field: %s", h)
<mask> }
<mask> }
<mask>
<mask> req := dns.Msg{}
<mask> req.Id = dns.Id()
<mask> req.RecursionDesired = true
</s> Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API </s> remove hosts = append(hosts, field)
</s> add hosts = append(hosts, sanitized)
}
return hosts, nil
}
func getDNSServerPrefix(input string) string {
prefix := ""
switch {
case strings.HasPrefix(input, "dns://"):
prefix = "dns://"
case strings.HasPrefix(input, "tls://"):
prefix = "tls://"
}
return prefix
}
func splitDNSServerPrefixServer(input string) (string, string) {
prefix := getDNSServerPrefix(input)
host := strings.TrimPrefix(input, prefix)
return prefix, host
}
func sanitizeDNSServer(input string) (string, error) {
prefix, host := splitDNSServerPrefixServer(input)
host = appendPortIfMissing(prefix, host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return "", err
}
ip := net.ParseIP(h)
if ip == nil {
return "", fmt.Errorf("Invalid DNS server field: %s", h)
}
}
return prefix + host, nil
}
func appendPortIfMissing(prefix, input string) string {
port := "53"
switch prefix {
case "tls://":
port = "853"
}
_, _, err := net.SplitHostPort(input)
if err == nil {
return input </s> remove ip := net.ParseIP(field)
if ip == nil {
log.Printf("Invalid DNS server field: %s\n", field)
continue
}
</s> add return hosts, err </s> remove resp, err := dns.Exchange(&req, host)
</s> add prefix, host := splitDNSServerPrefixServer(input)
c := dns.Client{
Timeout: time.Minute,
}
switch prefix {
case "tls://":
c.Net = "tcp-tls"
}
resp, rtt, err := c.Exchange(&req, host) </s> remove func appendPortIfMissing(input string) string {
_, _, err := net.SplitHostPort(input)
if err == nil {
return input
}
return net.JoinHostPort(input, "53")
}
func parseIPsOptionalPort(input string) []string {
</s> add func sanitiseDNSServers(input string) ([]string, error) { </s> remove _, _, err := net.SplitHostPort(field)
</s> add sanitized, err := sanitizeDNSServer(field) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff86d6b7dc31e463651c11f02330630e35676e05 | control.go |
prefix, host := splitDNSServerPrefixServer(input)
c := dns.Client{
Timeout: time.Minute,
}
switch prefix {
case "tls://":
c.Net = "tcp-tls"
}
resp, rtt, err := c.Exchange(&req, host) | <mask> req.RecursionDesired = true
<mask> req.Question = []dns.Question{
<mask> {"google-public-dns-a.google.com.", dns.TypeA, dns.ClassINET},
<mask> }
<mask> resp, err := dns.Exchange(&req, host)
<mask> if err != nil {
<mask> return fmt.Errorf("Couldn't communicate with DNS server %s: %s", host, err)
<mask> }
<mask> if len(resp.Answer) != 1 {
<mask> return fmt.Errorf("DNS server %s returned wrong answer", host)
</s> Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API </s> remove return fmt.Errorf("Couldn't communicate with DNS server %s: %s", host, err)
</s> add return fmt.Errorf("Couldn't communicate with DNS server %s: %s", input, err) </s> remove return fmt.Errorf("DNS server %s returned wrong answer", host)
</s> add return fmt.Errorf("DNS server %s returned wrong answer", input) </s> remove return fmt.Errorf("DNS server %s returned wrong answer: %v", host, t.A)
</s> add return fmt.Errorf("DNS server %s returned wrong answer: %v", input, t.A) </s> remove func checkDNS(host string) error {
host = appendPortIfMissing(host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return err
}
ip := net.ParseIP(h)
if ip == nil {
return fmt.Errorf("Invalid DNS server field: %s", h)
}
</s> add func checkDNS(input string) error {
input, err := sanitizeDNSServer(input)
if err != nil {
return err | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff86d6b7dc31e463651c11f02330630e35676e05 | control.go |
return fmt.Errorf("Couldn't communicate with DNS server %s: %s", input, err) | <mask> {"google-public-dns-a.google.com.", dns.TypeA, dns.ClassINET},
<mask> }
<mask> resp, err := dns.Exchange(&req, host)
<mask> if err != nil {
<mask> return fmt.Errorf("Couldn't communicate with DNS server %s: %s", host, err)
<mask> }
<mask> if len(resp.Answer) != 1 {
<mask> return fmt.Errorf("DNS server %s returned wrong answer", host)
<mask> }
<mask> if t, ok := resp.Answer[0].(*dns.A); ok {
</s> Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API </s> remove resp, err := dns.Exchange(&req, host)
</s> add prefix, host := splitDNSServerPrefixServer(input)
c := dns.Client{
Timeout: time.Minute,
}
switch prefix {
case "tls://":
c.Net = "tcp-tls"
}
resp, rtt, err := c.Exchange(&req, host) </s> remove return fmt.Errorf("DNS server %s returned wrong answer", host)
</s> add return fmt.Errorf("DNS server %s returned wrong answer", input) </s> remove return fmt.Errorf("DNS server %s returned wrong answer: %v", host, t.A)
</s> add return fmt.Errorf("DNS server %s returned wrong answer: %v", input, t.A) </s> remove func checkDNS(host string) error {
host = appendPortIfMissing(host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return err
}
ip := net.ParseIP(h)
if ip == nil {
return fmt.Errorf("Invalid DNS server field: %s", h)
}
</s> add func checkDNS(input string) error {
input, err := sanitizeDNSServer(input)
if err != nil {
return err | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff86d6b7dc31e463651c11f02330630e35676e05 | control.go |
trace("exchange with %s took %v", input, rtt) | <mask> return fmt.Errorf("Couldn't communicate with DNS server %s: %s", input, err)
<mask> }
<mask> if len(resp.Answer) != 1 {
<mask> return fmt.Errorf("DNS server %s returned wrong answer", input)
<mask> }
<mask> if t, ok := resp.Answer[0].(*dns.A); ok {
</s> Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API </s> remove return fmt.Errorf("DNS server %s returned wrong answer", host)
</s> add return fmt.Errorf("DNS server %s returned wrong answer", input) </s> remove return fmt.Errorf("Couldn't communicate with DNS server %s: %s", host, err)
</s> add return fmt.Errorf("Couldn't communicate with DNS server %s: %s", input, err) </s> remove return fmt.Errorf("DNS server %s returned wrong answer: %v", host, t.A)
</s> add return fmt.Errorf("DNS server %s returned wrong answer: %v", input, t.A) </s> remove resp, err := dns.Exchange(&req, host)
</s> add prefix, host := splitDNSServerPrefixServer(input)
c := dns.Client{
Timeout: time.Minute,
}
switch prefix {
case "tls://":
c.Net = "tcp-tls"
}
resp, rtt, err := c.Exchange(&req, host) </s> remove func checkDNS(host string) error {
host = appendPortIfMissing(host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return err
}
ip := net.ParseIP(h)
if ip == nil {
return fmt.Errorf("Invalid DNS server field: %s", h)
}
</s> add func checkDNS(input string) error {
input, err := sanitizeDNSServer(input)
if err != nil {
return err | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff86d6b7dc31e463651c11f02330630e35676e05 | control.go |
return fmt.Errorf("DNS server %s returned wrong answer", input) | <mask> if err != nil {
<mask> return fmt.Errorf("Couldn't communicate with DNS server %s: %s", host, err)
<mask> }
<mask> if len(resp.Answer) != 1 {
<mask> return fmt.Errorf("DNS server %s returned wrong answer", host)
<mask> }
<mask> if t, ok := resp.Answer[0].(*dns.A); ok {
<mask> if !net.IPv4(8, 8, 8, 8).Equal(t.A) {
<mask> return fmt.Errorf("DNS server %s returned wrong answer: %v", host, t.A)
<mask> }
</s> Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API </s> remove return fmt.Errorf("DNS server %s returned wrong answer: %v", host, t.A)
</s> add return fmt.Errorf("DNS server %s returned wrong answer: %v", input, t.A) </s> remove return fmt.Errorf("Couldn't communicate with DNS server %s: %s", host, err)
</s> add return fmt.Errorf("Couldn't communicate with DNS server %s: %s", input, err) </s> remove resp, err := dns.Exchange(&req, host)
</s> add prefix, host := splitDNSServerPrefixServer(input)
c := dns.Client{
Timeout: time.Minute,
}
switch prefix {
case "tls://":
c.Net = "tcp-tls"
}
resp, rtt, err := c.Exchange(&req, host) </s> remove func checkDNS(host string) error {
host = appendPortIfMissing(host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return err
}
ip := net.ParseIP(h)
if ip == nil {
return fmt.Errorf("Invalid DNS server field: %s", h)
}
</s> add func checkDNS(input string) error {
input, err := sanitizeDNSServer(input)
if err != nil {
return err | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff86d6b7dc31e463651c11f02330630e35676e05 | control.go |
return fmt.Errorf("DNS server %s returned wrong answer: %v", input, t.A) | <mask> return fmt.Errorf("DNS server %s returned wrong answer", host)
<mask> }
<mask> if t, ok := resp.Answer[0].(*dns.A); ok {
<mask> if !net.IPv4(8, 8, 8, 8).Equal(t.A) {
<mask> return fmt.Errorf("DNS server %s returned wrong answer: %v", host, t.A)
<mask> }
<mask> }
<mask>
<mask> return nil
<mask> }
</s> Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API </s> remove return fmt.Errorf("DNS server %s returned wrong answer", host)
</s> add return fmt.Errorf("DNS server %s returned wrong answer", input) </s> remove return fmt.Errorf("Couldn't communicate with DNS server %s: %s", host, err)
</s> add return fmt.Errorf("Couldn't communicate with DNS server %s: %s", input, err) </s> remove resp, err := dns.Exchange(&req, host)
</s> add prefix, host := splitDNSServerPrefixServer(input)
c := dns.Client{
Timeout: time.Minute,
}
switch prefix {
case "tls://":
c.Net = "tcp-tls"
}
resp, rtt, err := c.Exchange(&req, host) </s> remove hosts = append(hosts, field)
</s> add hosts = append(hosts, sanitized)
}
return hosts, nil
}
func getDNSServerPrefix(input string) string {
prefix := ""
switch {
case strings.HasPrefix(input, "dns://"):
prefix = "dns://"
case strings.HasPrefix(input, "tls://"):
prefix = "tls://"
}
return prefix
}
func splitDNSServerPrefixServer(input string) (string, string) {
prefix := getDNSServerPrefix(input)
host := strings.TrimPrefix(input, prefix)
return prefix, host
}
func sanitizeDNSServer(input string) (string, error) {
prefix, host := splitDNSServerPrefixServer(input)
host = appendPortIfMissing(prefix, host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return "", err
}
ip := net.ParseIP(h)
if ip == nil {
return "", fmt.Errorf("Invalid DNS server field: %s", h)
}
}
return prefix + host, nil
}
func appendPortIfMissing(prefix, input string) string {
port := "53"
switch prefix {
case "tls://":
port = "853"
}
_, _, err := net.SplitHostPort(input)
if err == nil {
return input | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff86d6b7dc31e463651c11f02330630e35676e05 | control.go |
func sanitiseDNSServers(input string) ([]string, error) { | <mask>
<mask> return nil
<mask> }
<mask>
<mask> func appendPortIfMissing(input string) string {
<mask> _, _, err := net.SplitHostPort(input)
<mask> if err == nil {
<mask> return input
<mask> }
<mask> return net.JoinHostPort(input, "53")
<mask> }
<mask>
<mask> func parseIPsOptionalPort(input string) []string {
<mask> fields := strings.Fields(input)
<mask> hosts := []string{}
<mask> for _, field := range fields {
<mask> _, _, err := net.SplitHostPort(field)
<mask> if err != nil {
</s> Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API </s> remove _, _, err := net.SplitHostPort(field)
</s> add sanitized, err := sanitizeDNSServer(field) </s> remove ip := net.ParseIP(field)
if ip == nil {
log.Printf("Invalid DNS server field: %s\n", field)
continue
}
</s> add return hosts, err </s> remove hosts = append(hosts, field)
</s> add hosts = append(hosts, sanitized)
}
return hosts, nil
}
func getDNSServerPrefix(input string) string {
prefix := ""
switch {
case strings.HasPrefix(input, "dns://"):
prefix = "dns://"
case strings.HasPrefix(input, "tls://"):
prefix = "tls://"
}
return prefix
}
func splitDNSServerPrefixServer(input string) (string, string) {
prefix := getDNSServerPrefix(input)
host := strings.TrimPrefix(input, prefix)
return prefix, host
}
func sanitizeDNSServer(input string) (string, error) {
prefix, host := splitDNSServerPrefixServer(input)
host = appendPortIfMissing(prefix, host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return "", err
}
ip := net.ParseIP(h)
if ip == nil {
return "", fmt.Errorf("Invalid DNS server field: %s", h)
}
}
return prefix + host, nil
}
func appendPortIfMissing(prefix, input string) string {
port := "53"
switch prefix {
case "tls://":
port = "853"
}
_, _, err := net.SplitHostPort(input)
if err == nil {
return input </s> remove func checkDNS(host string) error {
host = appendPortIfMissing(host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return err
}
ip := net.ParseIP(h)
if ip == nil {
return fmt.Errorf("Invalid DNS server field: %s", h)
}
</s> add func checkDNS(input string) error {
input, err := sanitizeDNSServer(input)
if err != nil {
return err </s> remove hosts := parseIPsOptionalPort(string(body))
</s> add hosts, err := sanitiseDNSServers(string(body))
if err != nil {
httpError(w, http.StatusBadRequest, "Invalid DNS servers were given: %s", err)
return
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff86d6b7dc31e463651c11f02330630e35676e05 | control.go |
sanitized, err := sanitizeDNSServer(field) | <mask> func parseIPsOptionalPort(input string) []string {
<mask> fields := strings.Fields(input)
<mask> hosts := []string{}
<mask> for _, field := range fields {
<mask> _, _, err := net.SplitHostPort(field)
<mask> if err != nil {
<mask> ip := net.ParseIP(field)
<mask> if ip == nil {
<mask> log.Printf("Invalid DNS server field: %s\n", field)
<mask> continue
</s> Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API </s> remove ip := net.ParseIP(field)
if ip == nil {
log.Printf("Invalid DNS server field: %s\n", field)
continue
}
</s> add return hosts, err </s> remove func appendPortIfMissing(input string) string {
_, _, err := net.SplitHostPort(input)
if err == nil {
return input
}
return net.JoinHostPort(input, "53")
}
func parseIPsOptionalPort(input string) []string {
</s> add func sanitiseDNSServers(input string) ([]string, error) { </s> remove hosts = append(hosts, field)
</s> add hosts = append(hosts, sanitized)
}
return hosts, nil
}
func getDNSServerPrefix(input string) string {
prefix := ""
switch {
case strings.HasPrefix(input, "dns://"):
prefix = "dns://"
case strings.HasPrefix(input, "tls://"):
prefix = "tls://"
}
return prefix
}
func splitDNSServerPrefixServer(input string) (string, string) {
prefix := getDNSServerPrefix(input)
host := strings.TrimPrefix(input, prefix)
return prefix, host
}
func sanitizeDNSServer(input string) (string, error) {
prefix, host := splitDNSServerPrefixServer(input)
host = appendPortIfMissing(prefix, host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return "", err
}
ip := net.ParseIP(h)
if ip == nil {
return "", fmt.Errorf("Invalid DNS server field: %s", h)
}
}
return prefix + host, nil
}
func appendPortIfMissing(prefix, input string) string {
port := "53"
switch prefix {
case "tls://":
port = "853"
}
_, _, err := net.SplitHostPort(input)
if err == nil {
return input </s> remove func checkDNS(host string) error {
host = appendPortIfMissing(host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return err
}
ip := net.ParseIP(h)
if ip == nil {
return fmt.Errorf("Invalid DNS server field: %s", h)
}
</s> add func checkDNS(input string) error {
input, err := sanitizeDNSServer(input)
if err != nil {
return err </s> remove http.Error(w, errortext, 400)
</s> add http.Error(w, errortext, http.StatusBadRequest) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff86d6b7dc31e463651c11f02330630e35676e05 | control.go |
return hosts, err | <mask> hosts := []string{}
<mask> for _, field := range fields {
<mask> _, _, err := net.SplitHostPort(field)
<mask> if err != nil {
<mask> ip := net.ParseIP(field)
<mask> if ip == nil {
<mask> log.Printf("Invalid DNS server field: %s\n", field)
<mask> continue
<mask> }
<mask> }
<mask> hosts = append(hosts, field)
<mask> }
<mask> return hosts
<mask> }
</s> Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API </s> remove _, _, err := net.SplitHostPort(field)
</s> add sanitized, err := sanitizeDNSServer(field) </s> remove func appendPortIfMissing(input string) string {
_, _, err := net.SplitHostPort(input)
if err == nil {
return input
}
return net.JoinHostPort(input, "53")
}
func parseIPsOptionalPort(input string) []string {
</s> add func sanitiseDNSServers(input string) ([]string, error) { </s> remove hosts = append(hosts, field)
</s> add hosts = append(hosts, sanitized)
}
return hosts, nil
}
func getDNSServerPrefix(input string) string {
prefix := ""
switch {
case strings.HasPrefix(input, "dns://"):
prefix = "dns://"
case strings.HasPrefix(input, "tls://"):
prefix = "tls://"
}
return prefix
}
func splitDNSServerPrefixServer(input string) (string, string) {
prefix := getDNSServerPrefix(input)
host := strings.TrimPrefix(input, prefix)
return prefix, host
}
func sanitizeDNSServer(input string) (string, error) {
prefix, host := splitDNSServerPrefixServer(input)
host = appendPortIfMissing(prefix, host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return "", err
}
ip := net.ParseIP(h)
if ip == nil {
return "", fmt.Errorf("Invalid DNS server field: %s", h)
}
}
return prefix + host, nil
}
func appendPortIfMissing(prefix, input string) string {
port := "53"
switch prefix {
case "tls://":
port = "853"
}
_, _, err := net.SplitHostPort(input)
if err == nil {
return input </s> remove func checkDNS(host string) error {
host = appendPortIfMissing(host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return err
}
ip := net.ParseIP(h)
if ip == nil {
return fmt.Errorf("Invalid DNS server field: %s", h)
}
</s> add func checkDNS(input string) error {
input, err := sanitizeDNSServer(input)
if err != nil {
return err </s> remove return hosts
</s> add return net.JoinHostPort(input, port) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff86d6b7dc31e463651c11f02330630e35676e05 | control.go |
hosts = append(hosts, sanitized)
}
return hosts, nil
}
func getDNSServerPrefix(input string) string {
prefix := ""
switch {
case strings.HasPrefix(input, "dns://"):
prefix = "dns://"
case strings.HasPrefix(input, "tls://"):
prefix = "tls://"
}
return prefix
}
func splitDNSServerPrefixServer(input string) (string, string) {
prefix := getDNSServerPrefix(input)
host := strings.TrimPrefix(input, prefix)
return prefix, host
}
func sanitizeDNSServer(input string) (string, error) {
prefix, host := splitDNSServerPrefixServer(input)
host = appendPortIfMissing(prefix, host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return "", err
}
ip := net.ParseIP(h)
if ip == nil {
return "", fmt.Errorf("Invalid DNS server field: %s", h)
}
}
return prefix + host, nil
}
func appendPortIfMissing(prefix, input string) string {
port := "53"
switch prefix {
case "tls://":
port = "853"
}
_, _, err := net.SplitHostPort(input)
if err == nil {
return input | <mask> log.Printf("Invalid DNS server field: %s\n", field)
<mask> continue
<mask> }
<mask> }
<mask> hosts = append(hosts, field)
<mask> }
<mask> return hosts
<mask> }
<mask>
<mask> func handleGetVersionJSON(w http.ResponseWriter, r *http.Request) {
</s> Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API </s> remove return hosts
</s> add return net.JoinHostPort(input, port) </s> remove ip := net.ParseIP(field)
if ip == nil {
log.Printf("Invalid DNS server field: %s\n", field)
continue
}
</s> add return hosts, err </s> remove _, _, err := net.SplitHostPort(field)
</s> add sanitized, err := sanitizeDNSServer(field) </s> remove func checkDNS(host string) error {
host = appendPortIfMissing(host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return err
}
ip := net.ParseIP(h)
if ip == nil {
return fmt.Errorf("Invalid DNS server field: %s", h)
}
</s> add func checkDNS(input string) error {
input, err := sanitizeDNSServer(input)
if err != nil {
return err | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff86d6b7dc31e463651c11f02330630e35676e05 | control.go |
return net.JoinHostPort(input, port) | <mask> }
<mask> }
<mask> hosts = append(hosts, field)
<mask> }
<mask> return hosts
<mask> }
<mask>
<mask> func handleGetVersionJSON(w http.ResponseWriter, r *http.Request) {
<mask> now := time.Now()
<mask> if now.Sub(versionCheckLastTime) <= versionCheckPeriod && len(versionCheckJSON) != 0 {
</s> Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API </s> remove hosts = append(hosts, field)
</s> add hosts = append(hosts, sanitized)
}
return hosts, nil
}
func getDNSServerPrefix(input string) string {
prefix := ""
switch {
case strings.HasPrefix(input, "dns://"):
prefix = "dns://"
case strings.HasPrefix(input, "tls://"):
prefix = "tls://"
}
return prefix
}
func splitDNSServerPrefixServer(input string) (string, string) {
prefix := getDNSServerPrefix(input)
host := strings.TrimPrefix(input, prefix)
return prefix, host
}
func sanitizeDNSServer(input string) (string, error) {
prefix, host := splitDNSServerPrefixServer(input)
host = appendPortIfMissing(prefix, host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return "", err
}
ip := net.ParseIP(h)
if ip == nil {
return "", fmt.Errorf("Invalid DNS server field: %s", h)
}
}
return prefix + host, nil
}
func appendPortIfMissing(prefix, input string) string {
port := "53"
switch prefix {
case "tls://":
port = "853"
}
_, _, err := net.SplitHostPort(input)
if err == nil {
return input </s> remove ip := net.ParseIP(field)
if ip == nil {
log.Printf("Invalid DNS server field: %s\n", field)
continue
}
</s> add return hosts, err </s> remove hosts := parseIPsOptionalPort(string(body))
</s> add hosts, err := sanitiseDNSServers(string(body))
if err != nil {
httpError(w, http.StatusBadRequest, "Invalid DNS servers were given: %s", err)
return
} </s> remove func checkDNS(host string) error {
host = appendPortIfMissing(host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return err
}
ip := net.ParseIP(h)
if ip == nil {
return fmt.Errorf("Invalid DNS server field: %s", h)
}
</s> add func checkDNS(input string) error {
input, err := sanitizeDNSServer(input)
if err != nil {
return err | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff86d6b7dc31e463651c11f02330630e35676e05 | control.go |
"os" | <mask> "errors"
<mask> "fmt"
<mask> "io"
<mask> "net/http"
<mask> "path"
<mask> "runtime"
<mask> "sort"
<mask> "strings"
<mask> "time"
<mask> )
</s> Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API </s> remove fmt.Print(buf.String())
</s> add fmt.Fprint(os.Stderr, buf.String()) </s> remove http.Error(w, errortext, 400)
</s> add http.Error(w, errortext, http.StatusBadRequest) </s> remove hosts := parseIPsOptionalPort(string(body))
</s> add hosts, err := sanitiseDNSServers(string(body))
if err != nil {
httpError(w, http.StatusBadRequest, "Invalid DNS servers were given: %s", err)
return
} | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff86d6b7dc31e463651c11f02330630e35676e05 | helpers.go |
fmt.Fprint(os.Stderr, buf.String()) | <mask> buf.WriteString(text)
<mask> if len(text) == 0 || text[len(text)-1] != '\n' {
<mask> buf.WriteRune('\n')
<mask> }
<mask> fmt.Print(buf.String())
<mask> }
</s> Set default servers to tls://1.1.1.1 and tls://1.0.0.1
Also add support for tls:// in webUI API </s> remove return hosts
</s> add return net.JoinHostPort(input, port) </s> remove hosts := parseIPsOptionalPort(string(body))
</s> add hosts, err := sanitiseDNSServers(string(body))
if err != nil {
httpError(w, http.StatusBadRequest, "Invalid DNS servers were given: %s", err)
return
} </s> remove http.Error(w, errortext, 400)
</s> add http.Error(w, errortext, http.StatusBadRequest) </s> remove func checkDNS(host string) error {
host = appendPortIfMissing(host)
{
h, _, err := net.SplitHostPort(host)
if err != nil {
return err
}
ip := net.ParseIP(h)
if ip == nil {
return fmt.Errorf("Invalid DNS server field: %s", h)
}
</s> add func checkDNS(input string) error {
input, err := sanitizeDNSServer(input)
if err != nil {
return err </s> remove ip := net.ParseIP(field)
if ip == nil {
log.Printf("Invalid DNS server field: %s\n", field)
continue
}
</s> add return hosts, err | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff86d6b7dc31e463651c11f02330630e35676e05 | helpers.go |
# This comment is used to simplify checking local copies of the
# Makefile. Bump this number every time a significant change is made to
# this Makefile.
#
# AdGuard-Project-Version: 2
# Don't name these macros "GO" etc., because GNU Make apparently makes
# them exported environment variables with the literal value of
# "${GO:-go}" and so on, which is not what we need. Use a dot in the
# name to make sure that users don't have an environment variable with
# the same name.
#
# See https://unix.stackexchange.com/q/646255/105635.
GO.MACRO = $${GO:-go}
VERBOSE.MACRO = $${VERBOSE:-0}
| <mask> #
<mask> # See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html.
<mask> .POSIX:
<mask>
<mask> CHANNEL = development
<mask> CLIENT_DIR = client
<mask> COMMIT = $$( git rev-parse --short HEAD )
<mask> DIST_DIR = dist
<mask> GOPROXY = https://goproxy.cn|https://proxy.golang.org|direct
</s> Pull request 1747: chlog-and-proj-skel
Merge in DNS/adguard-home from chlog-and-proj-skel to master
Squashed commit of the following:
commit 8e7c3e2eb50c559bdcd5862e72c16511dd8272da
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Feb 21 16:52:10 2023 +0300
all: upd proj skel </s> remove # Don't name this macro "GO", because GNU Make apparenly makes it an
# exported environment variable with the literal value of "${GO:-go}",
# which is not what we need. Use a dot in the name to make sure that
# users don't have an environment variable with the same name.
#
# See https://unix.stackexchange.com/q/646255/105635.
GO.MACRO = $${GO:-go}
</s> add </s> remove VERBOSE = 0
</s> add </s> remove # Only show interactive prompts if there is a terminal attached. This
# should work on all of our supported Unix systems.
</s> add # This comment is used to simplify checking local copies of the script.
# Bump this number every time a significant change is made to this
# script.
#
# AdGuard-Project-Version: 1
# Only show interactive prompts if there a terminal is attached to
# stdout. While this technically doesn't guarantee that reading from
# /dev/tty works, this should work reasonably well on all of our
# supported development systems and in most terminal emulators. </s> remove # Keep this target first, so that a naked make invocation triggers
# a full build.
</s> add # Keep this target first, so that a naked make invocation triggers a
# full build. </s> remove VERBOSE='$(VERBOSE)'\
</s> add VERBOSE="$(VERBOSE.MACRO)"\ | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff9b24ad6912e894d2992c07e7d017bc269e8bd5 | Makefile |
<mask> CHANNEL = development
<mask> CLIENT_DIR = client
<mask> COMMIT = $$( git rev-parse --short HEAD )
<mask> DIST_DIR = dist
<mask> # Don't name this macro "GO", because GNU Make apparenly makes it an
<mask> # exported environment variable with the literal value of "${GO:-go}",
<mask> # which is not what we need. Use a dot in the name to make sure that
<mask> # users don't have an environment variable with the same name.
<mask> #
<mask> # See https://unix.stackexchange.com/q/646255/105635.
<mask> GO.MACRO = $${GO:-go}
<mask> GOPROXY = https://goproxy.cn|https://proxy.golang.org|direct
<mask> GOSUMDB = sum.golang.google.cn
<mask> GPG_KEY = devteam@adguard.com
<mask> GPG_KEY_PASSPHRASE = not-a-real-password
<mask> NPM = npm
</s> Pull request 1747: chlog-and-proj-skel
Merge in DNS/adguard-home from chlog-and-proj-skel to master
Squashed commit of the following:
commit 8e7c3e2eb50c559bdcd5862e72c16511dd8272da
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Feb 21 16:52:10 2023 +0300
all: upd proj skel </s> remove VERBOSE = 0
</s> add </s> remove # Only show interactive prompts if there is a terminal attached. This
# should work on all of our supported Unix systems.
</s> add # This comment is used to simplify checking local copies of the script.
# Bump this number every time a significant change is made to this
# script.
#
# AdGuard-Project-Version: 1
# Only show interactive prompts if there a terminal is attached to
# stdout. While this technically doesn't guarantee that reading from
# /dev/tty works, this should work reasonably well on all of our
# supported development systems and in most terminal emulators. </s> remove # Keep this target first, so that a naked make invocation triggers
# a full build.
</s> add # Keep this target first, so that a naked make invocation triggers a
# full build. </s> remove VERBOSE='$(VERBOSE)'\
</s> add VERBOSE="$(VERBOSE.MACRO)"\ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff9b24ad6912e894d2992c07e7d017bc269e8bd5 | Makefile | |
<mask> NPM_INSTALL_FLAGS = $(NPM_FLAGS) --quiet --no-progress --ignore-engines\
<mask> --ignore-optional --ignore-platform --ignore-scripts
<mask> RACE = 0
<mask> SIGN = 1
<mask> VERBOSE = 0
<mask> VERSION = v0.0.0
<mask> YARN = yarn
<mask>
<mask> NEXTAPI = 0
<mask>
</s> Pull request 1747: chlog-and-proj-skel
Merge in DNS/adguard-home from chlog-and-proj-skel to master
Squashed commit of the following:
commit 8e7c3e2eb50c559bdcd5862e72c16511dd8272da
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Feb 21 16:52:10 2023 +0300
all: upd proj skel </s> remove # Don't name this macro "GO", because GNU Make apparenly makes it an
# exported environment variable with the literal value of "${GO:-go}",
# which is not what we need. Use a dot in the name to make sure that
# users don't have an environment variable with the same name.
#
# See https://unix.stackexchange.com/q/646255/105635.
GO.MACRO = $${GO:-go}
</s> add </s> remove # Only show interactive prompts if there is a terminal attached. This
# should work on all of our supported Unix systems.
</s> add # This comment is used to simplify checking local copies of the script.
# Bump this number every time a significant change is made to this
# script.
#
# AdGuard-Project-Version: 1
# Only show interactive prompts if there a terminal is attached to
# stdout. While this technically doesn't guarantee that reading from
# /dev/tty works, this should work reasonably well on all of our
# supported development systems and in most terminal emulators. </s> remove if [ -e /dev/tty ]
</s> add if [ -t '1' ] </s> remove // +build next
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff9b24ad6912e894d2992c07e7d017bc269e8bd5 | Makefile | |
VERBOSE="$(VERBOSE.MACRO)"\ | <mask> PATH="$${PWD}/bin:$$( "$(GO.MACRO)" env GOPATH )/bin:$${PATH}"\
<mask> RACE='$(RACE)'\
<mask> SIGN='$(SIGN)'\
<mask> NEXTAPI='$(NEXTAPI)'\
<mask> VERBOSE='$(VERBOSE)'\
<mask> VERSION='$(VERSION)'\
<mask>
<mask> # Keep the line above blank.
<mask>
<mask> # Keep this target first, so that a naked make invocation triggers
</s> Pull request 1747: chlog-and-proj-skel
Merge in DNS/adguard-home from chlog-and-proj-skel to master
Squashed commit of the following:
commit 8e7c3e2eb50c559bdcd5862e72c16511dd8272da
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Feb 21 16:52:10 2023 +0300
all: upd proj skel </s> remove # Keep this target first, so that a naked make invocation triggers
# a full build.
</s> add # Keep this target first, so that a naked make invocation triggers a
# full build. </s> remove # Don't name this macro "GO", because GNU Make apparenly makes it an
# exported environment variable with the literal value of "${GO:-go}",
# which is not what we need. Use a dot in the name to make sure that
# users don't have an environment variable with the same name.
#
# See https://unix.stackexchange.com/q/646255/105635.
GO.MACRO = $${GO:-go}
</s> add </s> remove # Only show interactive prompts if there is a terminal attached. This
# should work on all of our supported Unix systems.
</s> add # This comment is used to simplify checking local copies of the script.
# Bump this number every time a significant change is made to this
# script.
#
# AdGuard-Project-Version: 1
# Only show interactive prompts if there a terminal is attached to
# stdout. While this technically doesn't guarantee that reading from
# /dev/tty works, this should work reasonably well on all of our
# supported development systems and in most terminal emulators. </s> remove if [ -e /dev/tty ]
</s> add if [ -t '1' ] | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff9b24ad6912e894d2992c07e7d017bc269e8bd5 | Makefile |
# Keep this target first, so that a naked make invocation triggers a
# full build. | <mask> VERSION='$(VERSION)'\
<mask>
<mask> # Keep the line above blank.
<mask>
<mask> # Keep this target first, so that a naked make invocation triggers
<mask> # a full build.
<mask> build: deps quick-build
<mask>
<mask> quick-build: js-build go-build
<mask>
<mask> ci: deps test
</s> Pull request 1747: chlog-and-proj-skel
Merge in DNS/adguard-home from chlog-and-proj-skel to master
Squashed commit of the following:
commit 8e7c3e2eb50c559bdcd5862e72c16511dd8272da
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Feb 21 16:52:10 2023 +0300
all: upd proj skel </s> remove VERBOSE='$(VERBOSE)'\
</s> add VERBOSE="$(VERBOSE.MACRO)"\ </s> remove # Only show interactive prompts if there is a terminal attached. This
# should work on all of our supported Unix systems.
</s> add # This comment is used to simplify checking local copies of the script.
# Bump this number every time a significant change is made to this
# script.
#
# AdGuard-Project-Version: 1
# Only show interactive prompts if there a terminal is attached to
# stdout. While this technically doesn't guarantee that reading from
# /dev/tty works, this should work reasonably well on all of our
# supported development systems and in most terminal emulators. </s> remove # Don't name this macro "GO", because GNU Make apparenly makes it an
# exported environment variable with the literal value of "${GO:-go}",
# which is not what we need. Use a dot in the name to make sure that
# users don't have an environment variable with the same name.
#
# See https://unix.stackexchange.com/q/646255/105635.
GO.MACRO = $${GO:-go}
</s> add </s> remove if [ -e /dev/tty ]
</s> add if [ -t '1' ] | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff9b24ad6912e894d2992c07e7d017bc269e8bd5 | Makefile |
txt-lint: ; $(ENV) "$(SHELL)" ./scripts/make/txt-lint.sh | <mask>
<mask> openapi-lint: ; cd ./openapi/ && $(YARN) test
<mask> openapi-show: ; cd ./openapi/ && $(YARN) start
<mask>
<mask> txt-lint: ; $(ENV) "$(SHELL)" ./scripts/make/txt-lint.sh
</s> Pull request 1747: chlog-and-proj-skel
Merge in DNS/adguard-home from chlog-and-proj-skel to master
Squashed commit of the following:
commit 8e7c3e2eb50c559bdcd5862e72c16511dd8272da
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Feb 21 16:52:10 2023 +0300
all: upd proj skel </s> remove # Keep this target first, so that a naked make invocation triggers
# a full build.
</s> add # Keep this target first, so that a naked make invocation triggers a
# full build. </s> remove if [ -e /dev/tty ]
</s> add if [ -t '1' ] </s> remove # Only show interactive prompts if there is a terminal attached. This
# should work on all of our supported Unix systems.
</s> add # This comment is used to simplify checking local copies of the script.
# Bump this number every time a significant change is made to this
# script.
#
# AdGuard-Project-Version: 1
# Only show interactive prompts if there a terminal is attached to
# stdout. While this technically doesn't guarantee that reading from
# /dev/tty works, this should work reasonably well on all of our
# supported development systems and in most terminal emulators. </s> remove // +build next
</s> add </s> remove // +build !next
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff9b24ad6912e894d2992c07e7d017bc269e8bd5 | Makefile |
<mask> //go:build tools
<mask> // +build tools
<mask>
<mask> package tools
<mask>
<mask> import (
<mask> _ "github.com/fzipp/gocyclo/cmd/gocyclo"
</s> Pull request 1747: chlog-and-proj-skel
Merge in DNS/adguard-home from chlog-and-proj-skel to master
Squashed commit of the following:
commit 8e7c3e2eb50c559bdcd5862e72c16511dd8272da
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Feb 21 16:52:10 2023 +0300
all: upd proj skel </s> remove // +build next
</s> add </s> remove // +build !next
</s> add </s> remove if [ -e /dev/tty ]
</s> add if [ -t '1' ] </s> remove # Only show interactive prompts if there is a terminal attached. This
# should work on all of our supported Unix systems.
</s> add # This comment is used to simplify checking local copies of the script.
# Bump this number every time a significant change is made to this
# script.
#
# AdGuard-Project-Version: 1
# Only show interactive prompts if there a terminal is attached to
# stdout. While this technically doesn't guarantee that reading from
# /dev/tty works, this should work reasonably well on all of our
# supported development systems and in most terminal emulators. </s> remove txt-lint: ; $(ENV) "$(SHELL)" ./scripts/make/txt-lint.sh
</s> add txt-lint: ; $(ENV) "$(SHELL)" ./scripts/make/txt-lint.sh | [
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff9b24ad6912e894d2992c07e7d017bc269e8bd5 | internal/tools/tools.go | |
<mask> //go:build !next
<mask> // +build !next
<mask>
<mask> package main
<mask>
<mask> import (
<mask> "embed"
</s> Pull request 1747: chlog-and-proj-skel
Merge in DNS/adguard-home from chlog-and-proj-skel to master
Squashed commit of the following:
commit 8e7c3e2eb50c559bdcd5862e72c16511dd8272da
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Feb 21 16:52:10 2023 +0300
all: upd proj skel </s> remove // +build next
</s> add </s> remove // +build tools
</s> add </s> remove if [ -e /dev/tty ]
</s> add if [ -t '1' ] </s> remove # Only show interactive prompts if there is a terminal attached. This
# should work on all of our supported Unix systems.
</s> add # This comment is used to simplify checking local copies of the script.
# Bump this number every time a significant change is made to this
# script.
#
# AdGuard-Project-Version: 1
# Only show interactive prompts if there a terminal is attached to
# stdout. While this technically doesn't guarantee that reading from
# /dev/tty works, this should work reasonably well on all of our
# supported development systems and in most terminal emulators. </s> remove txt-lint: ; $(ENV) "$(SHELL)" ./scripts/make/txt-lint.sh
</s> add txt-lint: ; $(ENV) "$(SHELL)" ./scripts/make/txt-lint.sh | [
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff9b24ad6912e894d2992c07e7d017bc269e8bd5 | main.go | |
<mask> //go:build next
<mask> // +build next
<mask>
<mask> package main
<mask>
<mask> import (
<mask> "embed"
</s> Pull request 1747: chlog-and-proj-skel
Merge in DNS/adguard-home from chlog-and-proj-skel to master
Squashed commit of the following:
commit 8e7c3e2eb50c559bdcd5862e72c16511dd8272da
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Feb 21 16:52:10 2023 +0300
all: upd proj skel </s> remove // +build !next
</s> add </s> remove // +build tools
</s> add </s> remove if [ -e /dev/tty ]
</s> add if [ -t '1' ] </s> remove # Only show interactive prompts if there is a terminal attached. This
# should work on all of our supported Unix systems.
</s> add # This comment is used to simplify checking local copies of the script.
# Bump this number every time a significant change is made to this
# script.
#
# AdGuard-Project-Version: 1
# Only show interactive prompts if there a terminal is attached to
# stdout. While this technically doesn't guarantee that reading from
# /dev/tty works, this should work reasonably well on all of our
# supported development systems and in most terminal emulators. </s> remove txt-lint: ; $(ENV) "$(SHELL)" ./scripts/make/txt-lint.sh
</s> add txt-lint: ; $(ENV) "$(SHELL)" ./scripts/make/txt-lint.sh | [
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff9b24ad6912e894d2992c07e7d017bc269e8bd5 | main_next.go | |
# This comment is used to simplify checking local copies of the script.
# Bump this number every time a significant change is made to this
# script.
#
# AdGuard-Project-Version: 1
# Only show interactive prompts if there a terminal is attached to
# stdout. While this technically doesn't guarantee that reading from
# /dev/tty works, this should work reasonably well on all of our
# supported development systems and in most terminal emulators. | <mask> #!/bin/sh
<mask>
<mask> set -e -f -u
<mask>
<mask> # Only show interactive prompts if there is a terminal attached. This
<mask> # should work on all of our supported Unix systems.
<mask> is_tty='0'
<mask> if [ -e /dev/tty ]
<mask> then
<mask> is_tty='1'
<mask> fi
</s> Pull request 1747: chlog-and-proj-skel
Merge in DNS/adguard-home from chlog-and-proj-skel to master
Squashed commit of the following:
commit 8e7c3e2eb50c559bdcd5862e72c16511dd8272da
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Feb 21 16:52:10 2023 +0300
all: upd proj skel </s> remove if [ -e /dev/tty ]
</s> add if [ -t '1' ] </s> remove # Don't name this macro "GO", because GNU Make apparenly makes it an
# exported environment variable with the literal value of "${GO:-go}",
# which is not what we need. Use a dot in the name to make sure that
# users don't have an environment variable with the same name.
#
# See https://unix.stackexchange.com/q/646255/105635.
GO.MACRO = $${GO:-go}
</s> add </s> remove # Keep this target first, so that a naked make invocation triggers
# a full build.
</s> add # Keep this target first, so that a naked make invocation triggers a
# full build. </s> remove VERBOSE='$(VERBOSE)'\
</s> add VERBOSE="$(VERBOSE.MACRO)"\ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff9b24ad6912e894d2992c07e7d017bc269e8bd5 | scripts/hooks/pre-commit |
if [ -t '1' ] | <mask>
<mask> # Only show interactive prompts if there is a terminal attached. This
<mask> # should work on all of our supported Unix systems.
<mask> is_tty='0'
<mask> if [ -e /dev/tty ]
<mask> then
<mask> is_tty='1'
<mask> fi
<mask> readonly is_tty
<mask>
</s> Pull request 1747: chlog-and-proj-skel
Merge in DNS/adguard-home from chlog-and-proj-skel to master
Squashed commit of the following:
commit 8e7c3e2eb50c559bdcd5862e72c16511dd8272da
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Tue Feb 21 16:52:10 2023 +0300
all: upd proj skel </s> remove # Only show interactive prompts if there is a terminal attached. This
# should work on all of our supported Unix systems.
</s> add # This comment is used to simplify checking local copies of the script.
# Bump this number every time a significant change is made to this
# script.
#
# AdGuard-Project-Version: 1
# Only show interactive prompts if there a terminal is attached to
# stdout. While this technically doesn't guarantee that reading from
# /dev/tty works, this should work reasonably well on all of our
# supported development systems and in most terminal emulators. </s> remove # Don't name this macro "GO", because GNU Make apparenly makes it an
# exported environment variable with the literal value of "${GO:-go}",
# which is not what we need. Use a dot in the name to make sure that
# users don't have an environment variable with the same name.
#
# See https://unix.stackexchange.com/q/646255/105635.
GO.MACRO = $${GO:-go}
</s> add </s> remove # Keep this target first, so that a naked make invocation triggers
# a full build.
</s> add # Keep this target first, so that a naked make invocation triggers a
# full build. </s> remove VERBOSE='$(VERBOSE)'\
</s> add VERBOSE="$(VERBOSE.MACRO)"\ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ff9b24ad6912e894d2992c07e7d017bc269e8bd5 | scripts/hooks/pre-commit |
BaseDir: t.TempDir(), | <mask> Enabled: true,
<mask> FileEnabled: true,
<mask> Interval: 1,
<mask> MemSize: 100,
<mask> BaseDir: aghtest.PrepareTestDir(t),
<mask> })
<mask>
<mask> // Add disk entries.
<mask> addEntry(l, "example.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1))
<mask> // Write to disk (first file).
</s> Pull request: all: fix windows tempdir
Merge in DNS/adguard-home from try-fixing-windows-tests to master
Squashed commit of the following:
commit 25a43db5d53f24b98921efa21d8d2f231992e761
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Mar 26 21:19:00 2021 +0300
all: fix windows tempdir </s> remove BaseDir: aghtest.PrepareTestDir(t),
</s> add BaseDir: t.TempDir(), </s> remove BaseDir: aghtest.PrepareTestDir(t),
</s> add BaseDir: t.TempDir(), </s> remove BaseDir: aghtest.PrepareTestDir(t),
</s> add BaseDir: t.TempDir(), </s> remove lineTime, _ := time.Parse(time.RFC3339Nano, "2020-02-18T22:36:35.920973+03:00")
lineIP := uint32(0)
</s> add var lineIP uint32
lineTime := time.Date(2020, 2, 18, 19, 36, 35, 920973000, time.UTC)
for i := 0; i < linesNum; i++ {
lineIP++
lineTime = lineTime.Add(time.Second) </s> remove testFile := prepareTestFile(t, linesNum)
</s> add testFile := prepareTestFiles(t, 1, linesNum)[0] | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca | internal/querylog/qlog_test.go |
BaseDir: t.TempDir(), | <mask> l := newQueryLog(Config{
<mask> Enabled: true,
<mask> Interval: 1,
<mask> MemSize: 100,
<mask> BaseDir: aghtest.PrepareTestDir(t),
<mask> })
<mask>
<mask> const (
<mask> entNum = 10
<mask> firstPageDomain = "first.example.org"
</s> Pull request: all: fix windows tempdir
Merge in DNS/adguard-home from try-fixing-windows-tests to master
Squashed commit of the following:
commit 25a43db5d53f24b98921efa21d8d2f231992e761
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Mar 26 21:19:00 2021 +0300
all: fix windows tempdir </s> remove BaseDir: aghtest.PrepareTestDir(t),
</s> add BaseDir: t.TempDir(), </s> remove BaseDir: aghtest.PrepareTestDir(t),
</s> add BaseDir: t.TempDir(), </s> remove BaseDir: aghtest.PrepareTestDir(t),
</s> add BaseDir: t.TempDir(), </s> remove const strV = "\"%s\""
const nl = "\n"
const format = `{"IP":` + strV + `,"T":` + strV + `,` +
`"QH":"example.org","QT":"A","QC":"IN",` +
`"Answer":"AAAAAAABAAEAAAAAB2V4YW1wbGUDb3JnAAABAAEHZXhhbXBsZQNvcmcAAAEAAQAAAAAABAECAwQ=",` +
`"Result":{},"Elapsed":0,"Upstream":"upstream"}` + nl
</s> add const ans = `"AAAAAAABAAEAAAAAB2V4YW1wbGUDb3JnAAABAAEHZXhhbXBsZQNvcmcAAAEAAQAAAAAABAECAwQ="`
const format = `{"IP":%q,"T":%q,"QH":"example.org","QT":"A","QC":"IN",` +
`"Answer":` + ans + `,"Result":{},"Elapsed":0,"Upstream":"upstream"}` + "\n" </s> remove if filesNum == 0 {
return []string{}
}
</s> add f, err := ioutil.TempFile(dir, "*.txt")
require.NoError(t, err)
// Use defer and not t.Cleanup to make sure that the file is closed
// after this function is done.
defer func() {
derr := f.Close()
require.NoError(t, derr)
}() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca | internal/querylog/qlog_test.go |
BaseDir: t.TempDir(), | <mask> Enabled: true,
<mask> FileEnabled: true,
<mask> Interval: 1,
<mask> MemSize: 100,
<mask> BaseDir: aghtest.PrepareTestDir(t),
<mask> })
<mask>
<mask> const entNum = 10
<mask> // Add entries to the log.
<mask> for i := 0; i < entNum; i++ {
</s> Pull request: all: fix windows tempdir
Merge in DNS/adguard-home from try-fixing-windows-tests to master
Squashed commit of the following:
commit 25a43db5d53f24b98921efa21d8d2f231992e761
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Mar 26 21:19:00 2021 +0300
all: fix windows tempdir </s> remove BaseDir: aghtest.PrepareTestDir(t),
</s> add BaseDir: t.TempDir(), </s> remove BaseDir: aghtest.PrepareTestDir(t),
</s> add BaseDir: t.TempDir(), </s> remove BaseDir: aghtest.PrepareTestDir(t),
</s> add BaseDir: t.TempDir(), </s> remove ip := make(net.IP, 4)
binary.BigEndian.PutUint32(ip, lineIP)
</s> add return f.Name()
} </s> remove files := make([]string, filesNum)
for j := range files {
f, err := ioutil.TempFile(dir, "*.txt")
require.Nil(t, err)
files[filesNum-j-1] = f.Name()
</s> add line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca | internal/querylog/qlog_test.go |
BaseDir: t.TempDir(), | <mask> Enabled: true,
<mask> FileEnabled: false,
<mask> Interval: 1,
<mask> MemSize: 2,
<mask> BaseDir: aghtest.PrepareTestDir(t),
<mask> })
<mask>
<mask> addEntry(l, "example1.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1))
<mask> addEntry(l, "example2.org", net.IPv4(1, 1, 1, 1), net.IPv4(2, 2, 2, 1))
<mask> // The oldest entry is going to be removed from memory buffer.
</s> Pull request: all: fix windows tempdir
Merge in DNS/adguard-home from try-fixing-windows-tests to master
Squashed commit of the following:
commit 25a43db5d53f24b98921efa21d8d2f231992e761
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Mar 26 21:19:00 2021 +0300
all: fix windows tempdir </s> remove BaseDir: aghtest.PrepareTestDir(t),
</s> add BaseDir: t.TempDir(), </s> remove BaseDir: aghtest.PrepareTestDir(t),
</s> add BaseDir: t.TempDir(), </s> remove BaseDir: aghtest.PrepareTestDir(t),
</s> add BaseDir: t.TempDir(), </s> remove lineTime, _ := time.Parse(time.RFC3339Nano, "2020-02-18T22:36:35.920973+03:00")
lineIP := uint32(0)
</s> add var lineIP uint32
lineTime := time.Date(2020, 2, 18, 19, 36, 35, 920973000, time.UTC)
for i := 0; i < linesNum; i++ {
lineIP++
lineTime = lineTime.Add(time.Second) </s> remove testFile := prepareTestFile(t, linesNum)
</s> add testFile := prepareTestFiles(t, 1, linesNum)[0] | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca | internal/querylog/qlog_test.go |
<mask> "strings"
<mask> "testing"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
<mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> )
<mask>
<mask> // prepareTestFiles prepares several test query log files, each with the
</s> Pull request: all: fix windows tempdir
Merge in DNS/adguard-home from try-fixing-windows-tests to master
Squashed commit of the following:
commit 25a43db5d53f24b98921efa21d8d2f231992e761
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Mar 26 21:19:00 2021 +0300
all: fix windows tempdir </s> remove // prepareTestFiles prepares several test query log files, each with the
// specified lines count.
func prepareTestFiles(t *testing.T, filesNum, linesNum int) []string {
</s> add // prepareTestFile prepares one test query log file with the specified lines
// count.
func prepareTestFile(t *testing.T, dir string, linesNum int) (name string) { </s> remove line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano))
</s> add // prepareTestFiles prepares several test query log files, each with the
// specified lines count.
func prepareTestFiles(t *testing.T, filesNum, linesNum int) []string {
t.Helper() </s> remove return files
}
</s> add dir := t.TempDir() </s> remove // prepareTestFile prepares a test query log file with the specified number of
// lines.
func prepareTestFile(t *testing.T, linesCount int) string {
t.Helper()
</s> add files := make([]string, filesNum)
for i := range files {
files[filesNum-i-1] = prepareTestFile(t, dir, linesNum)
} </s> remove testFile := prepareTestFile(t, linesNum)
</s> add testFile := prepareTestFiles(t, 1, linesNum)[0] | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca | internal/querylog/qlogfile_test.go | |
// prepareTestFile prepares one test query log file with the specified lines
// count.
func prepareTestFile(t *testing.T, dir string, linesNum int) (name string) { | <mask> "github.com/stretchr/testify/assert"
<mask> "github.com/stretchr/testify/require"
<mask> )
<mask>
<mask> // prepareTestFiles prepares several test query log files, each with the
<mask> // specified lines count.
<mask> func prepareTestFiles(t *testing.T, filesNum, linesNum int) []string {
<mask> t.Helper()
<mask>
<mask> if filesNum == 0 {
<mask> return []string{}
<mask> }
</s> Pull request: all: fix windows tempdir
Merge in DNS/adguard-home from try-fixing-windows-tests to master
Squashed commit of the following:
commit 25a43db5d53f24b98921efa21d8d2f231992e761
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Mar 26 21:19:00 2021 +0300
all: fix windows tempdir </s> remove line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano))
</s> add // prepareTestFiles prepares several test query log files, each with the
// specified lines count.
func prepareTestFiles(t *testing.T, filesNum, linesNum int) []string {
t.Helper() </s> remove "github.com/AdguardTeam/AdGuardHome/internal/aghtest"
</s> add </s> remove if filesNum == 0 {
return []string{}
}
</s> add f, err := ioutil.TempFile(dir, "*.txt")
require.NoError(t, err)
// Use defer and not t.Cleanup to make sure that the file is closed
// after this function is done.
defer func() {
derr := f.Close()
require.NoError(t, derr)
}() </s> remove return files
}
</s> add dir := t.TempDir() </s> remove _, err = f.WriteString(line)
require.Nil(t, err)
}
</s> add if filesNum == 0 {
return []string{} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca | internal/querylog/qlogfile_test.go |
f, err := ioutil.TempFile(dir, "*.txt")
require.NoError(t, err)
// Use defer and not t.Cleanup to make sure that the file is closed
// after this function is done.
defer func() {
derr := f.Close()
require.NoError(t, derr)
}() | <mask> // specified lines count.
<mask> func prepareTestFiles(t *testing.T, filesNum, linesNum int) []string {
<mask> t.Helper()
<mask>
<mask> if filesNum == 0 {
<mask> return []string{}
<mask> }
<mask>
<mask> const strV = "\"%s\""
<mask> const nl = "\n"
<mask> const format = `{"IP":` + strV + `,"T":` + strV + `,` +
<mask> `"QH":"example.org","QT":"A","QC":"IN",` +
</s> Pull request: all: fix windows tempdir
Merge in DNS/adguard-home from try-fixing-windows-tests to master
Squashed commit of the following:
commit 25a43db5d53f24b98921efa21d8d2f231992e761
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Mar 26 21:19:00 2021 +0300
all: fix windows tempdir </s> remove const strV = "\"%s\""
const nl = "\n"
const format = `{"IP":` + strV + `,"T":` + strV + `,` +
`"QH":"example.org","QT":"A","QC":"IN",` +
`"Answer":"AAAAAAABAAEAAAAAB2V4YW1wbGUDb3JnAAABAAEHZXhhbXBsZQNvcmcAAAEAAQAAAAAABAECAwQ=",` +
`"Result":{},"Elapsed":0,"Upstream":"upstream"}` + nl
</s> add const ans = `"AAAAAAABAAEAAAAAB2V4YW1wbGUDb3JnAAABAAEHZXhhbXBsZQNvcmcAAAEAAQAAAAAABAECAwQ="`
const format = `{"IP":%q,"T":%q,"QH":"example.org","QT":"A","QC":"IN",` +
`"Answer":` + ans + `,"Result":{},"Elapsed":0,"Upstream":"upstream"}` + "\n" </s> remove // prepareTestFiles prepares several test query log files, each with the
// specified lines count.
func prepareTestFiles(t *testing.T, filesNum, linesNum int) []string {
</s> add // prepareTestFile prepares one test query log file with the specified lines
// count.
func prepareTestFile(t *testing.T, dir string, linesNum int) (name string) { </s> remove lineTime, _ := time.Parse(time.RFC3339Nano, "2020-02-18T22:36:35.920973+03:00")
lineIP := uint32(0)
</s> add var lineIP uint32
lineTime := time.Date(2020, 2, 18, 19, 36, 35, 920973000, time.UTC)
for i := 0; i < linesNum; i++ {
lineIP++
lineTime = lineTime.Add(time.Second) </s> remove line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano))
</s> add // prepareTestFiles prepares several test query log files, each with the
// specified lines count.
func prepareTestFiles(t *testing.T, filesNum, linesNum int) []string {
t.Helper() </s> remove _, err = f.WriteString(line)
require.Nil(t, err)
}
</s> add if filesNum == 0 {
return []string{} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca | internal/querylog/qlogfile_test.go |
const ans = `"AAAAAAABAAEAAAAAB2V4YW1wbGUDb3JnAAABAAEHZXhhbXBsZQNvcmcAAAEAAQAAAAAABAECAwQ="`
const format = `{"IP":%q,"T":%q,"QH":"example.org","QT":"A","QC":"IN",` +
`"Answer":` + ans + `,"Result":{},"Elapsed":0,"Upstream":"upstream"}` + "\n" | <mask> if filesNum == 0 {
<mask> return []string{}
<mask> }
<mask>
<mask> const strV = "\"%s\""
<mask> const nl = "\n"
<mask> const format = `{"IP":` + strV + `,"T":` + strV + `,` +
<mask> `"QH":"example.org","QT":"A","QC":"IN",` +
<mask> `"Answer":"AAAAAAABAAEAAAAAB2V4YW1wbGUDb3JnAAABAAEHZXhhbXBsZQNvcmcAAAEAAQAAAAAABAECAwQ=",` +
<mask> `"Result":{},"Elapsed":0,"Upstream":"upstream"}` + nl
<mask>
<mask> lineTime, _ := time.Parse(time.RFC3339Nano, "2020-02-18T22:36:35.920973+03:00")
<mask> lineIP := uint32(0)
<mask>
<mask> dir := aghtest.PrepareTestDir(t)
</s> Pull request: all: fix windows tempdir
Merge in DNS/adguard-home from try-fixing-windows-tests to master
Squashed commit of the following:
commit 25a43db5d53f24b98921efa21d8d2f231992e761
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Mar 26 21:19:00 2021 +0300
all: fix windows tempdir </s> remove if filesNum == 0 {
return []string{}
}
</s> add f, err := ioutil.TempFile(dir, "*.txt")
require.NoError(t, err)
// Use defer and not t.Cleanup to make sure that the file is closed
// after this function is done.
defer func() {
derr := f.Close()
require.NoError(t, derr)
}() </s> remove lineTime, _ := time.Parse(time.RFC3339Nano, "2020-02-18T22:36:35.920973+03:00")
lineIP := uint32(0)
</s> add var lineIP uint32
lineTime := time.Date(2020, 2, 18, 19, 36, 35, 920973000, time.UTC)
for i := 0; i < linesNum; i++ {
lineIP++
lineTime = lineTime.Add(time.Second) </s> remove dir := aghtest.PrepareTestDir(t)
</s> add ip := make(net.IP, 4)
binary.BigEndian.PutUint32(ip, lineIP) </s> remove _, err = f.WriteString(line)
require.Nil(t, err)
}
</s> add if filesNum == 0 {
return []string{} </s> remove files := make([]string, filesNum)
for j := range files {
f, err := ioutil.TempFile(dir, "*.txt")
require.Nil(t, err)
files[filesNum-j-1] = f.Name()
</s> add line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca | internal/querylog/qlogfile_test.go |
var lineIP uint32
lineTime := time.Date(2020, 2, 18, 19, 36, 35, 920973000, time.UTC)
for i := 0; i < linesNum; i++ {
lineIP++
lineTime = lineTime.Add(time.Second) | <mask> `"QH":"example.org","QT":"A","QC":"IN",` +
<mask> `"Answer":"AAAAAAABAAEAAAAAB2V4YW1wbGUDb3JnAAABAAEHZXhhbXBsZQNvcmcAAAEAAQAAAAAABAECAwQ=",` +
<mask> `"Result":{},"Elapsed":0,"Upstream":"upstream"}` + nl
<mask>
<mask> lineTime, _ := time.Parse(time.RFC3339Nano, "2020-02-18T22:36:35.920973+03:00")
<mask> lineIP := uint32(0)
<mask>
<mask> dir := aghtest.PrepareTestDir(t)
<mask>
<mask> files := make([]string, filesNum)
<mask> for j := range files {
</s> Pull request: all: fix windows tempdir
Merge in DNS/adguard-home from try-fixing-windows-tests to master
Squashed commit of the following:
commit 25a43db5d53f24b98921efa21d8d2f231992e761
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Mar 26 21:19:00 2021 +0300
all: fix windows tempdir </s> remove const strV = "\"%s\""
const nl = "\n"
const format = `{"IP":` + strV + `,"T":` + strV + `,` +
`"QH":"example.org","QT":"A","QC":"IN",` +
`"Answer":"AAAAAAABAAEAAAAAB2V4YW1wbGUDb3JnAAABAAEHZXhhbXBsZQNvcmcAAAEAAQAAAAAABAECAwQ=",` +
`"Result":{},"Elapsed":0,"Upstream":"upstream"}` + nl
</s> add const ans = `"AAAAAAABAAEAAAAAB2V4YW1wbGUDb3JnAAABAAEHZXhhbXBsZQNvcmcAAAEAAQAAAAAABAECAwQ="`
const format = `{"IP":%q,"T":%q,"QH":"example.org","QT":"A","QC":"IN",` +
`"Answer":` + ans + `,"Result":{},"Elapsed":0,"Upstream":"upstream"}` + "\n" </s> remove dir := aghtest.PrepareTestDir(t)
</s> add ip := make(net.IP, 4)
binary.BigEndian.PutUint32(ip, lineIP) </s> remove files := make([]string, filesNum)
for j := range files {
f, err := ioutil.TempFile(dir, "*.txt")
require.Nil(t, err)
files[filesNum-j-1] = f.Name()
</s> add line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) </s> remove if filesNum == 0 {
return []string{}
}
</s> add f, err := ioutil.TempFile(dir, "*.txt")
require.NoError(t, err)
// Use defer and not t.Cleanup to make sure that the file is closed
// after this function is done.
defer func() {
derr := f.Close()
require.NoError(t, derr)
}() </s> remove // prepareTestFile prepares a test query log file with the specified number of
// lines.
func prepareTestFile(t *testing.T, linesCount int) string {
t.Helper()
</s> add files := make([]string, filesNum)
for i := range files {
files[filesNum-i-1] = prepareTestFile(t, dir, linesNum)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca | internal/querylog/qlogfile_test.go |
ip := make(net.IP, 4)
binary.BigEndian.PutUint32(ip, lineIP) | <mask>
<mask> lineTime, _ := time.Parse(time.RFC3339Nano, "2020-02-18T22:36:35.920973+03:00")
<mask> lineIP := uint32(0)
<mask>
<mask> dir := aghtest.PrepareTestDir(t)
<mask>
<mask> files := make([]string, filesNum)
<mask> for j := range files {
<mask> f, err := ioutil.TempFile(dir, "*.txt")
<mask> require.Nil(t, err)
</s> Pull request: all: fix windows tempdir
Merge in DNS/adguard-home from try-fixing-windows-tests to master
Squashed commit of the following:
commit 25a43db5d53f24b98921efa21d8d2f231992e761
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Mar 26 21:19:00 2021 +0300
all: fix windows tempdir </s> remove lineTime, _ := time.Parse(time.RFC3339Nano, "2020-02-18T22:36:35.920973+03:00")
lineIP := uint32(0)
</s> add var lineIP uint32
lineTime := time.Date(2020, 2, 18, 19, 36, 35, 920973000, time.UTC)
for i := 0; i < linesNum; i++ {
lineIP++
lineTime = lineTime.Add(time.Second) </s> remove files := make([]string, filesNum)
for j := range files {
f, err := ioutil.TempFile(dir, "*.txt")
require.Nil(t, err)
files[filesNum-j-1] = f.Name()
</s> add line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) </s> remove const strV = "\"%s\""
const nl = "\n"
const format = `{"IP":` + strV + `,"T":` + strV + `,` +
`"QH":"example.org","QT":"A","QC":"IN",` +
`"Answer":"AAAAAAABAAEAAAAAB2V4YW1wbGUDb3JnAAABAAEHZXhhbXBsZQNvcmcAAAEAAQAAAAAABAECAwQ=",` +
`"Result":{},"Elapsed":0,"Upstream":"upstream"}` + nl
</s> add const ans = `"AAAAAAABAAEAAAAAB2V4YW1wbGUDb3JnAAABAAEHZXhhbXBsZQNvcmcAAAEAAQAAAAAABAECAwQ="`
const format = `{"IP":%q,"T":%q,"QH":"example.org","QT":"A","QC":"IN",` +
`"Answer":` + ans + `,"Result":{},"Elapsed":0,"Upstream":"upstream"}` + "\n" </s> remove dir := aghtest.PrepareTestDir(t)
</s> add dir := t.TempDir() </s> remove for i := 0; i < linesNum; i++ {
lineIP++
lineTime = lineTime.Add(time.Second)
</s> add _, err = f.WriteString(line)
require.NoError(t, err)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca | internal/querylog/qlogfile_test.go |
line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) | <mask> lineIP := uint32(0)
<mask>
<mask> dir := aghtest.PrepareTestDir(t)
<mask>
<mask> files := make([]string, filesNum)
<mask> for j := range files {
<mask> f, err := ioutil.TempFile(dir, "*.txt")
<mask> require.Nil(t, err)
<mask> files[filesNum-j-1] = f.Name()
<mask>
<mask> for i := 0; i < linesNum; i++ {
<mask> lineIP++
<mask> lineTime = lineTime.Add(time.Second)
<mask>
</s> Pull request: all: fix windows tempdir
Merge in DNS/adguard-home from try-fixing-windows-tests to master
Squashed commit of the following:
commit 25a43db5d53f24b98921efa21d8d2f231992e761
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Mar 26 21:19:00 2021 +0300
all: fix windows tempdir </s> remove lineTime, _ := time.Parse(time.RFC3339Nano, "2020-02-18T22:36:35.920973+03:00")
lineIP := uint32(0)
</s> add var lineIP uint32
lineTime := time.Date(2020, 2, 18, 19, 36, 35, 920973000, time.UTC)
for i := 0; i < linesNum; i++ {
lineIP++
lineTime = lineTime.Add(time.Second) </s> remove for i := 0; i < linesNum; i++ {
lineIP++
lineTime = lineTime.Add(time.Second)
</s> add _, err = f.WriteString(line)
require.NoError(t, err)
} </s> remove dir := aghtest.PrepareTestDir(t)
</s> add ip := make(net.IP, 4)
binary.BigEndian.PutUint32(ip, lineIP) </s> remove ip := make(net.IP, 4)
binary.BigEndian.PutUint32(ip, lineIP)
</s> add return f.Name()
} </s> remove // prepareTestFile prepares a test query log file with the specified number of
// lines.
func prepareTestFile(t *testing.T, linesCount int) string {
t.Helper()
</s> add files := make([]string, filesNum)
for i := range files {
files[filesNum-i-1] = prepareTestFile(t, dir, linesNum)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca | internal/querylog/qlogfile_test.go |
_, err = f.WriteString(line)
require.NoError(t, err)
} | <mask> f, err := ioutil.TempFile(dir, "*.txt")
<mask> require.Nil(t, err)
<mask> files[filesNum-j-1] = f.Name()
<mask>
<mask> for i := 0; i < linesNum; i++ {
<mask> lineIP++
<mask> lineTime = lineTime.Add(time.Second)
<mask>
<mask> ip := make(net.IP, 4)
<mask> binary.BigEndian.PutUint32(ip, lineIP)
<mask>
<mask> line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano))
</s> Pull request: all: fix windows tempdir
Merge in DNS/adguard-home from try-fixing-windows-tests to master
Squashed commit of the following:
commit 25a43db5d53f24b98921efa21d8d2f231992e761
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date: Fri Mar 26 21:19:00 2021 +0300
all: fix windows tempdir </s> remove ip := make(net.IP, 4)
binary.BigEndian.PutUint32(ip, lineIP)
</s> add return f.Name()
} </s> remove files := make([]string, filesNum)
for j := range files {
f, err := ioutil.TempFile(dir, "*.txt")
require.Nil(t, err)
files[filesNum-j-1] = f.Name()
</s> add line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano)) </s> remove dir := aghtest.PrepareTestDir(t)
</s> add ip := make(net.IP, 4)
binary.BigEndian.PutUint32(ip, lineIP) </s> remove lineTime, _ := time.Parse(time.RFC3339Nano, "2020-02-18T22:36:35.920973+03:00")
lineIP := uint32(0)
</s> add var lineIP uint32
lineTime := time.Date(2020, 2, 18, 19, 36, 35, 920973000, time.UTC)
for i := 0; i < linesNum; i++ {
lineIP++
lineTime = lineTime.Add(time.Second) </s> remove line := fmt.Sprintf(format, ip, lineTime.Format(time.RFC3339Nano))
</s> add // prepareTestFiles prepares several test query log files, each with the
// specified lines count.
func prepareTestFiles(t *testing.T, filesNum, linesNum int) []string {
t.Helper() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/ffb503976ba92a723579866fd37ec1a1169417ca | internal/querylog/qlogfile_test.go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.