fix: compatibility with AdGuard Home

- AdGuard doesn't block subdomain in `example.com` syntax, whereas
uBO interprets it as equivalent to `||example.com^`.
- https://github.com/adguardteam/adguardhome/wiki/Hosts-Blocklists
- https://github.com/gorhill/uBlock/wiki/Static-filter-syntax#hosts-files
- Closes #19
This commit is contained in:
curben 2020-07-08 11:22:57 +01:00
parent a0c79c4277
commit 4bbf26a481
No known key found for this signature in database
GPG Key ID: 5D9DB57A25D34EE3
1 changed files with 11 additions and 2 deletions

View File

@ -116,11 +116,20 @@ FIFTH_LINE="! License: https://creativecommons.org/publicdomain/zero/1.0/"
SIXTH_LINE="! Source: https://urlhaus.abuse.ch/api/"
COMMENT_ABP="$FIRST_LINE\n$SECOND_LINE\n$THIRD_LINE\n$FOURTH_LINE\n$FIFTH_LINE\n$SIXTH_LINE"
cat "malware-domains.txt" "malware-url-top-domains.txt" | \
# Compatibility with Adguard Home (#19)
cat "malware-domains.txt" | \
sed "s/^/||/g" | \
sed "s/$/^/g" > "malware-domains-adguard.txt"
cat "malware-domains-online.txt" | \
sed "s/^/||/g" | \
sed "s/$/^/g" > "malware-domains-online-adguard.txt"
cat "malware-domains-adguard.txt" "malware-url-top-domains.txt" | \
sort | \
sed '1 i\'"$COMMENT_ABP"'' > "../urlhaus-filter.txt"
cat "malware-domains-online.txt" "malware-url-top-domains-online.txt" | \
cat "malware-domains-online-adguard.txt" "malware-url-top-domains-online.txt" | \
sort | \
sed '1 i\'"$COMMENT_ABP"'' | \
sed "1s/Malicious/Online Malicious/" > "../urlhaus-filter-online.txt"