code_before
stringlengths 16
1.81M
| edits
stringlengths 4
328k
| next_edit
stringlengths 0
76.5k
| code_after
stringlengths 3
49.9M
| label_window
sequencelengths 4
1.81k
| instruction
stringlengths 20
51.9k
| html_url
stringlengths 74
116
| file_name
stringlengths 3
311
|
---|---|---|---|---|---|---|---|
d.checkMatchEmpty(t, "yandex.ru")
d.parentalServer = defaultParentalServer
}
// FILTERING
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
var tests = []struct {
testname string
rules string
hostname string
isFiltered bool
reason Reason
dnsType uint16
}{
{"sanity", "||doubleclick.net^", "www.doubleclick.net", true, FilteredBlockList, dns.TypeA},
{"sanity", "||doubleclick.net^", "nodoubleclick.net", false, NotFilteredNotFound, dns.TypeA},
{"sanity", "||doubleclick.net^", "doubleclick.net.ru", false, NotFilteredNotFound, dns.TypeA},
{"sanity", "||doubleclick.net^", "wmconvirus.narod.ru", false, NotFilteredNotFound, dns.TypeA},
{"blocking", blockingRules, "example.org", true, FilteredBlockList, dns.TypeA},
{"blocking", blockingRules, "test.example.org", true, FilteredBlockList, dns.TypeA},
{"blocking", blockingRules, "test.test.example.org", true, FilteredBlockList, dns.TypeA},
{"blocking", blockingRules, "testexample.org", false, NotFilteredNotFound, dns.TypeA},
{"blocking", blockingRules, "onemoreexample.org", false, NotFilteredNotFound, dns.TypeA},
{"allowlist", allowlistRules, "example.org", true, FilteredBlockList, dns.TypeA},
{"allowlist", allowlistRules, "test.example.org", false, NotFilteredAllowList, dns.TypeA},
{"allowlist", allowlistRules, "test.test.example.org", false, NotFilteredAllowList, dns.TypeA},
{"allowlist", allowlistRules, "testexample.org", false, NotFilteredNotFound, dns.TypeA},
{"allowlist", allowlistRules, "onemoreexample.org", false, NotFilteredNotFound, dns.TypeA},
{"important", importantRules, "example.org", false, NotFilteredAllowList, dns.TypeA},
{"important", importantRules, "test.example.org", true, FilteredBlockList, dns.TypeA},
{"important", importantRules, "test.test.example.org", true, FilteredBlockList, dns.TypeA},
{"important", importantRules, "testexample.org", false, NotFilteredNotFound, dns.TypeA},
{"important", importantRules, "onemoreexample.org", false, NotFilteredNotFound, dns.TypeA},
{"regex", regexRules, "example.org", true, FilteredBlockList, dns.TypeA},
{"regex", regexRules, "test.example.org", false, NotFilteredAllowList, dns.TypeA},
{"regex", regexRules, "test.test.example.org", false, NotFilteredAllowList, dns.TypeA},
{"regex", regexRules, "testexample.org", true, FilteredBlockList, dns.TypeA},
{"regex", regexRules, "onemoreexample.org", true, FilteredBlockList, dns.TypeA},
{"mask", maskRules, "test.example.org", true, FilteredBlockList, dns.TypeA},
{"mask", maskRules, "test2.example.org", true, FilteredBlockList, dns.TypeA},
{"mask", maskRules, "example.com", true, FilteredBlockList, dns.TypeA},
{"mask", maskRules, "exampleeee.com", true, FilteredBlockList, dns.TypeA},
{"mask", maskRules, "onemoreexamsite.com", true, FilteredBlockList, dns.TypeA},
{"mask", maskRules, "example.org", false, NotFilteredNotFound, dns.TypeA},
{"mask", maskRules, "testexample.org", false, NotFilteredNotFound, dns.TypeA},
{"mask", maskRules, "example.co.uk", false, NotFilteredNotFound, dns.TypeA},
{"dnstype", dnstypeRules, "onemoreexample.org", false, NotFilteredNotFound, dns.TypeA},
{"dnstype", dnstypeRules, "example.org", false, NotFilteredNotFound, dns.TypeA},
{"dnstype", dnstypeRules, "example.org", true, FilteredBlockList, dns.TypeAAAA},
{"dnstype", dnstypeRules, "test.example.org", false, NotFilteredAllowList, dns.TypeA},
{"dnstype", dnstypeRules, "test.example.org", false, NotFilteredAllowList, dns.TypeAAAA},
}
func TestMatching(t *testing.T) {
for _, test := range tests {
t.Run(fmt.Sprintf("%s-%s", test.testname, test.hostname), func(t *testing.T) {
filters := []Filter{{
| </s> remove for _, test := range tests {
t.Run(fmt.Sprintf("%s-%s", test.testname, test.hostname), func(t *testing.T) {
filters := []Filter{{
ID: 0, Data: []byte(test.rules),
}}
d := NewForTest(nil, filters)
defer d.Close()
res, err := d.CheckHost(test.hostname, test.dnsType, &setts)
if err != nil {
t.Errorf("Error while matching host %s: %s", test.hostname, err)
}
if res.IsFiltered != test.isFiltered {
t.Errorf("Hostname %s has wrong result (%v must be %v)", test.hostname, res.IsFiltered, test.isFiltered)
}
if res.Reason != test.reason {
t.Errorf("Hostname %s has wrong reason (%v must be %v)", test.hostname, res.Reason.String(), test.reason.String())
}
</s> add const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason) </s> remove var r Result
filters := []Filter{{
ID: 0, Data: []byte("||example.org^\n"),
</s> add d := newForTest(
&Config{
ParentalEnabled: true,
SafeBrowsingEnabled: false,
},
[]Filter{{
ID: 0, Data: []byte("||example.org^\n"),
}},
)
t.Cleanup(d.Close)
d.parentalUpstream = &testSbUpstream{
hostname: "pornhub.com",
block: true,
}
d.safeBrowsingUpstream = &testSbUpstream{
hostname: "wmconvirus.narod.ru",
block: true,
}
type testCase struct {
name string
host string
before bool
wantReason Reason
}
testCases := []testCase{{
name: "filters",
host: "example.org",
before: true,
wantReason: FilteredBlockList,
}, {
name: "parental",
host: "pornhub.com",
before: true,
wantReason: FilteredParental,
}, {
name: "safebrowsing",
host: "wmconvirus.narod.ru",
before: false,
wantReason: FilteredSafeBrowsing,
}, {
name: "additional_rules",
host: "facebook.com",
before: false,
wantReason: FilteredBlockedService, </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) | // Filtering. | d.checkMatchEmpty(t, "yandex.ru")
d.parentalServer = defaultParentalServer
}
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
// Filtering.
func TestMatching(t *testing.T) {
for _, test := range tests {
t.Run(fmt.Sprintf("%s-%s", test.testname, test.hostname), func(t *testing.T) {
filters := []Filter{{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
{"dnstype", dnstypeRules, "test.example.org", false, NotFilteredAllowList, dns.TypeAAAA},
}
func TestMatching(t *testing.T) {
for _, test := range tests {
t.Run(fmt.Sprintf("%s-%s", test.testname, test.hostname), func(t *testing.T) {
filters := []Filter{{
ID: 0, Data: []byte(test.rules),
}}
d := NewForTest(nil, filters)
defer d.Close()
res, err := d.CheckHost(test.hostname, test.dnsType, &setts)
if err != nil {
t.Errorf("Error while matching host %s: %s", test.hostname, err)
}
if res.IsFiltered != test.isFiltered {
t.Errorf("Hostname %s has wrong result (%v must be %v)", test.hostname, res.IsFiltered, test.isFiltered)
}
if res.Reason != test.reason {
t.Errorf("Hostname %s has wrong reason (%v must be %v)", test.hostname, res.Reason.String(), test.reason.String())
}
})
}
}
func TestWhitelist(t *testing.T) {
| </s> remove if err != nil {
t.Errorf("Error while matching host %s: %s", hostname, err)
}
if res.IsFiltered {
t.Errorf("Expected hostname %s to not match", hostname)
}
</s> add assert.Nilf(t, err, "Error while matching host %s: %s", hostname, err)
assert.Falsef(t, res.IsFiltered, "Expected hostname %s to not match", hostname) </s> remove hostname := "wmconvirus.narod.ru"
res, err := d.CheckHost(hostname, dns.TypeA, &setts)
if err != nil {
b.Errorf("Error while matching host %s: %s", hostname, err)
}
if !res.IsFiltered {
b.Errorf("Expected hostname %s to match", hostname)
}
</s> add res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked) </s> remove hostname := "wmconvirus.narod.ru"
res, err := d.CheckHost(hostname, dns.TypeA, &setts)
if err != nil {
b.Errorf("Error while matching host %s: %s", hostname, err)
}
if !res.IsFiltered {
b.Errorf("Expected hostname %s to match", hostname)
}
</s> add res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked) </s> remove if err != nil {
t.Errorf("Error while matching host %s: %s", hostname, err)
}
if !res.IsFiltered {
t.Errorf("Expected hostname %s to match", hostname)
}
</s> add assert.Nilf(t, err, "Error while matching host %s: %s", hostname, err)
assert.Truef(t, res.IsFiltered, "Expected hostname %s to match", hostname) </s> remove if err != nil {
t.Errorf("Error while matching host %s: %s", hostname, err)
}
if !res.IsFiltered {
t.Errorf("Expected hostname %s to match", hostname)
}
if len(res.Rules) == 0 {
t.Errorf("Expected result to have rules")
return
}
r := res.Rules[0]
if r.IP == nil || r.IP.String() != ip {
t.Errorf("Expected ip %s to match, actual: %v", ip, r.IP)
</s> add assert.Nilf(t, err, "Error while matching host %s: %s", hostname, err)
assert.Truef(t, res.IsFiltered, "Expected hostname %s to match", hostname)
if assert.NotEmpty(t, res.Rules, "Expected result to have rules") {
r := res.Rules[0]
assert.NotNilf(t, r.IP, "Expected ip %s to match, actual: %v", ip, r.IP)
assert.Equalf(t, ip, r.IP.String(), "Expected ip %s to match, actual: %v", ip, r.IP) | const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason) | {"dnstype", dnstypeRules, "test.example.org", false, NotFilteredAllowList, dns.TypeAAAA},
}
func TestMatching(t *testing.T) {
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason)
})
}
}
func TestWhitelist(t *testing.T) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
`
whiteFilters := []Filter{{
ID: 0, Data: []byte(whiteRules),
}}
d := NewForTest(nil, filters)
d.SetFilters(filters, whiteFilters, false)
defer d.Close()
// matched by white filter
res, err := d.CheckHost("host1", dns.TypeA, &setts)
| </s> remove defer d.Close()
</s> add t.Cleanup(d.Close) </s> remove // matched by white filter
</s> add // Matched by white filter. </s> remove d := NewForTest(nil, filters)
defer d.Close()
</s> add d := newForTest(nil, filters)
t.Cleanup(d.Close) </s> remove d := NewForTest(&Config{ParentalEnabled: true, SafeBrowsingEnabled: false}, filters)
defer d.Close()
// no client settings:
// blocked by filters
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredBlockList {
t.Fatalf("CheckHost FilteredBlockList")
}
</s> add </s> remove // not matched by white filter, but matched by block filter
</s> add // Not matched by white filter, but matched by block filter. | d := newForTest(nil, filters) | `
whiteFilters := []Filter{{
ID: 0, Data: []byte(whiteRules),
}}
d := newForTest(nil, filters)
d.SetFilters(filters, whiteFilters, false)
defer d.Close()
// matched by white filter
res, err := d.CheckHost("host1", dns.TypeA, &setts) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
ID: 0, Data: []byte(whiteRules),
}}
d := NewForTest(nil, filters)
d.SetFilters(filters, whiteFilters, false)
defer d.Close()
// matched by white filter
res, err := d.CheckHost("host1", dns.TypeA, &setts)
assert.Nil(t, err)
assert.False(t, res.IsFiltered)
| </s> remove d := NewForTest(nil, filters)
</s> add d := newForTest(nil, filters) </s> remove // matched by white filter
</s> add // Matched by white filter. </s> remove // not matched by white filter, but matched by block filter
</s> add // Not matched by white filter, but matched by block filter. </s> remove d := NewForTest(nil, filters)
defer d.Close()
</s> add d := newForTest(nil, filters)
t.Cleanup(d.Close) </s> remove d := NewForTest(&Config{ParentalEnabled: true, SafeBrowsingEnabled: false}, filters)
defer d.Close()
// no client settings:
// blocked by filters
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredBlockList {
t.Fatalf("CheckHost FilteredBlockList")
}
</s> add | t.Cleanup(d.Close) | ID: 0, Data: []byte(whiteRules),
}}
d := NewForTest(nil, filters)
d.SetFilters(filters, whiteFilters, false)
t.Cleanup(d.Close)
// matched by white filter
res, err := d.CheckHost("host1", dns.TypeA, &setts)
assert.Nil(t, err)
assert.False(t, res.IsFiltered) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
d := NewForTest(nil, filters)
d.SetFilters(filters, whiteFilters, false)
defer d.Close()
// matched by white filter
res, err := d.CheckHost("host1", dns.TypeA, &setts)
assert.Nil(t, err)
assert.False(t, res.IsFiltered)
assert.Equal(t, res.Reason, NotFilteredAllowList)
if assert.Len(t, res.Rules, 1) {
| </s> remove defer d.Close()
</s> add t.Cleanup(d.Close) </s> remove d := NewForTest(nil, filters)
</s> add d := newForTest(nil, filters) </s> remove // not matched by white filter, but matched by block filter
</s> add // Not matched by white filter, but matched by block filter. </s> remove // Check host for each domain
for _, host := range googleDomains {
res, err := d.CheckHost(host, dns.TypeA, &setts)
assert.Nil(t, err)
assert.True(t, res.IsFiltered)
if assert.Len(t, res.Rules, 1) {
assert.NotEqual(t, res.Rules[0].IP.String(), "0.0.0.0")
}
</s> add func TestCheckHostSafeSearchGoogle(t *testing.T) {
d := newForTest(&Config{SafeSearchEnabled: true}, nil)
t.Cleanup(d.Close)
d.resolver = &testResolver{}
// Check host for each domain.
for _, host := range []string{
"www.google.com",
"www.google.im",
"www.google.co.in",
"www.google.iq",
"www.google.is",
"www.google.it",
"www.google.je",
} {
t.Run(host, func(t *testing.T) {
res, err := d.CheckHost(host, dns.TypeA, &setts)
assert.Nil(t, err)
assert.True(t, res.IsFiltered)
assert.Len(t, res.Rules, 1)
}) </s> remove assert.Equal(t, res.Rules[0].IP.String(), "213.180.193.56")
</s> add assert.Equal(t, res.Rules[0].IP, net.IPv4(213, 180, 193, 56)) | // Matched by white filter. | d := NewForTest(nil, filters)
d.SetFilters(filters, whiteFilters, false)
defer d.Close()
// Matched by white filter.
res, err := d.CheckHost("host1", dns.TypeA, &setts)
assert.Nil(t, err)
assert.False(t, res.IsFiltered)
assert.Equal(t, res.Reason, NotFilteredAllowList)
if assert.Len(t, res.Rules, 1) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
if assert.Len(t, res.Rules, 1) {
assert.Equal(t, "||host1^", res.Rules[0].Text)
}
// not matched by white filter, but matched by block filter
res, err = d.CheckHost("host2", dns.TypeA, &setts)
assert.Nil(t, err)
assert.True(t, res.IsFiltered)
assert.Equal(t, res.Reason, FilteredBlockList)
if assert.Len(t, res.Rules, 1) {
| </s> remove // matched by white filter
</s> add // Matched by white filter. </s> remove loopback4 := net.IP{0, 0, 0, 1}
assert.Equal(t, res.Rules[0].IP, loopback4)
</s> add assert.Equal(t, res.Rules[0].IP, net.IP{0, 0, 0, 1}) </s> remove // 2 IPv4 (return only the first one)
</s> add // Two IPv4, the first one returned. </s> remove // ...but empty IPv4
</s> add // Empty IPv4. </s> remove // ...but empty IPv6
</s> add // Empty IPv6. | // Not matched by white filter, but matched by block filter. | if assert.Len(t, res.Rules, 1) {
assert.Equal(t, "||host1^", res.Rules[0].Text)
}
// Not matched by white filter, but matched by block filter.
res, err = d.CheckHost("host2", dns.TypeA, &setts)
assert.Nil(t, err)
assert.True(t, res.IsFiltered)
assert.Equal(t, res.Reason, FilteredBlockList)
if assert.Len(t, res.Rules, 1) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
assert.Equal(t, "||host2^", res.Rules[0].Text)
}
}
// CLIENT SETTINGS
func applyClientSettings(setts *RequestFilteringSettings) {
setts.FilteringEnabled = false
setts.ParentalEnabled = false
setts.SafeBrowsingEnabled = true
| </s> remove func NewForTest(c *Config, filters []Filter) *DNSFilter {
</s> add func newForTest(c *Config, filters []Filter) *DNSFilter { </s> remove // IPv6
</s> add // IPv6 match. </s> remove // not matched by white filter, but matched by block filter
</s> add // Not matched by white filter, but matched by block filter. </s> remove // 2 IPv4 (return only the first one)
</s> add // Two IPv4, the first one returned. </s> remove
// blocked by additional rules
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.True(t, r.IsFiltered)
assert.Equal(t, r.Reason, FilteredBlockedService)
</s> add | // Client Settings. | assert.Equal(t, "||host2^", res.Rules[0].Text)
}
}
// Client Settings.
func applyClientSettings(setts *RequestFilteringSettings) {
setts.FilteringEnabled = false
setts.ParentalEnabled = false
setts.SafeBrowsingEnabled = true | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
s.Rules = []*rules.NetworkRule{rule}
setts.ServicesRules = append(setts.ServicesRules, s)
}
// Check behaviour without any per-client settings,
// then apply per-client settings and check behaviour once again
func TestClientSettings(t *testing.T) {
var r Result
filters := []Filter{{
ID: 0, Data: []byte("||example.org^\n"),
}}
| </s> remove var r Result
filters := []Filter{{
ID: 0, Data: []byte("||example.org^\n"),
</s> add d := newForTest(
&Config{
ParentalEnabled: true,
SafeBrowsingEnabled: false,
},
[]Filter{{
ID: 0, Data: []byte("||example.org^\n"),
}},
)
t.Cleanup(d.Close)
d.parentalUpstream = &testSbUpstream{
hostname: "pornhub.com",
block: true,
}
d.safeBrowsingUpstream = &testSbUpstream{
hostname: "wmconvirus.narod.ru",
block: true,
}
type testCase struct {
name string
host string
before bool
wantReason Reason
}
testCases := []testCase{{
name: "filters",
host: "example.org",
before: true,
wantReason: FilteredBlockList,
}, {
name: "parental",
host: "pornhub.com",
before: true,
wantReason: FilteredParental,
}, {
name: "safebrowsing",
host: "wmconvirus.narod.ru",
before: false,
wantReason: FilteredSafeBrowsing,
}, {
name: "additional_rules",
host: "facebook.com",
before: false,
wantReason: FilteredBlockedService, </s> remove // safesearch is disabled
r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost safesearch")
</s> add // Check behaviour without any per-client settings, then apply per-client
// settings and check behaviour once again.
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, tc.before)) </s> remove d := NewForTest(&Config{ParentalEnabled: true, SafeBrowsingEnabled: false}, filters)
defer d.Close()
// no client settings:
// blocked by filters
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredBlockList {
t.Fatalf("CheckHost FilteredBlockList")
}
</s> add </s> remove d := NewForTest(nil, filters)
defer d.Close()
</s> add d := newForTest(nil, filters)
t.Cleanup(d.Close) </s> remove d := NewForTest(nil, filters)
</s> add d := newForTest(nil, filters) | s.Rules = []*rules.NetworkRule{rule}
setts.ServicesRules = append(setts.ServicesRules, s)
}
func TestClientSettings(t *testing.T) {
var r Result
filters := []Filter{{
ID: 0, Data: []byte("||example.org^\n"),
}} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
|
// Check behaviour without any per-client settings,
// then apply per-client settings and check behaviour once again
func TestClientSettings(t *testing.T) {
var r Result
filters := []Filter{{
ID: 0, Data: []byte("||example.org^\n"),
}}
d := NewForTest(&Config{ParentalEnabled: true, SafeBrowsingEnabled: false}, filters)
defer d.Close()
// no client settings:
| </s> remove // Check behaviour without any per-client settings,
// then apply per-client settings and check behaviour once again
</s> add </s> remove d := NewForTest(&Config{ParentalEnabled: true, SafeBrowsingEnabled: false}, filters)
defer d.Close()
// no client settings:
// blocked by filters
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredBlockList {
t.Fatalf("CheckHost FilteredBlockList")
}
</s> add </s> remove // safesearch is disabled
r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost safesearch")
</s> add // Check behaviour without any per-client settings, then apply per-client
// settings and check behaviour once again.
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, tc.before)) </s> remove d := NewForTest(nil, filters)
</s> add d := newForTest(nil, filters) </s> remove d := NewForTest(nil, filters)
defer d.Close()
</s> add d := newForTest(nil, filters)
t.Cleanup(d.Close) | d := newForTest(
&Config{
ParentalEnabled: true,
SafeBrowsingEnabled: false,
},
[]Filter{{
ID: 0, Data: []byte("||example.org^\n"),
}},
)
t.Cleanup(d.Close)
d.parentalUpstream = &testSbUpstream{
hostname: "pornhub.com",
block: true,
}
d.safeBrowsingUpstream = &testSbUpstream{
hostname: "wmconvirus.narod.ru",
block: true,
}
type testCase struct {
name string
host string
before bool
wantReason Reason
}
testCases := []testCase{{
name: "filters",
host: "example.org",
before: true,
wantReason: FilteredBlockList,
}, {
name: "parental",
host: "pornhub.com",
before: true,
wantReason: FilteredParental,
}, {
name: "safebrowsing",
host: "wmconvirus.narod.ru",
before: false,
wantReason: FilteredSafeBrowsing,
}, {
name: "additional_rules",
host: "facebook.com",
before: false,
wantReason: FilteredBlockedService, |
// Check behaviour without any per-client settings,
// then apply per-client settings and check behaviour once again
func TestClientSettings(t *testing.T) {
d := newForTest(
&Config{
ParentalEnabled: true,
SafeBrowsingEnabled: false,
},
[]Filter{{
ID: 0, Data: []byte("||example.org^\n"),
}},
)
t.Cleanup(d.Close)
d.parentalUpstream = &testSbUpstream{
hostname: "pornhub.com",
block: true,
}
d.safeBrowsingUpstream = &testSbUpstream{
hostname: "wmconvirus.narod.ru",
block: true,
}
type testCase struct {
name string
host string
before bool
wantReason Reason
}
testCases := []testCase{{
name: "filters",
host: "example.org",
before: true,
wantReason: FilteredBlockList,
}, {
name: "parental",
host: "pornhub.com",
before: true,
wantReason: FilteredParental,
}, {
name: "safebrowsing",
host: "wmconvirus.narod.ru",
before: false,
wantReason: FilteredSafeBrowsing,
}, {
name: "additional_rules",
host: "facebook.com",
before: false,
wantReason: FilteredBlockedService,
d := newForTest(
&Config{
ParentalEnabled: true,
SafeBrowsingEnabled: false,
},
[]Filter{{
ID: 0, Data: []byte("||example.org^\n"),
}},
)
t.Cleanup(d.Close)
d.parentalUpstream = &testSbUpstream{
hostname: "pornhub.com",
block: true,
}
d.safeBrowsingUpstream = &testSbUpstream{
hostname: "wmconvirus.narod.ru",
block: true,
}
type testCase struct {
name string
host string
before bool
wantReason Reason
}
testCases := []testCase{{
name: "filters",
host: "example.org",
before: true,
wantReason: FilteredBlockList,
}, {
name: "parental",
host: "pornhub.com",
before: true,
wantReason: FilteredParental,
}, {
name: "safebrowsing",
host: "wmconvirus.narod.ru",
before: false,
wantReason: FilteredSafeBrowsing,
}, {
name: "additional_rules",
host: "facebook.com",
before: false,
wantReason: FilteredBlockedService,
d := newForTest(
&Config{
ParentalEnabled: true,
SafeBrowsingEnabled: false,
},
[]Filter{{
ID: 0, Data: []byte("||example.org^\n"),
}},
)
t.Cleanup(d.Close)
d.parentalUpstream = &testSbUpstream{
hostname: "pornhub.com",
block: true,
}
d.safeBrowsingUpstream = &testSbUpstream{
hostname: "wmconvirus.narod.ru",
block: true,
}
type testCase struct {
name string
host string
before bool
wantReason Reason
}
testCases := []testCase{{
name: "filters",
host: "example.org",
before: true,
wantReason: FilteredBlockList,
}, {
name: "parental",
host: "pornhub.com",
before: true,
wantReason: FilteredParental,
}, {
name: "safebrowsing",
host: "wmconvirus.narod.ru",
before: false,
wantReason: FilteredSafeBrowsing,
}, {
name: "additional_rules",
host: "facebook.com",
before: false,
wantReason: FilteredBlockedService,
}}
d := NewForTest(&Config{ParentalEnabled: true, SafeBrowsingEnabled: false}, filters)
defer d.Close()
// no client settings: | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
var r Result
filters := []Filter{{
ID: 0, Data: []byte("||example.org^\n"),
}}
d := NewForTest(&Config{ParentalEnabled: true, SafeBrowsingEnabled: false}, filters)
defer d.Close()
// no client settings:
// blocked by filters
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredBlockList {
t.Fatalf("CheckHost FilteredBlockList")
}
// blocked by parental
r, _ = d.CheckHost("pornhub.com", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredParental {
t.Fatalf("CheckHost FilteredParental")
| </s> remove // blocked by parental
r, _ = d.CheckHost("pornhub.com", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredParental {
t.Fatalf("CheckHost FilteredParental")
</s> add makeTester := func(tc testCase, before bool) func(t *testing.T) {
return func(t *testing.T) {
r, _ := d.CheckHost(tc.host, dns.TypeA, &setts)
if before {
assert.True(t, r.IsFiltered)
assert.Equal(t, tc.wantReason, r.Reason)
} else {
assert.False(t, r.IsFiltered)
}
} </s> remove // override filtering settings
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost")
}
// override parental settings (force disable parental)
r, _ = d.CheckHost("pornhub.com", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost")
}
// override safesearch settings (force enable safesearch)
r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredSafeBrowsing {
t.Fatalf("CheckHost FilteredSafeBrowsing")
</s> add for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before)) </s> remove
// blocked by additional rules
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.True(t, r.IsFiltered)
assert.Equal(t, r.Reason, FilteredBlockedService)
</s> add </s> remove // safesearch is disabled
r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost safesearch")
</s> add // Check behaviour without any per-client settings, then apply per-client
// settings and check behaviour once again.
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, tc.before)) </s> remove // not blocked
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.False(t, r.IsFiltered)
// override client settings:
</s> add | var r Result
filters := []Filter{{
ID: 0, Data: []byte("||example.org^\n"),
}}
// blocked by parental
r, _ = d.CheckHost("pornhub.com", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredParental {
t.Fatalf("CheckHost FilteredParental") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
|
if !r.IsFiltered || r.Reason != FilteredBlockList {
t.Fatalf("CheckHost FilteredBlockList")
}
// blocked by parental
r, _ = d.CheckHost("pornhub.com", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredParental {
t.Fatalf("CheckHost FilteredParental")
}
// safesearch is disabled
r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if r.IsFiltered {
| </s> remove d := NewForTest(&Config{ParentalEnabled: true, SafeBrowsingEnabled: false}, filters)
defer d.Close()
// no client settings:
// blocked by filters
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredBlockList {
t.Fatalf("CheckHost FilteredBlockList")
}
</s> add </s> remove // safesearch is disabled
r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost safesearch")
</s> add // Check behaviour without any per-client settings, then apply per-client
// settings and check behaviour once again.
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, tc.before)) </s> remove // override filtering settings
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost")
}
// override parental settings (force disable parental)
r, _ = d.CheckHost("pornhub.com", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost")
}
// override safesearch settings (force enable safesearch)
r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredSafeBrowsing {
t.Fatalf("CheckHost FilteredSafeBrowsing")
</s> add for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before)) </s> remove
// blocked by additional rules
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.True(t, r.IsFiltered)
assert.Equal(t, r.Reason, FilteredBlockedService)
</s> add </s> remove // not blocked
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.False(t, r.IsFiltered)
// override client settings:
</s> add | makeTester := func(tc testCase, before bool) func(t *testing.T) {
return func(t *testing.T) {
r, _ := d.CheckHost(tc.host, dns.TypeA, &setts)
if before {
assert.True(t, r.IsFiltered)
assert.Equal(t, tc.wantReason, r.Reason)
} else {
assert.False(t, r.IsFiltered)
}
} | if !r.IsFiltered || r.Reason != FilteredBlockList {
t.Fatalf("CheckHost FilteredBlockList")
}
makeTester := func(tc testCase, before bool) func(t *testing.T) {
return func(t *testing.T) {
r, _ := d.CheckHost(tc.host, dns.TypeA, &setts)
if before {
assert.True(t, r.IsFiltered)
assert.Equal(t, tc.wantReason, r.Reason)
} else {
assert.False(t, r.IsFiltered)
}
}
makeTester := func(tc testCase, before bool) func(t *testing.T) {
return func(t *testing.T) {
r, _ := d.CheckHost(tc.host, dns.TypeA, &setts)
if before {
assert.True(t, r.IsFiltered)
assert.Equal(t, tc.wantReason, r.Reason)
} else {
assert.False(t, r.IsFiltered)
}
}
makeTester := func(tc testCase, before bool) func(t *testing.T) {
return func(t *testing.T) {
r, _ := d.CheckHost(tc.host, dns.TypeA, &setts)
if before {
assert.True(t, r.IsFiltered)
assert.Equal(t, tc.wantReason, r.Reason)
} else {
assert.False(t, r.IsFiltered)
}
}
makeTester := func(tc testCase, before bool) func(t *testing.T) {
return func(t *testing.T) {
r, _ := d.CheckHost(tc.host, dns.TypeA, &setts)
if before {
assert.True(t, r.IsFiltered)
assert.Equal(t, tc.wantReason, r.Reason)
} else {
assert.False(t, r.IsFiltered)
}
}
}
// safesearch is disabled
r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if r.IsFiltered { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
if !r.IsFiltered || r.Reason != FilteredParental {
t.Fatalf("CheckHost FilteredParental")
}
// safesearch is disabled
r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost safesearch")
}
// not blocked
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.False(t, r.IsFiltered)
| </s> remove // blocked by parental
r, _ = d.CheckHost("pornhub.com", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredParental {
t.Fatalf("CheckHost FilteredParental")
</s> add makeTester := func(tc testCase, before bool) func(t *testing.T) {
return func(t *testing.T) {
r, _ := d.CheckHost(tc.host, dns.TypeA, &setts)
if before {
assert.True(t, r.IsFiltered)
assert.Equal(t, tc.wantReason, r.Reason)
} else {
assert.False(t, r.IsFiltered)
}
} </s> remove // not blocked
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.False(t, r.IsFiltered)
// override client settings:
</s> add </s> remove
// blocked by additional rules
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.True(t, r.IsFiltered)
assert.Equal(t, r.Reason, FilteredBlockedService)
</s> add </s> remove // override filtering settings
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost")
}
// override parental settings (force disable parental)
r, _ = d.CheckHost("pornhub.com", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost")
}
// override safesearch settings (force enable safesearch)
r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredSafeBrowsing {
t.Fatalf("CheckHost FilteredSafeBrowsing")
</s> add for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before)) </s> remove d := NewForTest(&Config{ParentalEnabled: true, SafeBrowsingEnabled: false}, filters)
defer d.Close()
// no client settings:
// blocked by filters
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredBlockList {
t.Fatalf("CheckHost FilteredBlockList")
}
</s> add | // Check behaviour without any per-client settings, then apply per-client
// settings and check behaviour once again.
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, tc.before)) | if !r.IsFiltered || r.Reason != FilteredParental {
t.Fatalf("CheckHost FilteredParental")
}
// Check behaviour without any per-client settings, then apply per-client
// settings and check behaviour once again.
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, tc.before))
// Check behaviour without any per-client settings, then apply per-client
// settings and check behaviour once again.
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, tc.before))
// Check behaviour without any per-client settings, then apply per-client
// settings and check behaviour once again.
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, tc.before))
// Check behaviour without any per-client settings, then apply per-client
// settings and check behaviour once again.
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, tc.before))
}
// not blocked
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.False(t, r.IsFiltered) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
if r.IsFiltered {
t.Fatalf("CheckHost safesearch")
}
// not blocked
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.False(t, r.IsFiltered)
// override client settings:
applyClientSettings(&setts)
// override filtering settings
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if r.IsFiltered {
| </s> remove // override filtering settings
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost")
}
// override parental settings (force disable parental)
r, _ = d.CheckHost("pornhub.com", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost")
}
// override safesearch settings (force enable safesearch)
r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredSafeBrowsing {
t.Fatalf("CheckHost FilteredSafeBrowsing")
</s> add for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before)) </s> remove // safesearch is disabled
r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost safesearch")
</s> add // Check behaviour without any per-client settings, then apply per-client
// settings and check behaviour once again.
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, tc.before)) </s> remove // blocked by parental
r, _ = d.CheckHost("pornhub.com", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredParental {
t.Fatalf("CheckHost FilteredParental")
</s> add makeTester := func(tc testCase, before bool) func(t *testing.T) {
return func(t *testing.T) {
r, _ := d.CheckHost(tc.host, dns.TypeA, &setts)
if before {
assert.True(t, r.IsFiltered)
assert.Equal(t, tc.wantReason, r.Reason)
} else {
assert.False(t, r.IsFiltered)
}
} </s> remove
// blocked by additional rules
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.True(t, r.IsFiltered)
assert.Equal(t, r.Reason, FilteredBlockedService)
</s> add </s> remove d := NewForTest(&Config{ParentalEnabled: true, SafeBrowsingEnabled: false}, filters)
defer d.Close()
// no client settings:
// blocked by filters
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredBlockList {
t.Fatalf("CheckHost FilteredBlockList")
}
</s> add | if r.IsFiltered {
t.Fatalf("CheckHost safesearch")
}
applyClientSettings(&setts)
// override filtering settings
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if r.IsFiltered { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
|
// override client settings:
applyClientSettings(&setts)
// override filtering settings
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost")
}
// override parental settings (force disable parental)
r, _ = d.CheckHost("pornhub.com", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost")
}
// override safesearch settings (force enable safesearch)
r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredSafeBrowsing {
t.Fatalf("CheckHost FilteredSafeBrowsing")
}
// blocked by additional rules
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.True(t, r.IsFiltered)
| </s> remove // not blocked
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.False(t, r.IsFiltered)
// override client settings:
</s> add </s> remove
// blocked by additional rules
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.True(t, r.IsFiltered)
assert.Equal(t, r.Reason, FilteredBlockedService)
</s> add </s> remove // blocked by parental
r, _ = d.CheckHost("pornhub.com", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredParental {
t.Fatalf("CheckHost FilteredParental")
</s> add makeTester := func(tc testCase, before bool) func(t *testing.T) {
return func(t *testing.T) {
r, _ := d.CheckHost(tc.host, dns.TypeA, &setts)
if before {
assert.True(t, r.IsFiltered)
assert.Equal(t, tc.wantReason, r.Reason)
} else {
assert.False(t, r.IsFiltered)
}
} </s> remove // safesearch is disabled
r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost safesearch")
</s> add // Check behaviour without any per-client settings, then apply per-client
// settings and check behaviour once again.
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, tc.before)) </s> remove d := NewForTest(&Config{ParentalEnabled: true, SafeBrowsingEnabled: false}, filters)
defer d.Close()
// no client settings:
// blocked by filters
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredBlockList {
t.Fatalf("CheckHost FilteredBlockList")
}
</s> add | for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before)) |
// override client settings:
applyClientSettings(&setts)
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before))
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before))
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before))
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before))
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before))
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before))
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before))
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before))
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before))
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before))
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before))
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before))
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before))
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before))
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before))
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before))
}
// blocked by additional rules
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.True(t, r.IsFiltered) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredSafeBrowsing {
t.Fatalf("CheckHost FilteredSafeBrowsing")
}
// blocked by additional rules
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.True(t, r.IsFiltered)
assert.Equal(t, r.Reason, FilteredBlockedService)
}
// BENCHMARKS
func BenchmarkSafeBrowsing(b *testing.B) {
| </s> remove // override filtering settings
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost")
}
// override parental settings (force disable parental)
r, _ = d.CheckHost("pornhub.com", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost")
}
// override safesearch settings (force enable safesearch)
r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredSafeBrowsing {
t.Fatalf("CheckHost FilteredSafeBrowsing")
</s> add for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, !tc.before)) </s> remove // blocked by parental
r, _ = d.CheckHost("pornhub.com", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredParental {
t.Fatalf("CheckHost FilteredParental")
</s> add makeTester := func(tc testCase, before bool) func(t *testing.T) {
return func(t *testing.T) {
r, _ := d.CheckHost(tc.host, dns.TypeA, &setts)
if before {
assert.True(t, r.IsFiltered)
assert.Equal(t, tc.wantReason, r.Reason)
} else {
assert.False(t, r.IsFiltered)
}
} </s> remove // safesearch is disabled
r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if r.IsFiltered {
t.Fatalf("CheckHost safesearch")
</s> add // Check behaviour without any per-client settings, then apply per-client
// settings and check behaviour once again.
for _, tc := range testCases {
t.Run(tc.name, makeTester(tc, tc.before)) </s> remove d := NewForTest(&Config{ParentalEnabled: true, SafeBrowsingEnabled: false}, filters)
defer d.Close()
// no client settings:
// blocked by filters
r, _ = d.CheckHost("example.org", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredBlockList {
t.Fatalf("CheckHost FilteredBlockList")
}
</s> add </s> remove // not blocked
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.False(t, r.IsFiltered)
// override client settings:
</s> add | r, _ = d.CheckHost("wmconvirus.narod.ru", dns.TypeA, &setts)
if !r.IsFiltered || r.Reason != FilteredSafeBrowsing {
t.Fatalf("CheckHost FilteredSafeBrowsing")
}
}
// BENCHMARKS
func BenchmarkSafeBrowsing(b *testing.B) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
|
assert.True(t, r.IsFiltered)
assert.Equal(t, r.Reason, FilteredBlockedService)
}
// BENCHMARKS
func BenchmarkSafeBrowsing(b *testing.B) {
d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
for n := 0; n < b.N; n++ {
| </s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
b.Cleanup(d.Close)
blocked := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: blocked,
block: true,
} </s> remove d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeSearchEnabled: true}, nil)
b.Cleanup(d.Close) </s> remove hostname := "wmconvirus.narod.ru"
res, err := d.CheckHost(hostname, dns.TypeA, &setts)
if err != nil {
b.Errorf("Error while matching host %s: %s", hostname, err)
}
if !res.IsFiltered {
b.Errorf("Expected hostname %s to match", hostname)
}
</s> add res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked) </s> remove if !ok {
b.Errorf("Expected safesearch to find result for www.google.com")
}
if val != "forcesafesearch.google.com" {
b.Errorf("Expected safesearch for google.com to be forcesafesearch.google.com")
}
</s> add assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com") </s> remove
// blocked by additional rules
r, _ = d.CheckHost("facebook.com", dns.TypeA, &setts)
assert.True(t, r.IsFiltered)
assert.Equal(t, r.Reason, FilteredBlockedService)
</s> add | // Benchmarks. | assert.True(t, r.IsFiltered)
assert.Equal(t, r.Reason, FilteredBlockedService)
}
// Benchmarks.
func BenchmarkSafeBrowsing(b *testing.B) {
d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
for n := 0; n < b.N; n++ { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
// BENCHMARKS
func BenchmarkSafeBrowsing(b *testing.B) {
d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
for n := 0; n < b.N; n++ {
hostname := "wmconvirus.narod.ru"
res, err := d.CheckHost(hostname, dns.TypeA, &setts)
if err != nil {
b.Errorf("Error while matching host %s: %s", hostname, err)
| </s> remove hostname := "wmconvirus.narod.ru"
res, err := d.CheckHost(hostname, dns.TypeA, &setts)
if err != nil {
b.Errorf("Error while matching host %s: %s", hostname, err)
}
if !res.IsFiltered {
b.Errorf("Expected hostname %s to match", hostname)
}
</s> add res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked) </s> remove // BENCHMARKS
</s> add // Benchmarks. </s> remove hostname := "wmconvirus.narod.ru"
res, err := d.CheckHost(hostname, dns.TypeA, &setts)
if err != nil {
b.Errorf("Error while matching host %s: %s", hostname, err)
}
if !res.IsFiltered {
b.Errorf("Expected hostname %s to match", hostname)
}
</s> add res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked) </s> remove d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeSearchEnabled: true}, nil)
b.Cleanup(d.Close) </s> remove if err != nil {
t.Errorf("Error while matching host %s: %s", hostname, err)
}
if res.IsFiltered {
t.Errorf("Expected hostname %s to not match", hostname)
}
</s> add assert.Nilf(t, err, "Error while matching host %s: %s", hostname, err)
assert.Falsef(t, res.IsFiltered, "Expected hostname %s to not match", hostname) | d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
b.Cleanup(d.Close)
blocked := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: blocked,
block: true,
} |
// BENCHMARKS
func BenchmarkSafeBrowsing(b *testing.B) {
d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
b.Cleanup(d.Close)
blocked := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: blocked,
block: true,
}
d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
b.Cleanup(d.Close)
blocked := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: blocked,
block: true,
}
for n := 0; n < b.N; n++ {
hostname := "wmconvirus.narod.ru"
res, err := d.CheckHost(hostname, dns.TypeA, &setts)
if err != nil {
b.Errorf("Error while matching host %s: %s", hostname, err) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
func BenchmarkSafeBrowsing(b *testing.B) {
d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
for n := 0; n < b.N; n++ {
hostname := "wmconvirus.narod.ru"
res, err := d.CheckHost(hostname, dns.TypeA, &setts)
if err != nil {
b.Errorf("Error while matching host %s: %s", hostname, err)
}
if !res.IsFiltered {
b.Errorf("Expected hostname %s to match", hostname)
}
}
}
func BenchmarkSafeBrowsingParallel(b *testing.B) {
d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
| </s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
b.Cleanup(d.Close)
blocked := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: blocked,
block: true,
} </s> remove hostname := "wmconvirus.narod.ru"
res, err := d.CheckHost(hostname, dns.TypeA, &setts)
if err != nil {
b.Errorf("Error while matching host %s: %s", hostname, err)
}
if !res.IsFiltered {
b.Errorf("Expected hostname %s to match", hostname)
}
</s> add res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked) </s> remove if err != nil {
t.Errorf("Error while matching host %s: %s", hostname, err)
}
if !res.IsFiltered {
t.Errorf("Expected hostname %s to match", hostname)
}
</s> add assert.Nilf(t, err, "Error while matching host %s: %s", hostname, err)
assert.Truef(t, res.IsFiltered, "Expected hostname %s to match", hostname) </s> remove if err != nil {
t.Errorf("Error while matching host %s: %s", hostname, err)
}
if res.IsFiltered {
t.Errorf("Expected hostname %s to not match", hostname)
}
</s> add assert.Nilf(t, err, "Error while matching host %s: %s", hostname, err)
assert.Falsef(t, res.IsFiltered, "Expected hostname %s to not match", hostname) </s> remove // BENCHMARKS
</s> add // Benchmarks. | res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked) | func BenchmarkSafeBrowsing(b *testing.B) {
d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
for n := 0; n < b.N; n++ {
res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked)
res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked)
res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked)
res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked)
res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked)
res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked)
res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked)
res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked)
}
}
func BenchmarkSafeBrowsingParallel(b *testing.B) {
d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
}
}
func BenchmarkSafeBrowsingParallel(b *testing.B) {
d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
hostname := "wmconvirus.narod.ru"
res, err := d.CheckHost(hostname, dns.TypeA, &setts)
if err != nil {
| </s> remove hostname := "wmconvirus.narod.ru"
res, err := d.CheckHost(hostname, dns.TypeA, &setts)
if err != nil {
b.Errorf("Error while matching host %s: %s", hostname, err)
}
if !res.IsFiltered {
b.Errorf("Expected hostname %s to match", hostname)
}
</s> add res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked) </s> remove hostname := "wmconvirus.narod.ru"
res, err := d.CheckHost(hostname, dns.TypeA, &setts)
if err != nil {
b.Errorf("Error while matching host %s: %s", hostname, err)
}
if !res.IsFiltered {
b.Errorf("Expected hostname %s to match", hostname)
}
</s> add res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked) </s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
b.Cleanup(d.Close)
blocked := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: blocked,
block: true,
} </s> remove d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeSearchEnabled: true}, nil)
b.Cleanup(d.Close) </s> remove if err != nil {
t.Errorf("Error while matching host %s: %s", hostname, err)
}
if res.IsFiltered {
t.Errorf("Expected hostname %s to not match", hostname)
}
</s> add assert.Nilf(t, err, "Error while matching host %s: %s", hostname, err)
assert.Falsef(t, res.IsFiltered, "Expected hostname %s to not match", hostname) | d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
b.Cleanup(d.Close)
blocked := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: blocked,
block: true,
} | }
}
func BenchmarkSafeBrowsingParallel(b *testing.B) {
d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
b.Cleanup(d.Close)
blocked := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: blocked,
block: true,
}
d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
b.Cleanup(d.Close)
blocked := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: blocked,
block: true,
}
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
hostname := "wmconvirus.narod.ru"
res, err := d.CheckHost(hostname, dns.TypeA, &setts)
if err != nil { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
hostname := "wmconvirus.narod.ru"
res, err := d.CheckHost(hostname, dns.TypeA, &setts)
if err != nil {
b.Errorf("Error while matching host %s: %s", hostname, err)
}
if !res.IsFiltered {
b.Errorf("Expected hostname %s to match", hostname)
}
}
})
}
func BenchmarkSafeSearch(b *testing.B) {
| </s> remove hostname := "wmconvirus.narod.ru"
res, err := d.CheckHost(hostname, dns.TypeA, &setts)
if err != nil {
b.Errorf("Error while matching host %s: %s", hostname, err)
}
if !res.IsFiltered {
b.Errorf("Expected hostname %s to match", hostname)
}
</s> add res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked) </s> remove if err != nil {
t.Errorf("Error while matching host %s: %s", hostname, err)
}
if !res.IsFiltered {
t.Errorf("Expected hostname %s to match", hostname)
}
</s> add assert.Nilf(t, err, "Error while matching host %s: %s", hostname, err)
assert.Truef(t, res.IsFiltered, "Expected hostname %s to match", hostname) </s> remove if err != nil {
t.Errorf("Error while matching host %s: %s", hostname, err)
}
if res.IsFiltered {
t.Errorf("Expected hostname %s to not match", hostname)
}
</s> add assert.Nilf(t, err, "Error while matching host %s: %s", hostname, err)
assert.Falsef(t, res.IsFiltered, "Expected hostname %s to not match", hostname) </s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
b.Cleanup(d.Close)
blocked := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: blocked,
block: true,
} </s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
b.Cleanup(d.Close)
blocked := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: blocked,
block: true,
} | res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked) | d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked)
res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked)
res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked)
res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked)
res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked)
res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked)
res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked)
res, err := d.CheckHost(blocked, dns.TypeA, &setts)
assert.Nilf(b, err, "Error while matching host %s: %s", blocked, err)
assert.True(b, res.IsFiltered, "Expected hostname %s to match", blocked)
}
})
}
func BenchmarkSafeSearch(b *testing.B) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
})
}
func BenchmarkSafeSearch(b *testing.B) {
d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
for n := 0; n < b.N; n++ {
val, ok := d.SafeSearchDomain("www.google.com")
if !ok {
b.Errorf("Expected safesearch to find result for www.google.com")
}
| </s> remove if !ok {
b.Errorf("Expected safesearch to find result for www.google.com")
}
if val != "forcesafesearch.google.com" {
b.Errorf("Expected safesearch for google.com to be forcesafesearch.google.com")
}
</s> add assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com") </s> remove d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeSearchEnabled: true}, nil)
b.Cleanup(d.Close) </s> remove if !ok {
b.Errorf("Expected safesearch to find result for www.google.com")
}
if val != "forcesafesearch.google.com" {
b.Errorf("Expected safesearch for google.com to be forcesafesearch.google.com")
}
</s> add assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com") </s> remove if !ok {
t.Errorf("Expected safesearch to find result for www.google.com")
}
if val != "forcesafesearch.google.com" {
t.Errorf("Expected safesearch for google.com to be forcesafesearch.google.com")
}
</s> add assert.True(t, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(t, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com") </s> remove d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeSearchEnabled: true}, nil)
t.Cleanup(d.Close) | d := newForTest(&Config{SafeSearchEnabled: true}, nil)
b.Cleanup(d.Close) | })
}
func BenchmarkSafeSearch(b *testing.B) {
d := newForTest(&Config{SafeSearchEnabled: true}, nil)
b.Cleanup(d.Close)
d := newForTest(&Config{SafeSearchEnabled: true}, nil)
b.Cleanup(d.Close)
for n := 0; n < b.N; n++ {
val, ok := d.SafeSearchDomain("www.google.com")
if !ok {
b.Errorf("Expected safesearch to find result for www.google.com")
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
for n := 0; n < b.N; n++ {
val, ok := d.SafeSearchDomain("www.google.com")
if !ok {
b.Errorf("Expected safesearch to find result for www.google.com")
}
if val != "forcesafesearch.google.com" {
b.Errorf("Expected safesearch for google.com to be forcesafesearch.google.com")
}
}
}
func BenchmarkSafeSearchParallel(b *testing.B) {
d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
| </s> remove d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeSearchEnabled: true}, nil)
b.Cleanup(d.Close) </s> remove if !ok {
b.Errorf("Expected safesearch to find result for www.google.com")
}
if val != "forcesafesearch.google.com" {
b.Errorf("Expected safesearch for google.com to be forcesafesearch.google.com")
}
</s> add assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com") </s> remove if !ok {
t.Errorf("Expected safesearch to find result for www.google.com")
}
if val != "forcesafesearch.google.com" {
t.Errorf("Expected safesearch for google.com to be forcesafesearch.google.com")
}
</s> add assert.True(t, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(t, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com") </s> remove d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeSearchEnabled: true}, nil)
b.Cleanup(d.Close) </s> remove d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeSearchEnabled: true}, nil)
t.Cleanup(d.Close) | assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com") | d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
for n := 0; n < b.N; n++ {
val, ok := d.SafeSearchDomain("www.google.com")
assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com")
assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com")
assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com")
assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com")
assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com")
assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com")
}
}
func BenchmarkSafeSearchParallel(b *testing.B) {
d := NewForTest(&Config{SafeSearchEnabled: true}, nil) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
}
}
func BenchmarkSafeSearchParallel(b *testing.B) {
d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
val, ok := d.SafeSearchDomain("www.google.com")
if !ok {
b.Errorf("Expected safesearch to find result for www.google.com")
| </s> remove if !ok {
b.Errorf("Expected safesearch to find result for www.google.com")
}
if val != "forcesafesearch.google.com" {
b.Errorf("Expected safesearch for google.com to be forcesafesearch.google.com")
}
</s> add assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com") </s> remove if !ok {
b.Errorf("Expected safesearch to find result for www.google.com")
}
if val != "forcesafesearch.google.com" {
b.Errorf("Expected safesearch for google.com to be forcesafesearch.google.com")
}
</s> add assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com") </s> remove d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeSearchEnabled: true}, nil)
b.Cleanup(d.Close) </s> remove if !ok {
t.Errorf("Expected safesearch to find result for www.google.com")
}
if val != "forcesafesearch.google.com" {
t.Errorf("Expected safesearch for google.com to be forcesafesearch.google.com")
}
</s> add assert.True(t, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(t, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com") </s> remove d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeSearchEnabled: true}, nil)
t.Cleanup(d.Close) | d := newForTest(&Config{SafeSearchEnabled: true}, nil)
b.Cleanup(d.Close) | }
}
func BenchmarkSafeSearchParallel(b *testing.B) {
d := newForTest(&Config{SafeSearchEnabled: true}, nil)
b.Cleanup(d.Close)
d := newForTest(&Config{SafeSearchEnabled: true}, nil)
b.Cleanup(d.Close)
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
val, ok := d.SafeSearchDomain("www.google.com")
if !ok {
b.Errorf("Expected safesearch to find result for www.google.com") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
defer d.Close()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
val, ok := d.SafeSearchDomain("www.google.com")
if !ok {
b.Errorf("Expected safesearch to find result for www.google.com")
}
if val != "forcesafesearch.google.com" {
b.Errorf("Expected safesearch for google.com to be forcesafesearch.google.com")
}
}
})
}
| </s> remove if !ok {
b.Errorf("Expected safesearch to find result for www.google.com")
}
if val != "forcesafesearch.google.com" {
b.Errorf("Expected safesearch for google.com to be forcesafesearch.google.com")
}
</s> add assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com") </s> remove if !ok {
t.Errorf("Expected safesearch to find result for www.google.com")
}
if val != "forcesafesearch.google.com" {
t.Errorf("Expected safesearch for google.com to be forcesafesearch.google.com")
}
</s> add assert.True(t, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(t, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com") </s> remove d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeSearchEnabled: true}, nil)
b.Cleanup(d.Close) </s> remove d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeSearchEnabled: true}, nil)
b.Cleanup(d.Close) </s> remove d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeSearchEnabled: true}, nil)
t.Cleanup(d.Close) | assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com") | defer d.Close()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
val, ok := d.SafeSearchDomain("www.google.com")
assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com")
assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com")
assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com")
assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com")
assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com")
assert.True(b, ok, "Expected safesearch to find result for www.google.com")
assert.Equal(b, "forcesafesearch.google.com", val, "Expected safesearch for google.com to be forcesafesearch.google.com")
}
})
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsfilter_test.go |
|disable-all^$dnsrewrite=127.0.0.2
@@||disable-all^$dnsrewrite
`
f := NewForTest(nil, []Filter{{ID: 0, Data: []byte(text)}})
setts := &RequestFilteringSettings{
FilteringEnabled: true,
}
ipv4p1 := net.IPv4(127, 0, 0, 1)
| </s> remove d := NewForTest(nil, filters)
</s> add d := newForTest(nil, filters) </s> remove // ...and 1 IPv6 address
</s> add // One IPv6 address. </s> remove loopback6 := net.IP{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
assert.Equal(t, res.Rules[0].IP, loopback6)
</s> add assert.Equal(t, res.Rules[0].IP, net.IPv6loopback) </s> remove d := NewForTest(nil, filters)
defer d.Close()
</s> add d := newForTest(nil, filters)
t.Cleanup(d.Close) </s> remove defer d.Close()
</s> add t.Cleanup(d.Close) | f := newForTest(nil, []Filter{{ID: 0, Data: []byte(text)}}) | |disable-all^$dnsrewrite=127.0.0.2
@@||disable-all^$dnsrewrite
`
f := newForTest(nil, []Filter{{ID: 0, Data: []byte(text)}})
setts := &RequestFilteringSettings{
FilteringEnabled: true,
}
ipv4p1 := net.IPv4(127, 0, 0, 1) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/dnsrewrite_test.go |
"github.com/stretchr/testify/assert"
)
func TestRewrites(t *testing.T) {
d := DNSFilter{}
// CNAME, A, AAAA
d.Rewrites = []RewriteEntry{
{"somecname", "somehost.com", 0, nil},
{"somehost.com", "0.0.0.0", 0, nil},
| </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove // ...and 1 IPv6 address
</s> add // One IPv6 address. | d := newForTest(nil, nil)
t.Cleanup(d.Close) | "github.com/stretchr/testify/assert"
)
func TestRewrites(t *testing.T) {
d := newForTest(nil, nil)
t.Cleanup(d.Close)
// CNAME, A, AAAA
d.Rewrites = []RewriteEntry{
{"somecname", "somehost.com", 0, nil},
{"somehost.com", "0.0.0.0", 0, nil},
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/rewrites_test.go |
assert.True(t, r.IPList[0].Equal(net.IP{1, 2, 3, 4}))
}
func TestRewritesLevels(t *testing.T) {
d := DNSFilter{}
// exact host, wildcard L2, wildcard L3
d.Rewrites = []RewriteEntry{
{"host.com", "1.1.1.1", 0, nil},
{"*.host.com", "2.2.2.2", 0, nil},
{"*.sub.host.com", "3.3.3.3", 0, nil},
| </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove loopback6 := net.IP{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
assert.Equal(t, res.Rules[0].IP, loopback6)
</s> add assert.Equal(t, res.Rules[0].IP, net.IPv6loopback) | d := newForTest(nil, nil)
t.Cleanup(d.Close) | assert.True(t, r.IPList[0].Equal(net.IP{1, 2, 3, 4}))
}
func TestRewritesLevels(t *testing.T) {
d := newForTest(nil, nil)
t.Cleanup(d.Close)
// exact host, wildcard L2, wildcard L3
d.Rewrites = []RewriteEntry{
{"host.com", "1.1.1.1", 0, nil},
{"*.host.com", "2.2.2.2", 0, nil},
{"*.sub.host.com", "3.3.3.3", 0, nil}, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/rewrites_test.go |
assert.True(t, net.IP{3, 3, 3, 3}.Equal(r.IPList[0]))
}
func TestRewritesExceptionCNAME(t *testing.T) {
d := DNSFilter{}
// wildcard; exception for a sub-domain
d.Rewrites = []RewriteEntry{
{"*.host.com", "2.2.2.2", 0, nil},
{"sub.host.com", "sub.host.com", 0, nil},
}
| </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove loopback6 := net.IP{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
assert.Equal(t, res.Rules[0].IP, loopback6)
</s> add assert.Equal(t, res.Rules[0].IP, net.IPv6loopback) | d := newForTest(nil, nil)
t.Cleanup(d.Close) | assert.True(t, net.IP{3, 3, 3, 3}.Equal(r.IPList[0]))
}
func TestRewritesExceptionCNAME(t *testing.T) {
d := newForTest(nil, nil)
t.Cleanup(d.Close)
// wildcard; exception for a sub-domain
d.Rewrites = []RewriteEntry{
{"*.host.com", "2.2.2.2", 0, nil},
{"sub.host.com", "sub.host.com", 0, nil},
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/rewrites_test.go |
assert.Equal(t, NotFilteredNotFound, r.Reason)
}
func TestRewritesExceptionWC(t *testing.T) {
d := DNSFilter{}
// wildcard; exception for a sub-wildcard
d.Rewrites = []RewriteEntry{
{"*.host.com", "2.2.2.2", 0, nil},
{"*.sub.host.com", "*.sub.host.com", 0, nil},
}
| </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove loopback6 := net.IP{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
assert.Equal(t, res.Rules[0].IP, loopback6)
</s> add assert.Equal(t, res.Rules[0].IP, net.IPv6loopback) | d := newForTest(nil, nil)
t.Cleanup(d.Close) | assert.Equal(t, NotFilteredNotFound, r.Reason)
}
func TestRewritesExceptionWC(t *testing.T) {
d := newForTest(nil, nil)
t.Cleanup(d.Close)
// wildcard; exception for a sub-wildcard
d.Rewrites = []RewriteEntry{
{"*.host.com", "2.2.2.2", 0, nil},
{"*.sub.host.com", "*.sub.host.com", 0, nil},
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/rewrites_test.go |
assert.Equal(t, NotFilteredNotFound, r.Reason)
}
func TestRewritesExceptionIP(t *testing.T) {
d := DNSFilter{}
// exception for AAAA record
d.Rewrites = []RewriteEntry{
{"host.com", "1.2.3.4", 0, nil},
{"host.com", "AAAA", 0, nil},
{"host2.com", "::1", 0, nil},
| </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) </s> remove loopback6 := net.IP{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}
assert.Equal(t, res.Rules[0].IP, loopback6)
</s> add assert.Equal(t, res.Rules[0].IP, net.IPv6loopback) | d := newForTest(nil, nil)
t.Cleanup(d.Close) | assert.Equal(t, NotFilteredNotFound, r.Reason)
}
func TestRewritesExceptionIP(t *testing.T) {
d := newForTest(nil, nil)
t.Cleanup(d.Close)
// exception for AAAA record
d.Rewrites = []RewriteEntry{
{"host.com", "1.2.3.4", 0, nil},
{"host.com", "AAAA", 0, nil},
{"host2.com", "::1", 0, nil}, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/rewrites_test.go |
import (
"crypto/sha256"
"encoding/hex"
"strings"
"testing"
"github.com/AdguardTeam/AdGuardHome/internal/agherr"
"github.com/AdguardTeam/golibs/cache"
"github.com/miekg/dns"
"github.com/stretchr/testify/assert"
| </s> remove d := DNSFilter{}
</s> add d := newForTest(nil, nil)
t.Cleanup(d.Close) | "sync" | import (
"crypto/sha256"
"encoding/hex"
"strings"
"sync"
"testing"
"github.com/AdguardTeam/AdGuardHome/internal/agherr"
"github.com/AdguardTeam/golibs/cache"
"github.com/miekg/dns"
"github.com/stretchr/testify/assert" | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/safebrowsing_test.go |
return ""
}
func TestSBPC_checkErrorUpstream(t *testing.T) {
d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
ups := &testErrUpstream{}
d.safeBrowsingUpstream = ups
d.parentalUpstream = ups
| </s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close) </s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close) </s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close)
matching := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: matching,
block: true,
}
</s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
b.Cleanup(d.Close)
blocked := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: blocked,
block: true,
} </s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
b.Cleanup(d.Close)
blocked := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: blocked,
block: true,
} | d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close) | return ""
}
func TestSBPC_checkErrorUpstream(t *testing.T) {
d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close)
d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close)
ups := &testErrUpstream{}
d.safeBrowsingUpstream = ups
d.parentalUpstream = ups | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/safebrowsing_test.go |
type testSbUpstream struct {
hostname string
block bool
requestsCount int
}
// Exchange returns a message depending on the upstream settings (hostname, block)
func (u *testSbUpstream) Exchange(r *dns.Msg) (*dns.Msg, error) {
u.counterLock.Lock()
| </s> remove var r Result
filters := []Filter{{
ID: 0, Data: []byte("||example.org^\n"),
</s> add d := newForTest(
&Config{
ParentalEnabled: true,
SafeBrowsingEnabled: false,
},
[]Filter{{
ID: 0, Data: []byte("||example.org^\n"),
}},
)
t.Cleanup(d.Close)
d.parentalUpstream = &testSbUpstream{
hostname: "pornhub.com",
block: true,
}
d.safeBrowsingUpstream = &testSbUpstream{
hostname: "wmconvirus.narod.ru",
block: true,
}
type testCase struct {
name string
host string
before bool
wantReason Reason
}
testCases := []testCase{{
name: "filters",
host: "example.org",
before: true,
wantReason: FilteredBlockList,
}, {
name: "parental",
host: "pornhub.com",
before: true,
wantReason: FilteredParental,
}, {
name: "safebrowsing",
host: "wmconvirus.narod.ru",
before: false,
wantReason: FilteredSafeBrowsing,
}, {
name: "additional_rules",
host: "facebook.com",
before: false,
wantReason: FilteredBlockedService, | counterLock sync.RWMutex | type testSbUpstream struct {
hostname string
block bool
requestsCount int
counterLock sync.RWMutex
}
// Exchange returns a message depending on the upstream settings (hostname, block)
func (u *testSbUpstream) Exchange(r *dns.Msg) (*dns.Msg, error) {
u.counterLock.Lock() | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/safebrowsing_test.go |
// Exchange returns a message depending on the upstream settings (hostname, block)
func (u *testSbUpstream) Exchange(r *dns.Msg) (*dns.Msg, error) {
u.requestsCount++
u.counterLock.Unlock()
hash := sha256.Sum256([]byte(u.hostname))
| </s> remove func TestCheckHostSafeSearchGoogle(t *testing.T) {
d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
// Slice of google domains
googleDomains := []string{"www.google.com", "www.google.im", "www.google.co.in", "www.google.iq", "www.google.is", "www.google.it", "www.google.je"}
</s> add // testResolver is a Resolver for tests.
type testResolver struct{}
// LookupIP implements Resolver interface for *testResolver.
func (r *testResolver) LookupIPAddr(_ context.Context, host string) (ips []net.IPAddr, err error) {
hash := sha256.Sum256([]byte(host))
addrs := []net.IPAddr{{
IP: net.IP(hash[:4]),
Zone: "somezone",
}, {
IP: net.IP(hash[4:20]),
Zone: "somezone",
}}
return addrs, nil
} | u.counterLock.Lock() |
// Exchange returns a message depending on the upstream settings (hostname, block)
func (u *testSbUpstream) Exchange(r *dns.Msg) (*dns.Msg, error) {
u.counterLock.Lock()
u.requestsCount++
u.counterLock.Unlock()
hash := sha256.Sum256([]byte(u.hostname)) | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/safebrowsing_test.go |
// Exchange returns a message depending on the upstream settings (hostname, block)
func (u *testSbUpstream) Exchange(r *dns.Msg) (*dns.Msg, error) {
u.counterLock.Lock()
u.requestsCount++
hash := sha256.Sum256([]byte(u.hostname))
prefix := hash[0:2]
hashToReturn := hex.EncodeToString(prefix) + strings.Repeat("ab", 28)
| </s> remove func TestCheckHostSafeSearchGoogle(t *testing.T) {
d := NewForTest(&Config{SafeSearchEnabled: true}, nil)
defer d.Close()
// Slice of google domains
googleDomains := []string{"www.google.com", "www.google.im", "www.google.co.in", "www.google.iq", "www.google.is", "www.google.it", "www.google.je"}
</s> add // testResolver is a Resolver for tests.
type testResolver struct{}
// LookupIP implements Resolver interface for *testResolver.
func (r *testResolver) LookupIPAddr(_ context.Context, host string) (ips []net.IPAddr, err error) {
hash := sha256.Sum256([]byte(host))
addrs := []net.IPAddr{{
IP: net.IP(hash[:4]),
Zone: "somezone",
}, {
IP: net.IP(hash[4:20]),
Zone: "somezone",
}}
return addrs, nil
} </s> remove // 2 IPv4 (return only the first one)
</s> add // Two IPv4, the first one returned. | u.counterLock.Unlock() | // Exchange returns a message depending on the upstream settings (hostname, block)
func (u *testSbUpstream) Exchange(r *dns.Msg) (*dns.Msg, error) {
u.counterLock.Lock()
u.requestsCount++
u.counterLock.Unlock()
hash := sha256.Sum256([]byte(u.hostname))
prefix := hash[0:2]
hashToReturn := hex.EncodeToString(prefix) + strings.Repeat("ab", 28) | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/safebrowsing_test.go |
return ""
}
func TestSBPC_sbValidResponse(t *testing.T) {
d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
ups := &testSbUpstream{}
d.safeBrowsingUpstream = ups
d.parentalUpstream = ups
| </s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close) </s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close) </s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close)
matching := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: matching,
block: true,
}
</s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
b.Cleanup(d.Close)
blocked := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: blocked,
block: true,
} </s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
b.Cleanup(d.Close)
blocked := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: blocked,
block: true,
} | d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close) | return ""
}
func TestSBPC_sbValidResponse(t *testing.T) {
d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close)
d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close)
ups := &testSbUpstream{}
d.safeBrowsingUpstream = ups
d.parentalUpstream = ups
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/safebrowsing_test.go |
assert.Equal(t, 1, ups.requestsCount)
}
func TestSBPC_pcBlockedResponse(t *testing.T) {
d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
ups := &testSbUpstream{}
d.safeBrowsingUpstream = ups
d.parentalUpstream = ups
| </s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close) </s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close) </s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close)
matching := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: matching,
block: true,
}
</s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
b.Cleanup(d.Close)
blocked := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: blocked,
block: true,
} </s> remove d := NewForTest(&Config{SafeBrowsingEnabled: true}, nil)
defer d.Close()
</s> add d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
b.Cleanup(d.Close)
blocked := "wmconvirus.narod.ru"
d.safeBrowsingUpstream = &testSbUpstream{
hostname: blocked,
block: true,
} | d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close) | assert.Equal(t, 1, ups.requestsCount)
}
func TestSBPC_pcBlockedResponse(t *testing.T) {
d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close)
d := newForTest(&Config{SafeBrowsingEnabled: true}, nil)
t.Cleanup(d.Close)
ups := &testSbUpstream{}
d.safeBrowsingUpstream = ups
d.parentalUpstream = ups
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/safebrowsing_test.go |
package dnsfilter
import (
"bytes"
"encoding/binary"
"encoding/gob"
"encoding/json"
"fmt"
| </s> remove // FILTERING
const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
var tests = []struct {
testname string
rules string
hostname string
isFiltered bool
reason Reason
dnsType uint16
}{
{"sanity", "||doubleclick.net^", "www.doubleclick.net", true, FilteredBlockList, dns.TypeA},
{"sanity", "||doubleclick.net^", "nodoubleclick.net", false, NotFilteredNotFound, dns.TypeA},
{"sanity", "||doubleclick.net^", "doubleclick.net.ru", false, NotFilteredNotFound, dns.TypeA},
{"sanity", "||doubleclick.net^", "wmconvirus.narod.ru", false, NotFilteredNotFound, dns.TypeA},
{"blocking", blockingRules, "example.org", true, FilteredBlockList, dns.TypeA},
{"blocking", blockingRules, "test.example.org", true, FilteredBlockList, dns.TypeA},
{"blocking", blockingRules, "test.test.example.org", true, FilteredBlockList, dns.TypeA},
{"blocking", blockingRules, "testexample.org", false, NotFilteredNotFound, dns.TypeA},
{"blocking", blockingRules, "onemoreexample.org", false, NotFilteredNotFound, dns.TypeA},
{"allowlist", allowlistRules, "example.org", true, FilteredBlockList, dns.TypeA},
{"allowlist", allowlistRules, "test.example.org", false, NotFilteredAllowList, dns.TypeA},
{"allowlist", allowlistRules, "test.test.example.org", false, NotFilteredAllowList, dns.TypeA},
{"allowlist", allowlistRules, "testexample.org", false, NotFilteredNotFound, dns.TypeA},
{"allowlist", allowlistRules, "onemoreexample.org", false, NotFilteredNotFound, dns.TypeA},
{"important", importantRules, "example.org", false, NotFilteredAllowList, dns.TypeA},
{"important", importantRules, "test.example.org", true, FilteredBlockList, dns.TypeA},
{"important", importantRules, "test.test.example.org", true, FilteredBlockList, dns.TypeA},
{"important", importantRules, "testexample.org", false, NotFilteredNotFound, dns.TypeA},
{"important", importantRules, "onemoreexample.org", false, NotFilteredNotFound, dns.TypeA},
{"regex", regexRules, "example.org", true, FilteredBlockList, dns.TypeA},
{"regex", regexRules, "test.example.org", false, NotFilteredAllowList, dns.TypeA},
{"regex", regexRules, "test.test.example.org", false, NotFilteredAllowList, dns.TypeA},
{"regex", regexRules, "testexample.org", true, FilteredBlockList, dns.TypeA},
{"regex", regexRules, "onemoreexample.org", true, FilteredBlockList, dns.TypeA},
{"mask", maskRules, "test.example.org", true, FilteredBlockList, dns.TypeA},
{"mask", maskRules, "test2.example.org", true, FilteredBlockList, dns.TypeA},
{"mask", maskRules, "example.com", true, FilteredBlockList, dns.TypeA},
{"mask", maskRules, "exampleeee.com", true, FilteredBlockList, dns.TypeA},
{"mask", maskRules, "onemoreexamsite.com", true, FilteredBlockList, dns.TypeA},
{"mask", maskRules, "example.org", false, NotFilteredNotFound, dns.TypeA},
{"mask", maskRules, "testexample.org", false, NotFilteredNotFound, dns.TypeA},
{"mask", maskRules, "example.co.uk", false, NotFilteredNotFound, dns.TypeA},
{"dnstype", dnstypeRules, "onemoreexample.org", false, NotFilteredNotFound, dns.TypeA},
{"dnstype", dnstypeRules, "example.org", false, NotFilteredNotFound, dns.TypeA},
{"dnstype", dnstypeRules, "example.org", true, FilteredBlockList, dns.TypeAAAA},
{"dnstype", dnstypeRules, "test.example.org", false, NotFilteredAllowList, dns.TypeA},
{"dnstype", dnstypeRules, "test.example.org", false, NotFilteredAllowList, dns.TypeAAAA},
}
</s> add // Filtering. </s> remove for _, test := range tests {
t.Run(fmt.Sprintf("%s-%s", test.testname, test.hostname), func(t *testing.T) {
filters := []Filter{{
ID: 0, Data: []byte(test.rules),
}}
d := NewForTest(nil, filters)
defer d.Close()
res, err := d.CheckHost(test.hostname, test.dnsType, &setts)
if err != nil {
t.Errorf("Error while matching host %s: %s", test.hostname, err)
}
if res.IsFiltered != test.isFiltered {
t.Errorf("Hostname %s has wrong result (%v must be %v)", test.hostname, res.IsFiltered, test.isFiltered)
}
if res.Reason != test.reason {
t.Errorf("Hostname %s has wrong reason (%v must be %v)", test.hostname, res.Reason.String(), test.reason.String())
}
</s> add const nl = "\n"
const (
blockingRules = `||example.org^` + nl
allowlistRules = `||example.org^` + nl + `@@||test.example.org` + nl
importantRules = `@@||example.org^` + nl + `||test.example.org^$important` + nl
regexRules = `/example\.org/` + nl + `@@||test.example.org^` + nl
maskRules = `test*.example.org^` + nl + `exam*.com` + nl
dnstypeRules = `||example.org^$dnstype=AAAA` + nl + `@@||test.example.org^` + nl
)
testCases := []struct {
name string
rules string
host string
wantIsFiltered bool
wantReason Reason
wantDNSType uint16
}{{
name: "sanity",
rules: "||doubleclick.net^",
host: "www.doubleclick.net",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "nodoubleclick.net",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "doubleclick.net.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "sanity",
rules: "||doubleclick.net^",
host: "wmconvirus.narod.ru",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "blocking",
rules: blockingRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "allowlist",
rules: allowlistRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "test.test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "important",
rules: importantRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "test.test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "testexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "regex",
rules: regexRules,
host: "onemoreexample.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "test2.example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "exampleeee.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "onemoreexamsite.com",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "testexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "mask",
rules: maskRules,
host: "example.co.uk",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "onemoreexample.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: false,
wantReason: NotFilteredNotFound,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "example.org",
wantIsFiltered: true,
wantReason: FilteredBlockList,
wantDNSType: dns.TypeAAAA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeA,
}, {
name: "dnstype",
rules: dnstypeRules,
host: "test.example.org",
wantIsFiltered: false,
wantReason: NotFilteredAllowList,
wantDNSType: dns.TypeAAAA,
}}
for _, tc := range testCases {
t.Run(fmt.Sprintf("%s-%s", tc.name, tc.host), func(t *testing.T) {
filters := []Filter{{ID: 0, Data: []byte(tc.rules)}}
d := newForTest(nil, filters)
t.Cleanup(d.Close)
res, err := d.CheckHost(tc.host, tc.wantDNSType, &setts)
assert.Nilf(t, err, "Error while matching host %s: %s", tc.host, err)
assert.Equalf(t, tc.wantIsFiltered, res.IsFiltered, "Hostname %s has wrong result (%v must be %v)", tc.host, res.IsFiltered, tc.wantIsFiltered)
assert.Equalf(t, tc.wantReason, res.Reason, "Hostname %s has wrong reason (%v must be %v)", tc.host, res.Reason, tc.wantReason) | "context" | package dnsfilter
import (
"bytes"
"context"
"encoding/binary"
"encoding/gob"
"encoding/json"
"fmt" | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/safesearch.go |
return res, nil
}
// TODO this address should be resolved with upstream that was configured in dnsforward
ips, err := net.LookupIP(safeHost)
if err != nil {
log.Tracef("SafeSearchDomain for %s was found but failed to lookup for %s cause %s", host, safeHost, err)
return Result{}, err
}
| </s> remove for _, ip := range ips {
if ipv4 := ip.To4(); ipv4 != nil {
</s> add for _, ipAddr := range ipAddrs {
if ipv4 := ipAddr.IP.To4(); ipv4 != nil { </s> remove if err != nil {
t.Fatalf("CheckHost for safesearh domain %s failed cause %s", domain, err)
}
</s> add assert.Nilf(t, err, "CheckHost for safesearh domain %s failed cause %s", domain, err) </s> remove // For yandex we already know valid ip.
</s> add // For yandex we already know valid IP. </s> remove ips, err := net.LookupIP(safeDomain)
</s> add ipAddrs, err := resolver.LookupIPAddr(context.Background(), safeDomain) | ipAddrs, err := d.resolver.LookupIPAddr(context.Background(), safeHost) |
return res, nil
}
ipAddrs, err := d.resolver.LookupIPAddr(context.Background(), safeHost)
ipAddrs, err := d.resolver.LookupIPAddr(context.Background(), safeHost)
if err != nil {
log.Tracef("SafeSearchDomain for %s was found but failed to lookup for %s cause %s", host, safeHost, err)
return Result{}, err
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/safesearch.go |
log.Tracef("SafeSearchDomain for %s was found but failed to lookup for %s cause %s", host, safeHost, err)
return Result{}, err
}
for _, ip := range ips {
if ipv4 := ip.To4(); ipv4 != nil {
res.Rules[0].IP = ipv4
l := d.setCacheResult(gctx.safeSearchCache, host, res)
log.Debug("SafeSearch: stored in cache: %s (%d bytes)", host, l)
| </s> remove // TODO this address should be resolved with upstream that was configured in dnsforward
ips, err := net.LookupIP(safeHost)
</s> add ipAddrs, err := d.resolver.LookupIPAddr(context.Background(), safeHost) </s> remove ip := ips[0]
for _, i := range ips {
if i.To4() != nil {
ip = i
</s> add ip := ipAddrs[0].IP
for _, ipAddr := range ipAddrs {
if ipAddr.IP.To4() != nil {
ip = ipAddr.IP </s> remove if err != nil {
t.Errorf("Error while matching host %s: %s", hostname, err)
}
if !res.IsFiltered {
t.Errorf("Expected hostname %s to match", hostname)
}
if len(res.Rules) == 0 {
t.Errorf("Expected result to have rules")
return
}
r := res.Rules[0]
if r.IP == nil || r.IP.String() != ip {
t.Errorf("Expected ip %s to match, actual: %v", ip, r.IP)
</s> add assert.Nilf(t, err, "Error while matching host %s: %s", hostname, err)
assert.Truef(t, res.IsFiltered, "Expected hostname %s to match", hostname)
if assert.NotEmpty(t, res.Rules, "Expected result to have rules") {
r := res.Rules[0]
assert.NotNilf(t, r.IP, "Expected ip %s to match, actual: %v", ip, r.IP)
assert.Equalf(t, ip, r.IP.String(), "Expected ip %s to match, actual: %v", ip, r.IP) </s> remove if err != nil {
t.Fatalf("CheckHost for safesearh domain %s failed cause %s", domain, err)
}
</s> add assert.Nilf(t, err, "CheckHost for safesearh domain %s failed cause %s", domain, err) </s> remove if err != nil {
t.Errorf("Error while matching host %s: %s", hostname, err)
}
if !res.IsFiltered {
t.Errorf("Expected hostname %s to match", hostname)
}
</s> add assert.Nilf(t, err, "Error while matching host %s: %s", hostname, err)
assert.Truef(t, res.IsFiltered, "Expected hostname %s to match", hostname) | for _, ipAddr := range ipAddrs {
if ipv4 := ipAddr.IP.To4(); ipv4 != nil { | log.Tracef("SafeSearchDomain for %s was found but failed to lookup for %s cause %s", host, safeHost, err)
return Result{}, err
}
for _, ipAddr := range ipAddrs {
if ipv4 := ipAddr.IP.To4(); ipv4 != nil {
for _, ipAddr := range ipAddrs {
if ipv4 := ipAddr.IP.To4(); ipv4 != nil {
res.Rules[0].IP = ipv4
l := d.setCacheResult(gctx.safeSearchCache, host, res)
log.Debug("SafeSearch: stored in cache: %s (%d bytes)", host, l)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 2574 external tests vol.1
Merge in DNS/adguard-home from 2574-external-tests to master
Updates #2574.
Squashed commit of the following:
commit cb7017aa7fc1c81c014c1fa7e0972b06748aff29
Merge: 2a073431 eeeb0383
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:43:41 2021 +0300
Merge branch 'master' into 2574-external-tests
commit 2a0734311c5a6ddd2d9c3f56a4494a20b4197955
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 15:16:40 2021 +0300
dnsfilter: imp docs
commit 49aff871282e2739d27fcbceefdf1bd005c21174
Author: Eugene Burkov <[email protected]>
Date: Fri Jan 29 14:10:56 2021 +0300
dnsfilter: imp docs
commit 11be89a5378c0e451f1b88dc48a2e8827ba38358
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 21:20:55 2021 +0300
dnsfilter: fix go version trouble
commit 1ba4afd95bd739c18818ab0bea0ae70d59b880dc
Author: Eugene Burkov <[email protected]>
Date: Thu Jan 28 17:42:29 2021 +0300
dnsfilter: imp tests | https://github.com/AdguardTeam/AdGuardHome/commit/0d0a419bd34dd8fe612f790ace698aebd930bfcc | internal/dnsfilter/safesearch.go |
}
log.Info("Available network interfaces: %s", buf.String())
}
// Start will listen on port 67 and serve DHCP requests.
// Even though config can be nil, it is not optional (at least for now), since there are no default values (yet).
func (s *Server) Start(config *ServerConfig) error {
if config != nil {
s.ServerConfig = *config
}
iface, err := net.InterfaceByName(s.InterfaceName)
if err != nil {
s.closeConn() // in case it was already started
| </s> remove s.dbLoad()
</s> add iface, err := net.InterfaceByName(s.InterfaceName)
if err != nil {
return wrapErrPrint(err, "Couldn't find interface by name %s", s.InterfaceName)
} </s> remove s.closeConn() // in case it was already started
</s> add </s> remove // s.closeConn() // in case it was already started
</s> add | // Init checks the configuration and initializes the server
func (s *Server) Init(config ServerConfig) error {
err := s.setConfig(config)
if err != nil {
return err | }
log.Info("Available network interfaces: %s", buf.String())
}
// Init checks the configuration and initializes the server
func (s *Server) Init(config ServerConfig) error {
err := s.setConfig(config)
if err != nil {
return err
// Init checks the configuration and initializes the server
func (s *Server) Init(config ServerConfig) error {
err := s.setConfig(config)
if err != nil {
return err
// Init checks the configuration and initializes the server
func (s *Server) Init(config ServerConfig) error {
err := s.setConfig(config)
if err != nil {
return err
// Init checks the configuration and initializes the server
func (s *Server) Init(config ServerConfig) error {
err := s.setConfig(config)
if err != nil {
return err
// Init checks the configuration and initializes the server
func (s *Server) Init(config ServerConfig) error {
err := s.setConfig(config)
if err != nil {
return err
}
iface, err := net.InterfaceByName(s.InterfaceName)
if err != nil {
s.closeConn() // in case it was already started | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dhcpd: move code from Start() to Init() | https://github.com/AdguardTeam/AdGuardHome/commit/0d405c0af84d87e3d24b608eb3f7690078ee52ca | dhcpd/dhcpd.go |
if err != nil {
return err
}
iface, err := net.InterfaceByName(s.InterfaceName)
if err != nil {
printInterfaces()
return wrapErrPrint(err, "Couldn't find interface by name %s", s.InterfaceName)
}
| </s> remove s.closeConn() // in case it was already started
</s> add </s> remove s.dbLoad()
</s> add iface, err := net.InterfaceByName(s.InterfaceName)
if err != nil {
return wrapErrPrint(err, "Couldn't find interface by name %s", s.InterfaceName)
} </s> remove s.closeConn() // in case it was already started
</s> add </s> remove
s.closeConn() // in case it was already started
</s> add </s> remove // s.closeConn() // in case it was already started
</s> add | s.dbLoad()
return nil
}
func (s *Server) setConfig(config ServerConfig) error {
s.ServerConfig = config | if err != nil {
return err
}
s.dbLoad()
return nil
}
func (s *Server) setConfig(config ServerConfig) error {
s.ServerConfig = config
iface, err := net.InterfaceByName(s.InterfaceName)
if err != nil {
printInterfaces()
return wrapErrPrint(err, "Couldn't find interface by name %s", s.InterfaceName)
} | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dhcpd: move code from Start() to Init() | https://github.com/AdguardTeam/AdGuardHome/commit/0d405c0af84d87e3d24b608eb3f7690078ee52ca | dhcpd/dhcpd.go |
}
iface, err := net.InterfaceByName(s.InterfaceName)
if err != nil {
s.closeConn() // in case it was already started
printInterfaces()
return wrapErrPrint(err, "Couldn't find interface by name %s", s.InterfaceName)
}
// get ipv4 address of an interface
| </s> remove s.closeConn() // in case it was already started
</s> add </s> remove s.dbLoad()
</s> add iface, err := net.InterfaceByName(s.InterfaceName)
if err != nil {
return wrapErrPrint(err, "Couldn't find interface by name %s", s.InterfaceName)
} </s> remove s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add | }
iface, err := net.InterfaceByName(s.InterfaceName)
if err != nil {
printInterfaces()
return wrapErrPrint(err, "Couldn't find interface by name %s", s.InterfaceName)
}
// get ipv4 address of an interface | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dhcpd: move code from Start() to Init() | https://github.com/AdguardTeam/AdGuardHome/commit/0d405c0af84d87e3d24b608eb3f7690078ee52ca | dhcpd/dhcpd.go |
|
// get ipv4 address of an interface
s.ipnet = getIfaceIPv4(iface)
if s.ipnet == nil {
s.closeConn() // in case it was already started
return wrapErrPrint(err, "Couldn't find IPv4 address of interface %s %+v", s.InterfaceName, iface)
}
if s.LeaseDuration == 0 {
s.leaseTime = time.Hour * 2
| </s> remove s.closeConn() // in case it was already started
</s> add </s> remove // s.closeConn() // in case it was already started
</s> add </s> remove
s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add |
// get ipv4 address of an interface
s.ipnet = getIfaceIPv4(iface)
if s.ipnet == nil {
return wrapErrPrint(err, "Couldn't find IPv4 address of interface %s %+v", s.InterfaceName, iface)
}
if s.LeaseDuration == 0 {
s.leaseTime = time.Hour * 2 | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dhcpd: move code from Start() to Init() | https://github.com/AdguardTeam/AdGuardHome/commit/0d405c0af84d87e3d24b608eb3f7690078ee52ca | dhcpd/dhcpd.go |
|
}
s.leaseStart, err = parseIPv4(s.RangeStart)
if err != nil {
s.closeConn() // in case it was already started
return wrapErrPrint(err, "Failed to parse range start address %s", s.RangeStart)
}
s.leaseStop, err = parseIPv4(s.RangeEnd)
if err != nil {
| </s> remove s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add </s> remove s.dbLoad()
</s> add iface, err := net.InterfaceByName(s.InterfaceName)
if err != nil {
return wrapErrPrint(err, "Couldn't find interface by name %s", s.InterfaceName)
} </s> remove s.closeConn() // in case it was already started
</s> add | }
s.leaseStart, err = parseIPv4(s.RangeStart)
if err != nil {
return wrapErrPrint(err, "Failed to parse range start address %s", s.RangeStart)
}
s.leaseStop, err = parseIPv4(s.RangeEnd)
if err != nil { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dhcpd: move code from Start() to Init() | https://github.com/AdguardTeam/AdGuardHome/commit/0d405c0af84d87e3d24b608eb3f7690078ee52ca | dhcpd/dhcpd.go |
|
}
s.leaseStop, err = parseIPv4(s.RangeEnd)
if err != nil {
s.closeConn() // in case it was already started
return wrapErrPrint(err, "Failed to parse range end address %s", s.RangeEnd)
}
subnet, err := parseIPv4(s.SubnetMask)
if err != nil {
| </s> remove
s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add </s> remove // s.closeConn() // in case it was already started
</s> add | }
s.leaseStop, err = parseIPv4(s.RangeEnd)
if err != nil {
return wrapErrPrint(err, "Failed to parse range end address %s", s.RangeEnd)
}
subnet, err := parseIPv4(s.SubnetMask)
if err != nil { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dhcpd: move code from Start() to Init() | https://github.com/AdguardTeam/AdGuardHome/commit/0d405c0af84d87e3d24b608eb3f7690078ee52ca | dhcpd/dhcpd.go |
|
}
subnet, err := parseIPv4(s.SubnetMask)
if err != nil {
s.closeConn() // in case it was already started
return wrapErrPrint(err, "Failed to parse subnet mask %s", s.SubnetMask)
}
// if !bytes.Equal(subnet, s.ipnet.Mask) {
// s.closeConn() // in case it was already started
| </s> remove // s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add </s> remove
s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add | }
subnet, err := parseIPv4(s.SubnetMask)
if err != nil {
return wrapErrPrint(err, "Failed to parse subnet mask %s", s.SubnetMask)
}
// if !bytes.Equal(subnet, s.ipnet.Mask) {
// s.closeConn() // in case it was already started | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dhcpd: move code from Start() to Init() | https://github.com/AdguardTeam/AdGuardHome/commit/0d405c0af84d87e3d24b608eb3f7690078ee52ca | dhcpd/dhcpd.go |
|
return wrapErrPrint(err, "Failed to parse subnet mask %s", s.SubnetMask)
}
// if !bytes.Equal(subnet, s.ipnet.Mask) {
// s.closeConn() // in case it was already started
// return wrapErrPrint(err, "specified subnet mask %s does not meatch interface %s subnet mask %s", s.SubnetMask, s.InterfaceName, s.ipnet.Mask)
// }
router, err := parseIPv4(s.GatewayIP)
if err != nil {
| </s> remove s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add </s> remove
s.closeConn() // in case it was already started
</s> add | return wrapErrPrint(err, "Failed to parse subnet mask %s", s.SubnetMask)
}
// if !bytes.Equal(subnet, s.ipnet.Mask) {
// return wrapErrPrint(err, "specified subnet mask %s does not meatch interface %s subnet mask %s", s.SubnetMask, s.InterfaceName, s.ipnet.Mask)
// }
router, err := parseIPv4(s.GatewayIP)
if err != nil { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dhcpd: move code from Start() to Init() | https://github.com/AdguardTeam/AdGuardHome/commit/0d405c0af84d87e3d24b608eb3f7690078ee52ca | dhcpd/dhcpd.go |
|
// }
router, err := parseIPv4(s.GatewayIP)
if err != nil {
s.closeConn() // in case it was already started
return wrapErrPrint(err, "Failed to parse gateway IP %s", s.GatewayIP)
}
s.leaseOptions = dhcp4.Options{
dhcp4.OptionSubnetMask: subnet,
| </s> remove // s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add </s> remove
s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add | // }
router, err := parseIPv4(s.GatewayIP)
if err != nil {
return wrapErrPrint(err, "Failed to parse gateway IP %s", s.GatewayIP)
}
s.leaseOptions = dhcp4.Options{
dhcp4.OptionSubnetMask: subnet, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dhcpd: move code from Start() to Init() | https://github.com/AdguardTeam/AdGuardHome/commit/0d405c0af84d87e3d24b608eb3f7690078ee52ca | dhcpd/dhcpd.go |
|
}
// TODO: don't close if interface and addresses are the same
if s.conn != nil {
s.closeConn()
}
iface, err := net.InterfaceByName(s.InterfaceName)
| </s> remove // Start will listen on port 67 and serve DHCP requests.
// Even though config can be nil, it is not optional (at least for now), since there are no default values (yet).
func (s *Server) Start(config *ServerConfig) error {
if config != nil {
s.ServerConfig = *config
</s> add // Init checks the configuration and initializes the server
func (s *Server) Init(config ServerConfig) error {
err := s.setConfig(config)
if err != nil {
return err </s> remove s.dbLoad()
</s> add iface, err := net.InterfaceByName(s.InterfaceName)
if err != nil {
return wrapErrPrint(err, "Couldn't find interface by name %s", s.InterfaceName)
} </s> remove s.closeConn() // in case it was already started
</s> add </s> remove s.closeConn() // in case it was already started
</s> add | return nil
}
// Start will listen on port 67 and serve DHCP requests.
func (s *Server) Start() error {
| }
return nil
}
// Start will listen on port 67 and serve DHCP requests.
func (s *Server) Start() error {
// TODO: don't close if interface and addresses are the same
if s.conn != nil {
s.closeConn()
}
iface, err := net.InterfaceByName(s.InterfaceName) | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dhcpd: move code from Start() to Init() | https://github.com/AdguardTeam/AdGuardHome/commit/0d405c0af84d87e3d24b608eb3f7690078ee52ca | dhcpd/dhcpd.go |
if s.conn != nil {
s.closeConn()
}
s.dbLoad()
c, err := newFilterConn(*iface, ":67") // it has to be bound to 0.0.0.0:67, otherwise it won't see DHCP discover/request packets
if err != nil {
return wrapErrPrint(err, "Couldn't start listening socket on 0.0.0.0:67")
}
| </s> remove
s.closeConn() // in case it was already started
</s> add </s> remove // Start will listen on port 67 and serve DHCP requests.
// Even though config can be nil, it is not optional (at least for now), since there are no default values (yet).
func (s *Server) Start(config *ServerConfig) error {
if config != nil {
s.ServerConfig = *config
</s> add // Init checks the configuration and initializes the server
func (s *Server) Init(config ServerConfig) error {
err := s.setConfig(config)
if err != nil {
return err </s> remove s.closeConn() // in case it was already started
</s> add | iface, err := net.InterfaceByName(s.InterfaceName)
if err != nil {
return wrapErrPrint(err, "Couldn't find interface by name %s", s.InterfaceName)
} | if s.conn != nil {
s.closeConn()
}
iface, err := net.InterfaceByName(s.InterfaceName)
if err != nil {
return wrapErrPrint(err, "Couldn't find interface by name %s", s.InterfaceName)
}
c, err := newFilterConn(*iface, ":67") // it has to be bound to 0.0.0.0:67, otherwise it won't see DHCP discover/request packets
if err != nil {
return wrapErrPrint(err, "Couldn't start listening socket on 0.0.0.0:67")
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * dhcpd: move code from Start() to Init() | https://github.com/AdguardTeam/AdGuardHome/commit/0d405c0af84d87e3d24b608eb3f7690078ee52ca | dhcpd/dhcpd.go |
var a []byte
var err error
ip := getIPString(addr)
if question != nil {
q, err = question.Pack()
if err != nil {
log.Printf("failed to pack question for querylog: %s", err)
return
}
}
if answer != nil {
a, err = answer.Pack()
if err != nil {
| </s> remove if len(entry.Question) > 0 {
q = new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
// ignore, log and move on
log.Printf("Failed to unpack dns message question: %s", err)
q = nil
}
</s> add if len(entry.Question) == 0 {
continue
}
q = new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
log.Tracef("q.Unpack(): %s", err)
continue </s> remove // ignore, log and move on
log.Printf("Failed to unpack dns message question: %s", err)
</s> add log.Debug("Failed to unpack dns message answer: %s", err) </s> remove if q != nil {
jsonEntry["question"] = map[string]interface{}{
"host": strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")),
"type": dns.Type(q.Question[0].Qtype).String(),
"class": dns.Class(q.Question[0].Qclass).String(),
}
</s> add jsonEntry["question"] = map[string]interface{}{
"host": strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")),
"type": dns.Type(q.Question[0].Qtype).String(),
"class": dns.Class(q.Question[0].Qclass).String(), | if question == nil {
return
}
q, err = question.Pack()
if err != nil {
log.Printf("failed to pack question for querylog: %s", err)
return | var a []byte
var err error
ip := getIPString(addr)
if question == nil {
return
}
q, err = question.Pack()
if err != nil {
log.Printf("failed to pack question for querylog: %s", err)
return
if question == nil {
return
}
q, err = question.Pack()
if err != nil {
log.Printf("failed to pack question for querylog: %s", err)
return
if question == nil {
return
}
q, err = question.Pack()
if err != nil {
log.Printf("failed to pack question for querylog: %s", err)
return
if question == nil {
return
}
q, err = question.Pack()
if err != nil {
log.Printf("failed to pack question for querylog: %s", err)
return
if question == nil {
return
}
q, err = question.Pack()
if err != nil {
log.Printf("failed to pack question for querylog: %s", err)
return
if question == nil {
return
}
q, err = question.Pack()
if err != nil {
log.Printf("failed to pack question for querylog: %s", err)
return
}
if answer != nil {
a, err = answer.Pack()
if err != nil { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * querylog: don't return entries without Question data | https://github.com/AdguardTeam/AdGuardHome/commit/0d4e95b36d02e8aadfe6cbdd87d357efba6f02e8 | querylog/qlog.go |
entry := entries[i]
var q *dns.Msg
var a *dns.Msg
if len(entry.Question) > 0 {
q = new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
// ignore, log and move on
log.Printf("Failed to unpack dns message question: %s", err)
q = nil
}
}
if len(entry.Answer) > 0 {
a = new(dns.Msg)
if err := a.Unpack(entry.Answer); err != nil {
// ignore, log and move on
| </s> remove // ignore, log and move on
log.Printf("Failed to unpack dns message question: %s", err)
</s> add log.Debug("Failed to unpack dns message answer: %s", err) </s> remove if question != nil {
q, err = question.Pack()
if err != nil {
log.Printf("failed to pack question for querylog: %s", err)
return
}
</s> add if question == nil {
return
}
q, err = question.Pack()
if err != nil {
log.Printf("failed to pack question for querylog: %s", err)
return </s> remove if q != nil {
jsonEntry["question"] = map[string]interface{}{
"host": strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")),
"type": dns.Type(q.Question[0].Qtype).String(),
"class": dns.Class(q.Question[0].Qclass).String(),
}
</s> add jsonEntry["question"] = map[string]interface{}{
"host": strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")),
"type": dns.Type(q.Question[0].Qtype).String(),
"class": dns.Class(q.Question[0].Qclass).String(), | if len(entry.Question) == 0 {
continue
}
q = new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
log.Tracef("q.Unpack(): %s", err)
continue | entry := entries[i]
var q *dns.Msg
var a *dns.Msg
if len(entry.Question) == 0 {
continue
}
q = new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
log.Tracef("q.Unpack(): %s", err)
continue
if len(entry.Question) == 0 {
continue
}
q = new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
log.Tracef("q.Unpack(): %s", err)
continue
if len(entry.Question) == 0 {
continue
}
q = new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
log.Tracef("q.Unpack(): %s", err)
continue
if len(entry.Question) == 0 {
continue
}
q = new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
log.Tracef("q.Unpack(): %s", err)
continue
if len(entry.Question) == 0 {
continue
}
q = new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
log.Tracef("q.Unpack(): %s", err)
continue
if len(entry.Question) == 0 {
continue
}
q = new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
log.Tracef("q.Unpack(): %s", err)
continue
if len(entry.Question) == 0 {
continue
}
q = new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
log.Tracef("q.Unpack(): %s", err)
continue
}
if len(entry.Answer) > 0 {
a = new(dns.Msg)
if err := a.Unpack(entry.Answer); err != nil {
// ignore, log and move on | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * querylog: don't return entries without Question data | https://github.com/AdguardTeam/AdGuardHome/commit/0d4e95b36d02e8aadfe6cbdd87d357efba6f02e8 | querylog/qlog.go |
if err := q.Unpack(entry.Question); err != nil {
log.Tracef("q.Unpack(): %s", err)
continue
}
if len(entry.Answer) > 0 {
a = new(dns.Msg)
if err := a.Unpack(entry.Answer); err != nil {
log.Debug("Failed to unpack dns message answer: %s", err)
| </s> remove if len(entry.Question) > 0 {
q = new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
// ignore, log and move on
log.Printf("Failed to unpack dns message question: %s", err)
q = nil
}
</s> add if len(entry.Question) == 0 {
continue
}
q = new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
log.Tracef("q.Unpack(): %s", err)
continue </s> remove // ignore, log and move on
log.Printf("Failed to unpack dns message question: %s", err)
</s> add log.Debug("Failed to unpack dns message answer: %s", err) </s> remove if question != nil {
q, err = question.Pack()
if err != nil {
log.Printf("failed to pack question for querylog: %s", err)
return
}
</s> add if question == nil {
return
}
q, err = question.Pack()
if err != nil {
log.Printf("failed to pack question for querylog: %s", err)
return </s> remove if q != nil {
jsonEntry["question"] = map[string]interface{}{
"host": strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")),
"type": dns.Type(q.Question[0].Qtype).String(),
"class": dns.Class(q.Question[0].Qclass).String(),
}
</s> add jsonEntry["question"] = map[string]interface{}{
"host": strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")),
"type": dns.Type(q.Question[0].Qtype).String(),
"class": dns.Class(q.Question[0].Qclass).String(), | if len(q.Question) != 1 {
log.Tracef("len(q.Question) != 1")
continue
}
| if err := q.Unpack(entry.Question); err != nil {
log.Tracef("q.Unpack(): %s", err)
continue
}
if len(q.Question) != 1 {
log.Tracef("len(q.Question) != 1")
continue
}
if len(entry.Answer) > 0 {
a = new(dns.Msg)
if err := a.Unpack(entry.Answer); err != nil {
log.Debug("Failed to unpack dns message answer: %s", err) | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | * querylog: don't return entries without Question data | https://github.com/AdguardTeam/AdGuardHome/commit/0d4e95b36d02e8aadfe6cbdd87d357efba6f02e8 | querylog/qlog.go |
}
if len(entry.Answer) > 0 {
a = new(dns.Msg)
if err := a.Unpack(entry.Answer); err != nil {
// ignore, log and move on
log.Printf("Failed to unpack dns message question: %s", err)
a = nil
}
}
jsonEntry := map[string]interface{}{
| </s> remove if len(entry.Question) > 0 {
q = new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
// ignore, log and move on
log.Printf("Failed to unpack dns message question: %s", err)
q = nil
}
</s> add if len(entry.Question) == 0 {
continue
}
q = new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
log.Tracef("q.Unpack(): %s", err)
continue </s> remove if question != nil {
q, err = question.Pack()
if err != nil {
log.Printf("failed to pack question for querylog: %s", err)
return
}
</s> add if question == nil {
return
}
q, err = question.Pack()
if err != nil {
log.Printf("failed to pack question for querylog: %s", err)
return </s> remove if q != nil {
jsonEntry["question"] = map[string]interface{}{
"host": strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")),
"type": dns.Type(q.Question[0].Qtype).String(),
"class": dns.Class(q.Question[0].Qclass).String(),
}
</s> add jsonEntry["question"] = map[string]interface{}{
"host": strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")),
"type": dns.Type(q.Question[0].Qtype).String(),
"class": dns.Class(q.Question[0].Qclass).String(), | log.Debug("Failed to unpack dns message answer: %s", err) | }
if len(entry.Answer) > 0 {
a = new(dns.Msg)
if err := a.Unpack(entry.Answer); err != nil {
log.Debug("Failed to unpack dns message answer: %s", err)
log.Debug("Failed to unpack dns message answer: %s", err)
a = nil
}
}
jsonEntry := map[string]interface{}{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * querylog: don't return entries without Question data | https://github.com/AdguardTeam/AdGuardHome/commit/0d4e95b36d02e8aadfe6cbdd87d357efba6f02e8 | querylog/qlog.go |
"elapsedMs": strconv.FormatFloat(entry.Elapsed.Seconds()*1000, 'f', -1, 64),
"time": entry.Time.Format(time.RFC3339Nano),
"client": entry.IP,
}
if q != nil {
jsonEntry["question"] = map[string]interface{}{
"host": strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")),
"type": dns.Type(q.Question[0].Qtype).String(),
"class": dns.Class(q.Question[0].Qclass).String(),
}
}
if a != nil {
jsonEntry["status"] = dns.RcodeToString[a.Rcode]
}
| </s> remove if len(entry.Question) > 0 {
q = new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
// ignore, log and move on
log.Printf("Failed to unpack dns message question: %s", err)
q = nil
}
</s> add if len(entry.Question) == 0 {
continue
}
q = new(dns.Msg)
if err := q.Unpack(entry.Question); err != nil {
log.Tracef("q.Unpack(): %s", err)
continue </s> remove // ignore, log and move on
log.Printf("Failed to unpack dns message question: %s", err)
</s> add log.Debug("Failed to unpack dns message answer: %s", err) </s> remove if question != nil {
q, err = question.Pack()
if err != nil {
log.Printf("failed to pack question for querylog: %s", err)
return
}
</s> add if question == nil {
return
}
q, err = question.Pack()
if err != nil {
log.Printf("failed to pack question for querylog: %s", err)
return | jsonEntry["question"] = map[string]interface{}{
"host": strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")),
"type": dns.Type(q.Question[0].Qtype).String(),
"class": dns.Class(q.Question[0].Qclass).String(), | "elapsedMs": strconv.FormatFloat(entry.Elapsed.Seconds()*1000, 'f', -1, 64),
"time": entry.Time.Format(time.RFC3339Nano),
"client": entry.IP,
}
jsonEntry["question"] = map[string]interface{}{
"host": strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")),
"type": dns.Type(q.Question[0].Qtype).String(),
"class": dns.Class(q.Question[0].Qclass).String(),
jsonEntry["question"] = map[string]interface{}{
"host": strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")),
"type": dns.Type(q.Question[0].Qtype).String(),
"class": dns.Class(q.Question[0].Qclass).String(),
jsonEntry["question"] = map[string]interface{}{
"host": strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")),
"type": dns.Type(q.Question[0].Qtype).String(),
"class": dns.Class(q.Question[0].Qclass).String(),
jsonEntry["question"] = map[string]interface{}{
"host": strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")),
"type": dns.Type(q.Question[0].Qtype).String(),
"class": dns.Class(q.Question[0].Qclass).String(),
jsonEntry["question"] = map[string]interface{}{
"host": strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")),
"type": dns.Type(q.Question[0].Qtype).String(),
"class": dns.Class(q.Question[0].Qclass).String(),
jsonEntry["question"] = map[string]interface{}{
"host": strings.ToLower(strings.TrimSuffix(q.Question[0].Name, ".")),
"type": dns.Type(q.Question[0].Qtype).String(),
"class": dns.Class(q.Question[0].Qclass).String(),
}
if a != nil {
jsonEntry["status"] = dns.RcodeToString[a.Rcode]
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * querylog: don't return entries without Question data | https://github.com/AdguardTeam/AdGuardHome/commit/0d4e95b36d02e8aadfe6cbdd87d357efba6f02e8 | querylog/qlog.go |
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
"strings"
"time"
| </s> remove version: '0.99.3'
</s> add version: '0.101' </s> remove httpRegister(http.MethodGet, "/control/filtering/status", handleFilteringStatus)
httpRegister(http.MethodPost, "/control/filtering/config", handleFilteringConfig)
httpRegister(http.MethodPost, "/control/filtering/add_url", handleFilteringAddURL)
httpRegister(http.MethodPost, "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister(http.MethodPost, "/control/filtering/set_url", handleFilteringSetURL)
httpRegister(http.MethodPost, "/control/filtering/refresh", handleFilteringRefresh)
httpRegister(http.MethodPost, "/control/filtering/set_rules", handleFilteringSetRules)
</s> add httpRegister("GET", "/control/filtering/status", handleFilteringStatus)
httpRegister("POST", "/control/filtering/config", handleFilteringConfig)
httpRegister("POST", "/control/filtering/add_url", handleFilteringAddURL)
httpRegister("POST", "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister("POST", "/control/filtering/set_url", handleFilteringSetURL)
httpRegister("POST", "/control/filtering/refresh", handleFilteringRefresh)
httpRegister("POST", "/control/filtering/set_rules", handleFilteringSetRules)
httpRegister("GET", "/control/filtering/check_host", handleCheckHost) | "net" | import (
"encoding/json"
"fmt"
"io/ioutil"
"net"
"net/http"
"net/url"
"os"
"strings"
"time" | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + GET /filtering/check_host: Check if host name is filtered | https://github.com/AdguardTeam/AdGuardHome/commit/0d7c01d50f8efdc55203178cafe091ee07780445 | home/control_filtering.go |
"strings"
"time"
"github.com/AdguardTeam/golibs/log"
)
// IsValidURL - return TRUE if URL is valid
func IsValidURL(rawurl string) bool {
url, err := url.ParseRequestURI(rawurl)
| </s> remove httpRegister(http.MethodGet, "/control/filtering/status", handleFilteringStatus)
httpRegister(http.MethodPost, "/control/filtering/config", handleFilteringConfig)
httpRegister(http.MethodPost, "/control/filtering/add_url", handleFilteringAddURL)
httpRegister(http.MethodPost, "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister(http.MethodPost, "/control/filtering/set_url", handleFilteringSetURL)
httpRegister(http.MethodPost, "/control/filtering/refresh", handleFilteringRefresh)
httpRegister(http.MethodPost, "/control/filtering/set_rules", handleFilteringSetRules)
</s> add httpRegister("GET", "/control/filtering/status", handleFilteringStatus)
httpRegister("POST", "/control/filtering/config", handleFilteringConfig)
httpRegister("POST", "/control/filtering/add_url", handleFilteringAddURL)
httpRegister("POST", "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister("POST", "/control/filtering/set_url", handleFilteringSetURL)
httpRegister("POST", "/control/filtering/refresh", handleFilteringRefresh)
httpRegister("POST", "/control/filtering/set_rules", handleFilteringSetRules)
httpRegister("GET", "/control/filtering/check_host", handleCheckHost) </s> remove version: '0.99.3'
</s> add version: '0.101' | "github.com/miekg/dns" | "strings"
"time"
"github.com/AdguardTeam/golibs/log"
"github.com/miekg/dns"
)
// IsValidURL - return TRUE if URL is valid
func IsValidURL(rawurl string) bool {
url, err := url.ParseRequestURI(rawurl) | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + GET /filtering/check_host: Check if host name is filtered | https://github.com/AdguardTeam/AdGuardHome/commit/0d7c01d50f8efdc55203178cafe091ee07780445 | home/control_filtering.go |
}
// RegisterFilteringHandlers - register handlers
func RegisterFilteringHandlers() {
httpRegister(http.MethodGet, "/control/filtering/status", handleFilteringStatus)
httpRegister(http.MethodPost, "/control/filtering/config", handleFilteringConfig)
httpRegister(http.MethodPost, "/control/filtering/add_url", handleFilteringAddURL)
httpRegister(http.MethodPost, "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister(http.MethodPost, "/control/filtering/set_url", handleFilteringSetURL)
httpRegister(http.MethodPost, "/control/filtering/refresh", handleFilteringRefresh)
httpRegister(http.MethodPost, "/control/filtering/set_rules", handleFilteringSetRules)
}
func checkFiltersUpdateIntervalHours(i uint32) bool {
return i == 0 || i == 1 || i == 12 || i == 1*24 || i == 3*24 || i == 7*24
}
| </s> remove version: '0.99.3'
</s> add version: '0.101' | httpRegister("GET", "/control/filtering/status", handleFilteringStatus)
httpRegister("POST", "/control/filtering/config", handleFilteringConfig)
httpRegister("POST", "/control/filtering/add_url", handleFilteringAddURL)
httpRegister("POST", "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister("POST", "/control/filtering/set_url", handleFilteringSetURL)
httpRegister("POST", "/control/filtering/refresh", handleFilteringRefresh)
httpRegister("POST", "/control/filtering/set_rules", handleFilteringSetRules)
httpRegister("GET", "/control/filtering/check_host", handleCheckHost) | }
// RegisterFilteringHandlers - register handlers
func RegisterFilteringHandlers() {
httpRegister("GET", "/control/filtering/status", handleFilteringStatus)
httpRegister("POST", "/control/filtering/config", handleFilteringConfig)
httpRegister("POST", "/control/filtering/add_url", handleFilteringAddURL)
httpRegister("POST", "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister("POST", "/control/filtering/set_url", handleFilteringSetURL)
httpRegister("POST", "/control/filtering/refresh", handleFilteringRefresh)
httpRegister("POST", "/control/filtering/set_rules", handleFilteringSetRules)
httpRegister("GET", "/control/filtering/check_host", handleCheckHost)
httpRegister("GET", "/control/filtering/status", handleFilteringStatus)
httpRegister("POST", "/control/filtering/config", handleFilteringConfig)
httpRegister("POST", "/control/filtering/add_url", handleFilteringAddURL)
httpRegister("POST", "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister("POST", "/control/filtering/set_url", handleFilteringSetURL)
httpRegister("POST", "/control/filtering/refresh", handleFilteringRefresh)
httpRegister("POST", "/control/filtering/set_rules", handleFilteringSetRules)
httpRegister("GET", "/control/filtering/check_host", handleCheckHost)
httpRegister("GET", "/control/filtering/status", handleFilteringStatus)
httpRegister("POST", "/control/filtering/config", handleFilteringConfig)
httpRegister("POST", "/control/filtering/add_url", handleFilteringAddURL)
httpRegister("POST", "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister("POST", "/control/filtering/set_url", handleFilteringSetURL)
httpRegister("POST", "/control/filtering/refresh", handleFilteringRefresh)
httpRegister("POST", "/control/filtering/set_rules", handleFilteringSetRules)
httpRegister("GET", "/control/filtering/check_host", handleCheckHost)
httpRegister("GET", "/control/filtering/status", handleFilteringStatus)
httpRegister("POST", "/control/filtering/config", handleFilteringConfig)
httpRegister("POST", "/control/filtering/add_url", handleFilteringAddURL)
httpRegister("POST", "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister("POST", "/control/filtering/set_url", handleFilteringSetURL)
httpRegister("POST", "/control/filtering/refresh", handleFilteringRefresh)
httpRegister("POST", "/control/filtering/set_rules", handleFilteringSetRules)
httpRegister("GET", "/control/filtering/check_host", handleCheckHost)
httpRegister("GET", "/control/filtering/status", handleFilteringStatus)
httpRegister("POST", "/control/filtering/config", handleFilteringConfig)
httpRegister("POST", "/control/filtering/add_url", handleFilteringAddURL)
httpRegister("POST", "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister("POST", "/control/filtering/set_url", handleFilteringSetURL)
httpRegister("POST", "/control/filtering/refresh", handleFilteringRefresh)
httpRegister("POST", "/control/filtering/set_rules", handleFilteringSetRules)
httpRegister("GET", "/control/filtering/check_host", handleCheckHost)
httpRegister("GET", "/control/filtering/status", handleFilteringStatus)
httpRegister("POST", "/control/filtering/config", handleFilteringConfig)
httpRegister("POST", "/control/filtering/add_url", handleFilteringAddURL)
httpRegister("POST", "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister("POST", "/control/filtering/set_url", handleFilteringSetURL)
httpRegister("POST", "/control/filtering/refresh", handleFilteringRefresh)
httpRegister("POST", "/control/filtering/set_rules", handleFilteringSetRules)
httpRegister("GET", "/control/filtering/check_host", handleCheckHost)
httpRegister("GET", "/control/filtering/status", handleFilteringStatus)
httpRegister("POST", "/control/filtering/config", handleFilteringConfig)
httpRegister("POST", "/control/filtering/add_url", handleFilteringAddURL)
httpRegister("POST", "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister("POST", "/control/filtering/set_url", handleFilteringSetURL)
httpRegister("POST", "/control/filtering/refresh", handleFilteringRefresh)
httpRegister("POST", "/control/filtering/set_rules", handleFilteringSetRules)
httpRegister("GET", "/control/filtering/check_host", handleCheckHost)
}
func checkFiltersUpdateIntervalHours(i uint32) bool {
return i == 0 || i == 1 || i == 12 || i == 1*24 || i == 3*24 || i == 7*24
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + GET /filtering/check_host: Check if host name is filtered | https://github.com/AdguardTeam/AdGuardHome/commit/0d7c01d50f8efdc55203178cafe091ee07780445 | home/control_filtering.go |
swagger: '2.0'
info:
title: 'AdGuard Home'
description: 'AdGuard Home REST API. Admin web interface is built on top of this REST API.'
version: '0.99.3'
schemes:
- http
basePath: /control
produces:
- application/json
| </s> remove httpRegister(http.MethodGet, "/control/filtering/status", handleFilteringStatus)
httpRegister(http.MethodPost, "/control/filtering/config", handleFilteringConfig)
httpRegister(http.MethodPost, "/control/filtering/add_url", handleFilteringAddURL)
httpRegister(http.MethodPost, "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister(http.MethodPost, "/control/filtering/set_url", handleFilteringSetURL)
httpRegister(http.MethodPost, "/control/filtering/refresh", handleFilteringRefresh)
httpRegister(http.MethodPost, "/control/filtering/set_rules", handleFilteringSetRules)
</s> add httpRegister("GET", "/control/filtering/status", handleFilteringStatus)
httpRegister("POST", "/control/filtering/config", handleFilteringConfig)
httpRegister("POST", "/control/filtering/add_url", handleFilteringAddURL)
httpRegister("POST", "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister("POST", "/control/filtering/set_url", handleFilteringSetURL)
httpRegister("POST", "/control/filtering/refresh", handleFilteringRefresh)
httpRegister("POST", "/control/filtering/set_rules", handleFilteringSetRules)
httpRegister("GET", "/control/filtering/check_host", handleCheckHost) | version: '0.101' | swagger: '2.0'
info:
title: 'AdGuard Home'
description: 'AdGuard Home REST API. Admin web interface is built on top of this REST API.'
version: '0.101'
schemes:
- http
basePath: /control
produces:
- application/json | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + GET /filtering/check_host: Check if host name is filtered | https://github.com/AdguardTeam/AdGuardHome/commit/0d7c01d50f8efdc55203178cafe091ee07780445 | openapi/openapi.yaml |
description: OK
# --------------------------------------------------
# Safebrowsing methods
# --------------------------------------------------
/safebrowsing/enable:
| </s> remove version: '0.99.3'
</s> add version: '0.101' </s> remove httpRegister(http.MethodGet, "/control/filtering/status", handleFilteringStatus)
httpRegister(http.MethodPost, "/control/filtering/config", handleFilteringConfig)
httpRegister(http.MethodPost, "/control/filtering/add_url", handleFilteringAddURL)
httpRegister(http.MethodPost, "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister(http.MethodPost, "/control/filtering/set_url", handleFilteringSetURL)
httpRegister(http.MethodPost, "/control/filtering/refresh", handleFilteringRefresh)
httpRegister(http.MethodPost, "/control/filtering/set_rules", handleFilteringSetRules)
</s> add httpRegister("GET", "/control/filtering/status", handleFilteringStatus)
httpRegister("POST", "/control/filtering/config", handleFilteringConfig)
httpRegister("POST", "/control/filtering/add_url", handleFilteringAddURL)
httpRegister("POST", "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister("POST", "/control/filtering/set_url", handleFilteringSetURL)
httpRegister("POST", "/control/filtering/refresh", handleFilteringRefresh)
httpRegister("POST", "/control/filtering/set_rules", handleFilteringSetRules)
httpRegister("GET", "/control/filtering/check_host", handleCheckHost) | /filtering/check_host:
get:
tags:
- filtering
operationId: filteringCheckHost
summary: 'Check if host name is filtered'
parameters:
- name: name
in: query
type: string
responses:
200:
description: OK
schema:
$ref: "#/definitions/FilterCheckHostResponse"
| description: OK
/filtering/check_host:
get:
tags:
- filtering
operationId: filteringCheckHost
summary: 'Check if host name is filtered'
parameters:
- name: name
in: query
type: string
responses:
200:
description: OK
schema:
$ref: "#/definitions/FilterCheckHostResponse"
# --------------------------------------------------
# Safebrowsing methods
# --------------------------------------------------
/safebrowsing/enable: | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + GET /filtering/check_host: Check if host name is filtered | https://github.com/AdguardTeam/AdGuardHome/commit/0d7c01d50f8efdc55203178cafe091ee07780445 | openapi/openapi.yaml |
- "FilteredParental"
- "FilteredInvalid"
- "FilteredSafeSearch"
- "FilteredBlockedService"
service_name:
type: "string"
description: "Set if reason=FilteredBlockedService"
status:
type: "string"
description: "DNS response status"
| </s> remove version: '0.99.3'
</s> add version: '0.101' </s> remove httpRegister(http.MethodGet, "/control/filtering/status", handleFilteringStatus)
httpRegister(http.MethodPost, "/control/filtering/config", handleFilteringConfig)
httpRegister(http.MethodPost, "/control/filtering/add_url", handleFilteringAddURL)
httpRegister(http.MethodPost, "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister(http.MethodPost, "/control/filtering/set_url", handleFilteringSetURL)
httpRegister(http.MethodPost, "/control/filtering/refresh", handleFilteringRefresh)
httpRegister(http.MethodPost, "/control/filtering/set_rules", handleFilteringSetRules)
</s> add httpRegister("GET", "/control/filtering/status", handleFilteringStatus)
httpRegister("POST", "/control/filtering/config", handleFilteringConfig)
httpRegister("POST", "/control/filtering/add_url", handleFilteringAddURL)
httpRegister("POST", "/control/filtering/remove_url", handleFilteringRemoveURL)
httpRegister("POST", "/control/filtering/set_url", handleFilteringSetURL)
httpRegister("POST", "/control/filtering/refresh", handleFilteringRefresh)
httpRegister("POST", "/control/filtering/set_rules", handleFilteringSetRules)
httpRegister("GET", "/control/filtering/check_host", handleCheckHost) | - "ReasonRewrite" | - "FilteredParental"
- "FilteredInvalid"
- "FilteredSafeSearch"
- "FilteredBlockedService"
- "ReasonRewrite"
service_name:
type: "string"
description: "Set if reason=FilteredBlockedService"
status:
type: "string"
description: "DNS response status" | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + GET /filtering/check_host: Check if host name is filtered | https://github.com/AdguardTeam/AdGuardHome/commit/0d7c01d50f8efdc55203178cafe091ee07780445 | openapi/openapi.yaml |
func (clients *clientsContainer) WriteDiskConfig(objects *[]clientObject) {
clients.lock.Lock()
defer clients.lock.Unlock()
clientObjects := []clientObject{}
for _, cli := range clients.list {
cy := clientObject{
Name: cli.Name,
UseGlobalSettings: !cli.UseOwnSettings,
FilteringEnabled: cli.FilteringEnabled,
| </s> remove cy := clientObject{
</s> add cliObj := clientObject{ </s> remove // above loop can generate different orderings when writing to the
// config file: this produces lots of diffs in config files, so sort
// objects by name before writing.
</s> add // above loop can generate different orderings when writing to the config
// file: this produces lots of diffs in config files, so sort objects by
// name before writing. </s> remove clientObjects = append(clientObjects, cy)
</s> add clientObjects = append(clientObjects, cliObj) </s> remove cy.Tags = stringutil.CloneSlice(cli.Tags)
cy.IDs = stringutil.CloneSlice(cli.IDs)
cy.BlockedServices = stringutil.CloneSlice(cli.BlockedServices)
cy.Upstreams = stringutil.CloneSlice(cli.Upstreams)
</s> add cliObj.Tags = stringutil.CloneSlice(cli.Tags)
cliObj.IDs = stringutil.CloneSlice(cli.IDs)
cliObj.BlockedServices = stringutil.CloneSlice(cli.BlockedServices)
cliObj.Upstreams = stringutil.CloneSlice(cli.Upstreams) | var clientObjects []clientObject | func (clients *clientsContainer) WriteDiskConfig(objects *[]clientObject) {
clients.lock.Lock()
defer clients.lock.Unlock()
var clientObjects []clientObject
for _, cli := range clients.list {
cy := clientObject{
Name: cli.Name,
UseGlobalSettings: !cli.UseOwnSettings,
FilteringEnabled: cli.FilteringEnabled, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | all: doc changes, imp names | https://github.com/AdguardTeam/AdGuardHome/commit/0e1015a4ee7f4101ef21cb2b2688beb50a11dc83 | internal/home/clients.go |
defer clients.lock.Unlock()
clientObjects := []clientObject{}
for _, cli := range clients.list {
cy := clientObject{
Name: cli.Name,
UseGlobalSettings: !cli.UseOwnSettings,
FilteringEnabled: cli.FilteringEnabled,
ParentalEnabled: cli.ParentalEnabled,
SafeSearchEnabled: cli.SafeSearchEnabled,
| </s> remove clientObjects := []clientObject{}
</s> add var clientObjects []clientObject </s> remove // above loop can generate different orderings when writing to the
// config file: this produces lots of diffs in config files, so sort
// objects by name before writing.
</s> add // above loop can generate different orderings when writing to the config
// file: this produces lots of diffs in config files, so sort objects by
// name before writing. </s> remove clientObjects = append(clientObjects, cy)
</s> add clientObjects = append(clientObjects, cliObj) </s> remove cy.Tags = stringutil.CloneSlice(cli.Tags)
cy.IDs = stringutil.CloneSlice(cli.IDs)
cy.BlockedServices = stringutil.CloneSlice(cli.BlockedServices)
cy.Upstreams = stringutil.CloneSlice(cli.Upstreams)
</s> add cliObj.Tags = stringutil.CloneSlice(cli.Tags)
cliObj.IDs = stringutil.CloneSlice(cli.IDs)
cliObj.BlockedServices = stringutil.CloneSlice(cli.BlockedServices)
cliObj.Upstreams = stringutil.CloneSlice(cli.Upstreams) | cliObj := clientObject{ | defer clients.lock.Unlock()
clientObjects := []clientObject{}
for _, cli := range clients.list {
cliObj := clientObject{
Name: cli.Name,
UseGlobalSettings: !cli.UseOwnSettings,
FilteringEnabled: cli.FilteringEnabled,
ParentalEnabled: cli.ParentalEnabled,
SafeSearchEnabled: cli.SafeSearchEnabled, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | all: doc changes, imp names | https://github.com/AdguardTeam/AdGuardHome/commit/0e1015a4ee7f4101ef21cb2b2688beb50a11dc83 | internal/home/clients.go |
SafeBrowsingEnabled: cli.SafeBrowsingEnabled,
UseGlobalBlockedServices: !cli.UseOwnBlockedServices,
}
cy.Tags = stringutil.CloneSlice(cli.Tags)
cy.IDs = stringutil.CloneSlice(cli.IDs)
cy.BlockedServices = stringutil.CloneSlice(cli.BlockedServices)
cy.Upstreams = stringutil.CloneSlice(cli.Upstreams)
clientObjects = append(clientObjects, cy)
}
// Maps aren't guaranteed to iterate in the same order each time, so the
| </s> remove clientObjects = append(clientObjects, cy)
</s> add clientObjects = append(clientObjects, cliObj) </s> remove // above loop can generate different orderings when writing to the
// config file: this produces lots of diffs in config files, so sort
// objects by name before writing.
</s> add // above loop can generate different orderings when writing to the config
// file: this produces lots of diffs in config files, so sort objects by
// name before writing. </s> remove clientObjects := []clientObject{}
</s> add var clientObjects []clientObject </s> remove cy := clientObject{
</s> add cliObj := clientObject{ | cliObj.Tags = stringutil.CloneSlice(cli.Tags)
cliObj.IDs = stringutil.CloneSlice(cli.IDs)
cliObj.BlockedServices = stringutil.CloneSlice(cli.BlockedServices)
cliObj.Upstreams = stringutil.CloneSlice(cli.Upstreams) | SafeBrowsingEnabled: cli.SafeBrowsingEnabled,
UseGlobalBlockedServices: !cli.UseOwnBlockedServices,
}
cliObj.Tags = stringutil.CloneSlice(cli.Tags)
cliObj.IDs = stringutil.CloneSlice(cli.IDs)
cliObj.BlockedServices = stringutil.CloneSlice(cli.BlockedServices)
cliObj.Upstreams = stringutil.CloneSlice(cli.Upstreams)
cliObj.Tags = stringutil.CloneSlice(cli.Tags)
cliObj.IDs = stringutil.CloneSlice(cli.IDs)
cliObj.BlockedServices = stringutil.CloneSlice(cli.BlockedServices)
cliObj.Upstreams = stringutil.CloneSlice(cli.Upstreams)
cliObj.Tags = stringutil.CloneSlice(cli.Tags)
cliObj.IDs = stringutil.CloneSlice(cli.IDs)
cliObj.BlockedServices = stringutil.CloneSlice(cli.BlockedServices)
cliObj.Upstreams = stringutil.CloneSlice(cli.Upstreams)
cliObj.Tags = stringutil.CloneSlice(cli.Tags)
cliObj.IDs = stringutil.CloneSlice(cli.IDs)
cliObj.BlockedServices = stringutil.CloneSlice(cli.BlockedServices)
cliObj.Upstreams = stringutil.CloneSlice(cli.Upstreams)
clientObjects = append(clientObjects, cy)
}
// Maps aren't guaranteed to iterate in the same order each time, so the | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | all: doc changes, imp names | https://github.com/AdguardTeam/AdGuardHome/commit/0e1015a4ee7f4101ef21cb2b2688beb50a11dc83 | internal/home/clients.go |
cy.IDs = stringutil.CloneSlice(cli.IDs)
cy.BlockedServices = stringutil.CloneSlice(cli.BlockedServices)
cy.Upstreams = stringutil.CloneSlice(cli.Upstreams)
clientObjects = append(clientObjects, cy)
}
// Maps aren't guaranteed to iterate in the same order each time, so the
// above loop can generate different orderings when writing to the
// config file: this produces lots of diffs in config files, so sort
| </s> remove // above loop can generate different orderings when writing to the
// config file: this produces lots of diffs in config files, so sort
// objects by name before writing.
</s> add // above loop can generate different orderings when writing to the config
// file: this produces lots of diffs in config files, so sort objects by
// name before writing. </s> remove cy.Tags = stringutil.CloneSlice(cli.Tags)
cy.IDs = stringutil.CloneSlice(cli.IDs)
cy.BlockedServices = stringutil.CloneSlice(cli.BlockedServices)
cy.Upstreams = stringutil.CloneSlice(cli.Upstreams)
</s> add cliObj.Tags = stringutil.CloneSlice(cli.Tags)
cliObj.IDs = stringutil.CloneSlice(cli.IDs)
cliObj.BlockedServices = stringutil.CloneSlice(cli.BlockedServices)
cliObj.Upstreams = stringutil.CloneSlice(cli.Upstreams) </s> remove clientObjects := []clientObject{}
</s> add var clientObjects []clientObject </s> remove cy := clientObject{
</s> add cliObj := clientObject{ | clientObjects = append(clientObjects, cliObj) | cy.IDs = stringutil.CloneSlice(cli.IDs)
cy.BlockedServices = stringutil.CloneSlice(cli.BlockedServices)
cy.Upstreams = stringutil.CloneSlice(cli.Upstreams)
clientObjects = append(clientObjects, cliObj)
}
// Maps aren't guaranteed to iterate in the same order each time, so the
// above loop can generate different orderings when writing to the
// config file: this produces lots of diffs in config files, so sort | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | all: doc changes, imp names | https://github.com/AdguardTeam/AdGuardHome/commit/0e1015a4ee7f4101ef21cb2b2688beb50a11dc83 | internal/home/clients.go |
clientObjects = append(clientObjects, cy)
}
// Maps aren't guaranteed to iterate in the same order each time, so the
// above loop can generate different orderings when writing to the
// config file: this produces lots of diffs in config files, so sort
// objects by name before writing.
sort.Slice(clientObjects, func(i, j int) bool {
return clientObjects[i].Name < clientObjects[j].Name
})
*objects = append(*objects, clientObjects...)
}
| </s> remove clientObjects = append(clientObjects, cy)
</s> add clientObjects = append(clientObjects, cliObj) </s> remove cy.Tags = stringutil.CloneSlice(cli.Tags)
cy.IDs = stringutil.CloneSlice(cli.IDs)
cy.BlockedServices = stringutil.CloneSlice(cli.BlockedServices)
cy.Upstreams = stringutil.CloneSlice(cli.Upstreams)
</s> add cliObj.Tags = stringutil.CloneSlice(cli.Tags)
cliObj.IDs = stringutil.CloneSlice(cli.IDs)
cliObj.BlockedServices = stringutil.CloneSlice(cli.BlockedServices)
cliObj.Upstreams = stringutil.CloneSlice(cli.Upstreams) </s> remove clientObjects := []clientObject{}
</s> add var clientObjects []clientObject </s> remove cy := clientObject{
</s> add cliObj := clientObject{ | // above loop can generate different orderings when writing to the config
// file: this produces lots of diffs in config files, so sort objects by
// name before writing. | clientObjects = append(clientObjects, cy)
}
// Maps aren't guaranteed to iterate in the same order each time, so the
// above loop can generate different orderings when writing to the config
// file: this produces lots of diffs in config files, so sort objects by
// name before writing.
// above loop can generate different orderings when writing to the config
// file: this produces lots of diffs in config files, so sort objects by
// name before writing.
// above loop can generate different orderings when writing to the config
// file: this produces lots of diffs in config files, so sort objects by
// name before writing.
sort.Slice(clientObjects, func(i, j int) bool {
return clientObjects[i].Name < clientObjects[j].Name
})
*objects = append(*objects, clientObjects...)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | all: doc changes, imp names | https://github.com/AdguardTeam/AdGuardHome/commit/0e1015a4ee7f4101ef21cb2b2688beb50a11dc83 | internal/home/clients.go |
// configure log level and output
configureLogger(args)
// Go memory hacks
memoryUsage(args)
// Print the first message after logger is configured.
log.Println(version.Full())
log.Debug("current working directory is %s", Context.workDir)
if args.runningAsService {
log.Info("AdGuard Home is running as a service")
| </s> remove // disableMemoryOptimization - disables memory optimization hacks
// see memoryUsage() function for the details
disableMemoryOptimization bool
</s> add </s> remove nil, func(o options) (options, error) { o.disableMemoryOptimization = true; return o, nil }, nil,
func(o options) []string { return boolSliceOrNil(o.disableMemoryOptimization) },
</s> add nil, nil, func(_ options, _ string) (f effect, err error) {
log.Info("warning: using --no-mem-optimization flag has no effect and is deprecated")
return nil, nil
},
func(o options) []string { return nil }, </s> remove assert.False(t, testParseOK(t).disableMemoryOptimization, "empty is not disable update")
assert.True(t, testParseOK(t, "--no-mem-optimization").disableMemoryOptimization, "--no-mem-optimization is disable update")
</s> add o, eff, err := parse("", []string{"--no-mem-optimization"})
require.NoError(t, err)
assert.Nil(t, eff)
assert.Zero(t, o) |
// configure log level and output
configureLogger(args)
// Print the first message after logger is configured.
log.Println(version.Full())
log.Debug("current working directory is %s", Context.workDir)
if args.runningAsService {
log.Info("AdGuard Home is running as a service") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 4437 depr memory opt
Merge in DNS/adguard-home from 4437-rm-mem-opt to master
Updates #4437.
Updates #2044.
Squashed commit of the following:
commit d1e5520213f6b68570d18a8d831d4923112901ba
Merge: 73a6b494 8bb95469
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 19:37:09 2022 +0300
Merge branch 'master' into 4437-rm-mem-opt
commit 73a6b4948cb32f1cb79a54b244018b29382fad76
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:33:23 2022 +0300
all: imp log of changes
commit a62efcdcd44de300726c906c7f6198c0a02d4ccf
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:27:42 2022 +0300
home: depr memory opt | https://github.com/AdguardTeam/AdGuardHome/commit/0e608fda1367c33e8da1b8fc28029f45b3d69fab | internal/home/home.go |
|
"strconv"
"github.com/AdguardTeam/AdGuardHome/internal/version"
)
// options passed from command-line arguments
type options struct {
| </s> remove // disableMemoryOptimization - disables memory optimization hacks
// see memoryUsage() function for the details
disableMemoryOptimization bool
</s> add </s> remove const reportFmt = "expected %s but got %s"
</s> add </s> remove // Go memory hacks
memoryUsage(args)
</s> add </s> remove }, {
name: "disable_mem_opt",
opts: options{disableMemoryOptimization: true},
ss: []string{"--no-mem-optimization"},
</s> add | "github.com/AdguardTeam/golibs/log" | "strconv"
"github.com/AdguardTeam/AdGuardHome/internal/version"
"github.com/AdguardTeam/golibs/log"
)
// options passed from command-line arguments
type options struct { | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 4437 depr memory opt
Merge in DNS/adguard-home from 4437-rm-mem-opt to master
Updates #4437.
Updates #2044.
Squashed commit of the following:
commit d1e5520213f6b68570d18a8d831d4923112901ba
Merge: 73a6b494 8bb95469
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 19:37:09 2022 +0300
Merge branch 'master' into 4437-rm-mem-opt
commit 73a6b4948cb32f1cb79a54b244018b29382fad76
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:33:23 2022 +0300
all: imp log of changes
commit a62efcdcd44de300726c906c7f6198c0a02d4ccf
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:27:42 2022 +0300
home: depr memory opt | https://github.com/AdguardTeam/AdGuardHome/commit/0e608fda1367c33e8da1b8fc28029f45b3d69fab | internal/home/options.go |
// runningAsService flag is set to true when options are passed from the service runner
runningAsService bool
// disableMemoryOptimization - disables memory optimization hacks
// see memoryUsage() function for the details
disableMemoryOptimization bool
glinetMode bool // Activate GL-Inet compatibility mode
// noEtcHosts flag should be provided when /etc/hosts file shouldn't be
// used.
noEtcHosts bool
| </s> remove // Go memory hacks
memoryUsage(args)
</s> add </s> remove nil, func(o options) (options, error) { o.disableMemoryOptimization = true; return o, nil }, nil,
func(o options) []string { return boolSliceOrNil(o.disableMemoryOptimization) },
</s> add nil, nil, func(_ options, _ string) (f effect, err error) {
log.Info("warning: using --no-mem-optimization flag has no effect and is deprecated")
return nil, nil
},
func(o options) []string { return nil }, </s> remove assert.False(t, testParseOK(t).disableMemoryOptimization, "empty is not disable update")
assert.True(t, testParseOK(t, "--no-mem-optimization").disableMemoryOptimization, "--no-mem-optimization is disable update")
</s> add o, eff, err := parse("", []string{"--no-mem-optimization"})
require.NoError(t, err)
assert.Nil(t, eff)
assert.Zero(t, o) |
// runningAsService flag is set to true when options are passed from the service runner
runningAsService bool
glinetMode bool // Activate GL-Inet compatibility mode
// noEtcHosts flag should be provided when /etc/hosts file shouldn't be
// used.
noEtcHosts bool | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 4437 depr memory opt
Merge in DNS/adguard-home from 4437-rm-mem-opt to master
Updates #4437.
Updates #2044.
Squashed commit of the following:
commit d1e5520213f6b68570d18a8d831d4923112901ba
Merge: 73a6b494 8bb95469
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 19:37:09 2022 +0300
Merge branch 'master' into 4437-rm-mem-opt
commit 73a6b4948cb32f1cb79a54b244018b29382fad76
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:33:23 2022 +0300
all: imp log of changes
commit a62efcdcd44de300726c906c7f6198c0a02d4ccf
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:27:42 2022 +0300
home: depr memory opt | https://github.com/AdguardTeam/AdGuardHome/commit/0e608fda1367c33e8da1b8fc28029f45b3d69fab | internal/home/options.go |
|
var disableMemoryOptimizationArg = arg{
"Disable memory optimization.",
"no-mem-optimization", "",
nil, func(o options) (options, error) { o.disableMemoryOptimization = true; return o, nil }, nil,
func(o options) []string { return boolSliceOrNil(o.disableMemoryOptimization) },
}
var verboseArg = arg{
"Enable verbose output.",
"verbose", "v",
| </s> remove const reportFmt = "expected %s but got %s"
</s> add </s> remove }, {
name: "disable_mem_opt",
opts: options{disableMemoryOptimization: true},
ss: []string{"--no-mem-optimization"},
</s> add </s> remove assert.False(t, testParseOK(t).disableMemoryOptimization, "empty is not disable update")
assert.True(t, testParseOK(t, "--no-mem-optimization").disableMemoryOptimization, "--no-mem-optimization is disable update")
</s> add o, eff, err := parse("", []string{"--no-mem-optimization"})
require.NoError(t, err)
assert.Nil(t, eff)
assert.Zero(t, o) </s> remove "--no-mem-optimization",
</s> add </s> remove serviceControlAction: "run",
configFilename: "config",
workDir: "work",
pidFile: "pid",
disableUpdate: true,
disableMemoryOptimization: true,
</s> add serviceControlAction: "run",
configFilename: "config",
workDir: "work",
pidFile: "pid",
disableUpdate: true, | nil, nil, func(_ options, _ string) (f effect, err error) {
log.Info("warning: using --no-mem-optimization flag has no effect and is deprecated")
return nil, nil
},
func(o options) []string { return nil }, |
var disableMemoryOptimizationArg = arg{
"Disable memory optimization.",
"no-mem-optimization", "",
nil, nil, func(_ options, _ string) (f effect, err error) {
log.Info("warning: using --no-mem-optimization flag has no effect and is deprecated")
return nil, nil
},
func(o options) []string { return nil },
nil, nil, func(_ options, _ string) (f effect, err error) {
log.Info("warning: using --no-mem-optimization flag has no effect and is deprecated")
return nil, nil
},
func(o options) []string { return nil },
}
var verboseArg = arg{
"Enable verbose output.",
"verbose", "v", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 4437 depr memory opt
Merge in DNS/adguard-home from 4437-rm-mem-opt to master
Updates #4437.
Updates #2044.
Squashed commit of the following:
commit d1e5520213f6b68570d18a8d831d4923112901ba
Merge: 73a6b494 8bb95469
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 19:37:09 2022 +0300
Merge branch 'master' into 4437-rm-mem-opt
commit 73a6b4948cb32f1cb79a54b244018b29382fad76
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:33:23 2022 +0300
all: imp log of changes
commit a62efcdcd44de300726c906c7f6198c0a02d4ccf
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:27:42 2022 +0300
home: depr memory opt | https://github.com/AdguardTeam/AdGuardHome/commit/0e608fda1367c33e8da1b8fc28029f45b3d69fab | internal/home/options.go |
assert.False(t, testParseOK(t).disableUpdate, "empty is not disable update")
assert.True(t, testParseOK(t, "--no-check-update").disableUpdate, "--no-check-update is disable update")
}
func TestParseDisableMemoryOptimization(t *testing.T) {
o, eff, err := parse("", []string{"--no-mem-optimization"})
require.NoError(t, err)
assert.Nil(t, eff)
assert.Zero(t, o)
| </s> remove assert.False(t, testParseOK(t).disableMemoryOptimization, "empty is not disable update")
assert.True(t, testParseOK(t, "--no-mem-optimization").disableMemoryOptimization, "--no-mem-optimization is disable update")
</s> add o, eff, err := parse("", []string{"--no-mem-optimization"})
require.NoError(t, err)
assert.Nil(t, eff)
assert.Zero(t, o) </s> remove nil, func(o options) (options, error) { o.disableMemoryOptimization = true; return o, nil }, nil,
func(o options) []string { return boolSliceOrNil(o.disableMemoryOptimization) },
</s> add nil, nil, func(_ options, _ string) (f effect, err error) {
log.Info("warning: using --no-mem-optimization flag has no effect and is deprecated")
return nil, nil
},
func(o options) []string { return nil }, </s> remove const reportFmt = "expected %s but got %s"
</s> add </s> remove require.Lenf(t, result, len(tc.ss), reportFmt, tc.ss, result)
for i, r := range result {
assert.Equalf(t, tc.ss[i], r, reportFmt, tc.ss, result)
}
</s> add assert.ElementsMatch(t, tc.ss, result) </s> remove "--no-mem-optimization",
</s> add | // TODO(e.burkov): Remove after v0.108.0. | assert.False(t, testParseOK(t).disableUpdate, "empty is not disable update")
assert.True(t, testParseOK(t, "--no-check-update").disableUpdate, "--no-check-update is disable update")
}
// TODO(e.burkov): Remove after v0.108.0.
func TestParseDisableMemoryOptimization(t *testing.T) {
o, eff, err := parse("", []string{"--no-mem-optimization"})
require.NoError(t, err)
assert.Nil(t, eff)
assert.Zero(t, o) | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 4437 depr memory opt
Merge in DNS/adguard-home from 4437-rm-mem-opt to master
Updates #4437.
Updates #2044.
Squashed commit of the following:
commit d1e5520213f6b68570d18a8d831d4923112901ba
Merge: 73a6b494 8bb95469
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 19:37:09 2022 +0300
Merge branch 'master' into 4437-rm-mem-opt
commit 73a6b4948cb32f1cb79a54b244018b29382fad76
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:33:23 2022 +0300
all: imp log of changes
commit a62efcdcd44de300726c906c7f6198c0a02d4ccf
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:27:42 2022 +0300
home: depr memory opt | https://github.com/AdguardTeam/AdGuardHome/commit/0e608fda1367c33e8da1b8fc28029f45b3d69fab | internal/home/options_test.go |
assert.True(t, testParseOK(t, "--no-check-update").disableUpdate, "--no-check-update is disable update")
}
func TestParseDisableMemoryOptimization(t *testing.T) {
assert.False(t, testParseOK(t).disableMemoryOptimization, "empty is not disable update")
assert.True(t, testParseOK(t, "--no-mem-optimization").disableMemoryOptimization, "--no-mem-optimization is disable update")
}
func TestParseService(t *testing.T) {
assert.Equal(t, "", testParseOK(t).serviceControlAction, "empty is not service cmd")
assert.Equal(t, "cmd", testParseOK(t, "-s", "cmd").serviceControlAction, "-s is service cmd")
| </s> remove const reportFmt = "expected %s but got %s"
</s> add </s> remove nil, func(o options) (options, error) { o.disableMemoryOptimization = true; return o, nil }, nil,
func(o options) []string { return boolSliceOrNil(o.disableMemoryOptimization) },
</s> add nil, nil, func(_ options, _ string) (f effect, err error) {
log.Info("warning: using --no-mem-optimization flag has no effect and is deprecated")
return nil, nil
},
func(o options) []string { return nil }, </s> remove "--no-mem-optimization",
</s> add </s> remove // disableMemoryOptimization - disables memory optimization hacks
// see memoryUsage() function for the details
disableMemoryOptimization bool
</s> add | o, eff, err := parse("", []string{"--no-mem-optimization"})
require.NoError(t, err)
assert.Nil(t, eff)
assert.Zero(t, o) | assert.True(t, testParseOK(t, "--no-check-update").disableUpdate, "--no-check-update is disable update")
}
func TestParseDisableMemoryOptimization(t *testing.T) {
o, eff, err := parse("", []string{"--no-mem-optimization"})
require.NoError(t, err)
assert.Nil(t, eff)
assert.Zero(t, o)
o, eff, err := parse("", []string{"--no-mem-optimization"})
require.NoError(t, err)
assert.Nil(t, eff)
assert.Zero(t, o)
}
func TestParseService(t *testing.T) {
assert.Equal(t, "", testParseOK(t).serviceControlAction, "empty is not service cmd")
assert.Equal(t, "cmd", testParseOK(t, "-s", "cmd").serviceControlAction, "-s is service cmd") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 4437 depr memory opt
Merge in DNS/adguard-home from 4437-rm-mem-opt to master
Updates #4437.
Updates #2044.
Squashed commit of the following:
commit d1e5520213f6b68570d18a8d831d4923112901ba
Merge: 73a6b494 8bb95469
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 19:37:09 2022 +0300
Merge branch 'master' into 4437-rm-mem-opt
commit 73a6b4948cb32f1cb79a54b244018b29382fad76
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:33:23 2022 +0300
all: imp log of changes
commit a62efcdcd44de300726c906c7f6198c0a02d4ccf
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:27:42 2022 +0300
home: depr memory opt | https://github.com/AdguardTeam/AdGuardHome/commit/0e608fda1367c33e8da1b8fc28029f45b3d69fab | internal/home/options_test.go |
testParseErr(t, "unknown dash", "-")
}
func TestSerialize(t *testing.T) {
const reportFmt = "expected %s but got %s"
testCases := []struct {
name string
opts options
ss []string
}{{
| </s> remove nil, func(o options) (options, error) { o.disableMemoryOptimization = true; return o, nil }, nil,
func(o options) []string { return boolSliceOrNil(o.disableMemoryOptimization) },
</s> add nil, nil, func(_ options, _ string) (f effect, err error) {
log.Info("warning: using --no-mem-optimization flag has no effect and is deprecated")
return nil, nil
},
func(o options) []string { return nil }, </s> remove require.Lenf(t, result, len(tc.ss), reportFmt, tc.ss, result)
for i, r := range result {
assert.Equalf(t, tc.ss[i], r, reportFmt, tc.ss, result)
}
</s> add assert.ElementsMatch(t, tc.ss, result) </s> remove "--no-mem-optimization",
</s> add </s> remove assert.False(t, testParseOK(t).disableMemoryOptimization, "empty is not disable update")
assert.True(t, testParseOK(t, "--no-mem-optimization").disableMemoryOptimization, "--no-mem-optimization is disable update")
</s> add o, eff, err := parse("", []string{"--no-mem-optimization"})
require.NoError(t, err)
assert.Nil(t, eff)
assert.Zero(t, o) | testParseErr(t, "unknown dash", "-")
}
func TestSerialize(t *testing.T) {
testCases := []struct {
name string
opts options
ss []string
}{{ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 4437 depr memory opt
Merge in DNS/adguard-home from 4437-rm-mem-opt to master
Updates #4437.
Updates #2044.
Squashed commit of the following:
commit d1e5520213f6b68570d18a8d831d4923112901ba
Merge: 73a6b494 8bb95469
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 19:37:09 2022 +0300
Merge branch 'master' into 4437-rm-mem-opt
commit 73a6b4948cb32f1cb79a54b244018b29382fad76
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:33:23 2022 +0300
all: imp log of changes
commit a62efcdcd44de300726c906c7f6198c0a02d4ccf
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:27:42 2022 +0300
home: depr memory opt | https://github.com/AdguardTeam/AdGuardHome/commit/0e608fda1367c33e8da1b8fc28029f45b3d69fab | internal/home/options_test.go |
|
}, {
name: "glinet_mode",
opts: options{glinetMode: true},
ss: []string{"--glinet"},
}, {
name: "disable_mem_opt",
opts: options{disableMemoryOptimization: true},
ss: []string{"--no-mem-optimization"},
}, {
name: "multiple",
opts: options{
serviceControlAction: "run",
configFilename: "config",
| </s> remove serviceControlAction: "run",
configFilename: "config",
workDir: "work",
pidFile: "pid",
disableUpdate: true,
disableMemoryOptimization: true,
</s> add serviceControlAction: "run",
configFilename: "config",
workDir: "work",
pidFile: "pid",
disableUpdate: true, </s> remove "--no-mem-optimization",
</s> add </s> remove nil, func(o options) (options, error) { o.disableMemoryOptimization = true; return o, nil }, nil,
func(o options) []string { return boolSliceOrNil(o.disableMemoryOptimization) },
</s> add nil, nil, func(_ options, _ string) (f effect, err error) {
log.Info("warning: using --no-mem-optimization flag has no effect and is deprecated")
return nil, nil
},
func(o options) []string { return nil }, </s> remove require.Lenf(t, result, len(tc.ss), reportFmt, tc.ss, result)
for i, r := range result {
assert.Equalf(t, tc.ss[i], r, reportFmt, tc.ss, result)
}
</s> add assert.ElementsMatch(t, tc.ss, result) </s> remove const reportFmt = "expected %s but got %s"
</s> add | }, {
name: "glinet_mode",
opts: options{glinetMode: true},
ss: []string{"--glinet"},
}, {
name: "multiple",
opts: options{
serviceControlAction: "run",
configFilename: "config", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 4437 depr memory opt
Merge in DNS/adguard-home from 4437-rm-mem-opt to master
Updates #4437.
Updates #2044.
Squashed commit of the following:
commit d1e5520213f6b68570d18a8d831d4923112901ba
Merge: 73a6b494 8bb95469
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 19:37:09 2022 +0300
Merge branch 'master' into 4437-rm-mem-opt
commit 73a6b4948cb32f1cb79a54b244018b29382fad76
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:33:23 2022 +0300
all: imp log of changes
commit a62efcdcd44de300726c906c7f6198c0a02d4ccf
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:27:42 2022 +0300
home: depr memory opt | https://github.com/AdguardTeam/AdGuardHome/commit/0e608fda1367c33e8da1b8fc28029f45b3d69fab | internal/home/options_test.go |
|
ss: []string{"--no-mem-optimization"},
}, {
name: "multiple",
opts: options{
serviceControlAction: "run",
configFilename: "config",
workDir: "work",
pidFile: "pid",
disableUpdate: true,
disableMemoryOptimization: true,
},
ss: []string{
"-c", "config",
"-w", "work",
"-s", "run",
| </s> remove }, {
name: "disable_mem_opt",
opts: options{disableMemoryOptimization: true},
ss: []string{"--no-mem-optimization"},
</s> add </s> remove "--no-mem-optimization",
</s> add </s> remove nil, func(o options) (options, error) { o.disableMemoryOptimization = true; return o, nil }, nil,
func(o options) []string { return boolSliceOrNil(o.disableMemoryOptimization) },
</s> add nil, nil, func(_ options, _ string) (f effect, err error) {
log.Info("warning: using --no-mem-optimization flag has no effect and is deprecated")
return nil, nil
},
func(o options) []string { return nil }, </s> remove assert.False(t, testParseOK(t).disableMemoryOptimization, "empty is not disable update")
assert.True(t, testParseOK(t, "--no-mem-optimization").disableMemoryOptimization, "--no-mem-optimization is disable update")
</s> add o, eff, err := parse("", []string{"--no-mem-optimization"})
require.NoError(t, err)
assert.Nil(t, eff)
assert.Zero(t, o) </s> remove require.Lenf(t, result, len(tc.ss), reportFmt, tc.ss, result)
for i, r := range result {
assert.Equalf(t, tc.ss[i], r, reportFmt, tc.ss, result)
}
</s> add assert.ElementsMatch(t, tc.ss, result) | serviceControlAction: "run",
configFilename: "config",
workDir: "work",
pidFile: "pid",
disableUpdate: true, | ss: []string{"--no-mem-optimization"},
}, {
name: "multiple",
opts: options{
serviceControlAction: "run",
configFilename: "config",
workDir: "work",
pidFile: "pid",
disableUpdate: true,
serviceControlAction: "run",
configFilename: "config",
workDir: "work",
pidFile: "pid",
disableUpdate: true,
serviceControlAction: "run",
configFilename: "config",
workDir: "work",
pidFile: "pid",
disableUpdate: true,
serviceControlAction: "run",
configFilename: "config",
workDir: "work",
pidFile: "pid",
disableUpdate: true,
serviceControlAction: "run",
configFilename: "config",
workDir: "work",
pidFile: "pid",
disableUpdate: true,
serviceControlAction: "run",
configFilename: "config",
workDir: "work",
pidFile: "pid",
disableUpdate: true,
},
ss: []string{
"-c", "config",
"-w", "work",
"-s", "run", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 4437 depr memory opt
Merge in DNS/adguard-home from 4437-rm-mem-opt to master
Updates #4437.
Updates #2044.
Squashed commit of the following:
commit d1e5520213f6b68570d18a8d831d4923112901ba
Merge: 73a6b494 8bb95469
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 19:37:09 2022 +0300
Merge branch 'master' into 4437-rm-mem-opt
commit 73a6b4948cb32f1cb79a54b244018b29382fad76
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:33:23 2022 +0300
all: imp log of changes
commit a62efcdcd44de300726c906c7f6198c0a02d4ccf
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:27:42 2022 +0300
home: depr memory opt | https://github.com/AdguardTeam/AdGuardHome/commit/0e608fda1367c33e8da1b8fc28029f45b3d69fab | internal/home/options_test.go |
"-w", "work",
"-s", "run",
"--pidfile", "pid",
"--no-check-update",
"--no-mem-optimization",
},
}}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
| </s> remove require.Lenf(t, result, len(tc.ss), reportFmt, tc.ss, result)
for i, r := range result {
assert.Equalf(t, tc.ss[i], r, reportFmt, tc.ss, result)
}
</s> add assert.ElementsMatch(t, tc.ss, result) </s> remove serviceControlAction: "run",
configFilename: "config",
workDir: "work",
pidFile: "pid",
disableUpdate: true,
disableMemoryOptimization: true,
</s> add serviceControlAction: "run",
configFilename: "config",
workDir: "work",
pidFile: "pid",
disableUpdate: true, </s> remove }, {
name: "disable_mem_opt",
opts: options{disableMemoryOptimization: true},
ss: []string{"--no-mem-optimization"},
</s> add </s> remove const reportFmt = "expected %s but got %s"
</s> add </s> remove nil, func(o options) (options, error) { o.disableMemoryOptimization = true; return o, nil }, nil,
func(o options) []string { return boolSliceOrNil(o.disableMemoryOptimization) },
</s> add nil, nil, func(_ options, _ string) (f effect, err error) {
log.Info("warning: using --no-mem-optimization flag has no effect and is deprecated")
return nil, nil
},
func(o options) []string { return nil }, | "-w", "work",
"-s", "run",
"--pidfile", "pid",
"--no-check-update",
},
}}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: 4437 depr memory opt
Merge in DNS/adguard-home from 4437-rm-mem-opt to master
Updates #4437.
Updates #2044.
Squashed commit of the following:
commit d1e5520213f6b68570d18a8d831d4923112901ba
Merge: 73a6b494 8bb95469
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 19:37:09 2022 +0300
Merge branch 'master' into 4437-rm-mem-opt
commit 73a6b4948cb32f1cb79a54b244018b29382fad76
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:33:23 2022 +0300
all: imp log of changes
commit a62efcdcd44de300726c906c7f6198c0a02d4ccf
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:27:42 2022 +0300
home: depr memory opt | https://github.com/AdguardTeam/AdGuardHome/commit/0e608fda1367c33e8da1b8fc28029f45b3d69fab | internal/home/options_test.go |
|
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
result := serialize(tc.opts)
require.Lenf(t, result, len(tc.ss), reportFmt, tc.ss, result)
for i, r := range result {
assert.Equalf(t, tc.ss[i], r, reportFmt, tc.ss, result)
}
})
}
}
| </s> remove "--no-mem-optimization",
</s> add </s> remove const reportFmt = "expected %s but got %s"
</s> add </s> remove assert.False(t, testParseOK(t).disableMemoryOptimization, "empty is not disable update")
assert.True(t, testParseOK(t, "--no-mem-optimization").disableMemoryOptimization, "--no-mem-optimization is disable update")
</s> add o, eff, err := parse("", []string{"--no-mem-optimization"})
require.NoError(t, err)
assert.Nil(t, eff)
assert.Zero(t, o) </s> remove nil, func(o options) (options, error) { o.disableMemoryOptimization = true; return o, nil }, nil,
func(o options) []string { return boolSliceOrNil(o.disableMemoryOptimization) },
</s> add nil, nil, func(_ options, _ string) (f effect, err error) {
log.Info("warning: using --no-mem-optimization flag has no effect and is deprecated")
return nil, nil
},
func(o options) []string { return nil }, | assert.ElementsMatch(t, tc.ss, result) |
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
result := serialize(tc.opts)
assert.ElementsMatch(t, tc.ss, result)
assert.ElementsMatch(t, tc.ss, result)
assert.ElementsMatch(t, tc.ss, result)
assert.ElementsMatch(t, tc.ss, result)
assert.ElementsMatch(t, tc.ss, result)
})
}
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep"
] | Pull request: 4437 depr memory opt
Merge in DNS/adguard-home from 4437-rm-mem-opt to master
Updates #4437.
Updates #2044.
Squashed commit of the following:
commit d1e5520213f6b68570d18a8d831d4923112901ba
Merge: 73a6b494 8bb95469
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 19:37:09 2022 +0300
Merge branch 'master' into 4437-rm-mem-opt
commit 73a6b4948cb32f1cb79a54b244018b29382fad76
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:33:23 2022 +0300
all: imp log of changes
commit a62efcdcd44de300726c906c7f6198c0a02d4ccf
Author: Eugene Burkov <[email protected]>
Date: Wed Apr 6 18:27:42 2022 +0300
home: depr memory opt | https://github.com/AdguardTeam/AdGuardHome/commit/0e608fda1367c33e8da1b8fc28029f45b3d69fab | internal/home/options_test.go |
.DS_Store
/.git
/.github
/.vscode
.idea
/AdGuardHome
/AdGuardHome.exe
/AdGuardHome.yaml
/AdGuardHome.log
/data
/build
/build2
/dist
/client/node_modules
/client2/node_modules
/.gitattributes
/.gitignore
/.goreleaser.yml
/changelog.config.js
/coverage.txt
/Dockerfile
/LICENSE.txt
/Makefile
/querylog.json
/querylog.json.1
/*.md
# Test output
dnsfilter/tests/top-1m.csv
dnsfilter/tests/dnsfilter.TestLotsOfRules*.pprof
# Snapcraft build temporary files
*.snap
launchpad_credentials
snapcraft_login
snapcraft.yaml.bak
# IntelliJ IDEA project files
*.iml
# Packr
*-packr.go
| </s> remove # * build -- builds AdGuardHome for the current platform
# * client -- builds client-side code of AdGuard Home
# * client-watch -- builds client-side code of AdGuard Home and watches for changes there
# * docker -- builds a docker image for the current platform
# * clean -- clean everything created by previous builds
# * lint -- run all linters
# * test -- run all unit-tests
# * dependencies -- installs dependencies (go and npm modules)
# * ci -- installs dependencies, runs linters and tests, intended to be used by CI/CD
#
# Building releases:
#
# * release -- builds AdGuard Home distros. CHANNEL must be specified (edge, release or beta).
# * release_and_sign -- builds AdGuard Home distros and signs the binary files.
# CHANNEL must be specified (edge, release or beta).
# * sign -- Repacks all release archive files and signs the binary files inside them.
# For signing to work, the public+private key pair for $(GPG_KEY) must be imported:
# gpg --import public.txt
# gpg --import private.txt
# GPG_KEY_PASSPHRASE must contain the GPG key passphrase
# * docker-multi-arch -- builds a multi-arch image. If you want it to be pushed to docker hub,
# you must specify:
# * DOCKER_IMAGE_NAME - adguard/adguard-home
# * DOCKER_OUTPUT - type=image,name=adguard/adguard-home,push=true
GO := go
GOPATH := $(shell $(GO) env GOPATH)
PWD := $(shell pwd)
TARGET=AdGuardHome
BASE_URL="https://static.adguard.com/adguardhome/$(CHANNEL)"
GPG_KEY := [email protected]
GPG_KEY_PASSPHRASE :=
GPG_CMD := gpg --detach-sig --default-key $(GPG_KEY) --pinentry-mode loopback --passphrase $(GPG_KEY_PASSPHRASE)
VERBOSE := -v
REBUILD_CLIENT = 1
# See release target
DIST_DIR=dist
# Update channel. Can be release, beta or edge. Uses edge by default.
CHANNEL ?= edge
# Validate channel
ifneq ($(CHANNEL),release)
ifneq ($(CHANNEL),beta)
ifneq ($(CHANNEL),edge)
$(error CHANNEL value is not valid. Valid values are release,beta or edge)
endif
endif
endif
# Version history URL (see
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/releases"
ifeq ($(CHANNEL),edge)
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/commits/master"
endif
# goreleaser command depends on the $CHANNEL
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --snapshot --parallelism 1
ifneq ($(CHANNEL),edge)
# If this is not an "edge" build, use normal release command
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --parallelism 1
endif
# Version properties
COMMIT=$(shell git rev-parse --short HEAD)
TAG_NAME=$(shell git describe --abbrev=0)
PRERELEASE_VERSION=$(shell git describe --abbrev=0)
# TODO(a.garipov): The cut call is a temporary solution to trim
# prerelease versions. See the comment in .goreleaser.yml.
RELEASE_VERSION=$(shell git describe --abbrev=0 | cut -c 1-8)
SNAPSHOT_VERSION=$(RELEASE_VERSION)-SNAPSHOT-$(COMMIT)
# Set proper version
VERSION=
ifeq ($(TAG_NAME),$(shell git describe --abbrev=4))
ifeq ($(CHANNEL),edge)
VERSION=$(SNAPSHOT_VERSION)
else ifeq ($(CHANNEL),beta)
VERSION=$(PRERELEASE_VERSION)
else
VERSION=$(RELEASE_VERSION)
endif
else
VERSION=$(SNAPSHOT_VERSION)
endif
# Docker target parameters
DOCKER_IMAGE_NAME ?= adguardhome-dev
DOCKER_IMAGE_FULL_NAME = $(DOCKER_IMAGE_NAME):$(VERSION)
DOCKER_PLATFORMS=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le
DOCKER_OUTPUT ?= type=image,name=$(DOCKER_IMAGE_NAME),push=false
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
# Docker tags (can be redefined)
DOCKER_TAGS ?=
ifndef DOCKER_TAGS
ifeq ($(CHANNEL),release)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):latest
endif
ifeq ($(CHANNEL),beta)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):beta
endif
ifeq ($(CHANNEL),edge)
# Don't set the version tag when pushing to "edge"
DOCKER_IMAGE_FULL_NAME := $(DOCKER_IMAGE_NAME):edge
# DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):edge
endif
endif
# Validate docker build arguments
ifndef DOCKER_IMAGE_NAME
$(error DOCKER_IMAGE_NAME value is not set)
endif
# OS-specific flags
TEST_FLAGS := --race $(VERBOSE)
ifeq ($(OS),Windows_NT)
TEST_FLAGS :=
endif
.PHONY: all build client client-watch docker lint lint-js lint-go test dependencies clean release docker-multi-arch
all: build
init:
git config core.hooksPath .githooks
build:
test '$(REBUILD_CLIENT)' = '1' && $(MAKE) client_with_deps || exit 0
$(GO) mod download
PATH=$(GOPATH)/bin:$(PATH) $(GO) generate ./...
CGO_ENABLED=0 $(GO) build -ldflags="-s -w -X main.version=$(VERSION) -X main.channel=$(CHANNEL) -X main.goarm=$(GOARM)"
PATH=$(GOPATH)/bin:$(PATH) packr clean
client:
npm --prefix client run build-prod
yarn --cwd client2 build
client_with_deps:
npm --prefix client ci
npm --prefix client run build-prod
yarn --cwd client2 build
client-watch:
npm --prefix client run watch
yarn --cwd client2 start
docker:
DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--load \
-t "$(DOCKER_IMAGE_NAME)" -f ./Dockerfile .
@echo Now you can run the docker image:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
</s> add # GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps </s> remove DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--platform $(DOCKER_PLATFORMS) \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--output "$(DOCKER_OUTPUT)" \
-t "$(DOCKER_IMAGE_FULL_NAME)" -f ./Dockerfile .
@echo If the image was pushed to the registry, you can now run it:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
release: client_with_deps
$(GO) mod download
@echo Starting release build: version $(VERSION), channel $(CHANNEL)
CHANNEL=$(CHANNEL) $(GORELEASER_COMMAND)
$(call write_version_file,$(VERSION))
PATH=$(GOPATH)/bin:$(PATH) packr clean
release_and_sign: client_with_deps
$(MAKE) release
$(call repack_dist)
sign:
$(call repack_dist)
define write_version_file
$(eval version := $(1))
@echo Writing version file: $(version)
# Variables for CI
rm -f $(DIST_DIR)/version.txt
echo "version=$(version)" > $(DIST_DIR)/version.txt
# Prepare the version.json file
rm -f $(DIST_DIR)/version.json
echo "{" >> $(DIST_DIR)/version.json
echo " \"version\": \"$(version)\"," >> $(DIST_DIR)/version.json
echo " \"announcement\": \"AdGuard Home $(version) is now available!\"," >> $(DIST_DIR)/version.json
echo " \"announcement_url\": \"$(VERSION_HISTORY_URL)\"," >> $(DIST_DIR)/version.json
echo " \"selfupdate_min_version\": \"0.0\"," >> $(DIST_DIR)/version.json
# Windows builds
echo " \"download_windows_amd64\": \"$(BASE_URL)/AdGuardHome_windows_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_windows_386\": \"$(BASE_URL)/AdGuardHome_windows_386.zip\"," >> $(DIST_DIR)/version.json
# MacOS builds
echo " \"download_darwin_amd64\": \"$(BASE_URL)/AdGuardHome_darwin_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_darwin_386\": \"$(BASE_URL)/AdGuardHome_darwin_386.zip\"," >> $(DIST_DIR)/version.json
# Linux
echo " \"download_linux_amd64\": \"$(BASE_URL)/AdGuardHome_linux_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_386\": \"$(BASE_URL)/AdGuardHome_linux_386.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, all kinds of ARM
echo " \"download_linux_arm\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv5\": \"$(BASE_URL)/AdGuardHome_linux_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv6\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv7\": \"$(BASE_URL)/AdGuardHome_linux_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_arm64\": \"$(BASE_URL)/AdGuardHome_linux_arm64.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, MIPS
echo " \"download_linux_mips\": \"$(BASE_URL)/AdGuardHome_linux_mips_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mipsle\": \"$(BASE_URL)/AdGuardHome_linux_mipsle_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64\": \"$(BASE_URL)/AdGuardHome_linux_mips64_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64le\": \"$(BASE_URL)/AdGuardHome_linux_mips64le_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD
echo " \"download_freebsd_386\": \"$(BASE_URL)/AdGuardHome_freebsd_386.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_amd64\": \"$(BASE_URL)/AdGuardHome_freebsd_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD, all kinds of ARM
echo " \"download_freebsd_arm\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv5\": \"$(BASE_URL)/AdGuardHome_freebsd_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv6\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv7\": \"$(BASE_URL)/AdGuardHome_freebsd_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_arm64\": \"$(BASE_URL)/AdGuardHome_freebsd_arm64.tar.gz\"" >> $(DIST_DIR)/version.json
# Finish
echo "}" >> $(DIST_DIR)/version.json
endef
define repack_dist
# Repack archive files
# A temporary solution for our auto-update code to be able to unpack these archive files
# The problem is that goreleaser doesn't add directory AdGuardHome/ to the archive file
# and we can't create it
rm -rf $(DIST_DIR)/AdGuardHome
# Windows builds
$(call zip_repack_windows,AdGuardHome_windows_amd64.zip)
$(call zip_repack_windows,AdGuardHome_windows_386.zip)
# MacOS builds
$(call zip_repack,AdGuardHome_darwin_amd64.zip)
$(call zip_repack,AdGuardHome_darwin_386.zip)
# Linux
$(call tar_repack,AdGuardHome_linux_amd64.tar.gz)
$(call tar_repack,AdGuardHome_linux_386.tar.gz)
# Linux, all kinds of ARM
$(call tar_repack,AdGuardHome_linux_armv5.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv6.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv7.tar.gz)
$(call tar_repack,AdGuardHome_linux_arm64.tar.gz)
# Linux, MIPS
$(call tar_repack,AdGuardHome_linux_mips_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mipsle_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64le_softfloat.tar.gz)
# FreeBSD
$(call tar_repack,AdGuardHome_freebsd_386.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_amd64.tar.gz)
# FreeBSD, all kinds of ARM
$(call tar_repack,AdGuardHome_freebsd_armv5.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv6.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv7.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_arm64.tar.gz)
endef
define zip_repack_windows
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome.exe && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define zip_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define tar_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
tar xzf $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
tar czf $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
</s> add @ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release </s> remove # Available targets
</s> add # See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html.
.POSIX:
CHANNEL = development
CLIENT_BETA_DIR = client2
CLIENT_DIR = client
COMMIT = $$(git rev-parse --short HEAD)
DIST_DIR = dist
GO = go
# TODO(a.garipov): Add more default proxies using pipes after update to
# Go 1.15. </s> remove - 'app'
- 'docker'
</s> add - 'build-release' | # Ignore everything except for explicitly allowed stuff.
*
!dist/docker | # Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker
# Ignore everything except for explicitly allowed stuff.
*
!dist/docker | [
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | .dockerignore |
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Run make ci'
'shell': 'bash'
'run': 'make ci'
- 'name': 'Upload coverage'
'uses': 'codecov/codecov-action@v1'
'if': "success() && matrix.os == 'ubuntu-latest'"
'with':
'token': '${{ secrets.CODECOV_TOKEN }}'
| </s> remove - 'name': 'Set up GoReleaser'
'run': 'curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh'
- 'name': 'Run snapshot build'
'run': 'make release'
'docker':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
</s> add </s> remove 'app':
</s> add 'build-release': </s> remove 'run': 'npm --prefix client ci'
</s> add 'run': 'npm --prefix="./client" ci' </s> remove 'fields': 'repo, message, commit, author, job'
</s> add 'fields': 'repo, message, commit, author, workflow' </s> remove 'fields': 'repo, message, commit, author, job'
</s> add 'fields': 'repo, message, commit, author, workflow' | 'run': 'make VERBOSE=1 ci' | 'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Run make ci'
'shell': 'bash'
'run': 'make VERBOSE=1 ci'
- 'name': 'Upload coverage'
'uses': 'codecov/codecov-action@v1'
'if': "success() && matrix.os == 'ubuntu-latest'"
'with':
'token': '${{ secrets.CODECOV_TOKEN }}' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | .github/workflows/build.yml |
'if': "success() && matrix.os == 'ubuntu-latest'"
'with':
'token': '${{ secrets.CODECOV_TOKEN }}'
'file': './coverage.txt'
'app':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
| </s> remove 'run': 'make ci'
</s> add 'run': 'make VERBOSE=1 ci' </s> remove - 'name': 'Set up GoReleaser'
'run': 'curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh'
- 'name': 'Run snapshot build'
'run': 'make release'
'docker':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
</s> add </s> remove make go-install-tools go-lint
</s> add make go-deps go-tools go-lint </s> remove 'run': 'npm --prefix client ci'
</s> add 'run': 'npm --prefix="./client" ci' </s> remove 'fields': 'repo, message, commit, author, job'
</s> add 'fields': 'repo, message, commit, author, workflow' | 'build-release': | 'if': "success() && matrix.os == 'ubuntu-latest'"
'with':
'token': '${{ secrets.CODECOV_TOKEN }}'
'file': './coverage.txt'
'build-release':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | .github/workflows/build.yml |
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Set up Snapcraft'
'run': 'sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft'
- 'name': 'Set up GoReleaser'
'run': 'curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh'
- 'name': 'Run snapshot build'
'run': 'make release'
'docker':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
- 'name': 'Set up QEMU'
'uses': 'docker/setup-qemu-action@v1'
- 'name': 'Set up Docker Buildx'
'uses': 'docker/setup-buildx-action@v1'
- 'name': 'Docker Buildx (build)'
| </s> remove - 'name': 'Docker Buildx (build)'
'run': 'make docker-multi-arch'
</s> add - 'name': 'Run snapshot build'
'run': 'make SIGN=0 VERBOSE=1 js-deps js-build build-release build-docker' </s> remove 'run': 'make ci'
</s> add 'run': 'make VERBOSE=1 ci' </s> remove 'app':
</s> add 'build-release': </s> remove 'run': 'npm --prefix client ci'
</s> add 'run': 'npm --prefix="./client" ci' </s> remove make go-install-tools go-lint
</s> add make go-deps go-tools go-lint | 'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
'restore-keys': '${{ runner.os }}-node-'
- 'name': 'Set up Snapcraft'
'run': 'sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft'
- 'name': 'Set up QEMU'
'uses': 'docker/setup-qemu-action@v1'
- 'name': 'Set up Docker Buildx'
'uses': 'docker/setup-buildx-action@v1'
- 'name': 'Docker Buildx (build)' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | .github/workflows/build.yml |
|
- 'name': 'Set up QEMU'
'uses': 'docker/setup-qemu-action@v1'
- 'name': 'Set up Docker Buildx'
'uses': 'docker/setup-buildx-action@v1'
- 'name': 'Docker Buildx (build)'
'run': 'make docker-multi-arch'
'notify':
'needs':
- 'app'
- 'docker'
| </s> remove - 'name': 'Set up GoReleaser'
'run': 'curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh'
- 'name': 'Run snapshot build'
'run': 'make release'
'docker':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
</s> add </s> remove - 'app'
- 'docker'
</s> add - 'build-release' </s> remove 'run': 'npm --prefix client ci'
</s> add 'run': 'npm --prefix="./client" ci' </s> remove 'run': 'npm --prefix client run lint'
</s> add 'run': 'npm --prefix="./client" run lint' </s> remove 'run': 'make ci'
</s> add 'run': 'make VERBOSE=1 ci' | - 'name': 'Run snapshot build'
'run': 'make SIGN=0 VERBOSE=1 js-deps js-build build-release build-docker' | - 'name': 'Set up QEMU'
'uses': 'docker/setup-qemu-action@v1'
- 'name': 'Set up Docker Buildx'
'uses': 'docker/setup-buildx-action@v1'
- 'name': 'Run snapshot build'
'run': 'make SIGN=0 VERBOSE=1 js-deps js-build build-release build-docker'
- 'name': 'Run snapshot build'
'run': 'make SIGN=0 VERBOSE=1 js-deps js-build build-release build-docker'
'notify':
'needs':
- 'app'
- 'docker' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | .github/workflows/build.yml |
'run': 'make docker-multi-arch'
'notify':
'needs':
- 'app'
- 'docker'
# Secrets are not passed to workflows that are triggered by a pull request
# from a fork.
#
# Use always() to signal to the runner that this job must run even if the
# previous ones failed.
| </s> remove 'run': 'npm --prefix client run lint'
</s> add 'run': 'npm --prefix="./client" run lint' </s> remove # * build -- builds AdGuardHome for the current platform
# * client -- builds client-side code of AdGuard Home
# * client-watch -- builds client-side code of AdGuard Home and watches for changes there
# * docker -- builds a docker image for the current platform
# * clean -- clean everything created by previous builds
# * lint -- run all linters
# * test -- run all unit-tests
# * dependencies -- installs dependencies (go and npm modules)
# * ci -- installs dependencies, runs linters and tests, intended to be used by CI/CD
#
# Building releases:
#
# * release -- builds AdGuard Home distros. CHANNEL must be specified (edge, release or beta).
# * release_and_sign -- builds AdGuard Home distros and signs the binary files.
# CHANNEL must be specified (edge, release or beta).
# * sign -- Repacks all release archive files and signs the binary files inside them.
# For signing to work, the public+private key pair for $(GPG_KEY) must be imported:
# gpg --import public.txt
# gpg --import private.txt
# GPG_KEY_PASSPHRASE must contain the GPG key passphrase
# * docker-multi-arch -- builds a multi-arch image. If you want it to be pushed to docker hub,
# you must specify:
# * DOCKER_IMAGE_NAME - adguard/adguard-home
# * DOCKER_OUTPUT - type=image,name=adguard/adguard-home,push=true
GO := go
GOPATH := $(shell $(GO) env GOPATH)
PWD := $(shell pwd)
TARGET=AdGuardHome
BASE_URL="https://static.adguard.com/adguardhome/$(CHANNEL)"
GPG_KEY := [email protected]
GPG_KEY_PASSPHRASE :=
GPG_CMD := gpg --detach-sig --default-key $(GPG_KEY) --pinentry-mode loopback --passphrase $(GPG_KEY_PASSPHRASE)
VERBOSE := -v
REBUILD_CLIENT = 1
# See release target
DIST_DIR=dist
# Update channel. Can be release, beta or edge. Uses edge by default.
CHANNEL ?= edge
# Validate channel
ifneq ($(CHANNEL),release)
ifneq ($(CHANNEL),beta)
ifneq ($(CHANNEL),edge)
$(error CHANNEL value is not valid. Valid values are release,beta or edge)
endif
endif
endif
# Version history URL (see
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/releases"
ifeq ($(CHANNEL),edge)
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/commits/master"
endif
# goreleaser command depends on the $CHANNEL
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --snapshot --parallelism 1
ifneq ($(CHANNEL),edge)
# If this is not an "edge" build, use normal release command
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --parallelism 1
endif
# Version properties
COMMIT=$(shell git rev-parse --short HEAD)
TAG_NAME=$(shell git describe --abbrev=0)
PRERELEASE_VERSION=$(shell git describe --abbrev=0)
# TODO(a.garipov): The cut call is a temporary solution to trim
# prerelease versions. See the comment in .goreleaser.yml.
RELEASE_VERSION=$(shell git describe --abbrev=0 | cut -c 1-8)
SNAPSHOT_VERSION=$(RELEASE_VERSION)-SNAPSHOT-$(COMMIT)
# Set proper version
VERSION=
ifeq ($(TAG_NAME),$(shell git describe --abbrev=4))
ifeq ($(CHANNEL),edge)
VERSION=$(SNAPSHOT_VERSION)
else ifeq ($(CHANNEL),beta)
VERSION=$(PRERELEASE_VERSION)
else
VERSION=$(RELEASE_VERSION)
endif
else
VERSION=$(SNAPSHOT_VERSION)
endif
# Docker target parameters
DOCKER_IMAGE_NAME ?= adguardhome-dev
DOCKER_IMAGE_FULL_NAME = $(DOCKER_IMAGE_NAME):$(VERSION)
DOCKER_PLATFORMS=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le
DOCKER_OUTPUT ?= type=image,name=$(DOCKER_IMAGE_NAME),push=false
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
# Docker tags (can be redefined)
DOCKER_TAGS ?=
ifndef DOCKER_TAGS
ifeq ($(CHANNEL),release)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):latest
endif
ifeq ($(CHANNEL),beta)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):beta
endif
ifeq ($(CHANNEL),edge)
# Don't set the version tag when pushing to "edge"
DOCKER_IMAGE_FULL_NAME := $(DOCKER_IMAGE_NAME):edge
# DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):edge
endif
endif
# Validate docker build arguments
ifndef DOCKER_IMAGE_NAME
$(error DOCKER_IMAGE_NAME value is not set)
endif
# OS-specific flags
TEST_FLAGS := --race $(VERBOSE)
ifeq ($(OS),Windows_NT)
TEST_FLAGS :=
endif
.PHONY: all build client client-watch docker lint lint-js lint-go test dependencies clean release docker-multi-arch
all: build
init:
git config core.hooksPath .githooks
build:
test '$(REBUILD_CLIENT)' = '1' && $(MAKE) client_with_deps || exit 0
$(GO) mod download
PATH=$(GOPATH)/bin:$(PATH) $(GO) generate ./...
CGO_ENABLED=0 $(GO) build -ldflags="-s -w -X main.version=$(VERSION) -X main.channel=$(CHANNEL) -X main.goarm=$(GOARM)"
PATH=$(GOPATH)/bin:$(PATH) packr clean
client:
npm --prefix client run build-prod
yarn --cwd client2 build
client_with_deps:
npm --prefix client ci
npm --prefix client run build-prod
yarn --cwd client2 build
client-watch:
npm --prefix client run watch
yarn --cwd client2 start
docker:
DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--load \
-t "$(DOCKER_IMAGE_NAME)" -f ./Dockerfile .
@echo Now you can run the docker image:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
</s> add # GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps </s> remove - 'name': 'Docker Buildx (build)'
'run': 'make docker-multi-arch'
</s> add - 'name': 'Run snapshot build'
'run': 'make SIGN=0 VERBOSE=1 js-deps js-build build-release build-docker' </s> remove # Available targets
</s> add # See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html.
.POSIX:
CHANNEL = development
CLIENT_BETA_DIR = client2
CLIENT_DIR = client
COMMIT = $$(git rev-parse --short HEAD)
DIST_DIR = dist
GO = go
# TODO(a.garipov): Add more default proxies using pipes after update to
# Go 1.15. </s> remove DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--platform $(DOCKER_PLATFORMS) \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--output "$(DOCKER_OUTPUT)" \
-t "$(DOCKER_IMAGE_FULL_NAME)" -f ./Dockerfile .
@echo If the image was pushed to the registry, you can now run it:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
release: client_with_deps
$(GO) mod download
@echo Starting release build: version $(VERSION), channel $(CHANNEL)
CHANNEL=$(CHANNEL) $(GORELEASER_COMMAND)
$(call write_version_file,$(VERSION))
PATH=$(GOPATH)/bin:$(PATH) packr clean
release_and_sign: client_with_deps
$(MAKE) release
$(call repack_dist)
sign:
$(call repack_dist)
define write_version_file
$(eval version := $(1))
@echo Writing version file: $(version)
# Variables for CI
rm -f $(DIST_DIR)/version.txt
echo "version=$(version)" > $(DIST_DIR)/version.txt
# Prepare the version.json file
rm -f $(DIST_DIR)/version.json
echo "{" >> $(DIST_DIR)/version.json
echo " \"version\": \"$(version)\"," >> $(DIST_DIR)/version.json
echo " \"announcement\": \"AdGuard Home $(version) is now available!\"," >> $(DIST_DIR)/version.json
echo " \"announcement_url\": \"$(VERSION_HISTORY_URL)\"," >> $(DIST_DIR)/version.json
echo " \"selfupdate_min_version\": \"0.0\"," >> $(DIST_DIR)/version.json
# Windows builds
echo " \"download_windows_amd64\": \"$(BASE_URL)/AdGuardHome_windows_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_windows_386\": \"$(BASE_URL)/AdGuardHome_windows_386.zip\"," >> $(DIST_DIR)/version.json
# MacOS builds
echo " \"download_darwin_amd64\": \"$(BASE_URL)/AdGuardHome_darwin_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_darwin_386\": \"$(BASE_URL)/AdGuardHome_darwin_386.zip\"," >> $(DIST_DIR)/version.json
# Linux
echo " \"download_linux_amd64\": \"$(BASE_URL)/AdGuardHome_linux_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_386\": \"$(BASE_URL)/AdGuardHome_linux_386.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, all kinds of ARM
echo " \"download_linux_arm\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv5\": \"$(BASE_URL)/AdGuardHome_linux_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv6\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv7\": \"$(BASE_URL)/AdGuardHome_linux_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_arm64\": \"$(BASE_URL)/AdGuardHome_linux_arm64.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, MIPS
echo " \"download_linux_mips\": \"$(BASE_URL)/AdGuardHome_linux_mips_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mipsle\": \"$(BASE_URL)/AdGuardHome_linux_mipsle_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64\": \"$(BASE_URL)/AdGuardHome_linux_mips64_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64le\": \"$(BASE_URL)/AdGuardHome_linux_mips64le_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD
echo " \"download_freebsd_386\": \"$(BASE_URL)/AdGuardHome_freebsd_386.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_amd64\": \"$(BASE_URL)/AdGuardHome_freebsd_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD, all kinds of ARM
echo " \"download_freebsd_arm\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv5\": \"$(BASE_URL)/AdGuardHome_freebsd_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv6\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv7\": \"$(BASE_URL)/AdGuardHome_freebsd_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_arm64\": \"$(BASE_URL)/AdGuardHome_freebsd_arm64.tar.gz\"" >> $(DIST_DIR)/version.json
# Finish
echo "}" >> $(DIST_DIR)/version.json
endef
define repack_dist
# Repack archive files
# A temporary solution for our auto-update code to be able to unpack these archive files
# The problem is that goreleaser doesn't add directory AdGuardHome/ to the archive file
# and we can't create it
rm -rf $(DIST_DIR)/AdGuardHome
# Windows builds
$(call zip_repack_windows,AdGuardHome_windows_amd64.zip)
$(call zip_repack_windows,AdGuardHome_windows_386.zip)
# MacOS builds
$(call zip_repack,AdGuardHome_darwin_amd64.zip)
$(call zip_repack,AdGuardHome_darwin_386.zip)
# Linux
$(call tar_repack,AdGuardHome_linux_amd64.tar.gz)
$(call tar_repack,AdGuardHome_linux_386.tar.gz)
# Linux, all kinds of ARM
$(call tar_repack,AdGuardHome_linux_armv5.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv6.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv7.tar.gz)
$(call tar_repack,AdGuardHome_linux_arm64.tar.gz)
# Linux, MIPS
$(call tar_repack,AdGuardHome_linux_mips_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mipsle_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64le_softfloat.tar.gz)
# FreeBSD
$(call tar_repack,AdGuardHome_freebsd_386.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_amd64.tar.gz)
# FreeBSD, all kinds of ARM
$(call tar_repack,AdGuardHome_freebsd_armv5.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv6.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv7.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_arm64.tar.gz)
endef
define zip_repack_windows
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome.exe && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define zip_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define tar_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
tar xzf $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
tar czf $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
</s> add @ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release | - 'build-release' | 'run': 'make docker-multi-arch'
'notify':
'needs':
- 'build-release'
- 'build-release'
# Secrets are not passed to workflows that are triggered by a pull request
# from a fork.
#
# Use always() to signal to the runner that this job must run even if the
# previous ones failed. | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | .github/workflows/build.yml |
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author, job'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}'
| </s> remove 'fields': 'repo, message, commit, author, job'
</s> add 'fields': 'repo, message, commit, author, workflow' </s> remove 'run': 'make ci'
</s> add 'run': 'make VERBOSE=1 ci' </s> remove 'app':
</s> add 'build-release': </s> remove - 'name': 'Set up GoReleaser'
'run': 'curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh'
- 'name': 'Run snapshot build'
'run': 'make release'
'docker':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
</s> add </s> remove - 'name': 'Docker Buildx (build)'
'run': 'make docker-multi-arch'
</s> add - 'name': 'Run snapshot build'
'run': 'make SIGN=0 VERBOSE=1 js-deps js-build build-release build-docker' | 'fields': 'repo, message, commit, author, workflow' | - 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author, workflow'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | .github/workflows/build.yml |
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'run-lint'
'run': >
make go-install-tools go-lint
'eslint':
'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
| </s> remove 'run': 'npm --prefix client ci'
</s> add 'run': 'npm --prefix="./client" ci' </s> remove - 'name': 'Set up GoReleaser'
'run': 'curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh'
- 'name': 'Run snapshot build'
'run': 'make release'
'docker':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
</s> add </s> remove 'app':
</s> add 'build-release': </s> remove 'run': 'npm --prefix client run lint'
</s> add 'run': 'npm --prefix="./client" run lint' </s> remove - 'name': 'Docker Buildx (build)'
'run': 'make docker-multi-arch'
</s> add - 'name': 'Run snapshot build'
'run': 'make SIGN=0 VERBOSE=1 js-deps js-build build-release build-docker' | make go-deps go-tools go-lint | 'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'run-lint'
'run': >
make go-deps go-tools go-lint
'eslint':
'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | .github/workflows/lint.yml |
'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
'run': 'npm --prefix client ci'
- 'name': 'Run ESLint'
'run': 'npm --prefix client run lint'
'notify':
'needs':
- 'go-lint'
| </s> remove 'run': 'npm --prefix client run lint'
</s> add 'run': 'npm --prefix="./client" run lint' </s> remove make go-install-tools go-lint
</s> add make go-deps go-tools go-lint </s> remove - 'name': 'Set up GoReleaser'
'run': 'curl -sfL https://install.goreleaser.com/github.com/goreleaser/goreleaser.sh | BINDIR="$(go env GOPATH)/bin" sh'
- 'name': 'Run snapshot build'
'run': 'make release'
'docker':
'runs-on': 'ubuntu-latest'
'needs': 'test'
'steps':
- 'name': 'Checkout'
'uses': 'actions/checkout@v2'
'with':
'fetch-depth': 0
</s> add </s> remove 'app':
</s> add 'build-release': </s> remove - 'name': 'Docker Buildx (build)'
'run': 'make docker-multi-arch'
</s> add - 'name': 'Run snapshot build'
'run': 'make SIGN=0 VERBOSE=1 js-deps js-build build-release build-docker' | 'run': 'npm --prefix="./client" ci' | 'runs-on': 'ubuntu-latest'
'steps':
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
'run': 'npm --prefix="./client" ci'
- 'name': 'Run ESLint'
'run': 'npm --prefix client run lint'
'notify':
'needs':
- 'go-lint' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | .github/workflows/lint.yml |
- 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
'run': 'npm --prefix client ci'
- 'name': 'Run ESLint'
'run': 'npm --prefix client run lint'
'notify':
'needs':
- 'go-lint'
- 'eslint'
# Secrets are not passed to workflows that are triggered by a pull request
| </s> remove 'run': 'npm --prefix client ci'
</s> add 'run': 'npm --prefix="./client" ci' </s> remove - 'app'
- 'docker'
</s> add - 'build-release' </s> remove make go-install-tools go-lint
</s> add make go-deps go-tools go-lint </s> remove - 'name': 'Docker Buildx (build)'
'run': 'make docker-multi-arch'
</s> add - 'name': 'Run snapshot build'
'run': 'make SIGN=0 VERBOSE=1 js-deps js-build build-release build-docker' </s> remove 'run': 'make ci'
</s> add 'run': 'make VERBOSE=1 ci' | 'run': 'npm --prefix="./client" run lint' | - 'uses': 'actions/checkout@v2'
- 'name': 'Install modules'
'run': 'npm --prefix client ci'
- 'name': 'Run ESLint'
'run': 'npm --prefix="./client" run lint'
'notify':
'needs':
- 'go-lint'
- 'eslint'
# Secrets are not passed to workflows that are triggered by a pull request | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | .github/workflows/lint.yml |
- 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author, job'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}'
| </s> | 'fields': 'repo, message, commit, author, workflow' | - 'name': 'Send Slack notif'
'uses': '8398a7/action-slack@v3'
'with':
'status': '${{ env.WORKFLOW_CONCLUSION }}'
'fields': 'repo, message, commit, author, workflow'
'env':
'GITHUB_TOKEN': '${{ secrets.GITHUB_TOKEN }}'
'SLACK_WEBHOOK_URL': '${{ secrets.SLACK_WEBHOOK_URL }}' | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | .github/workflows/lint.yml |
#
# Available targets
#
# * build -- builds AdGuardHome for the current platform
# * client -- builds client-side code of AdGuard Home
# * client-watch -- builds client-side code of AdGuard Home and watches for changes there
# * docker -- builds a docker image for the current platform
| </s> remove # * build -- builds AdGuardHome for the current platform
# * client -- builds client-side code of AdGuard Home
# * client-watch -- builds client-side code of AdGuard Home and watches for changes there
# * docker -- builds a docker image for the current platform
# * clean -- clean everything created by previous builds
# * lint -- run all linters
# * test -- run all unit-tests
# * dependencies -- installs dependencies (go and npm modules)
# * ci -- installs dependencies, runs linters and tests, intended to be used by CI/CD
#
# Building releases:
#
# * release -- builds AdGuard Home distros. CHANNEL must be specified (edge, release or beta).
# * release_and_sign -- builds AdGuard Home distros and signs the binary files.
# CHANNEL must be specified (edge, release or beta).
# * sign -- Repacks all release archive files and signs the binary files inside them.
# For signing to work, the public+private key pair for $(GPG_KEY) must be imported:
# gpg --import public.txt
# gpg --import private.txt
# GPG_KEY_PASSPHRASE must contain the GPG key passphrase
# * docker-multi-arch -- builds a multi-arch image. If you want it to be pushed to docker hub,
# you must specify:
# * DOCKER_IMAGE_NAME - adguard/adguard-home
# * DOCKER_OUTPUT - type=image,name=adguard/adguard-home,push=true
GO := go
GOPATH := $(shell $(GO) env GOPATH)
PWD := $(shell pwd)
TARGET=AdGuardHome
BASE_URL="https://static.adguard.com/adguardhome/$(CHANNEL)"
GPG_KEY := [email protected]
GPG_KEY_PASSPHRASE :=
GPG_CMD := gpg --detach-sig --default-key $(GPG_KEY) --pinentry-mode loopback --passphrase $(GPG_KEY_PASSPHRASE)
VERBOSE := -v
REBUILD_CLIENT = 1
# See release target
DIST_DIR=dist
# Update channel. Can be release, beta or edge. Uses edge by default.
CHANNEL ?= edge
# Validate channel
ifneq ($(CHANNEL),release)
ifneq ($(CHANNEL),beta)
ifneq ($(CHANNEL),edge)
$(error CHANNEL value is not valid. Valid values are release,beta or edge)
endif
endif
endif
# Version history URL (see
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/releases"
ifeq ($(CHANNEL),edge)
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/commits/master"
endif
# goreleaser command depends on the $CHANNEL
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --snapshot --parallelism 1
ifneq ($(CHANNEL),edge)
# If this is not an "edge" build, use normal release command
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --parallelism 1
endif
# Version properties
COMMIT=$(shell git rev-parse --short HEAD)
TAG_NAME=$(shell git describe --abbrev=0)
PRERELEASE_VERSION=$(shell git describe --abbrev=0)
# TODO(a.garipov): The cut call is a temporary solution to trim
# prerelease versions. See the comment in .goreleaser.yml.
RELEASE_VERSION=$(shell git describe --abbrev=0 | cut -c 1-8)
SNAPSHOT_VERSION=$(RELEASE_VERSION)-SNAPSHOT-$(COMMIT)
# Set proper version
VERSION=
ifeq ($(TAG_NAME),$(shell git describe --abbrev=4))
ifeq ($(CHANNEL),edge)
VERSION=$(SNAPSHOT_VERSION)
else ifeq ($(CHANNEL),beta)
VERSION=$(PRERELEASE_VERSION)
else
VERSION=$(RELEASE_VERSION)
endif
else
VERSION=$(SNAPSHOT_VERSION)
endif
# Docker target parameters
DOCKER_IMAGE_NAME ?= adguardhome-dev
DOCKER_IMAGE_FULL_NAME = $(DOCKER_IMAGE_NAME):$(VERSION)
DOCKER_PLATFORMS=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le
DOCKER_OUTPUT ?= type=image,name=$(DOCKER_IMAGE_NAME),push=false
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
# Docker tags (can be redefined)
DOCKER_TAGS ?=
ifndef DOCKER_TAGS
ifeq ($(CHANNEL),release)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):latest
endif
ifeq ($(CHANNEL),beta)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):beta
endif
ifeq ($(CHANNEL),edge)
# Don't set the version tag when pushing to "edge"
DOCKER_IMAGE_FULL_NAME := $(DOCKER_IMAGE_NAME):edge
# DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):edge
endif
endif
# Validate docker build arguments
ifndef DOCKER_IMAGE_NAME
$(error DOCKER_IMAGE_NAME value is not set)
endif
# OS-specific flags
TEST_FLAGS := --race $(VERBOSE)
ifeq ($(OS),Windows_NT)
TEST_FLAGS :=
endif
.PHONY: all build client client-watch docker lint lint-js lint-go test dependencies clean release docker-multi-arch
all: build
init:
git config core.hooksPath .githooks
build:
test '$(REBUILD_CLIENT)' = '1' && $(MAKE) client_with_deps || exit 0
$(GO) mod download
PATH=$(GOPATH)/bin:$(PATH) $(GO) generate ./...
CGO_ENABLED=0 $(GO) build -ldflags="-s -w -X main.version=$(VERSION) -X main.channel=$(CHANNEL) -X main.goarm=$(GOARM)"
PATH=$(GOPATH)/bin:$(PATH) packr clean
client:
npm --prefix client run build-prod
yarn --cwd client2 build
client_with_deps:
npm --prefix client ci
npm --prefix client run build-prod
yarn --cwd client2 build
client-watch:
npm --prefix client run watch
yarn --cwd client2 start
docker:
DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--load \
-t "$(DOCKER_IMAGE_NAME)" -f ./Dockerfile .
@echo Now you can run the docker image:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
</s> add # GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps </s> remove DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--platform $(DOCKER_PLATFORMS) \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--output "$(DOCKER_OUTPUT)" \
-t "$(DOCKER_IMAGE_FULL_NAME)" -f ./Dockerfile .
@echo If the image was pushed to the registry, you can now run it:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
release: client_with_deps
$(GO) mod download
@echo Starting release build: version $(VERSION), channel $(CHANNEL)
CHANNEL=$(CHANNEL) $(GORELEASER_COMMAND)
$(call write_version_file,$(VERSION))
PATH=$(GOPATH)/bin:$(PATH) packr clean
release_and_sign: client_with_deps
$(MAKE) release
$(call repack_dist)
sign:
$(call repack_dist)
define write_version_file
$(eval version := $(1))
@echo Writing version file: $(version)
# Variables for CI
rm -f $(DIST_DIR)/version.txt
echo "version=$(version)" > $(DIST_DIR)/version.txt
# Prepare the version.json file
rm -f $(DIST_DIR)/version.json
echo "{" >> $(DIST_DIR)/version.json
echo " \"version\": \"$(version)\"," >> $(DIST_DIR)/version.json
echo " \"announcement\": \"AdGuard Home $(version) is now available!\"," >> $(DIST_DIR)/version.json
echo " \"announcement_url\": \"$(VERSION_HISTORY_URL)\"," >> $(DIST_DIR)/version.json
echo " \"selfupdate_min_version\": \"0.0\"," >> $(DIST_DIR)/version.json
# Windows builds
echo " \"download_windows_amd64\": \"$(BASE_URL)/AdGuardHome_windows_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_windows_386\": \"$(BASE_URL)/AdGuardHome_windows_386.zip\"," >> $(DIST_DIR)/version.json
# MacOS builds
echo " \"download_darwin_amd64\": \"$(BASE_URL)/AdGuardHome_darwin_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_darwin_386\": \"$(BASE_URL)/AdGuardHome_darwin_386.zip\"," >> $(DIST_DIR)/version.json
# Linux
echo " \"download_linux_amd64\": \"$(BASE_URL)/AdGuardHome_linux_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_386\": \"$(BASE_URL)/AdGuardHome_linux_386.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, all kinds of ARM
echo " \"download_linux_arm\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv5\": \"$(BASE_URL)/AdGuardHome_linux_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv6\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv7\": \"$(BASE_URL)/AdGuardHome_linux_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_arm64\": \"$(BASE_URL)/AdGuardHome_linux_arm64.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, MIPS
echo " \"download_linux_mips\": \"$(BASE_URL)/AdGuardHome_linux_mips_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mipsle\": \"$(BASE_URL)/AdGuardHome_linux_mipsle_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64\": \"$(BASE_URL)/AdGuardHome_linux_mips64_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64le\": \"$(BASE_URL)/AdGuardHome_linux_mips64le_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD
echo " \"download_freebsd_386\": \"$(BASE_URL)/AdGuardHome_freebsd_386.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_amd64\": \"$(BASE_URL)/AdGuardHome_freebsd_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD, all kinds of ARM
echo " \"download_freebsd_arm\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv5\": \"$(BASE_URL)/AdGuardHome_freebsd_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv6\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv7\": \"$(BASE_URL)/AdGuardHome_freebsd_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_arm64\": \"$(BASE_URL)/AdGuardHome_freebsd_arm64.tar.gz\"" >> $(DIST_DIR)/version.json
# Finish
echo "}" >> $(DIST_DIR)/version.json
endef
define repack_dist
# Repack archive files
# A temporary solution for our auto-update code to be able to unpack these archive files
# The problem is that goreleaser doesn't add directory AdGuardHome/ to the archive file
# and we can't create it
rm -rf $(DIST_DIR)/AdGuardHome
# Windows builds
$(call zip_repack_windows,AdGuardHome_windows_amd64.zip)
$(call zip_repack_windows,AdGuardHome_windows_386.zip)
# MacOS builds
$(call zip_repack,AdGuardHome_darwin_amd64.zip)
$(call zip_repack,AdGuardHome_darwin_386.zip)
# Linux
$(call tar_repack,AdGuardHome_linux_amd64.tar.gz)
$(call tar_repack,AdGuardHome_linux_386.tar.gz)
# Linux, all kinds of ARM
$(call tar_repack,AdGuardHome_linux_armv5.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv6.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv7.tar.gz)
$(call tar_repack,AdGuardHome_linux_arm64.tar.gz)
# Linux, MIPS
$(call tar_repack,AdGuardHome_linux_mips_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mipsle_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64le_softfloat.tar.gz)
# FreeBSD
$(call tar_repack,AdGuardHome_freebsd_386.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_amd64.tar.gz)
# FreeBSD, all kinds of ARM
$(call tar_repack,AdGuardHome_freebsd_armv5.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv6.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv7.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_arm64.tar.gz)
endef
define zip_repack_windows
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome.exe && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define zip_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define tar_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
tar xzf $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
tar czf $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
</s> add @ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release </s> remove .DS_Store
/.git
/.github
/.vscode
.idea
/AdGuardHome
/AdGuardHome.exe
/AdGuardHome.yaml
/AdGuardHome.log
/data
/build
/build2
/dist
/client/node_modules
/client2/node_modules
/.gitattributes
/.gitignore
/.goreleaser.yml
/changelog.config.js
/coverage.txt
/Dockerfile
/LICENSE.txt
/Makefile
/querylog.json
/querylog.json.1
/*.md
# Test output
dnsfilter/tests/top-1m.csv
dnsfilter/tests/dnsfilter.TestLotsOfRules*.pprof
# Snapcraft build temporary files
*.snap
launchpad_credentials
snapcraft_login
snapcraft.yaml.bak
# IntelliJ IDEA project files
*.iml
# Packr
*-packr.go
</s> add # Ignore everything except for explicitly allowed stuff.
*
!dist/docker </s> remove npm --prefix client ci
yarn --cwd client2 install
$(GO) mod download
clean:
rm -f ./AdGuardHome ./AdGuardHome.exe ./coverage.txt
rm -f -r ./build/ ./client/node_modules/ ./data/ ./$(DIST_DIR)/
# Set the GOPATH explicitly in case make clean is called from under sudo
# after a Docker build.
env PATH="$(GOPATH)/bin:$$PATH" packr clean
rm -f -r ./bin/
</s> add @ echo "use make deps instead"
@ $(MAKE) deps | # See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html.
.POSIX:
CHANNEL = development
CLIENT_BETA_DIR = client2
CLIENT_DIR = client
COMMIT = $$(git rev-parse --short HEAD)
DIST_DIR = dist
GO = go
# TODO(a.garipov): Add more default proxies using pipes after update to
# Go 1.15. | #
# See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html.
.POSIX:
CHANNEL = development
CLIENT_BETA_DIR = client2
CLIENT_DIR = client
COMMIT = $$(git rev-parse --short HEAD)
DIST_DIR = dist
GO = go
# TODO(a.garipov): Add more default proxies using pipes after update to
# Go 1.15.
#
# * build -- builds AdGuardHome for the current platform
# * client -- builds client-side code of AdGuard Home
# * client-watch -- builds client-side code of AdGuard Home and watches for changes there
# * docker -- builds a docker image for the current platform | [
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | Makefile |
#
# Available targets
#
# * build -- builds AdGuardHome for the current platform
# * client -- builds client-side code of AdGuard Home
# * client-watch -- builds client-side code of AdGuard Home and watches for changes there
# * docker -- builds a docker image for the current platform
# * clean -- clean everything created by previous builds
# * lint -- run all linters
# * test -- run all unit-tests
# * dependencies -- installs dependencies (go and npm modules)
# * ci -- installs dependencies, runs linters and tests, intended to be used by CI/CD
#
# Building releases:
#
# * release -- builds AdGuard Home distros. CHANNEL must be specified (edge, release or beta).
# * release_and_sign -- builds AdGuard Home distros and signs the binary files.
# CHANNEL must be specified (edge, release or beta).
# * sign -- Repacks all release archive files and signs the binary files inside them.
# For signing to work, the public+private key pair for $(GPG_KEY) must be imported:
# gpg --import public.txt
# gpg --import private.txt
# GPG_KEY_PASSPHRASE must contain the GPG key passphrase
# * docker-multi-arch -- builds a multi-arch image. If you want it to be pushed to docker hub,
# you must specify:
# * DOCKER_IMAGE_NAME - adguard/adguard-home
# * DOCKER_OUTPUT - type=image,name=adguard/adguard-home,push=true
GO := go
GOPATH := $(shell $(GO) env GOPATH)
PWD := $(shell pwd)
TARGET=AdGuardHome
BASE_URL="https://static.adguard.com/adguardhome/$(CHANNEL)"
GPG_KEY := [email protected]
GPG_KEY_PASSPHRASE :=
GPG_CMD := gpg --detach-sig --default-key $(GPG_KEY) --pinentry-mode loopback --passphrase $(GPG_KEY_PASSPHRASE)
VERBOSE := -v
REBUILD_CLIENT = 1
# See release target
DIST_DIR=dist
# Update channel. Can be release, beta or edge. Uses edge by default.
CHANNEL ?= edge
# Validate channel
ifneq ($(CHANNEL),release)
ifneq ($(CHANNEL),beta)
ifneq ($(CHANNEL),edge)
$(error CHANNEL value is not valid. Valid values are release,beta or edge)
endif
endif
endif
# Version history URL (see
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/releases"
ifeq ($(CHANNEL),edge)
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/commits/master"
endif
# goreleaser command depends on the $CHANNEL
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --snapshot --parallelism 1
ifneq ($(CHANNEL),edge)
# If this is not an "edge" build, use normal release command
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --parallelism 1
endif
# Version properties
COMMIT=$(shell git rev-parse --short HEAD)
TAG_NAME=$(shell git describe --abbrev=0)
PRERELEASE_VERSION=$(shell git describe --abbrev=0)
# TODO(a.garipov): The cut call is a temporary solution to trim
# prerelease versions. See the comment in .goreleaser.yml.
RELEASE_VERSION=$(shell git describe --abbrev=0 | cut -c 1-8)
SNAPSHOT_VERSION=$(RELEASE_VERSION)-SNAPSHOT-$(COMMIT)
# Set proper version
VERSION=
ifeq ($(TAG_NAME),$(shell git describe --abbrev=4))
ifeq ($(CHANNEL),edge)
VERSION=$(SNAPSHOT_VERSION)
else ifeq ($(CHANNEL),beta)
VERSION=$(PRERELEASE_VERSION)
else
VERSION=$(RELEASE_VERSION)
endif
else
VERSION=$(SNAPSHOT_VERSION)
endif
# Docker target parameters
DOCKER_IMAGE_NAME ?= adguardhome-dev
DOCKER_IMAGE_FULL_NAME = $(DOCKER_IMAGE_NAME):$(VERSION)
DOCKER_PLATFORMS=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le
DOCKER_OUTPUT ?= type=image,name=$(DOCKER_IMAGE_NAME),push=false
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
# Docker tags (can be redefined)
DOCKER_TAGS ?=
ifndef DOCKER_TAGS
ifeq ($(CHANNEL),release)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):latest
endif
ifeq ($(CHANNEL),beta)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):beta
endif
ifeq ($(CHANNEL),edge)
# Don't set the version tag when pushing to "edge"
DOCKER_IMAGE_FULL_NAME := $(DOCKER_IMAGE_NAME):edge
# DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):edge
endif
endif
# Validate docker build arguments
ifndef DOCKER_IMAGE_NAME
$(error DOCKER_IMAGE_NAME value is not set)
endif
# OS-specific flags
TEST_FLAGS := --race $(VERBOSE)
ifeq ($(OS),Windows_NT)
TEST_FLAGS :=
endif
.PHONY: all build client client-watch docker lint lint-js lint-go test dependencies clean release docker-multi-arch
all: build
init:
git config core.hooksPath .githooks
build:
test '$(REBUILD_CLIENT)' = '1' && $(MAKE) client_with_deps || exit 0
$(GO) mod download
PATH=$(GOPATH)/bin:$(PATH) $(GO) generate ./...
CGO_ENABLED=0 $(GO) build -ldflags="-s -w -X main.version=$(VERSION) -X main.channel=$(CHANNEL) -X main.goarm=$(GOARM)"
PATH=$(GOPATH)/bin:$(PATH) packr clean
client:
npm --prefix client run build-prod
yarn --cwd client2 build
client_with_deps:
npm --prefix client ci
npm --prefix client run build-prod
yarn --cwd client2 build
client-watch:
npm --prefix client run watch
yarn --cwd client2 start
docker:
DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--load \
-t "$(DOCKER_IMAGE_NAME)" -f ./Dockerfile .
@echo Now you can run the docker image:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
lint: js-lint go-lint
js-lint: dependencies
npm --prefix client run lint
yarn --cwd client2 lint
| </s> remove # Available targets
</s> add # See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html.
.POSIX:
CHANNEL = development
CLIENT_BETA_DIR = client2
CLIENT_DIR = client
COMMIT = $$(git rev-parse --short HEAD)
DIST_DIR = dist
GO = go
# TODO(a.garipov): Add more default proxies using pipes after update to
# Go 1.15. </s> remove DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--platform $(DOCKER_PLATFORMS) \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--output "$(DOCKER_OUTPUT)" \
-t "$(DOCKER_IMAGE_FULL_NAME)" -f ./Dockerfile .
@echo If the image was pushed to the registry, you can now run it:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
release: client_with_deps
$(GO) mod download
@echo Starting release build: version $(VERSION), channel $(CHANNEL)
CHANNEL=$(CHANNEL) $(GORELEASER_COMMAND)
$(call write_version_file,$(VERSION))
PATH=$(GOPATH)/bin:$(PATH) packr clean
release_and_sign: client_with_deps
$(MAKE) release
$(call repack_dist)
sign:
$(call repack_dist)
define write_version_file
$(eval version := $(1))
@echo Writing version file: $(version)
# Variables for CI
rm -f $(DIST_DIR)/version.txt
echo "version=$(version)" > $(DIST_DIR)/version.txt
# Prepare the version.json file
rm -f $(DIST_DIR)/version.json
echo "{" >> $(DIST_DIR)/version.json
echo " \"version\": \"$(version)\"," >> $(DIST_DIR)/version.json
echo " \"announcement\": \"AdGuard Home $(version) is now available!\"," >> $(DIST_DIR)/version.json
echo " \"announcement_url\": \"$(VERSION_HISTORY_URL)\"," >> $(DIST_DIR)/version.json
echo " \"selfupdate_min_version\": \"0.0\"," >> $(DIST_DIR)/version.json
# Windows builds
echo " \"download_windows_amd64\": \"$(BASE_URL)/AdGuardHome_windows_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_windows_386\": \"$(BASE_URL)/AdGuardHome_windows_386.zip\"," >> $(DIST_DIR)/version.json
# MacOS builds
echo " \"download_darwin_amd64\": \"$(BASE_URL)/AdGuardHome_darwin_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_darwin_386\": \"$(BASE_URL)/AdGuardHome_darwin_386.zip\"," >> $(DIST_DIR)/version.json
# Linux
echo " \"download_linux_amd64\": \"$(BASE_URL)/AdGuardHome_linux_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_386\": \"$(BASE_URL)/AdGuardHome_linux_386.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, all kinds of ARM
echo " \"download_linux_arm\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv5\": \"$(BASE_URL)/AdGuardHome_linux_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv6\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv7\": \"$(BASE_URL)/AdGuardHome_linux_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_arm64\": \"$(BASE_URL)/AdGuardHome_linux_arm64.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, MIPS
echo " \"download_linux_mips\": \"$(BASE_URL)/AdGuardHome_linux_mips_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mipsle\": \"$(BASE_URL)/AdGuardHome_linux_mipsle_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64\": \"$(BASE_URL)/AdGuardHome_linux_mips64_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64le\": \"$(BASE_URL)/AdGuardHome_linux_mips64le_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD
echo " \"download_freebsd_386\": \"$(BASE_URL)/AdGuardHome_freebsd_386.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_amd64\": \"$(BASE_URL)/AdGuardHome_freebsd_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD, all kinds of ARM
echo " \"download_freebsd_arm\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv5\": \"$(BASE_URL)/AdGuardHome_freebsd_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv6\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv7\": \"$(BASE_URL)/AdGuardHome_freebsd_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_arm64\": \"$(BASE_URL)/AdGuardHome_freebsd_arm64.tar.gz\"" >> $(DIST_DIR)/version.json
# Finish
echo "}" >> $(DIST_DIR)/version.json
endef
define repack_dist
# Repack archive files
# A temporary solution for our auto-update code to be able to unpack these archive files
# The problem is that goreleaser doesn't add directory AdGuardHome/ to the archive file
# and we can't create it
rm -rf $(DIST_DIR)/AdGuardHome
# Windows builds
$(call zip_repack_windows,AdGuardHome_windows_amd64.zip)
$(call zip_repack_windows,AdGuardHome_windows_386.zip)
# MacOS builds
$(call zip_repack,AdGuardHome_darwin_amd64.zip)
$(call zip_repack,AdGuardHome_darwin_386.zip)
# Linux
$(call tar_repack,AdGuardHome_linux_amd64.tar.gz)
$(call tar_repack,AdGuardHome_linux_386.tar.gz)
# Linux, all kinds of ARM
$(call tar_repack,AdGuardHome_linux_armv5.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv6.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv7.tar.gz)
$(call tar_repack,AdGuardHome_linux_arm64.tar.gz)
# Linux, MIPS
$(call tar_repack,AdGuardHome_linux_mips_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mipsle_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64le_softfloat.tar.gz)
# FreeBSD
$(call tar_repack,AdGuardHome_freebsd_386.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_amd64.tar.gz)
# FreeBSD, all kinds of ARM
$(call tar_repack,AdGuardHome_freebsd_armv5.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv6.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv7.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_arm64.tar.gz)
endef
define zip_repack_windows
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome.exe && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define zip_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define tar_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
tar xzf $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
tar czf $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
</s> add @ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release </s> remove npm --prefix client ci
yarn --cwd client2 install
$(GO) mod download
clean:
rm -f ./AdGuardHome ./AdGuardHome.exe ./coverage.txt
rm -f -r ./build/ ./client/node_modules/ ./data/ ./$(DIST_DIR)/
# Set the GOPATH explicitly in case make clean is called from under sudo
# after a Docker build.
env PATH="$(GOPATH)/bin:$$PATH" packr clean
rm -f -r ./bin/
</s> add @ echo "use make deps instead"
@ $(MAKE) deps </s> remove
js-lint: dependencies
npm --prefix client run lint
yarn --cwd client2 lint
go-install-tools:
env GO=$(GO) sh ./scripts/go-install-tools.sh
go-lint:
env GO=$(GO) PATH="$$PWD/bin:$$PATH" sh ./scripts/go-lint.sh
</s> add </s> remove - 'app'
- 'docker'
</s> add - 'build-release' | # GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps | #
# Available targets
#
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
# GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps
lint: js-lint go-lint
js-lint: dependencies
npm --prefix client run lint
yarn --cwd client2 lint | [
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | Makefile |
@echo Now you can run the docker image:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
lint: js-lint go-lint
js-lint: dependencies
npm --prefix client run lint
yarn --cwd client2 lint
go-install-tools:
env GO=$(GO) sh ./scripts/go-install-tools.sh
go-lint:
env GO=$(GO) PATH="$$PWD/bin:$$PATH" sh ./scripts/go-lint.sh
test: js-test go-test
js-test:
npm run test --prefix client
| </s> remove # * build -- builds AdGuardHome for the current platform
# * client -- builds client-side code of AdGuard Home
# * client-watch -- builds client-side code of AdGuard Home and watches for changes there
# * docker -- builds a docker image for the current platform
# * clean -- clean everything created by previous builds
# * lint -- run all linters
# * test -- run all unit-tests
# * dependencies -- installs dependencies (go and npm modules)
# * ci -- installs dependencies, runs linters and tests, intended to be used by CI/CD
#
# Building releases:
#
# * release -- builds AdGuard Home distros. CHANNEL must be specified (edge, release or beta).
# * release_and_sign -- builds AdGuard Home distros and signs the binary files.
# CHANNEL must be specified (edge, release or beta).
# * sign -- Repacks all release archive files and signs the binary files inside them.
# For signing to work, the public+private key pair for $(GPG_KEY) must be imported:
# gpg --import public.txt
# gpg --import private.txt
# GPG_KEY_PASSPHRASE must contain the GPG key passphrase
# * docker-multi-arch -- builds a multi-arch image. If you want it to be pushed to docker hub,
# you must specify:
# * DOCKER_IMAGE_NAME - adguard/adguard-home
# * DOCKER_OUTPUT - type=image,name=adguard/adguard-home,push=true
GO := go
GOPATH := $(shell $(GO) env GOPATH)
PWD := $(shell pwd)
TARGET=AdGuardHome
BASE_URL="https://static.adguard.com/adguardhome/$(CHANNEL)"
GPG_KEY := [email protected]
GPG_KEY_PASSPHRASE :=
GPG_CMD := gpg --detach-sig --default-key $(GPG_KEY) --pinentry-mode loopback --passphrase $(GPG_KEY_PASSPHRASE)
VERBOSE := -v
REBUILD_CLIENT = 1
# See release target
DIST_DIR=dist
# Update channel. Can be release, beta or edge. Uses edge by default.
CHANNEL ?= edge
# Validate channel
ifneq ($(CHANNEL),release)
ifneq ($(CHANNEL),beta)
ifneq ($(CHANNEL),edge)
$(error CHANNEL value is not valid. Valid values are release,beta or edge)
endif
endif
endif
# Version history URL (see
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/releases"
ifeq ($(CHANNEL),edge)
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/commits/master"
endif
# goreleaser command depends on the $CHANNEL
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --snapshot --parallelism 1
ifneq ($(CHANNEL),edge)
# If this is not an "edge" build, use normal release command
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --parallelism 1
endif
# Version properties
COMMIT=$(shell git rev-parse --short HEAD)
TAG_NAME=$(shell git describe --abbrev=0)
PRERELEASE_VERSION=$(shell git describe --abbrev=0)
# TODO(a.garipov): The cut call is a temporary solution to trim
# prerelease versions. See the comment in .goreleaser.yml.
RELEASE_VERSION=$(shell git describe --abbrev=0 | cut -c 1-8)
SNAPSHOT_VERSION=$(RELEASE_VERSION)-SNAPSHOT-$(COMMIT)
# Set proper version
VERSION=
ifeq ($(TAG_NAME),$(shell git describe --abbrev=4))
ifeq ($(CHANNEL),edge)
VERSION=$(SNAPSHOT_VERSION)
else ifeq ($(CHANNEL),beta)
VERSION=$(PRERELEASE_VERSION)
else
VERSION=$(RELEASE_VERSION)
endif
else
VERSION=$(SNAPSHOT_VERSION)
endif
# Docker target parameters
DOCKER_IMAGE_NAME ?= adguardhome-dev
DOCKER_IMAGE_FULL_NAME = $(DOCKER_IMAGE_NAME):$(VERSION)
DOCKER_PLATFORMS=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le
DOCKER_OUTPUT ?= type=image,name=$(DOCKER_IMAGE_NAME),push=false
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
# Docker tags (can be redefined)
DOCKER_TAGS ?=
ifndef DOCKER_TAGS
ifeq ($(CHANNEL),release)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):latest
endif
ifeq ($(CHANNEL),beta)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):beta
endif
ifeq ($(CHANNEL),edge)
# Don't set the version tag when pushing to "edge"
DOCKER_IMAGE_FULL_NAME := $(DOCKER_IMAGE_NAME):edge
# DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):edge
endif
endif
# Validate docker build arguments
ifndef DOCKER_IMAGE_NAME
$(error DOCKER_IMAGE_NAME value is not set)
endif
# OS-specific flags
TEST_FLAGS := --race $(VERBOSE)
ifeq ($(OS),Windows_NT)
TEST_FLAGS :=
endif
.PHONY: all build client client-watch docker lint lint-js lint-go test dependencies clean release docker-multi-arch
all: build
init:
git config core.hooksPath .githooks
build:
test '$(REBUILD_CLIENT)' = '1' && $(MAKE) client_with_deps || exit 0
$(GO) mod download
PATH=$(GOPATH)/bin:$(PATH) $(GO) generate ./...
CGO_ENABLED=0 $(GO) build -ldflags="-s -w -X main.version=$(VERSION) -X main.channel=$(CHANNEL) -X main.goarm=$(GOARM)"
PATH=$(GOPATH)/bin:$(PATH) packr clean
client:
npm --prefix client run build-prod
yarn --cwd client2 build
client_with_deps:
npm --prefix client ci
npm --prefix client run build-prod
yarn --cwd client2 build
client-watch:
npm --prefix client run watch
yarn --cwd client2 start
docker:
DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--load \
-t "$(DOCKER_IMAGE_NAME)" -f ./Dockerfile .
@echo Now you can run the docker image:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
</s> add # GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps </s> remove npm run test --prefix client
go-test:
$(GO) test $(TEST_FLAGS) --coverprofile coverage.txt ./...
</s> add $(NPM) $(NPM_FLAGS) run test </s> remove DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--platform $(DOCKER_PLATFORMS) \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--output "$(DOCKER_OUTPUT)" \
-t "$(DOCKER_IMAGE_FULL_NAME)" -f ./Dockerfile .
@echo If the image was pushed to the registry, you can now run it:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
release: client_with_deps
$(GO) mod download
@echo Starting release build: version $(VERSION), channel $(CHANNEL)
CHANNEL=$(CHANNEL) $(GORELEASER_COMMAND)
$(call write_version_file,$(VERSION))
PATH=$(GOPATH)/bin:$(PATH) packr clean
release_and_sign: client_with_deps
$(MAKE) release
$(call repack_dist)
sign:
$(call repack_dist)
define write_version_file
$(eval version := $(1))
@echo Writing version file: $(version)
# Variables for CI
rm -f $(DIST_DIR)/version.txt
echo "version=$(version)" > $(DIST_DIR)/version.txt
# Prepare the version.json file
rm -f $(DIST_DIR)/version.json
echo "{" >> $(DIST_DIR)/version.json
echo " \"version\": \"$(version)\"," >> $(DIST_DIR)/version.json
echo " \"announcement\": \"AdGuard Home $(version) is now available!\"," >> $(DIST_DIR)/version.json
echo " \"announcement_url\": \"$(VERSION_HISTORY_URL)\"," >> $(DIST_DIR)/version.json
echo " \"selfupdate_min_version\": \"0.0\"," >> $(DIST_DIR)/version.json
# Windows builds
echo " \"download_windows_amd64\": \"$(BASE_URL)/AdGuardHome_windows_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_windows_386\": \"$(BASE_URL)/AdGuardHome_windows_386.zip\"," >> $(DIST_DIR)/version.json
# MacOS builds
echo " \"download_darwin_amd64\": \"$(BASE_URL)/AdGuardHome_darwin_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_darwin_386\": \"$(BASE_URL)/AdGuardHome_darwin_386.zip\"," >> $(DIST_DIR)/version.json
# Linux
echo " \"download_linux_amd64\": \"$(BASE_URL)/AdGuardHome_linux_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_386\": \"$(BASE_URL)/AdGuardHome_linux_386.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, all kinds of ARM
echo " \"download_linux_arm\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv5\": \"$(BASE_URL)/AdGuardHome_linux_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv6\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv7\": \"$(BASE_URL)/AdGuardHome_linux_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_arm64\": \"$(BASE_URL)/AdGuardHome_linux_arm64.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, MIPS
echo " \"download_linux_mips\": \"$(BASE_URL)/AdGuardHome_linux_mips_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mipsle\": \"$(BASE_URL)/AdGuardHome_linux_mipsle_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64\": \"$(BASE_URL)/AdGuardHome_linux_mips64_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64le\": \"$(BASE_URL)/AdGuardHome_linux_mips64le_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD
echo " \"download_freebsd_386\": \"$(BASE_URL)/AdGuardHome_freebsd_386.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_amd64\": \"$(BASE_URL)/AdGuardHome_freebsd_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD, all kinds of ARM
echo " \"download_freebsd_arm\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv5\": \"$(BASE_URL)/AdGuardHome_freebsd_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv6\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv7\": \"$(BASE_URL)/AdGuardHome_freebsd_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_arm64\": \"$(BASE_URL)/AdGuardHome_freebsd_arm64.tar.gz\"" >> $(DIST_DIR)/version.json
# Finish
echo "}" >> $(DIST_DIR)/version.json
endef
define repack_dist
# Repack archive files
# A temporary solution for our auto-update code to be able to unpack these archive files
# The problem is that goreleaser doesn't add directory AdGuardHome/ to the archive file
# and we can't create it
rm -rf $(DIST_DIR)/AdGuardHome
# Windows builds
$(call zip_repack_windows,AdGuardHome_windows_amd64.zip)
$(call zip_repack_windows,AdGuardHome_windows_386.zip)
# MacOS builds
$(call zip_repack,AdGuardHome_darwin_amd64.zip)
$(call zip_repack,AdGuardHome_darwin_386.zip)
# Linux
$(call tar_repack,AdGuardHome_linux_amd64.tar.gz)
$(call tar_repack,AdGuardHome_linux_386.tar.gz)
# Linux, all kinds of ARM
$(call tar_repack,AdGuardHome_linux_armv5.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv6.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv7.tar.gz)
$(call tar_repack,AdGuardHome_linux_arm64.tar.gz)
# Linux, MIPS
$(call tar_repack,AdGuardHome_linux_mips_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mipsle_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64le_softfloat.tar.gz)
# FreeBSD
$(call tar_repack,AdGuardHome_freebsd_386.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_amd64.tar.gz)
# FreeBSD, all kinds of ARM
$(call tar_repack,AdGuardHome_freebsd_armv5.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv6.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv7.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_arm64.tar.gz)
endef
define zip_repack_windows
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome.exe && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define zip_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define tar_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
tar xzf $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
tar czf $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
</s> add @ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release </s> remove npm --prefix client ci
yarn --cwd client2 install
$(GO) mod download
clean:
rm -f ./AdGuardHome ./AdGuardHome.exe ./coverage.txt
rm -f -r ./build/ ./client/node_modules/ ./data/ ./$(DIST_DIR)/
# Set the GOPATH explicitly in case make clean is called from under sudo
# after a Docker build.
env PATH="$(GOPATH)/bin:$$PATH" packr clean
rm -f -r ./bin/
</s> add @ echo "use make deps instead"
@ $(MAKE) deps </s> remove ci: client_with_deps
$(GO) mod download
$(MAKE) test
</s> add go-build: ; $(ENV) "$(SHELL)" ./scripts/make/go-build.sh
go-deps: ; $(ENV) "$(SHELL)" ./scripts/make/go-deps.sh
go-lint: ; $(ENV) "$(SHELL)" ./scripts/make/go-lint.sh
go-test: ; $(ENV) "$(SHELL)" ./scripts/make/go-test.sh
go-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-tools.sh | @echo Now you can run the docker image:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
lint: js-lint go-lint
test: js-test go-test
js-test:
npm run test --prefix client
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | Makefile |
|
test: js-test go-test
js-test:
npm run test --prefix client
go-test:
$(GO) test $(TEST_FLAGS) --coverprofile coverage.txt ./...
ci: client_with_deps
$(GO) mod download
$(MAKE) test
| </s> remove ci: client_with_deps
$(GO) mod download
$(MAKE) test
</s> add go-build: ; $(ENV) "$(SHELL)" ./scripts/make/go-build.sh
go-deps: ; $(ENV) "$(SHELL)" ./scripts/make/go-deps.sh
go-lint: ; $(ENV) "$(SHELL)" ./scripts/make/go-lint.sh
go-test: ; $(ENV) "$(SHELL)" ./scripts/make/go-test.sh
go-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-tools.sh </s> remove
js-lint: dependencies
npm --prefix client run lint
yarn --cwd client2 lint
go-install-tools:
env GO=$(GO) sh ./scripts/go-install-tools.sh
go-lint:
env GO=$(GO) PATH="$$PWD/bin:$$PATH" sh ./scripts/go-lint.sh
</s> add </s> remove npm --prefix client ci
yarn --cwd client2 install
$(GO) mod download
clean:
rm -f ./AdGuardHome ./AdGuardHome.exe ./coverage.txt
rm -f -r ./build/ ./client/node_modules/ ./data/ ./$(DIST_DIR)/
# Set the GOPATH explicitly in case make clean is called from under sudo
# after a Docker build.
env PATH="$(GOPATH)/bin:$$PATH" packr clean
rm -f -r ./bin/
</s> add @ echo "use make deps instead"
@ $(MAKE) deps </s> remove # * build -- builds AdGuardHome for the current platform
# * client -- builds client-side code of AdGuard Home
# * client-watch -- builds client-side code of AdGuard Home and watches for changes there
# * docker -- builds a docker image for the current platform
# * clean -- clean everything created by previous builds
# * lint -- run all linters
# * test -- run all unit-tests
# * dependencies -- installs dependencies (go and npm modules)
# * ci -- installs dependencies, runs linters and tests, intended to be used by CI/CD
#
# Building releases:
#
# * release -- builds AdGuard Home distros. CHANNEL must be specified (edge, release or beta).
# * release_and_sign -- builds AdGuard Home distros and signs the binary files.
# CHANNEL must be specified (edge, release or beta).
# * sign -- Repacks all release archive files and signs the binary files inside them.
# For signing to work, the public+private key pair for $(GPG_KEY) must be imported:
# gpg --import public.txt
# gpg --import private.txt
# GPG_KEY_PASSPHRASE must contain the GPG key passphrase
# * docker-multi-arch -- builds a multi-arch image. If you want it to be pushed to docker hub,
# you must specify:
# * DOCKER_IMAGE_NAME - adguard/adguard-home
# * DOCKER_OUTPUT - type=image,name=adguard/adguard-home,push=true
GO := go
GOPATH := $(shell $(GO) env GOPATH)
PWD := $(shell pwd)
TARGET=AdGuardHome
BASE_URL="https://static.adguard.com/adguardhome/$(CHANNEL)"
GPG_KEY := [email protected]
GPG_KEY_PASSPHRASE :=
GPG_CMD := gpg --detach-sig --default-key $(GPG_KEY) --pinentry-mode loopback --passphrase $(GPG_KEY_PASSPHRASE)
VERBOSE := -v
REBUILD_CLIENT = 1
# See release target
DIST_DIR=dist
# Update channel. Can be release, beta or edge. Uses edge by default.
CHANNEL ?= edge
# Validate channel
ifneq ($(CHANNEL),release)
ifneq ($(CHANNEL),beta)
ifneq ($(CHANNEL),edge)
$(error CHANNEL value is not valid. Valid values are release,beta or edge)
endif
endif
endif
# Version history URL (see
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/releases"
ifeq ($(CHANNEL),edge)
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/commits/master"
endif
# goreleaser command depends on the $CHANNEL
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --snapshot --parallelism 1
ifneq ($(CHANNEL),edge)
# If this is not an "edge" build, use normal release command
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --parallelism 1
endif
# Version properties
COMMIT=$(shell git rev-parse --short HEAD)
TAG_NAME=$(shell git describe --abbrev=0)
PRERELEASE_VERSION=$(shell git describe --abbrev=0)
# TODO(a.garipov): The cut call is a temporary solution to trim
# prerelease versions. See the comment in .goreleaser.yml.
RELEASE_VERSION=$(shell git describe --abbrev=0 | cut -c 1-8)
SNAPSHOT_VERSION=$(RELEASE_VERSION)-SNAPSHOT-$(COMMIT)
# Set proper version
VERSION=
ifeq ($(TAG_NAME),$(shell git describe --abbrev=4))
ifeq ($(CHANNEL),edge)
VERSION=$(SNAPSHOT_VERSION)
else ifeq ($(CHANNEL),beta)
VERSION=$(PRERELEASE_VERSION)
else
VERSION=$(RELEASE_VERSION)
endif
else
VERSION=$(SNAPSHOT_VERSION)
endif
# Docker target parameters
DOCKER_IMAGE_NAME ?= adguardhome-dev
DOCKER_IMAGE_FULL_NAME = $(DOCKER_IMAGE_NAME):$(VERSION)
DOCKER_PLATFORMS=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le
DOCKER_OUTPUT ?= type=image,name=$(DOCKER_IMAGE_NAME),push=false
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
# Docker tags (can be redefined)
DOCKER_TAGS ?=
ifndef DOCKER_TAGS
ifeq ($(CHANNEL),release)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):latest
endif
ifeq ($(CHANNEL),beta)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):beta
endif
ifeq ($(CHANNEL),edge)
# Don't set the version tag when pushing to "edge"
DOCKER_IMAGE_FULL_NAME := $(DOCKER_IMAGE_NAME):edge
# DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):edge
endif
endif
# Validate docker build arguments
ifndef DOCKER_IMAGE_NAME
$(error DOCKER_IMAGE_NAME value is not set)
endif
# OS-specific flags
TEST_FLAGS := --race $(VERBOSE)
ifeq ($(OS),Windows_NT)
TEST_FLAGS :=
endif
.PHONY: all build client client-watch docker lint lint-js lint-go test dependencies clean release docker-multi-arch
all: build
init:
git config core.hooksPath .githooks
build:
test '$(REBUILD_CLIENT)' = '1' && $(MAKE) client_with_deps || exit 0
$(GO) mod download
PATH=$(GOPATH)/bin:$(PATH) $(GO) generate ./...
CGO_ENABLED=0 $(GO) build -ldflags="-s -w -X main.version=$(VERSION) -X main.channel=$(CHANNEL) -X main.goarm=$(GOARM)"
PATH=$(GOPATH)/bin:$(PATH) packr clean
client:
npm --prefix client run build-prod
yarn --cwd client2 build
client_with_deps:
npm --prefix client ci
npm --prefix client run build-prod
yarn --cwd client2 build
client-watch:
npm --prefix client run watch
yarn --cwd client2 start
docker:
DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--load \
-t "$(DOCKER_IMAGE_NAME)" -f ./Dockerfile .
@echo Now you can run the docker image:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
</s> add # GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps </s> remove DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--platform $(DOCKER_PLATFORMS) \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--output "$(DOCKER_OUTPUT)" \
-t "$(DOCKER_IMAGE_FULL_NAME)" -f ./Dockerfile .
@echo If the image was pushed to the registry, you can now run it:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
release: client_with_deps
$(GO) mod download
@echo Starting release build: version $(VERSION), channel $(CHANNEL)
CHANNEL=$(CHANNEL) $(GORELEASER_COMMAND)
$(call write_version_file,$(VERSION))
PATH=$(GOPATH)/bin:$(PATH) packr clean
release_and_sign: client_with_deps
$(MAKE) release
$(call repack_dist)
sign:
$(call repack_dist)
define write_version_file
$(eval version := $(1))
@echo Writing version file: $(version)
# Variables for CI
rm -f $(DIST_DIR)/version.txt
echo "version=$(version)" > $(DIST_DIR)/version.txt
# Prepare the version.json file
rm -f $(DIST_DIR)/version.json
echo "{" >> $(DIST_DIR)/version.json
echo " \"version\": \"$(version)\"," >> $(DIST_DIR)/version.json
echo " \"announcement\": \"AdGuard Home $(version) is now available!\"," >> $(DIST_DIR)/version.json
echo " \"announcement_url\": \"$(VERSION_HISTORY_URL)\"," >> $(DIST_DIR)/version.json
echo " \"selfupdate_min_version\": \"0.0\"," >> $(DIST_DIR)/version.json
# Windows builds
echo " \"download_windows_amd64\": \"$(BASE_URL)/AdGuardHome_windows_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_windows_386\": \"$(BASE_URL)/AdGuardHome_windows_386.zip\"," >> $(DIST_DIR)/version.json
# MacOS builds
echo " \"download_darwin_amd64\": \"$(BASE_URL)/AdGuardHome_darwin_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_darwin_386\": \"$(BASE_URL)/AdGuardHome_darwin_386.zip\"," >> $(DIST_DIR)/version.json
# Linux
echo " \"download_linux_amd64\": \"$(BASE_URL)/AdGuardHome_linux_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_386\": \"$(BASE_URL)/AdGuardHome_linux_386.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, all kinds of ARM
echo " \"download_linux_arm\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv5\": \"$(BASE_URL)/AdGuardHome_linux_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv6\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv7\": \"$(BASE_URL)/AdGuardHome_linux_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_arm64\": \"$(BASE_URL)/AdGuardHome_linux_arm64.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, MIPS
echo " \"download_linux_mips\": \"$(BASE_URL)/AdGuardHome_linux_mips_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mipsle\": \"$(BASE_URL)/AdGuardHome_linux_mipsle_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64\": \"$(BASE_URL)/AdGuardHome_linux_mips64_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64le\": \"$(BASE_URL)/AdGuardHome_linux_mips64le_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD
echo " \"download_freebsd_386\": \"$(BASE_URL)/AdGuardHome_freebsd_386.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_amd64\": \"$(BASE_URL)/AdGuardHome_freebsd_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD, all kinds of ARM
echo " \"download_freebsd_arm\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv5\": \"$(BASE_URL)/AdGuardHome_freebsd_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv6\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv7\": \"$(BASE_URL)/AdGuardHome_freebsd_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_arm64\": \"$(BASE_URL)/AdGuardHome_freebsd_arm64.tar.gz\"" >> $(DIST_DIR)/version.json
# Finish
echo "}" >> $(DIST_DIR)/version.json
endef
define repack_dist
# Repack archive files
# A temporary solution for our auto-update code to be able to unpack these archive files
# The problem is that goreleaser doesn't add directory AdGuardHome/ to the archive file
# and we can't create it
rm -rf $(DIST_DIR)/AdGuardHome
# Windows builds
$(call zip_repack_windows,AdGuardHome_windows_amd64.zip)
$(call zip_repack_windows,AdGuardHome_windows_386.zip)
# MacOS builds
$(call zip_repack,AdGuardHome_darwin_amd64.zip)
$(call zip_repack,AdGuardHome_darwin_386.zip)
# Linux
$(call tar_repack,AdGuardHome_linux_amd64.tar.gz)
$(call tar_repack,AdGuardHome_linux_386.tar.gz)
# Linux, all kinds of ARM
$(call tar_repack,AdGuardHome_linux_armv5.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv6.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv7.tar.gz)
$(call tar_repack,AdGuardHome_linux_arm64.tar.gz)
# Linux, MIPS
$(call tar_repack,AdGuardHome_linux_mips_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mipsle_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64le_softfloat.tar.gz)
# FreeBSD
$(call tar_repack,AdGuardHome_freebsd_386.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_amd64.tar.gz)
# FreeBSD, all kinds of ARM
$(call tar_repack,AdGuardHome_freebsd_armv5.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv6.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv7.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_arm64.tar.gz)
endef
define zip_repack_windows
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome.exe && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define zip_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define tar_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
tar xzf $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
tar czf $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
</s> add @ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release | $(NPM) $(NPM_FLAGS) run test |
test: js-test go-test
js-test:
$(NPM) $(NPM_FLAGS) run test
$(NPM) $(NPM_FLAGS) run test
$(NPM) $(NPM_FLAGS) run test
$(NPM) $(NPM_FLAGS) run test
ci: client_with_deps
$(GO) mod download
$(MAKE) test
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | Makefile |
go-test:
$(GO) test $(TEST_FLAGS) --coverprofile coverage.txt ./...
ci: client_with_deps
$(GO) mod download
$(MAKE) test
dependencies:
npm --prefix client ci
yarn --cwd client2 install
$(GO) mod download
| </s> remove npm run test --prefix client
go-test:
$(GO) test $(TEST_FLAGS) --coverprofile coverage.txt ./...
</s> add $(NPM) $(NPM_FLAGS) run test </s> remove npm --prefix client ci
yarn --cwd client2 install
$(GO) mod download
clean:
rm -f ./AdGuardHome ./AdGuardHome.exe ./coverage.txt
rm -f -r ./build/ ./client/node_modules/ ./data/ ./$(DIST_DIR)/
# Set the GOPATH explicitly in case make clean is called from under sudo
# after a Docker build.
env PATH="$(GOPATH)/bin:$$PATH" packr clean
rm -f -r ./bin/
</s> add @ echo "use make deps instead"
@ $(MAKE) deps </s> remove # * build -- builds AdGuardHome for the current platform
# * client -- builds client-side code of AdGuard Home
# * client-watch -- builds client-side code of AdGuard Home and watches for changes there
# * docker -- builds a docker image for the current platform
# * clean -- clean everything created by previous builds
# * lint -- run all linters
# * test -- run all unit-tests
# * dependencies -- installs dependencies (go and npm modules)
# * ci -- installs dependencies, runs linters and tests, intended to be used by CI/CD
#
# Building releases:
#
# * release -- builds AdGuard Home distros. CHANNEL must be specified (edge, release or beta).
# * release_and_sign -- builds AdGuard Home distros and signs the binary files.
# CHANNEL must be specified (edge, release or beta).
# * sign -- Repacks all release archive files and signs the binary files inside them.
# For signing to work, the public+private key pair for $(GPG_KEY) must be imported:
# gpg --import public.txt
# gpg --import private.txt
# GPG_KEY_PASSPHRASE must contain the GPG key passphrase
# * docker-multi-arch -- builds a multi-arch image. If you want it to be pushed to docker hub,
# you must specify:
# * DOCKER_IMAGE_NAME - adguard/adguard-home
# * DOCKER_OUTPUT - type=image,name=adguard/adguard-home,push=true
GO := go
GOPATH := $(shell $(GO) env GOPATH)
PWD := $(shell pwd)
TARGET=AdGuardHome
BASE_URL="https://static.adguard.com/adguardhome/$(CHANNEL)"
GPG_KEY := [email protected]
GPG_KEY_PASSPHRASE :=
GPG_CMD := gpg --detach-sig --default-key $(GPG_KEY) --pinentry-mode loopback --passphrase $(GPG_KEY_PASSPHRASE)
VERBOSE := -v
REBUILD_CLIENT = 1
# See release target
DIST_DIR=dist
# Update channel. Can be release, beta or edge. Uses edge by default.
CHANNEL ?= edge
# Validate channel
ifneq ($(CHANNEL),release)
ifneq ($(CHANNEL),beta)
ifneq ($(CHANNEL),edge)
$(error CHANNEL value is not valid. Valid values are release,beta or edge)
endif
endif
endif
# Version history URL (see
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/releases"
ifeq ($(CHANNEL),edge)
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/commits/master"
endif
# goreleaser command depends on the $CHANNEL
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --snapshot --parallelism 1
ifneq ($(CHANNEL),edge)
# If this is not an "edge" build, use normal release command
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --parallelism 1
endif
# Version properties
COMMIT=$(shell git rev-parse --short HEAD)
TAG_NAME=$(shell git describe --abbrev=0)
PRERELEASE_VERSION=$(shell git describe --abbrev=0)
# TODO(a.garipov): The cut call is a temporary solution to trim
# prerelease versions. See the comment in .goreleaser.yml.
RELEASE_VERSION=$(shell git describe --abbrev=0 | cut -c 1-8)
SNAPSHOT_VERSION=$(RELEASE_VERSION)-SNAPSHOT-$(COMMIT)
# Set proper version
VERSION=
ifeq ($(TAG_NAME),$(shell git describe --abbrev=4))
ifeq ($(CHANNEL),edge)
VERSION=$(SNAPSHOT_VERSION)
else ifeq ($(CHANNEL),beta)
VERSION=$(PRERELEASE_VERSION)
else
VERSION=$(RELEASE_VERSION)
endif
else
VERSION=$(SNAPSHOT_VERSION)
endif
# Docker target parameters
DOCKER_IMAGE_NAME ?= adguardhome-dev
DOCKER_IMAGE_FULL_NAME = $(DOCKER_IMAGE_NAME):$(VERSION)
DOCKER_PLATFORMS=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le
DOCKER_OUTPUT ?= type=image,name=$(DOCKER_IMAGE_NAME),push=false
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
# Docker tags (can be redefined)
DOCKER_TAGS ?=
ifndef DOCKER_TAGS
ifeq ($(CHANNEL),release)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):latest
endif
ifeq ($(CHANNEL),beta)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):beta
endif
ifeq ($(CHANNEL),edge)
# Don't set the version tag when pushing to "edge"
DOCKER_IMAGE_FULL_NAME := $(DOCKER_IMAGE_NAME):edge
# DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):edge
endif
endif
# Validate docker build arguments
ifndef DOCKER_IMAGE_NAME
$(error DOCKER_IMAGE_NAME value is not set)
endif
# OS-specific flags
TEST_FLAGS := --race $(VERBOSE)
ifeq ($(OS),Windows_NT)
TEST_FLAGS :=
endif
.PHONY: all build client client-watch docker lint lint-js lint-go test dependencies clean release docker-multi-arch
all: build
init:
git config core.hooksPath .githooks
build:
test '$(REBUILD_CLIENT)' = '1' && $(MAKE) client_with_deps || exit 0
$(GO) mod download
PATH=$(GOPATH)/bin:$(PATH) $(GO) generate ./...
CGO_ENABLED=0 $(GO) build -ldflags="-s -w -X main.version=$(VERSION) -X main.channel=$(CHANNEL) -X main.goarm=$(GOARM)"
PATH=$(GOPATH)/bin:$(PATH) packr clean
client:
npm --prefix client run build-prod
yarn --cwd client2 build
client_with_deps:
npm --prefix client ci
npm --prefix client run build-prod
yarn --cwd client2 build
client-watch:
npm --prefix client run watch
yarn --cwd client2 start
docker:
DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--load \
-t "$(DOCKER_IMAGE_NAME)" -f ./Dockerfile .
@echo Now you can run the docker image:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
</s> add # GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps </s> remove
js-lint: dependencies
npm --prefix client run lint
yarn --cwd client2 lint
go-install-tools:
env GO=$(GO) sh ./scripts/go-install-tools.sh
go-lint:
env GO=$(GO) PATH="$$PWD/bin:$$PATH" sh ./scripts/go-lint.sh
</s> add </s> remove DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--platform $(DOCKER_PLATFORMS) \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--output "$(DOCKER_OUTPUT)" \
-t "$(DOCKER_IMAGE_FULL_NAME)" -f ./Dockerfile .
@echo If the image was pushed to the registry, you can now run it:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
release: client_with_deps
$(GO) mod download
@echo Starting release build: version $(VERSION), channel $(CHANNEL)
CHANNEL=$(CHANNEL) $(GORELEASER_COMMAND)
$(call write_version_file,$(VERSION))
PATH=$(GOPATH)/bin:$(PATH) packr clean
release_and_sign: client_with_deps
$(MAKE) release
$(call repack_dist)
sign:
$(call repack_dist)
define write_version_file
$(eval version := $(1))
@echo Writing version file: $(version)
# Variables for CI
rm -f $(DIST_DIR)/version.txt
echo "version=$(version)" > $(DIST_DIR)/version.txt
# Prepare the version.json file
rm -f $(DIST_DIR)/version.json
echo "{" >> $(DIST_DIR)/version.json
echo " \"version\": \"$(version)\"," >> $(DIST_DIR)/version.json
echo " \"announcement\": \"AdGuard Home $(version) is now available!\"," >> $(DIST_DIR)/version.json
echo " \"announcement_url\": \"$(VERSION_HISTORY_URL)\"," >> $(DIST_DIR)/version.json
echo " \"selfupdate_min_version\": \"0.0\"," >> $(DIST_DIR)/version.json
# Windows builds
echo " \"download_windows_amd64\": \"$(BASE_URL)/AdGuardHome_windows_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_windows_386\": \"$(BASE_URL)/AdGuardHome_windows_386.zip\"," >> $(DIST_DIR)/version.json
# MacOS builds
echo " \"download_darwin_amd64\": \"$(BASE_URL)/AdGuardHome_darwin_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_darwin_386\": \"$(BASE_URL)/AdGuardHome_darwin_386.zip\"," >> $(DIST_DIR)/version.json
# Linux
echo " \"download_linux_amd64\": \"$(BASE_URL)/AdGuardHome_linux_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_386\": \"$(BASE_URL)/AdGuardHome_linux_386.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, all kinds of ARM
echo " \"download_linux_arm\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv5\": \"$(BASE_URL)/AdGuardHome_linux_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv6\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv7\": \"$(BASE_URL)/AdGuardHome_linux_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_arm64\": \"$(BASE_URL)/AdGuardHome_linux_arm64.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, MIPS
echo " \"download_linux_mips\": \"$(BASE_URL)/AdGuardHome_linux_mips_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mipsle\": \"$(BASE_URL)/AdGuardHome_linux_mipsle_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64\": \"$(BASE_URL)/AdGuardHome_linux_mips64_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64le\": \"$(BASE_URL)/AdGuardHome_linux_mips64le_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD
echo " \"download_freebsd_386\": \"$(BASE_URL)/AdGuardHome_freebsd_386.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_amd64\": \"$(BASE_URL)/AdGuardHome_freebsd_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD, all kinds of ARM
echo " \"download_freebsd_arm\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv5\": \"$(BASE_URL)/AdGuardHome_freebsd_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv6\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv7\": \"$(BASE_URL)/AdGuardHome_freebsd_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_arm64\": \"$(BASE_URL)/AdGuardHome_freebsd_arm64.tar.gz\"" >> $(DIST_DIR)/version.json
# Finish
echo "}" >> $(DIST_DIR)/version.json
endef
define repack_dist
# Repack archive files
# A temporary solution for our auto-update code to be able to unpack these archive files
# The problem is that goreleaser doesn't add directory AdGuardHome/ to the archive file
# and we can't create it
rm -rf $(DIST_DIR)/AdGuardHome
# Windows builds
$(call zip_repack_windows,AdGuardHome_windows_amd64.zip)
$(call zip_repack_windows,AdGuardHome_windows_386.zip)
# MacOS builds
$(call zip_repack,AdGuardHome_darwin_amd64.zip)
$(call zip_repack,AdGuardHome_darwin_386.zip)
# Linux
$(call tar_repack,AdGuardHome_linux_amd64.tar.gz)
$(call tar_repack,AdGuardHome_linux_386.tar.gz)
# Linux, all kinds of ARM
$(call tar_repack,AdGuardHome_linux_armv5.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv6.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv7.tar.gz)
$(call tar_repack,AdGuardHome_linux_arm64.tar.gz)
# Linux, MIPS
$(call tar_repack,AdGuardHome_linux_mips_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mipsle_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64le_softfloat.tar.gz)
# FreeBSD
$(call tar_repack,AdGuardHome_freebsd_386.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_amd64.tar.gz)
# FreeBSD, all kinds of ARM
$(call tar_repack,AdGuardHome_freebsd_armv5.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv6.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv7.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_arm64.tar.gz)
endef
define zip_repack_windows
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome.exe && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define zip_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define tar_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
tar xzf $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
tar czf $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
</s> add @ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release | go-build: ; $(ENV) "$(SHELL)" ./scripts/make/go-build.sh
go-deps: ; $(ENV) "$(SHELL)" ./scripts/make/go-deps.sh
go-lint: ; $(ENV) "$(SHELL)" ./scripts/make/go-lint.sh
go-test: ; $(ENV) "$(SHELL)" ./scripts/make/go-test.sh
go-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-tools.sh |
go-test:
$(GO) test $(TEST_FLAGS) --coverprofile coverage.txt ./...
go-build: ; $(ENV) "$(SHELL)" ./scripts/make/go-build.sh
go-deps: ; $(ENV) "$(SHELL)" ./scripts/make/go-deps.sh
go-lint: ; $(ENV) "$(SHELL)" ./scripts/make/go-lint.sh
go-test: ; $(ENV) "$(SHELL)" ./scripts/make/go-test.sh
go-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-tools.sh
go-build: ; $(ENV) "$(SHELL)" ./scripts/make/go-build.sh
go-deps: ; $(ENV) "$(SHELL)" ./scripts/make/go-deps.sh
go-lint: ; $(ENV) "$(SHELL)" ./scripts/make/go-lint.sh
go-test: ; $(ENV) "$(SHELL)" ./scripts/make/go-test.sh
go-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-tools.sh
go-build: ; $(ENV) "$(SHELL)" ./scripts/make/go-build.sh
go-deps: ; $(ENV) "$(SHELL)" ./scripts/make/go-deps.sh
go-lint: ; $(ENV) "$(SHELL)" ./scripts/make/go-lint.sh
go-test: ; $(ENV) "$(SHELL)" ./scripts/make/go-test.sh
go-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-tools.sh
dependencies:
npm --prefix client ci
yarn --cwd client2 install
$(GO) mod download | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | Makefile |
go-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-tools.sh
dependencies:
@ echo "use make deps instead"
@ $(MAKE) deps
docker-multi-arch:
@ echo "use make build-docker instead"
| </s> remove npm --prefix client ci
yarn --cwd client2 install
$(GO) mod download
clean:
rm -f ./AdGuardHome ./AdGuardHome.exe ./coverage.txt
rm -f -r ./build/ ./client/node_modules/ ./data/ ./$(DIST_DIR)/
# Set the GOPATH explicitly in case make clean is called from under sudo
# after a Docker build.
env PATH="$(GOPATH)/bin:$$PATH" packr clean
rm -f -r ./bin/
</s> add @ echo "use make deps instead"
@ $(MAKE) deps </s> remove DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--platform $(DOCKER_PLATFORMS) \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--output "$(DOCKER_OUTPUT)" \
-t "$(DOCKER_IMAGE_FULL_NAME)" -f ./Dockerfile .
@echo If the image was pushed to the registry, you can now run it:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
release: client_with_deps
$(GO) mod download
@echo Starting release build: version $(VERSION), channel $(CHANNEL)
CHANNEL=$(CHANNEL) $(GORELEASER_COMMAND)
$(call write_version_file,$(VERSION))
PATH=$(GOPATH)/bin:$(PATH) packr clean
release_and_sign: client_with_deps
$(MAKE) release
$(call repack_dist)
sign:
$(call repack_dist)
define write_version_file
$(eval version := $(1))
@echo Writing version file: $(version)
# Variables for CI
rm -f $(DIST_DIR)/version.txt
echo "version=$(version)" > $(DIST_DIR)/version.txt
# Prepare the version.json file
rm -f $(DIST_DIR)/version.json
echo "{" >> $(DIST_DIR)/version.json
echo " \"version\": \"$(version)\"," >> $(DIST_DIR)/version.json
echo " \"announcement\": \"AdGuard Home $(version) is now available!\"," >> $(DIST_DIR)/version.json
echo " \"announcement_url\": \"$(VERSION_HISTORY_URL)\"," >> $(DIST_DIR)/version.json
echo " \"selfupdate_min_version\": \"0.0\"," >> $(DIST_DIR)/version.json
# Windows builds
echo " \"download_windows_amd64\": \"$(BASE_URL)/AdGuardHome_windows_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_windows_386\": \"$(BASE_URL)/AdGuardHome_windows_386.zip\"," >> $(DIST_DIR)/version.json
# MacOS builds
echo " \"download_darwin_amd64\": \"$(BASE_URL)/AdGuardHome_darwin_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_darwin_386\": \"$(BASE_URL)/AdGuardHome_darwin_386.zip\"," >> $(DIST_DIR)/version.json
# Linux
echo " \"download_linux_amd64\": \"$(BASE_URL)/AdGuardHome_linux_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_386\": \"$(BASE_URL)/AdGuardHome_linux_386.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, all kinds of ARM
echo " \"download_linux_arm\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv5\": \"$(BASE_URL)/AdGuardHome_linux_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv6\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv7\": \"$(BASE_URL)/AdGuardHome_linux_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_arm64\": \"$(BASE_URL)/AdGuardHome_linux_arm64.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, MIPS
echo " \"download_linux_mips\": \"$(BASE_URL)/AdGuardHome_linux_mips_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mipsle\": \"$(BASE_URL)/AdGuardHome_linux_mipsle_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64\": \"$(BASE_URL)/AdGuardHome_linux_mips64_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64le\": \"$(BASE_URL)/AdGuardHome_linux_mips64le_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD
echo " \"download_freebsd_386\": \"$(BASE_URL)/AdGuardHome_freebsd_386.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_amd64\": \"$(BASE_URL)/AdGuardHome_freebsd_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD, all kinds of ARM
echo " \"download_freebsd_arm\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv5\": \"$(BASE_URL)/AdGuardHome_freebsd_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv6\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv7\": \"$(BASE_URL)/AdGuardHome_freebsd_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_arm64\": \"$(BASE_URL)/AdGuardHome_freebsd_arm64.tar.gz\"" >> $(DIST_DIR)/version.json
# Finish
echo "}" >> $(DIST_DIR)/version.json
endef
define repack_dist
# Repack archive files
# A temporary solution for our auto-update code to be able to unpack these archive files
# The problem is that goreleaser doesn't add directory AdGuardHome/ to the archive file
# and we can't create it
rm -rf $(DIST_DIR)/AdGuardHome
# Windows builds
$(call zip_repack_windows,AdGuardHome_windows_amd64.zip)
$(call zip_repack_windows,AdGuardHome_windows_386.zip)
# MacOS builds
$(call zip_repack,AdGuardHome_darwin_amd64.zip)
$(call zip_repack,AdGuardHome_darwin_386.zip)
# Linux
$(call tar_repack,AdGuardHome_linux_amd64.tar.gz)
$(call tar_repack,AdGuardHome_linux_386.tar.gz)
# Linux, all kinds of ARM
$(call tar_repack,AdGuardHome_linux_armv5.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv6.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv7.tar.gz)
$(call tar_repack,AdGuardHome_linux_arm64.tar.gz)
# Linux, MIPS
$(call tar_repack,AdGuardHome_linux_mips_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mipsle_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64le_softfloat.tar.gz)
# FreeBSD
$(call tar_repack,AdGuardHome_freebsd_386.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_amd64.tar.gz)
# FreeBSD, all kinds of ARM
$(call tar_repack,AdGuardHome_freebsd_armv5.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv6.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv7.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_arm64.tar.gz)
endef
define zip_repack_windows
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome.exe && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define zip_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define tar_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
tar xzf $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
tar czf $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
</s> add @ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release </s> remove ci: client_with_deps
$(GO) mod download
$(MAKE) test
</s> add go-build: ; $(ENV) "$(SHELL)" ./scripts/make/go-build.sh
go-deps: ; $(ENV) "$(SHELL)" ./scripts/make/go-deps.sh
go-lint: ; $(ENV) "$(SHELL)" ./scripts/make/go-lint.sh
go-test: ; $(ENV) "$(SHELL)" ./scripts/make/go-test.sh
go-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-tools.sh </s> remove make go-install-tools go-lint
</s> add make go-deps go-tools go-lint </s> remove 'run': 'make ci'
</s> add 'run': 'make VERBOSE=1 ci' | # TODO(a.garipov): Remove the legacy targets once the build
# infrastructure stops using them. | go-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-tools.sh
# TODO(a.garipov): Remove the legacy targets once the build
# infrastructure stops using them.
dependencies:
@ echo "use make deps instead"
@ $(MAKE) deps
docker-multi-arch:
@ echo "use make build-docker instead" | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | Makefile |
$(GO) mod download
$(MAKE) test
dependencies:
npm --prefix client ci
yarn --cwd client2 install
$(GO) mod download
clean:
rm -f ./AdGuardHome ./AdGuardHome.exe ./coverage.txt
rm -f -r ./build/ ./client/node_modules/ ./data/ ./$(DIST_DIR)/
# Set the GOPATH explicitly in case make clean is called from under sudo
# after a Docker build.
env PATH="$(GOPATH)/bin:$$PATH" packr clean
rm -f -r ./bin/
docker-multi-arch:
DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--platform $(DOCKER_PLATFORMS) \
--build-arg VERSION=$(VERSION) \
| </s> remove DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--platform $(DOCKER_PLATFORMS) \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--output "$(DOCKER_OUTPUT)" \
-t "$(DOCKER_IMAGE_FULL_NAME)" -f ./Dockerfile .
@echo If the image was pushed to the registry, you can now run it:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
release: client_with_deps
$(GO) mod download
@echo Starting release build: version $(VERSION), channel $(CHANNEL)
CHANNEL=$(CHANNEL) $(GORELEASER_COMMAND)
$(call write_version_file,$(VERSION))
PATH=$(GOPATH)/bin:$(PATH) packr clean
release_and_sign: client_with_deps
$(MAKE) release
$(call repack_dist)
sign:
$(call repack_dist)
define write_version_file
$(eval version := $(1))
@echo Writing version file: $(version)
# Variables for CI
rm -f $(DIST_DIR)/version.txt
echo "version=$(version)" > $(DIST_DIR)/version.txt
# Prepare the version.json file
rm -f $(DIST_DIR)/version.json
echo "{" >> $(DIST_DIR)/version.json
echo " \"version\": \"$(version)\"," >> $(DIST_DIR)/version.json
echo " \"announcement\": \"AdGuard Home $(version) is now available!\"," >> $(DIST_DIR)/version.json
echo " \"announcement_url\": \"$(VERSION_HISTORY_URL)\"," >> $(DIST_DIR)/version.json
echo " \"selfupdate_min_version\": \"0.0\"," >> $(DIST_DIR)/version.json
# Windows builds
echo " \"download_windows_amd64\": \"$(BASE_URL)/AdGuardHome_windows_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_windows_386\": \"$(BASE_URL)/AdGuardHome_windows_386.zip\"," >> $(DIST_DIR)/version.json
# MacOS builds
echo " \"download_darwin_amd64\": \"$(BASE_URL)/AdGuardHome_darwin_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_darwin_386\": \"$(BASE_URL)/AdGuardHome_darwin_386.zip\"," >> $(DIST_DIR)/version.json
# Linux
echo " \"download_linux_amd64\": \"$(BASE_URL)/AdGuardHome_linux_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_386\": \"$(BASE_URL)/AdGuardHome_linux_386.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, all kinds of ARM
echo " \"download_linux_arm\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv5\": \"$(BASE_URL)/AdGuardHome_linux_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv6\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv7\": \"$(BASE_URL)/AdGuardHome_linux_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_arm64\": \"$(BASE_URL)/AdGuardHome_linux_arm64.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, MIPS
echo " \"download_linux_mips\": \"$(BASE_URL)/AdGuardHome_linux_mips_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mipsle\": \"$(BASE_URL)/AdGuardHome_linux_mipsle_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64\": \"$(BASE_URL)/AdGuardHome_linux_mips64_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64le\": \"$(BASE_URL)/AdGuardHome_linux_mips64le_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD
echo " \"download_freebsd_386\": \"$(BASE_URL)/AdGuardHome_freebsd_386.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_amd64\": \"$(BASE_URL)/AdGuardHome_freebsd_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD, all kinds of ARM
echo " \"download_freebsd_arm\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv5\": \"$(BASE_URL)/AdGuardHome_freebsd_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv6\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv7\": \"$(BASE_URL)/AdGuardHome_freebsd_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_arm64\": \"$(BASE_URL)/AdGuardHome_freebsd_arm64.tar.gz\"" >> $(DIST_DIR)/version.json
# Finish
echo "}" >> $(DIST_DIR)/version.json
endef
define repack_dist
# Repack archive files
# A temporary solution for our auto-update code to be able to unpack these archive files
# The problem is that goreleaser doesn't add directory AdGuardHome/ to the archive file
# and we can't create it
rm -rf $(DIST_DIR)/AdGuardHome
# Windows builds
$(call zip_repack_windows,AdGuardHome_windows_amd64.zip)
$(call zip_repack_windows,AdGuardHome_windows_386.zip)
# MacOS builds
$(call zip_repack,AdGuardHome_darwin_amd64.zip)
$(call zip_repack,AdGuardHome_darwin_386.zip)
# Linux
$(call tar_repack,AdGuardHome_linux_amd64.tar.gz)
$(call tar_repack,AdGuardHome_linux_386.tar.gz)
# Linux, all kinds of ARM
$(call tar_repack,AdGuardHome_linux_armv5.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv6.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv7.tar.gz)
$(call tar_repack,AdGuardHome_linux_arm64.tar.gz)
# Linux, MIPS
$(call tar_repack,AdGuardHome_linux_mips_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mipsle_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64le_softfloat.tar.gz)
# FreeBSD
$(call tar_repack,AdGuardHome_freebsd_386.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_amd64.tar.gz)
# FreeBSD, all kinds of ARM
$(call tar_repack,AdGuardHome_freebsd_armv5.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv6.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv7.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_arm64.tar.gz)
endef
define zip_repack_windows
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome.exe && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define zip_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define tar_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
tar xzf $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
tar czf $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
</s> add @ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release </s> remove # * build -- builds AdGuardHome for the current platform
# * client -- builds client-side code of AdGuard Home
# * client-watch -- builds client-side code of AdGuard Home and watches for changes there
# * docker -- builds a docker image for the current platform
# * clean -- clean everything created by previous builds
# * lint -- run all linters
# * test -- run all unit-tests
# * dependencies -- installs dependencies (go and npm modules)
# * ci -- installs dependencies, runs linters and tests, intended to be used by CI/CD
#
# Building releases:
#
# * release -- builds AdGuard Home distros. CHANNEL must be specified (edge, release or beta).
# * release_and_sign -- builds AdGuard Home distros and signs the binary files.
# CHANNEL must be specified (edge, release or beta).
# * sign -- Repacks all release archive files and signs the binary files inside them.
# For signing to work, the public+private key pair for $(GPG_KEY) must be imported:
# gpg --import public.txt
# gpg --import private.txt
# GPG_KEY_PASSPHRASE must contain the GPG key passphrase
# * docker-multi-arch -- builds a multi-arch image. If you want it to be pushed to docker hub,
# you must specify:
# * DOCKER_IMAGE_NAME - adguard/adguard-home
# * DOCKER_OUTPUT - type=image,name=adguard/adguard-home,push=true
GO := go
GOPATH := $(shell $(GO) env GOPATH)
PWD := $(shell pwd)
TARGET=AdGuardHome
BASE_URL="https://static.adguard.com/adguardhome/$(CHANNEL)"
GPG_KEY := [email protected]
GPG_KEY_PASSPHRASE :=
GPG_CMD := gpg --detach-sig --default-key $(GPG_KEY) --pinentry-mode loopback --passphrase $(GPG_KEY_PASSPHRASE)
VERBOSE := -v
REBUILD_CLIENT = 1
# See release target
DIST_DIR=dist
# Update channel. Can be release, beta or edge. Uses edge by default.
CHANNEL ?= edge
# Validate channel
ifneq ($(CHANNEL),release)
ifneq ($(CHANNEL),beta)
ifneq ($(CHANNEL),edge)
$(error CHANNEL value is not valid. Valid values are release,beta or edge)
endif
endif
endif
# Version history URL (see
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/releases"
ifeq ($(CHANNEL),edge)
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/commits/master"
endif
# goreleaser command depends on the $CHANNEL
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --snapshot --parallelism 1
ifneq ($(CHANNEL),edge)
# If this is not an "edge" build, use normal release command
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --parallelism 1
endif
# Version properties
COMMIT=$(shell git rev-parse --short HEAD)
TAG_NAME=$(shell git describe --abbrev=0)
PRERELEASE_VERSION=$(shell git describe --abbrev=0)
# TODO(a.garipov): The cut call is a temporary solution to trim
# prerelease versions. See the comment in .goreleaser.yml.
RELEASE_VERSION=$(shell git describe --abbrev=0 | cut -c 1-8)
SNAPSHOT_VERSION=$(RELEASE_VERSION)-SNAPSHOT-$(COMMIT)
# Set proper version
VERSION=
ifeq ($(TAG_NAME),$(shell git describe --abbrev=4))
ifeq ($(CHANNEL),edge)
VERSION=$(SNAPSHOT_VERSION)
else ifeq ($(CHANNEL),beta)
VERSION=$(PRERELEASE_VERSION)
else
VERSION=$(RELEASE_VERSION)
endif
else
VERSION=$(SNAPSHOT_VERSION)
endif
# Docker target parameters
DOCKER_IMAGE_NAME ?= adguardhome-dev
DOCKER_IMAGE_FULL_NAME = $(DOCKER_IMAGE_NAME):$(VERSION)
DOCKER_PLATFORMS=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le
DOCKER_OUTPUT ?= type=image,name=$(DOCKER_IMAGE_NAME),push=false
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
# Docker tags (can be redefined)
DOCKER_TAGS ?=
ifndef DOCKER_TAGS
ifeq ($(CHANNEL),release)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):latest
endif
ifeq ($(CHANNEL),beta)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):beta
endif
ifeq ($(CHANNEL),edge)
# Don't set the version tag when pushing to "edge"
DOCKER_IMAGE_FULL_NAME := $(DOCKER_IMAGE_NAME):edge
# DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):edge
endif
endif
# Validate docker build arguments
ifndef DOCKER_IMAGE_NAME
$(error DOCKER_IMAGE_NAME value is not set)
endif
# OS-specific flags
TEST_FLAGS := --race $(VERBOSE)
ifeq ($(OS),Windows_NT)
TEST_FLAGS :=
endif
.PHONY: all build client client-watch docker lint lint-js lint-go test dependencies clean release docker-multi-arch
all: build
init:
git config core.hooksPath .githooks
build:
test '$(REBUILD_CLIENT)' = '1' && $(MAKE) client_with_deps || exit 0
$(GO) mod download
PATH=$(GOPATH)/bin:$(PATH) $(GO) generate ./...
CGO_ENABLED=0 $(GO) build -ldflags="-s -w -X main.version=$(VERSION) -X main.channel=$(CHANNEL) -X main.goarm=$(GOARM)"
PATH=$(GOPATH)/bin:$(PATH) packr clean
client:
npm --prefix client run build-prod
yarn --cwd client2 build
client_with_deps:
npm --prefix client ci
npm --prefix client run build-prod
yarn --cwd client2 build
client-watch:
npm --prefix client run watch
yarn --cwd client2 start
docker:
DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--load \
-t "$(DOCKER_IMAGE_NAME)" -f ./Dockerfile .
@echo Now you can run the docker image:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
</s> add # GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps </s> remove ci: client_with_deps
$(GO) mod download
$(MAKE) test
</s> add go-build: ; $(ENV) "$(SHELL)" ./scripts/make/go-build.sh
go-deps: ; $(ENV) "$(SHELL)" ./scripts/make/go-deps.sh
go-lint: ; $(ENV) "$(SHELL)" ./scripts/make/go-lint.sh
go-test: ; $(ENV) "$(SHELL)" ./scripts/make/go-test.sh
go-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-tools.sh </s> remove npm run test --prefix client
go-test:
$(GO) test $(TEST_FLAGS) --coverprofile coverage.txt ./...
</s> add $(NPM) $(NPM_FLAGS) run test </s> remove
js-lint: dependencies
npm --prefix client run lint
yarn --cwd client2 lint
go-install-tools:
env GO=$(GO) sh ./scripts/go-install-tools.sh
go-lint:
env GO=$(GO) PATH="$$PWD/bin:$$PATH" sh ./scripts/go-lint.sh
</s> add | @ echo "use make deps instead"
@ $(MAKE) deps | $(GO) mod download
$(MAKE) test
dependencies:
@ echo "use make deps instead"
@ $(MAKE) deps
@ echo "use make deps instead"
@ $(MAKE) deps
@ echo "use make deps instead"
@ $(MAKE) deps
@ echo "use make deps instead"
@ $(MAKE) deps
@ echo "use make deps instead"
@ $(MAKE) deps
@ echo "use make deps instead"
@ $(MAKE) deps
@ echo "use make deps instead"
@ $(MAKE) deps
@ echo "use make deps instead"
@ $(MAKE) deps
@ echo "use make deps instead"
@ $(MAKE) deps
@ echo "use make deps instead"
@ $(MAKE) deps
@ echo "use make deps instead"
@ $(MAKE) deps
@ echo "use make deps instead"
@ $(MAKE) deps
docker-multi-arch:
DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--platform $(DOCKER_PLATFORMS) \
--build-arg VERSION=$(VERSION) \ | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | Makefile |
env PATH="$(GOPATH)/bin:$$PATH" packr clean
rm -f -r ./bin/
docker-multi-arch:
DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--platform $(DOCKER_PLATFORMS) \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--output "$(DOCKER_OUTPUT)" \
-t "$(DOCKER_IMAGE_FULL_NAME)" -f ./Dockerfile .
@echo If the image was pushed to the registry, you can now run it:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
release: client_with_deps
$(GO) mod download
@echo Starting release build: version $(VERSION), channel $(CHANNEL)
CHANNEL=$(CHANNEL) $(GORELEASER_COMMAND)
$(call write_version_file,$(VERSION))
PATH=$(GOPATH)/bin:$(PATH) packr clean
release_and_sign: client_with_deps
$(MAKE) release
$(call repack_dist)
sign:
$(call repack_dist)
define write_version_file
$(eval version := $(1))
@echo Writing version file: $(version)
# Variables for CI
rm -f $(DIST_DIR)/version.txt
echo "version=$(version)" > $(DIST_DIR)/version.txt
# Prepare the version.json file
rm -f $(DIST_DIR)/version.json
echo "{" >> $(DIST_DIR)/version.json
echo " \"version\": \"$(version)\"," >> $(DIST_DIR)/version.json
echo " \"announcement\": \"AdGuard Home $(version) is now available!\"," >> $(DIST_DIR)/version.json
echo " \"announcement_url\": \"$(VERSION_HISTORY_URL)\"," >> $(DIST_DIR)/version.json
echo " \"selfupdate_min_version\": \"0.0\"," >> $(DIST_DIR)/version.json
# Windows builds
echo " \"download_windows_amd64\": \"$(BASE_URL)/AdGuardHome_windows_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_windows_386\": \"$(BASE_URL)/AdGuardHome_windows_386.zip\"," >> $(DIST_DIR)/version.json
# MacOS builds
echo " \"download_darwin_amd64\": \"$(BASE_URL)/AdGuardHome_darwin_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_darwin_386\": \"$(BASE_URL)/AdGuardHome_darwin_386.zip\"," >> $(DIST_DIR)/version.json
# Linux
echo " \"download_linux_amd64\": \"$(BASE_URL)/AdGuardHome_linux_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_386\": \"$(BASE_URL)/AdGuardHome_linux_386.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, all kinds of ARM
echo " \"download_linux_arm\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv5\": \"$(BASE_URL)/AdGuardHome_linux_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv6\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv7\": \"$(BASE_URL)/AdGuardHome_linux_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_arm64\": \"$(BASE_URL)/AdGuardHome_linux_arm64.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, MIPS
echo " \"download_linux_mips\": \"$(BASE_URL)/AdGuardHome_linux_mips_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mipsle\": \"$(BASE_URL)/AdGuardHome_linux_mipsle_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64\": \"$(BASE_URL)/AdGuardHome_linux_mips64_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64le\": \"$(BASE_URL)/AdGuardHome_linux_mips64le_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD
echo " \"download_freebsd_386\": \"$(BASE_URL)/AdGuardHome_freebsd_386.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_amd64\": \"$(BASE_URL)/AdGuardHome_freebsd_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD, all kinds of ARM
echo " \"download_freebsd_arm\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv5\": \"$(BASE_URL)/AdGuardHome_freebsd_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv6\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv7\": \"$(BASE_URL)/AdGuardHome_freebsd_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_arm64\": \"$(BASE_URL)/AdGuardHome_freebsd_arm64.tar.gz\"" >> $(DIST_DIR)/version.json
# Finish
echo "}" >> $(DIST_DIR)/version.json
endef
define repack_dist
# Repack archive files
# A temporary solution for our auto-update code to be able to unpack these archive files
# The problem is that goreleaser doesn't add directory AdGuardHome/ to the archive file
# and we can't create it
rm -rf $(DIST_DIR)/AdGuardHome
# Windows builds
$(call zip_repack_windows,AdGuardHome_windows_amd64.zip)
$(call zip_repack_windows,AdGuardHome_windows_386.zip)
# MacOS builds
$(call zip_repack,AdGuardHome_darwin_amd64.zip)
$(call zip_repack,AdGuardHome_darwin_386.zip)
# Linux
$(call tar_repack,AdGuardHome_linux_amd64.tar.gz)
$(call tar_repack,AdGuardHome_linux_386.tar.gz)
# Linux, all kinds of ARM
$(call tar_repack,AdGuardHome_linux_armv5.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv6.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv7.tar.gz)
$(call tar_repack,AdGuardHome_linux_arm64.tar.gz)
# Linux, MIPS
$(call tar_repack,AdGuardHome_linux_mips_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mipsle_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64le_softfloat.tar.gz)
# FreeBSD
$(call tar_repack,AdGuardHome_freebsd_386.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_amd64.tar.gz)
# FreeBSD, all kinds of ARM
$(call tar_repack,AdGuardHome_freebsd_armv5.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv6.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv7.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_arm64.tar.gz)
endef
define zip_repack_windows
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome.exe && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define zip_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define tar_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
tar xzf $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
tar czf $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
| </s> remove npm --prefix client ci
yarn --cwd client2 install
$(GO) mod download
clean:
rm -f ./AdGuardHome ./AdGuardHome.exe ./coverage.txt
rm -f -r ./build/ ./client/node_modules/ ./data/ ./$(DIST_DIR)/
# Set the GOPATH explicitly in case make clean is called from under sudo
# after a Docker build.
env PATH="$(GOPATH)/bin:$$PATH" packr clean
rm -f -r ./bin/
</s> add @ echo "use make deps instead"
@ $(MAKE) deps </s> remove # * build -- builds AdGuardHome for the current platform
# * client -- builds client-side code of AdGuard Home
# * client-watch -- builds client-side code of AdGuard Home and watches for changes there
# * docker -- builds a docker image for the current platform
# * clean -- clean everything created by previous builds
# * lint -- run all linters
# * test -- run all unit-tests
# * dependencies -- installs dependencies (go and npm modules)
# * ci -- installs dependencies, runs linters and tests, intended to be used by CI/CD
#
# Building releases:
#
# * release -- builds AdGuard Home distros. CHANNEL must be specified (edge, release or beta).
# * release_and_sign -- builds AdGuard Home distros and signs the binary files.
# CHANNEL must be specified (edge, release or beta).
# * sign -- Repacks all release archive files and signs the binary files inside them.
# For signing to work, the public+private key pair for $(GPG_KEY) must be imported:
# gpg --import public.txt
# gpg --import private.txt
# GPG_KEY_PASSPHRASE must contain the GPG key passphrase
# * docker-multi-arch -- builds a multi-arch image. If you want it to be pushed to docker hub,
# you must specify:
# * DOCKER_IMAGE_NAME - adguard/adguard-home
# * DOCKER_OUTPUT - type=image,name=adguard/adguard-home,push=true
GO := go
GOPATH := $(shell $(GO) env GOPATH)
PWD := $(shell pwd)
TARGET=AdGuardHome
BASE_URL="https://static.adguard.com/adguardhome/$(CHANNEL)"
GPG_KEY := [email protected]
GPG_KEY_PASSPHRASE :=
GPG_CMD := gpg --detach-sig --default-key $(GPG_KEY) --pinentry-mode loopback --passphrase $(GPG_KEY_PASSPHRASE)
VERBOSE := -v
REBUILD_CLIENT = 1
# See release target
DIST_DIR=dist
# Update channel. Can be release, beta or edge. Uses edge by default.
CHANNEL ?= edge
# Validate channel
ifneq ($(CHANNEL),release)
ifneq ($(CHANNEL),beta)
ifneq ($(CHANNEL),edge)
$(error CHANNEL value is not valid. Valid values are release,beta or edge)
endif
endif
endif
# Version history URL (see
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/releases"
ifeq ($(CHANNEL),edge)
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/commits/master"
endif
# goreleaser command depends on the $CHANNEL
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --snapshot --parallelism 1
ifneq ($(CHANNEL),edge)
# If this is not an "edge" build, use normal release command
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --parallelism 1
endif
# Version properties
COMMIT=$(shell git rev-parse --short HEAD)
TAG_NAME=$(shell git describe --abbrev=0)
PRERELEASE_VERSION=$(shell git describe --abbrev=0)
# TODO(a.garipov): The cut call is a temporary solution to trim
# prerelease versions. See the comment in .goreleaser.yml.
RELEASE_VERSION=$(shell git describe --abbrev=0 | cut -c 1-8)
SNAPSHOT_VERSION=$(RELEASE_VERSION)-SNAPSHOT-$(COMMIT)
# Set proper version
VERSION=
ifeq ($(TAG_NAME),$(shell git describe --abbrev=4))
ifeq ($(CHANNEL),edge)
VERSION=$(SNAPSHOT_VERSION)
else ifeq ($(CHANNEL),beta)
VERSION=$(PRERELEASE_VERSION)
else
VERSION=$(RELEASE_VERSION)
endif
else
VERSION=$(SNAPSHOT_VERSION)
endif
# Docker target parameters
DOCKER_IMAGE_NAME ?= adguardhome-dev
DOCKER_IMAGE_FULL_NAME = $(DOCKER_IMAGE_NAME):$(VERSION)
DOCKER_PLATFORMS=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le
DOCKER_OUTPUT ?= type=image,name=$(DOCKER_IMAGE_NAME),push=false
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
# Docker tags (can be redefined)
DOCKER_TAGS ?=
ifndef DOCKER_TAGS
ifeq ($(CHANNEL),release)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):latest
endif
ifeq ($(CHANNEL),beta)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):beta
endif
ifeq ($(CHANNEL),edge)
# Don't set the version tag when pushing to "edge"
DOCKER_IMAGE_FULL_NAME := $(DOCKER_IMAGE_NAME):edge
# DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):edge
endif
endif
# Validate docker build arguments
ifndef DOCKER_IMAGE_NAME
$(error DOCKER_IMAGE_NAME value is not set)
endif
# OS-specific flags
TEST_FLAGS := --race $(VERBOSE)
ifeq ($(OS),Windows_NT)
TEST_FLAGS :=
endif
.PHONY: all build client client-watch docker lint lint-js lint-go test dependencies clean release docker-multi-arch
all: build
init:
git config core.hooksPath .githooks
build:
test '$(REBUILD_CLIENT)' = '1' && $(MAKE) client_with_deps || exit 0
$(GO) mod download
PATH=$(GOPATH)/bin:$(PATH) $(GO) generate ./...
CGO_ENABLED=0 $(GO) build -ldflags="-s -w -X main.version=$(VERSION) -X main.channel=$(CHANNEL) -X main.goarm=$(GOARM)"
PATH=$(GOPATH)/bin:$(PATH) packr clean
client:
npm --prefix client run build-prod
yarn --cwd client2 build
client_with_deps:
npm --prefix client ci
npm --prefix client run build-prod
yarn --cwd client2 build
client-watch:
npm --prefix client run watch
yarn --cwd client2 start
docker:
DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--load \
-t "$(DOCKER_IMAGE_NAME)" -f ./Dockerfile .
@echo Now you can run the docker image:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
</s> add # GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps </s> remove # Available targets
</s> add # See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html.
.POSIX:
CHANNEL = development
CLIENT_BETA_DIR = client2
CLIENT_DIR = client
COMMIT = $$(git rev-parse --short HEAD)
DIST_DIR = dist
GO = go
# TODO(a.garipov): Add more default proxies using pipes after update to
# Go 1.15. </s> remove
js-lint: dependencies
npm --prefix client run lint
yarn --cwd client2 lint
go-install-tools:
env GO=$(GO) sh ./scripts/go-install-tools.sh
go-lint:
env GO=$(GO) PATH="$$PWD/bin:$$PATH" sh ./scripts/go-lint.sh
</s> add | @ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release | env PATH="$(GOPATH)/bin:$$PATH" packr clean
rm -f -r ./bin/
docker-multi-arch:
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release
@ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | Makefile |
//go:generate go install -v github.com/gobuffalo/packr/packr
//go:generate packr clean
//go:generate packr -z
package main
import (
| </s> remove npm --prefix client ci
yarn --cwd client2 install
$(GO) mod download
clean:
rm -f ./AdGuardHome ./AdGuardHome.exe ./coverage.txt
rm -f -r ./build/ ./client/node_modules/ ./data/ ./$(DIST_DIR)/
# Set the GOPATH explicitly in case make clean is called from under sudo
# after a Docker build.
env PATH="$(GOPATH)/bin:$$PATH" packr clean
rm -f -r ./bin/
</s> add @ echo "use make deps instead"
@ $(MAKE) deps </s> remove # * build -- builds AdGuardHome for the current platform
# * client -- builds client-side code of AdGuard Home
# * client-watch -- builds client-side code of AdGuard Home and watches for changes there
# * docker -- builds a docker image for the current platform
# * clean -- clean everything created by previous builds
# * lint -- run all linters
# * test -- run all unit-tests
# * dependencies -- installs dependencies (go and npm modules)
# * ci -- installs dependencies, runs linters and tests, intended to be used by CI/CD
#
# Building releases:
#
# * release -- builds AdGuard Home distros. CHANNEL must be specified (edge, release or beta).
# * release_and_sign -- builds AdGuard Home distros and signs the binary files.
# CHANNEL must be specified (edge, release or beta).
# * sign -- Repacks all release archive files and signs the binary files inside them.
# For signing to work, the public+private key pair for $(GPG_KEY) must be imported:
# gpg --import public.txt
# gpg --import private.txt
# GPG_KEY_PASSPHRASE must contain the GPG key passphrase
# * docker-multi-arch -- builds a multi-arch image. If you want it to be pushed to docker hub,
# you must specify:
# * DOCKER_IMAGE_NAME - adguard/adguard-home
# * DOCKER_OUTPUT - type=image,name=adguard/adguard-home,push=true
GO := go
GOPATH := $(shell $(GO) env GOPATH)
PWD := $(shell pwd)
TARGET=AdGuardHome
BASE_URL="https://static.adguard.com/adguardhome/$(CHANNEL)"
GPG_KEY := [email protected]
GPG_KEY_PASSPHRASE :=
GPG_CMD := gpg --detach-sig --default-key $(GPG_KEY) --pinentry-mode loopback --passphrase $(GPG_KEY_PASSPHRASE)
VERBOSE := -v
REBUILD_CLIENT = 1
# See release target
DIST_DIR=dist
# Update channel. Can be release, beta or edge. Uses edge by default.
CHANNEL ?= edge
# Validate channel
ifneq ($(CHANNEL),release)
ifneq ($(CHANNEL),beta)
ifneq ($(CHANNEL),edge)
$(error CHANNEL value is not valid. Valid values are release,beta or edge)
endif
endif
endif
# Version history URL (see
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/releases"
ifeq ($(CHANNEL),edge)
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/commits/master"
endif
# goreleaser command depends on the $CHANNEL
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --snapshot --parallelism 1
ifneq ($(CHANNEL),edge)
# If this is not an "edge" build, use normal release command
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --parallelism 1
endif
# Version properties
COMMIT=$(shell git rev-parse --short HEAD)
TAG_NAME=$(shell git describe --abbrev=0)
PRERELEASE_VERSION=$(shell git describe --abbrev=0)
# TODO(a.garipov): The cut call is a temporary solution to trim
# prerelease versions. See the comment in .goreleaser.yml.
RELEASE_VERSION=$(shell git describe --abbrev=0 | cut -c 1-8)
SNAPSHOT_VERSION=$(RELEASE_VERSION)-SNAPSHOT-$(COMMIT)
# Set proper version
VERSION=
ifeq ($(TAG_NAME),$(shell git describe --abbrev=4))
ifeq ($(CHANNEL),edge)
VERSION=$(SNAPSHOT_VERSION)
else ifeq ($(CHANNEL),beta)
VERSION=$(PRERELEASE_VERSION)
else
VERSION=$(RELEASE_VERSION)
endif
else
VERSION=$(SNAPSHOT_VERSION)
endif
# Docker target parameters
DOCKER_IMAGE_NAME ?= adguardhome-dev
DOCKER_IMAGE_FULL_NAME = $(DOCKER_IMAGE_NAME):$(VERSION)
DOCKER_PLATFORMS=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le
DOCKER_OUTPUT ?= type=image,name=$(DOCKER_IMAGE_NAME),push=false
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
# Docker tags (can be redefined)
DOCKER_TAGS ?=
ifndef DOCKER_TAGS
ifeq ($(CHANNEL),release)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):latest
endif
ifeq ($(CHANNEL),beta)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):beta
endif
ifeq ($(CHANNEL),edge)
# Don't set the version tag when pushing to "edge"
DOCKER_IMAGE_FULL_NAME := $(DOCKER_IMAGE_NAME):edge
# DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):edge
endif
endif
# Validate docker build arguments
ifndef DOCKER_IMAGE_NAME
$(error DOCKER_IMAGE_NAME value is not set)
endif
# OS-specific flags
TEST_FLAGS := --race $(VERBOSE)
ifeq ($(OS),Windows_NT)
TEST_FLAGS :=
endif
.PHONY: all build client client-watch docker lint lint-js lint-go test dependencies clean release docker-multi-arch
all: build
init:
git config core.hooksPath .githooks
build:
test '$(REBUILD_CLIENT)' = '1' && $(MAKE) client_with_deps || exit 0
$(GO) mod download
PATH=$(GOPATH)/bin:$(PATH) $(GO) generate ./...
CGO_ENABLED=0 $(GO) build -ldflags="-s -w -X main.version=$(VERSION) -X main.channel=$(CHANNEL) -X main.goarm=$(GOARM)"
PATH=$(GOPATH)/bin:$(PATH) packr clean
client:
npm --prefix client run build-prod
yarn --cwd client2 build
client_with_deps:
npm --prefix client ci
npm --prefix client run build-prod
yarn --cwd client2 build
client-watch:
npm --prefix client run watch
yarn --cwd client2 start
docker:
DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--load \
-t "$(DOCKER_IMAGE_NAME)" -f ./Dockerfile .
@echo Now you can run the docker image:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
</s> add # GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps </s> remove DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--platform $(DOCKER_PLATFORMS) \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--output "$(DOCKER_OUTPUT)" \
-t "$(DOCKER_IMAGE_FULL_NAME)" -f ./Dockerfile .
@echo If the image was pushed to the registry, you can now run it:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
release: client_with_deps
$(GO) mod download
@echo Starting release build: version $(VERSION), channel $(CHANNEL)
CHANNEL=$(CHANNEL) $(GORELEASER_COMMAND)
$(call write_version_file,$(VERSION))
PATH=$(GOPATH)/bin:$(PATH) packr clean
release_and_sign: client_with_deps
$(MAKE) release
$(call repack_dist)
sign:
$(call repack_dist)
define write_version_file
$(eval version := $(1))
@echo Writing version file: $(version)
# Variables for CI
rm -f $(DIST_DIR)/version.txt
echo "version=$(version)" > $(DIST_DIR)/version.txt
# Prepare the version.json file
rm -f $(DIST_DIR)/version.json
echo "{" >> $(DIST_DIR)/version.json
echo " \"version\": \"$(version)\"," >> $(DIST_DIR)/version.json
echo " \"announcement\": \"AdGuard Home $(version) is now available!\"," >> $(DIST_DIR)/version.json
echo " \"announcement_url\": \"$(VERSION_HISTORY_URL)\"," >> $(DIST_DIR)/version.json
echo " \"selfupdate_min_version\": \"0.0\"," >> $(DIST_DIR)/version.json
# Windows builds
echo " \"download_windows_amd64\": \"$(BASE_URL)/AdGuardHome_windows_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_windows_386\": \"$(BASE_URL)/AdGuardHome_windows_386.zip\"," >> $(DIST_DIR)/version.json
# MacOS builds
echo " \"download_darwin_amd64\": \"$(BASE_URL)/AdGuardHome_darwin_amd64.zip\"," >> $(DIST_DIR)/version.json
echo " \"download_darwin_386\": \"$(BASE_URL)/AdGuardHome_darwin_386.zip\"," >> $(DIST_DIR)/version.json
# Linux
echo " \"download_linux_amd64\": \"$(BASE_URL)/AdGuardHome_linux_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_386\": \"$(BASE_URL)/AdGuardHome_linux_386.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, all kinds of ARM
echo " \"download_linux_arm\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv5\": \"$(BASE_URL)/AdGuardHome_linux_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv6\": \"$(BASE_URL)/AdGuardHome_linux_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_armv7\": \"$(BASE_URL)/AdGuardHome_linux_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_arm64\": \"$(BASE_URL)/AdGuardHome_linux_arm64.tar.gz\"," >> $(DIST_DIR)/version.json
# Linux, MIPS
echo " \"download_linux_mips\": \"$(BASE_URL)/AdGuardHome_linux_mips_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mipsle\": \"$(BASE_URL)/AdGuardHome_linux_mipsle_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64\": \"$(BASE_URL)/AdGuardHome_linux_mips64_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_linux_mips64le\": \"$(BASE_URL)/AdGuardHome_linux_mips64le_softfloat.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD
echo " \"download_freebsd_386\": \"$(BASE_URL)/AdGuardHome_freebsd_386.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_amd64\": \"$(BASE_URL)/AdGuardHome_freebsd_amd64.tar.gz\"," >> $(DIST_DIR)/version.json
# FreeBSD, all kinds of ARM
echo " \"download_freebsd_arm\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv5\": \"$(BASE_URL)/AdGuardHome_freebsd_armv5.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv6\": \"$(BASE_URL)/AdGuardHome_freebsd_armv6.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_armv7\": \"$(BASE_URL)/AdGuardHome_freebsd_armv7.tar.gz\"," >> $(DIST_DIR)/version.json
echo " \"download_freebsd_arm64\": \"$(BASE_URL)/AdGuardHome_freebsd_arm64.tar.gz\"" >> $(DIST_DIR)/version.json
# Finish
echo "}" >> $(DIST_DIR)/version.json
endef
define repack_dist
# Repack archive files
# A temporary solution for our auto-update code to be able to unpack these archive files
# The problem is that goreleaser doesn't add directory AdGuardHome/ to the archive file
# and we can't create it
rm -rf $(DIST_DIR)/AdGuardHome
# Windows builds
$(call zip_repack_windows,AdGuardHome_windows_amd64.zip)
$(call zip_repack_windows,AdGuardHome_windows_386.zip)
# MacOS builds
$(call zip_repack,AdGuardHome_darwin_amd64.zip)
$(call zip_repack,AdGuardHome_darwin_386.zip)
# Linux
$(call tar_repack,AdGuardHome_linux_amd64.tar.gz)
$(call tar_repack,AdGuardHome_linux_386.tar.gz)
# Linux, all kinds of ARM
$(call tar_repack,AdGuardHome_linux_armv5.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv6.tar.gz)
$(call tar_repack,AdGuardHome_linux_armv7.tar.gz)
$(call tar_repack,AdGuardHome_linux_arm64.tar.gz)
# Linux, MIPS
$(call tar_repack,AdGuardHome_linux_mips_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mipsle_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64_softfloat.tar.gz)
$(call tar_repack,AdGuardHome_linux_mips64le_softfloat.tar.gz)
# FreeBSD
$(call tar_repack,AdGuardHome_freebsd_386.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_amd64.tar.gz)
# FreeBSD, all kinds of ARM
$(call tar_repack,AdGuardHome_freebsd_armv5.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv6.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_armv7.tar.gz)
$(call tar_repack,AdGuardHome_freebsd_arm64.tar.gz)
endef
define zip_repack_windows
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome.exe && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define zip_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
unzip $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
zip -r $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
define tar_repack
$(eval ARC := $(1))
cd $(DIST_DIR) && \
tar xzf $(ARC) && \
$(GPG_CMD) AdGuardHome/AdGuardHome && \
tar czf $(ARC) AdGuardHome/ && \
rm -rf AdGuardHome
endef
</s> add @ echo "use make build-docker instead"
@ $(MAKE) build-docker
go-install-tools:
@ echo "use make go-tools instead"
@ $(MAKE) go-tools
release:
@ echo "use make build-release instead"
@ $(MAKE) build-release </s> remove # Available targets
</s> add # See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html.
.POSIX:
CHANNEL = development
CLIENT_BETA_DIR = client2
CLIENT_DIR = client
COMMIT = $$(git rev-parse --short HEAD)
DIST_DIR = dist
GO = go
# TODO(a.garipov): Add more default proxies using pipes after update to
# Go 1.15. </s> remove ci: client_with_deps
$(GO) mod download
$(MAKE) test
</s> add go-build: ; $(ENV) "$(SHELL)" ./scripts/make/go-build.sh
go-deps: ; $(ENV) "$(SHELL)" ./scripts/make/go-deps.sh
go-lint: ; $(ENV) "$(SHELL)" ./scripts/make/go-lint.sh
go-test: ; $(ENV) "$(SHELL)" ./scripts/make/go-test.sh
go-tools: ; $(ENV) "$(SHELL)" ./scripts/make/go-tools.sh |
//go:generate packr clean
//go:generate packr -z
package main
import ( | [
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | main.go |
|
// goarm is the GOARM value. It is set by the linker.
var goarm = ""
// gomips is the GOMIPS value. It is set by the linker.
//
// TODO(a.garipov): Implement.
var gomips = ""
func main() {
home.Main(version, channel, goarm, gomips)
}
| </s> remove # * build -- builds AdGuardHome for the current platform
# * client -- builds client-side code of AdGuard Home
# * client-watch -- builds client-side code of AdGuard Home and watches for changes there
# * docker -- builds a docker image for the current platform
# * clean -- clean everything created by previous builds
# * lint -- run all linters
# * test -- run all unit-tests
# * dependencies -- installs dependencies (go and npm modules)
# * ci -- installs dependencies, runs linters and tests, intended to be used by CI/CD
#
# Building releases:
#
# * release -- builds AdGuard Home distros. CHANNEL must be specified (edge, release or beta).
# * release_and_sign -- builds AdGuard Home distros and signs the binary files.
# CHANNEL must be specified (edge, release or beta).
# * sign -- Repacks all release archive files and signs the binary files inside them.
# For signing to work, the public+private key pair for $(GPG_KEY) must be imported:
# gpg --import public.txt
# gpg --import private.txt
# GPG_KEY_PASSPHRASE must contain the GPG key passphrase
# * docker-multi-arch -- builds a multi-arch image. If you want it to be pushed to docker hub,
# you must specify:
# * DOCKER_IMAGE_NAME - adguard/adguard-home
# * DOCKER_OUTPUT - type=image,name=adguard/adguard-home,push=true
GO := go
GOPATH := $(shell $(GO) env GOPATH)
PWD := $(shell pwd)
TARGET=AdGuardHome
BASE_URL="https://static.adguard.com/adguardhome/$(CHANNEL)"
GPG_KEY := [email protected]
GPG_KEY_PASSPHRASE :=
GPG_CMD := gpg --detach-sig --default-key $(GPG_KEY) --pinentry-mode loopback --passphrase $(GPG_KEY_PASSPHRASE)
VERBOSE := -v
REBUILD_CLIENT = 1
# See release target
DIST_DIR=dist
# Update channel. Can be release, beta or edge. Uses edge by default.
CHANNEL ?= edge
# Validate channel
ifneq ($(CHANNEL),release)
ifneq ($(CHANNEL),beta)
ifneq ($(CHANNEL),edge)
$(error CHANNEL value is not valid. Valid values are release,beta or edge)
endif
endif
endif
# Version history URL (see
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/releases"
ifeq ($(CHANNEL),edge)
VERSION_HISTORY_URL="https://github.com/AdguardTeam/AdGuardHome/commits/master"
endif
# goreleaser command depends on the $CHANNEL
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --snapshot --parallelism 1
ifneq ($(CHANNEL),edge)
# If this is not an "edge" build, use normal release command
GORELEASER_COMMAND=goreleaser release --rm-dist --skip-publish --parallelism 1
endif
# Version properties
COMMIT=$(shell git rev-parse --short HEAD)
TAG_NAME=$(shell git describe --abbrev=0)
PRERELEASE_VERSION=$(shell git describe --abbrev=0)
# TODO(a.garipov): The cut call is a temporary solution to trim
# prerelease versions. See the comment in .goreleaser.yml.
RELEASE_VERSION=$(shell git describe --abbrev=0 | cut -c 1-8)
SNAPSHOT_VERSION=$(RELEASE_VERSION)-SNAPSHOT-$(COMMIT)
# Set proper version
VERSION=
ifeq ($(TAG_NAME),$(shell git describe --abbrev=4))
ifeq ($(CHANNEL),edge)
VERSION=$(SNAPSHOT_VERSION)
else ifeq ($(CHANNEL),beta)
VERSION=$(PRERELEASE_VERSION)
else
VERSION=$(RELEASE_VERSION)
endif
else
VERSION=$(SNAPSHOT_VERSION)
endif
# Docker target parameters
DOCKER_IMAGE_NAME ?= adguardhome-dev
DOCKER_IMAGE_FULL_NAME = $(DOCKER_IMAGE_NAME):$(VERSION)
DOCKER_PLATFORMS=linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le
DOCKER_OUTPUT ?= type=image,name=$(DOCKER_IMAGE_NAME),push=false
BUILD_DATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
# Docker tags (can be redefined)
DOCKER_TAGS ?=
ifndef DOCKER_TAGS
ifeq ($(CHANNEL),release)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):latest
endif
ifeq ($(CHANNEL),beta)
DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):beta
endif
ifeq ($(CHANNEL),edge)
# Don't set the version tag when pushing to "edge"
DOCKER_IMAGE_FULL_NAME := $(DOCKER_IMAGE_NAME):edge
# DOCKER_TAGS := --tag $(DOCKER_IMAGE_NAME):edge
endif
endif
# Validate docker build arguments
ifndef DOCKER_IMAGE_NAME
$(error DOCKER_IMAGE_NAME value is not set)
endif
# OS-specific flags
TEST_FLAGS := --race $(VERBOSE)
ifeq ($(OS),Windows_NT)
TEST_FLAGS :=
endif
.PHONY: all build client client-watch docker lint lint-js lint-go test dependencies clean release docker-multi-arch
all: build
init:
git config core.hooksPath .githooks
build:
test '$(REBUILD_CLIENT)' = '1' && $(MAKE) client_with_deps || exit 0
$(GO) mod download
PATH=$(GOPATH)/bin:$(PATH) $(GO) generate ./...
CGO_ENABLED=0 $(GO) build -ldflags="-s -w -X main.version=$(VERSION) -X main.channel=$(CHANNEL) -X main.goarm=$(GOARM)"
PATH=$(GOPATH)/bin:$(PATH) packr clean
client:
npm --prefix client run build-prod
yarn --cwd client2 build
client_with_deps:
npm --prefix client ci
npm --prefix client run build-prod
yarn --cwd client2 build
client-watch:
npm --prefix client run watch
yarn --cwd client2 start
docker:
DOCKER_CLI_EXPERIMENTAL=enabled \
docker buildx build \
--build-arg VERSION=$(VERSION) \
--build-arg CHANNEL=$(CHANNEL) \
--build-arg VCS_REF=$(COMMIT) \
--build-arg BUILD_DATE=$(BUILD_DATE) \
$(DOCKER_TAGS) \
--load \
-t "$(DOCKER_IMAGE_NAME)" -f ./Dockerfile .
@echo Now you can run the docker image:
@echo docker run --name "adguard-home" -p 53:53/tcp -p 53:53/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp $(DOCKER_IMAGE_NAME)
</s> add # GOPROXY = https://goproxy.io|https://goproxy.cn|direct
GOPROXY = https://goproxy.cn,https://goproxy.io,direct
GPG_KEY_PASSPHRASE = not-a-real-password
NPM = npm
NPM_FLAGS = --prefix $(CLIENT_DIR)
SIGN = 1
VERBOSE = 0
VERSION = v0.0.0
YARN = yarn
YARN_FLAGS = --cwd $(CLIENT_BETA_DIR)
ENV = env\
COMMIT='$(COMMIT)'\
CHANNEL='$(CHANNEL)'\
GPG_KEY_PASSPHRASE='$(GPG_KEY_PASSPHRASE)'\
DIST_DIR='$(DIST_DIR)'\
GO='$(GO)'\
GOPROXY='$(GOPROXY)'\
PATH="$${PWD}/bin:$$($(GO) env GOPATH)/bin:$${PATH}"\
SIGN='$(SIGN)'\
VERBOSE='$(VERBOSE)'\
VERSION='$(VERSION)'\
# Keep the line above blank.
# Keep this target first, so that a naked make invocation triggers
# a full build.
build: deps quick-build
quick-build: js-build go-build
ci: deps test
deps: js-deps go-deps </s> remove # Available targets
</s> add # See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html.
.POSIX:
CHANNEL = development
CLIENT_BETA_DIR = client2
CLIENT_DIR = client
COMMIT = $$(git rev-parse --short HEAD)
DIST_DIR = dist
GO = go
# TODO(a.garipov): Add more default proxies using pipes after update to
# Go 1.15. </s> remove npm --prefix client ci
yarn --cwd client2 install
$(GO) mod download
clean:
rm -f ./AdGuardHome ./AdGuardHome.exe ./coverage.txt
rm -f -r ./build/ ./client/node_modules/ ./data/ ./$(DIST_DIR)/
# Set the GOPATH explicitly in case make clean is called from under sudo
# after a Docker build.
env PATH="$(GOPATH)/bin:$$PATH" packr clean
rm -f -r ./bin/
</s> add @ echo "use make deps instead"
@ $(MAKE) deps </s> remove - 'app'
- 'docker'
</s> add - 'build-release' | // goarm is the GOARM value. It is set by the linker.
var goarm = ""
// gomips is the GOMIPS value. It is set by the linker.
var gomips = ""
func main() {
home.Main(version, channel, goarm, gomips)
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: all: add a new Makefile and scripts, remove goreleaaser
Merge in DNS/adguard-home from 2276-releases to master
Updates #2276.
Squashed commit of the following:
commit 84961947c51477aae53606ec6e2e0cce0bdfc139
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:36:13 2020 +0300
all: fix github build
commit 54af2adbf2f433e80393fb142e66ba6b3a78b13e
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 14:34:02 2020 +0300
all: remove old Dockerfile, improve build scripts
commit 99bb2f2ba1458d32074ac0911b5c02ce6669e43e
Merge: 2292b677a 5e20ac7ed
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:47:19 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 2292b677a20ce8e93d9e6e2bb042cd468606fec3
Author: Ainar Garipov <[email protected]>
Date: Wed Dec 30 13:30:10 2020 +0300
all: improve docker build
commit 0bcc97c41f105ee4a4363f20fa4775c7643bf0cc
Merge: c7d3f12ef aef4659e9
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 17:47:45 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit c7d3f12ef2b63ddfa2acf46e3129fcbc56fb0a90
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 16:28:25 2020 +0300
all: improve build scripts
commit 55de1e5d7ef0fbdbd1a76cfb71362d16ca0a1966
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 15:36:47 2020 +0300
all: fix Makefile
commit d11b1fe28d0fde1efeaf6160a614951b19d0ef94
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 14:16:19 2020 +0300
scripts: fix build-release
commit ecc0577e2451afa86c37da7283a63a9d26fb37ba
Merge: dde64ed8e 483f02c92
Author: Ainar Garipov <[email protected]>
Date: Tue Dec 29 13:59:32 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit dde64ed8e456f73559f21c2ca549dc3b46724add
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 18:04:46 2020 +0300
all: imp docs, other improvements
commit be8574408db79901bb15c1d31916db3ca352a35f
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 14:48:30 2020 +0300
all: imp docker build
commit fc1876f34b93d667bf166226f4bc666d394f10c7
Merge: fa5a304c8 955b735c8
Author: Ainar Garipov <[email protected]>
Date: Fri Dec 25 13:54:29 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit fa5a304c83d86145796a2de4141de6d18f7c56bf
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 19:10:51 2020 +0300
all: improve scripts
commit 3f32e3fd5e658d058d5c5172519384efc6cfef83
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:50:01 2020 +0300
all: improve scripts
commit 2d38b81421acab4b90a7a19da7598c75063e8e93
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:25:21 2020 +0300
all: fix shell for windows, improve go-lint.sh
commit d695285cd6dc476c0d972cfe0c49bbeea5f5a049
Merge: 313b020e9 9fb6bf82c
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:14:38 2020 +0300
Merge branch 'master' into WIP-2276-releases
commit 313b020e9dfcdab736670cee72b2171eac8c32b7
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 18:13:31 2020 +0300
Makefile: use npm ci again
commit 5acee9d6a6c8cd2a7dd04b173a73929650882bad
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:57:54 2020 +0300
all: try fixing windows build
commit c63a2a54641ac8cd032a3306bb35e49b9ae74728
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:39:30 2020 +0300
all: imp scripts, try another goproxy and direct
commit 423229e8b63ee73caeee8e84c23f67d145aff9df
Author: Ainar Garipov <[email protected]>
Date: Thu Dec 24 17:25:29 2020 +0300
all: imp HACKING.md, try a new proxy
... and 1 more commit | https://github.com/AdguardTeam/AdGuardHome/commit/0e84962fde7bbb430d4c23e1d7582bfcf173dcb5 | main.go |
|
"access_disallowed_title": "Disallowed clients",
"access_disallowed_desc": "A list of CIDR or IP addresses. If configured, AdGuard Home will drop requests from these IP addresses.",
"access_blocked_title": "Blocked domains",
"access_blocked_desc": "Don't confuse this with filters. AdGuard Home will drop DNS queries with these domains in query's question.",
"access_settings_saved": "Access settings successfully saved"
} | </s> remove function Version(props) {
const { dnsVersion, dnsAddresses, dnsPort } = props;
</s> add const Version = (props) => {
const {
dnsVersion, dnsAddresses, dnsPort, processingVersion, t,
} = props;
</s> remove { ...this.props.dashboard }
</s> add { ...dashboard }
getVersion={getVersion} </s> remove .card-refresh {
height: 26px;
width: 26px;
background-size: 14px;
background-position: center;
background-repeat: no-repeat;
background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiM0NjdmY2YiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtMjMgNHY2aC02Ii8+PHBhdGggZD0ibTEgMjB2LTZoNiIvPjxwYXRoIGQ9Im0zLjUxIDlhOSA5IDAgMCAxIDE0Ljg1LTMuMzZsNC42NCA0LjM2bS0yMiA0IDQuNjQgNC4zNmE5IDkgMCAwIDAgMTQuODUtMy4zNiIvPjwvc3ZnPg==");
}
.card-refresh:hover,
.card-refresh:not(:disabled):not(.disabled):active,
.card-refresh:focus:active {
background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtMjMgNHY2aC02Ii8+PHBhdGggZD0ibTEgMjB2LTZoNiIvPjxwYXRoIGQ9Im0zLjUxIDlhOSA5IDAgMCAxIDE0Ljg1LTMuMzZsNC42NCA0LjM2bS0yMiA0IDQuNjQgNC4zNmE5IDkgMCAwIDAgMTQuODUtMy4zNiIvPjwvc3ZnPg==");
}
</s> add </s> remove getGlobalVersion() {
</s> add getGlobalVersion(data) { | "access_settings_saved": "Access settings successfully saved",
"updates_checked": "Updates successfully checked",
"check_updates_now": "Check updates now" | "access_disallowed_title": "Disallowed clients",
"access_disallowed_desc": "A list of CIDR or IP addresses. If configured, AdGuard Home will drop requests from these IP addresses.",
"access_blocked_title": "Blocked domains",
"access_blocked_desc": "Don't confuse this with filters. AdGuard Home will drop DNS queries with these domains in query's question.",
"access_settings_saved": "Access settings successfully saved",
"updates_checked": "Updates successfully checked",
"check_updates_now": "Check updates now"
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep"
] | + client: add button for check updates | https://github.com/AdguardTeam/AdGuardHome/commit/0e9df33a409dbffeb2d5d45b7f31f30587a2e4f7 | client/src/__locales/en.json |
Subsets and Splits