all: sync with master; upd chlog

This commit is contained in:
Ainar Garipov
2023-02-15 16:53:29 +03:00
parent 80eb339896
commit 66b831072c
55 changed files with 24817 additions and 798 deletions

View File

@@ -205,7 +205,7 @@ code from [the repo][companiesrepo].
### Usage
```sh
( cd scripts/companiesdb && sh ./download.sh )
sh ./scripts/companiesdb/download.sh
```
[companiesrepo]: https://github.com/AdguardTeam/companiesdb

View File

@@ -4,11 +4,9 @@ set -e -f -u -x
# This script syncs companies DB that we bundle with AdGuard Home. The source
# for this database is https://github.com/AdguardTeam/companiesdb.
#
trackers_url='https://raw.githubusercontent.com/AdguardTeam/companiesdb/main/dist/trackers.json'
output='./client/src/helpers/trackers/trackers.json'
readonly trackers_url output
whotracksme='https://raw.githubusercontent.com/AdguardTeam/companiesdb/main/dist/whotracksme.json'
adguard='https://raw.githubusercontent.com/AdguardTeam/companiesdb/main/dist/adguard.json'
base_path='../../client/src/helpers/trackers'
readonly whotracksme adguard base_path
curl -o "${base_path}/whotracksme.json" -v "$whotracksme"
curl -o "${base_path}/adguard.json" -v "$adguard"
curl -o "$output" -v "$trackers_url"

View File

@@ -338,6 +338,18 @@ download_wget() {
wget --no-verbose -O "$wget_output" "$1"
}
# download_fetch uses fetch(1) to download a file. The first argument is the
# URL. The second argument is optional and is the output file.
download_fetch() {
fetch_output="${2:-}"
if [ "$fetch_output" = '' ]
then
fetch -o '-' "$1"
else
fetch -o "$fetch_output" "$1"
fi
}
# Function set_download_func sets the appropriate function for downloading
# files.
set_download_func() {
@@ -348,6 +360,9 @@ set_download_func() {
elif is_command 'wget'
then
download_func='download_wget'
elif is_command 'fetch'
then
download_func='download_fetch'
else
error_exit "either curl or wget is required to install AdGuard Home via this script"
fi

View File

@@ -227,8 +227,9 @@ gocyclo --over 13 ./internal/dhcpd ./internal/filtering/ ./internal/home/
# Apply stricter standards to new or somewhat refactored code.
gocyclo --over 10 ./internal/aghio/ ./internal/aghnet/ ./internal/aghos/\
./internal/aghtest/ ./internal/dnsforward/ ./internal/filtering/rewrite/\
./internal/stats/ ./internal/tools/ ./internal/updater/ ./internal/version/\
./scripts/vetted-filters/ ./main.go
./internal/stats/ ./internal/tools/ ./internal/updater/\
./internal/version/ ./scripts/blocked-services/ ./scripts/vetted-filters/\
./main.go
ineffassign ./...

View File

@@ -40,7 +40,7 @@ readonly go
count_flags='--count=1'
cover_flags='--coverprofile=./coverage.txt'
shuffle_flags='--shuffle=on'
timeout_flags="${TIMEOUT_FLAGS:---timeout=30s}"
timeout_flags="${TIMEOUT_FLAGS:---timeout=90s}"
readonly count_flags cover_flags shuffle_flags timeout_flags
"$go" test "$count_flags" "$cover_flags" "$race_flags" "$shuffle_flags" "$timeout_flags"\