Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mirrors
openwrt
packages
提交
abb91052
P
packages
项目概览
mirrors
/
openwrt
/
packages
大约 1 年 前同步成功
通知
16
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
packages
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
abb91052
编写于
9月 03, 2023
作者:
S
Stan Grishin
提交者:
GitHub
9月 03, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #21943 from stangri/master-adblock-fast
adblock-fast: initial commit
上级
f25b34fc
be69e34c
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
532 addition
and
264 deletion
+532
-264
net/adblock-fast/Makefile
net/adblock-fast/Makefile
+76
-0
net/adblock-fast/files/README.md
net/adblock-fast/files/README.md
+3
-0
net/adblock-fast/files/adblock-fast.config.update
net/adblock-fast/files/adblock-fast.config.update
+0
-9
net/adblock-fast/files/etc/config/adblock-fast
net/adblock-fast/files/etc/config/adblock-fast
+118
-0
net/adblock-fast/files/etc/init.d/adblock-fast
net/adblock-fast/files/etc/init.d/adblock-fast
+170
-141
net/adblock-fast/files/etc/uci-defaults/90-adblock-fast
net/adblock-fast/files/etc/uci-defaults/90-adblock-fast
+165
-0
net/adblock-fast/test.sh
net/adblock-fast/test.sh
+0
-0
net/simple-adblock/files/README.md
net/simple-adblock/files/README.md
+0
-3
net/simple-adblock/files/simple-adblock.conf
net/simple-adblock/files/simple-adblock.conf
+0
-106
net/simple-adblock/files/simple-adblock.hotplug
net/simple-adblock/files/simple-adblock.hotplug
+0
-5
未找到文件。
net/
simple-adblock
/Makefile
→
net/
adblock-fast
/Makefile
浏览文件 @
abb91052
# Copyright 20
17-2022
Stan Grishin (stangri@melmac.ca)
# Copyright 20
23
Stan Grishin (stangri@melmac.ca)
# TLD optimization written by Dirk Brenken (dev@brenken.org)
# This is free software, licensed under the GNU General Public License v3.
include
$(TOPDIR)/rules.mk
PKG_NAME
:=
simple-adblock
PKG_VERSION
:=
1.
9.5
PKG_RELEASE
:=
5
PKG_NAME
:=
adblock-fast
PKG_VERSION
:=
1.
0.0
PKG_RELEASE
:=
1
PKG_MAINTAINER
:=
Stan Grishin <stangri@melmac.ca>
PKG_LICENSE
:=
GPL-3.0-or-later
include
$(INCLUDE_DIR)/package.mk
define
Package/simple-adblock
SECTION
:=
net
CATEGORY
:=
Network
TITLE
:=
Simple AdBlock Service
URL
:=
https://docs.openwrt.melmac.net/simple-adblock/
DEPENDS
:=
+jshn +wget
PKGARCH
:=
all
define
Package/adblock-fast
SECTION
:=
net
CATEGORY
:=
Network
TITLE
:=
AdBlock Fast Service
URL
:=
https://docs.openwrt.melmac.net/adblock-fast/
DEPENDS
:=
+jshn +curl
CONFLICTS
:=
simple-adblock
PROVIDES
:=
simple-adblock
PKGARCH
:=
all
endef
define
Package/
simple-adblock
/description
Simple
adblock
script
to
block
ad
or
abuse/malware
domains
with
DNSMASQ
or
Unbound.
define
Package/
adblock-fast
/description
Fast
AdBlocking
script
to
block
ad
or
abuse/malware
domains
with
DNSMASQ
or
Unbound.
Script
supports
local/remote
list
of
domains
and
hosts-files
for
both
block-listing
and
allow-listing.
Please see https
:
//docs.openwrt.melmac.net/
simple-adblock
/ for more information.
Please see https
:
//docs.openwrt.melmac.net/
adblock-fast
/ for more information.
endef
define
Package/
simple-adblock
/conffiles
/etc/config/
simple-adblock
define
Package/
adblock-fast
/conffiles
/etc/config/
adblock-fast
endef
define
Build/Configure
...
...
@@ -37,36 +39,38 @@ endef
define
Build/Compile
endef
define
Package/
simple-adblock
/install
define
Package/
adblock-fast
/install
$(INSTALL_DIR)
$(1)/etc/init.d
$(INSTALL_BIN)
./files/etc/init.d/adblock-fast
$(1)/etc/init.d/adblock-fast
$(SED)
"s|^\(readonly PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|"
$(1)/etc/init.d/adblock-fast
$(INSTALL_DIR)
$(1)/etc/config
$(INSTALL_CONF)
./files/etc/config/adblock-fast
$(1)/etc/config/adblock-fast
$(INSTALL_DIR)
$(1)/tmp
$(INSTALL_BIN)
./files/simple-adblock.init
$(1)/etc/init.d/simple-adblock
$(SED)
"s|^\(readonly PKG_VERSION\).*|\1='$(PKG_VERSION)-$(PKG_RELEASE)'|"
$(1)/etc/init.d/simple-adblock
$(INSTALL_CONF)
./files/simple-adblock.conf
$(1)/etc/config/simple-adblock
$(INSTALL_DATA)
./files/simple-adblock.conf.update
$(1)/tmp/simple-adblock.conf.update
$(INSTALL_DATA)
./files/adblock-fast.config.update
$(1)/tmp/adblock-fast.config.update
$(INSTALL_DIR)
$(1)/etc/uci-defaults
$(INSTALL_BIN)
./files/etc/uci-defaults/90-adblock-fast
$(1)/etc/uci-defaults/90-adblock-fast
endef
define
Package/
simple-adblock
/postinst
define
Package/
adblock-fast
/postinst
#!/bin/sh
# check if we are on real system
if
[
-z
"$${IPKG_INSTROOT}"
];
then
sed
-f
/tmp/
simple-adblock.conf.update
-i
/etc/config/simple-adblock
||
true
/etc/init.d/
simple-adblock
enable
sed
-f
/tmp/
adblock-fast.config.update
-i
/etc/config/adblock-fast
||
true
/etc/init.d/
adblock-fast
enable
fi
exit
0
endef
define
Package/
simple-adblock
/prerm
define
Package/
adblock-fast
/prerm
#!/bin/sh
# check if we are on real system
if
[
-z
"$${IPKG_INSTROOT}"
];
then
echo
"Stopping service and removing rc.d symlink for
simple-adblock
"
/etc/init.d/
simple-adblock
stop
||
true
/etc/init.d/
simple-adblock
killcache
||
true
/etc/init.d/
simple-adblock
disable
||
true
echo
"Stopping service and removing rc.d symlink for
adblock-fast
"
/etc/init.d/
adblock-fast
stop
||
true
/etc/init.d/
adblock-fast
killcache
||
true
/etc/init.d/
adblock-fast
disable
||
true
fi
exit
0
endef
$(eval
$(call
BuildPackage,
simple-adblock
))
$(eval
$(call
BuildPackage,
adblock-fast
))
net/adblock-fast/files/README.md
0 → 100644
浏览文件 @
abb91052
# README
README has been moved to
[
https://docs.openwrt.melmac.net/adblock-fast/
](
https://docs.openwrt.melmac.net/adblock-fast/
)
.
net/
simple-adblock/files/simple-adblock.conf
.update
→
net/
adblock-fast/files/adblock-fast.config
.update
浏览文件 @
abb91052
s|whitelist_domains_url|allowed_domains_url|g
s|whitelist_domain|allowed_domain|g
s|blacklist_hosts_url|blocked_hosts_url|g
s|blacklist_domains_url|blocked_domains_url|g
s|blacklist_domain|blocked_domain|g
s|ssl.bblck.me|cdn.jsdelivr.net/gh/paulgb/BarbBlock|g
s|raw.githubusercontent.com/StevenBlack/hosts/|cdn.jsdelivr.net/gh/StevenBlack/hosts@|g
s|raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/|cdn.jsdelivr.net/gh/hoshsadiq/adblock-nocoin-list@|g
s|raw.githubusercontent.com/jawz101/MobileAdTrackers/|cdn.jsdelivr.net/gh/jawz101/MobileAdTrackers@|g
s|http://winhelp2002.mvps.org/hosts.txt|https://winhelp2002.mvps.org/hosts.txt|g
s|list blocked_domains_url 'https://dbl.oisd.nl/basic'|list blocked_adblockplus_url 'https://small.oisd.nl/'|g
s|list blocked_domains_url 'https://dbl.oisd.nl/nsfw'|list blocked_adblockplus_url 'https://nsfw.oisd.nl/'|g
...
...
net/adblock-fast/files/etc/config/adblock-fast
0 → 100644
浏览文件 @
abb91052
config adblock-fast 'config'
option enabled '0'
list allowed_domain 'cdn.jsdelivr.net'
option allow_non_ascii '0'
option canary_domains_icloud '0'
option canary_domains_mozilla '0'
option compressed_cache '0'
option compressed_cache_dir '/etc'
option config_update_enabled '0'
option config_update_url 'https://cdn.jsdelivr.net/gh/openwrt/packages/net/adblock-fast/files/adblock-fast.conf.update'
option curl_additional_param ''
option curl_max_file_size '30000000'
option curl_retry '3'
option debug '0'
option dns 'dnsmasq.servers'
option dnsmasq_instance '*'
# option dnsmasq_config_file_url 'https://big.oisd.nl/dnsmasq2'
option download_timeout '10'
option force_dns '1'
list force_dns_port '53'
list force_dns_port '853'
# ports listed below are used by some
# of the dnscrypt-proxy v1 resolvers
# list force_dns_port '553'
# list force_dns_port '1443'
# list force_dns_port '4343'
# list force_dns_port '4434'
# list force_dns_port '5443'
# list force_dns_port '8443'
option led 'none'
option parallel_downloads '1'
option procd_trigger_wan6 '0'
option procd_boot_wan_timeout '60'
option verbosity '2'
config file_url
option url 'https://cdn.jsdelivr.net/gh/StevenBlack/hosts/hosts'
option size '6770929'
option action 'block'
option enabled '0'
config file_url
option url 'https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_trackers_justdomains.txt'
option size '6241707'
option action 'block'
option enabled '0'
config file_url
option url 'https://big.oisd.nl/'
option size '6163363'
option action 'block'
option enabled '0'
config file_url
option url 'https://cdn.jsdelivr.net/gh/bongochong/CombinedPrivacyBlockLists/NoFormatting/cpbl-ctld.txt'
option size '2608152'
option action 'block'
option enabled '0'
config file_url
option url 'http://sysctl.org/cameleon/hosts'
option size '638545'
option action 'block'
option enabled '0'
config file_url
option url 'https://cdn.jsdelivr.net/gh/kboghdady/youTube_ads_4_pi-hole/black.list'
option size '553006'
option action 'block'
option enabled '0'
config file_url
option url 'https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_clickthroughs_justdomains.txt'
option size '362170'
option action 'block'
option enabled '0'
config file_url
option url 'https://someonewhocares.org/hosts/hosts'
option size '347410'
option action 'block'
option enabled '0'
config file_url
option url 'https://winhelp2002.mvps.org/hosts.txt'
option size '334861'
option action 'block'
option enabled '0'
config file_url
option url 'https://adaway.org/hosts.txt'
option size '243454'
option action 'block'
option enabled '0'
config file_url
option url 'https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_ads_justdomains.txt'
option size '222595'
option action 'block'
option enabled '0'
config file_url
option url 'https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_microsites_justdomains.txt'
option size '123275'
option action 'block'
option enabled '0'
config file_url
option url 'https://pgl.yoyo.org/as/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext'
option size '99588'
option action 'block'
option enabled '0'
config file_url
option url 'https://cdn.jsdelivr.net/gh/hoshsadiq/adblock-nocoin-list/hosts.txt'
option size '11149'
option action 'block'
option enabled '0'
net/
simple-adblock/files/simple-adblock.ini
t
→
net/
adblock-fast/files/etc/init.d/adblock-fas
t
100644 → 100755
浏览文件 @
abb91052
#!/bin/sh /etc/rc.common
# Copyright 20
17-2022
Stan Grishin (stangri@melmac.ca)
# shellcheck disable=SC1091,SC201
6,SC3043
,SC3057,SC3060
# Copyright 20
23 MOSSDeF,
Stan Grishin (stangri@melmac.ca)
# shellcheck disable=SC1091,SC201
5,SC2016,SC3037,SC3043,SC3045
,SC3057,SC3060
# shellcheck disable=SC2034
START
=
94
...
...
@@ -28,7 +28,7 @@ else
fi
readonly
PKG_VERSION
=
'dev-test'
readonly
packageName
=
'
simple-adblock
'
readonly
packageName
=
'
adblock-fast
'
readonly
serviceName
=
"
$packageName
$PKG_VERSION
"
readonly
packageConfigFile
=
"/etc/config/
${
packageName
}
"
readonly
dnsmasqAddnhostsFile
=
"/var/run/
${
packageName
}
/dnsmasq.addnhosts"
...
...
@@ -59,12 +59,13 @@ readonly unboundGzip="${packageName}.unbound.gz"
readonly
unboundFilter
=
's|^|local-zone: "|;s|$|" static|'
readonly
A_TMP
=
"/var/
${
packageName
}
.hosts.a.tmp"
readonly
B_TMP
=
"/var/
${
packageName
}
.hosts.b.tmp"
readonly
jsonFile
=
"/
var/run/
${
packageName
}
/
${
packageName
}
.json"
readonly
jsonFile
=
"/
dev/shm/
$packageName
-status
.json"
readonly
sharedMemoryError
=
"/dev/shm/
$packageName
-error"
readonly
hostsFilter
=
'/localhost/d;/^#/d;/^[^0-9]/d;s/^0\.0\.0\.0.//;s/^127\.0\.0\.1.//;s/[[:space:]]*#.*$//;s/[[:cntrl:]]$//;s/[[:space:]]//g;/[`~!@#\$%\^&\*()=+;:"'
\'
',<>?/\|[{}]/d;/]/d;/\./!d;/^$/d;/[^[:alnum:]_.-]/d;'
readonly
domainsFilter
=
'/^#/d;s/[[:space:]]*#.*$//;s/[[:space:]]*$//;s/[[:cntrl:]]$//;/[[:space:]]/d;/[`~!@#\$%\^&\*()=+;:"'
\'
',<>?/\|[{}]/d;/]/d;/\./!d;/^$/d;/[^[:alnum:]_.-]/d;'
readonly
adBlockPlusFilter
=
'/^#/d;/^!/d;s/[[:space:]]*#.*$//;s/^||//;s/\^$//;s/[[:space:]]*$//;s/[[:cntrl:]]$//;/[[:space:]]/d;/[`~!@#\$%\^&\*()=+;:"'
\'
',<>?/\|[{}]/d;/]/d;/\./!d;/^$/d;/[^[:alnum:]_.-]/d;'
readonly
dnsmasqFileFilter
=
'\|^server=/[[:alnum:]_.-].*/|!d'
readonly
dnsmasq2FileFilter
=
'\|^local=/[[:alnum:]_.-].*/|!d'
readonly
_OK_
=
'\033[0;32m\xe2\x9c\x93\033[0m'
readonly
_FAIL_
=
'\033[0;31m\xe2\x9c\x97\033[0m'
readonly
__OK__
=
'\033[0;32m[\xe2\x9c\x93]\033[0m'
...
...
@@ -88,6 +89,8 @@ outputGzip=
outputCache
=
awk
=
'awk'
load_environment_flag
=
allowed_url
=
blocked_url
=
debug
()
{
local
i j
;
for
i
in
"
$@
"
;
do
eval
"j=
\$
$i
"
;
echo
"
${
i
}
:
${
j
}
"
;
done
;
}
...
...
@@ -250,6 +253,36 @@ load_network() {
output
"
${
_ERROR_
}
:
$(
get_text
'errorNoWanGateway'
)
!
\\
n"
;
return
1
;
}
append_url
()
{
local
cfg
=
"
$1
"
var
=
"
$2
"
local
en action url
config_get en
"
$cfg
"
enabled
'1'
config_get action
"
$cfg
"
action
'block'
config_get url
"
$cfg
"
url
if
[
"
$en
"
=
'1'
]
;
then
if
[
"
$action
"
=
'allow'
]
;
then
allowed_url
=
"
${
allowed_url
:+
$allowed_url
}${
url
}
"
else
blocked_url
=
"
${
blocked_url
:+
$blocked_url
}${
url
}
"
fi
fi
}
detect_file_type
()
{
local
file
=
"
$1
"
if
[
"
$(
head
-1
"
$file
"
)
"
=
'[Adblock Plus]'
]
;
then
echo
'adBlockPlus'
elif
grep
-q
'^server='
"
$file
"
;
then
echo
'dnsmasqFile'
elif
grep
-q
'^local='
"
$file
"
;
then
echo
'dnsmasq2File'
elif
grep
-q
'^0.0.0.0'
"
$file
"
||
grep
-q
'^127.0.0.1'
"
$file
"
;
then
echo
'hosts'
else
echo
'domains'
fi
}
load_environment
()
{
local
i j
local
validation_result
=
"
$1
"
param
=
"
$2
"
...
...
@@ -272,7 +305,7 @@ load_environment() {
fi
if
[
"
$debug
"
-ne
0
]
;
then
exec
1>>
/tmp/simple-adblock.log
exec
1>>
"/tmp/
$packageName
.log"
exec
2>&1
set
-x
fi
...
...
@@ -444,20 +477,24 @@ load_environment() {
fi
# Prefer curl because it supports the file:// scheme.
if
is_present
'curl'
;
then
dl_command
=
"curl --silent --insecure"
dl_command
=
'curl --silent --insecure'
dl_command
=
"
${
dl_command
}${
curl_additional_param
:+
$curl_additional_param
}
"
dl_command
=
"
${
dl_command
}${
curl_max_file_size
:+
--max-filesize
$curl_max_file_size
}
"
dl_command
=
"
${
dl_command
}${
curl_retry
:+
--retry
$curl_retry
}
"
dl_command
=
"
${
dl_command
}${
download_timeout
:+
--connect-timeout
$download_timeout
}
"
dl_flag
=
"-o"
dl_flag
=
'-o'
elif
is_present
'/usr/libexec/wget-ssl'
;
then
dl_command
=
"/usr/libexec/wget-ssl --no-check-certificate -q"
dl_command
=
'/usr/libexec/wget-ssl --no-check-certificate -q'
dl_command
=
"
${
dl_command
}${
download_timeout
:+
--timeout
$download_timeout
}
"
dl_flag
=
"-O"
size_command
=
'/usr/libexec/wget-ssl --no-check-certificate -q -O /dev/null --server-response'
size_command
=
"
${
size_command
}${
download_timeout
:+
--timeout
$download_timeout
}
"
elif
is_present wget
&&
wget
--version
2>/dev/null |
grep
-q
"+https"
;
then
dl_command
=
"wget --no-check-certificate -q"
dl_command
=
"
${
dl_command
}${
download_timeout
:+
--timeout
$download_timeout
}
"
dl_flag
=
"-O"
size_command
=
'wget --no-check-certificate -q -O /dev/null --server-response'
size_command
=
"
${
size_command
}${
download_timeout
:+
--timeout
$download_timeout
}
"
else
dl_command
=
"uclient-fetch --no-check-certificate -q"
dl_command
=
"
${
dl_command
}${
download_timeout
:+
--timeout
$download_timeout
}
"
...
...
@@ -473,6 +510,8 @@ load_environment() {
else
unset
isSSLSupported
fi
config_load
"
$packageName
"
config_foreach append_url
'file_url'
load_environment_flag
=
1
cache
'test'
&&
return
0
cache
'test_gzip'
&&
return
0
...
...
@@ -484,6 +523,26 @@ load_environment() {
fi
}
get_url_filesize
()
{
local
url
=
"
$1
"
size size_command
[
-n
"
$url
"
]
||
return
0
is_present
'curl'
||
return
0
size_command
=
'curl --silent --insecure --fail --head --request GET'
size
=
"
$(
$size_command
"
$url
"
|
grep
-Po
'^[cC]ontent-[lL]ength: \K\w+'
)
"
echo
-en
"
$size
"
}
get_local_filesize
()
{
local
file
=
"
$1
"
size
[
-f
"
$file
"
]
||
return
0
if
is_present
stat
;
then
size
=
"
$(
stat
-c
%s
"
$file
"
)
"
elif
is_present
wc
;
then
size
=
"
$(
wc
-c
<
"
$file
"
)
"
fi
echo
-en
"
$size
"
}
resolver
()
{
local
cfg
=
"
$1
"
param
=
"
$2
"
case
"
$param
"
in
...
...
@@ -520,10 +579,10 @@ dns() {
fi
config_load
'dhcp'
if
[
"
$dns_instance
"
=
"*"
]
;
then
if
[
"
$dns
masq
_instance
"
=
"*"
]
;
then
config_foreach resolver
'dnsmasq'
"
$dns
"
elif
[
-n
"
$dns_instance
"
]
;
then
for
i
in
$dns_instance
;
do
elif
[
-n
"
$dns
masq
_instance
"
]
;
then
for
i
in
$dns
masq
_instance
;
do
resolver
"@dnsmasq[
$i
]"
"
$dns
"
||
resolver
"
$i
"
"
$dns
"
done
fi
...
...
@@ -622,17 +681,19 @@ json() {
json_load_file
"
$jsonFile
"
2>/dev/null
json_select
'data'
2>/dev/null
for
i
in
status message error stats reload restart
;
do
json_get_var
$i
"
$i
"
2>/dev/null
json_get_var
"
$i
"
"
$i
"
2>/dev/null
done
fi
case
"
$action
"
in
get
)
case
"
$param
"
in
triggers
)
curReload
=
"
$parallel_downloads
$debug
$download_timeout
$allowed_domain
$blocked_domain
$allowed_domains_url
\
$blocked_adblockplus_url
$blocked_domains_url
$blocked_hosts_url
$dns
$config_update_enabled
$config_update_url
\
$dnsmasq_config_file_url
$curl_additional_param
$curl_max_file_size
$curl_retry
"
curRestart
=
"
$compressed_cache
$compressed_cache_dir
$force_dns
$led
$force_dns_port
"
curReload
=
"
$parallel_downloads
$debug
$download_timeout
\
$allowed_domain
$blocked_domain
$allowed_url
$blocked_url
$dns
\
$config_update_enabled
$config_update_url
$dnsmasq_config_file_url
\
$curl_additional_param
$curl_max_file_size
$curl_retry
"
curRestart
=
"
$compressed_cache
$compressed_cache_dir
$force_dns
$led
\
$force_dns_port
"
if
[
!
-s
"
$jsonFile
"
]
;
then
ret
=
'on_boot'
elif
[
"
$curReload
"
!=
"
$reload
"
]
;
then
...
...
@@ -663,10 +724,12 @@ json() {
set
)
case
"
$param
"
in
triggers
)
reload
=
"
$parallel_downloads
$debug
$download_timeout
$allowed_domain
$blocked_domain
$allowed_domains_url
\
$blocked_adblockplus_url
$blocked_domains_url
$blocked_hosts_url
$dns
$config_update_enabled
$config_update_url
\
$dnsmasq_config_file_url
$curl_additional_param
$curl_max_file_size
$curl_retry
"
restart
=
"
$compressed_cache
$compressed_cache_dir
$force_dns
$led
$force_dns_port
"
reload
=
"
$parallel_downloads
$debug
$download_timeout
\
$allowed_domain
$blocked_domain
$allowed_url
$blocked_url
$dns
\
$config_update_enabled
$config_update_url
$dnsmasq_config_file_url
\
$curl_additional_param
$curl_max_file_size
$curl_retry
"
restart
=
"
$compressed_cache
$compressed_cache_dir
$force_dns
$led
\
$force_dns_port
"
;;
*
)
eval
"
$param
"
=
'${value}${extras:+|$extras}'
;;
...
...
@@ -729,24 +792,37 @@ cache() {
esac
}
process_url
()
{
local
label
type
D_TMP R_TMP
if
[
-z
"
$1
"
]
||
[
-z
"
$2
"
]
||
[
-z
"
$3
"
]
;
then return
1
;
fi
label
=
"
${
1
##*//
}
"
;
label
=
"
${
label
%%/*
}
"
;
case
"
$2
"
in
adbp
)
label
=
"ADBPlus:
$label
"
;
filter
=
"
$adBlockPlusFilter
"
;;
dnsmasq
)
label
=
"Dnsmasq:
$label
"
;
filter
=
"
$dnsmasqFileFilter
"
;;
domains
)
label
=
"Domains:
$label
"
;
filter
=
"
$domainsFilter
"
;;
hosts
)
label
=
"Hosts:
$label
"
;
filter
=
"
$hostsFilter
"
;;
esac
case
"
$3
"
in
allowed
)
type
=
'Allowed'
;
D_TMP
=
"
$A_TMP
"
_process_file_url
()
{
if
[
"
$2
"
!=
'0'
]
;
then
json add error
"errorConfigValidationFail"
output
"
${
_ERROR_
}
:
$(
get_text
'errorConfigValidationFail'
)
!
\\
n"
output
"Please check if the '
$packageConfigFile
' contains correct values for config options.
\\
n"
fi
if
[
"
$parallel_downloads
"
-gt
0
]
;
then
process_file_url
"
$1
"
&
else
process_file_url
"
$1
"
fi
}
process_file_url
()
{
local
cfg
=
"
$1
"
new_size
local
label
type
D_TMP R_TMP filter
if
[
-z
"
$cfg
"
]
||
[
-n
"
${
2
}${
3
}
"
]
;
then
url
=
"
$2
"
action
=
"
$3
"
fi
[
"
$enabled
"
=
'1'
]
||
return
0
[
-n
"
$url
"
]
||
return
1
label
=
"
${
url
##*//
}
"
label
=
"
${
label
%%/*
}
"
label
=
"File:
$label
"
case
"
$action
"
in
allow
)
type
=
'Allowed'
;
D_TMP
=
"
$A_TMP
"
;;
block
ed
)
type
=
'Blocked'
;
D_TMP
=
"
$B_TMP
"
block
)
type
=
'Blocked'
;
D_TMP
=
"
$B_TMP
"
;;
file
)
type
=
'File'
;
D_TMP
=
"
$B_TMP
"
;;
...
...
@@ -760,20 +836,33 @@ process_url() {
while
[
-z
"
$R_TMP
"
]
||
[
-e
"
$R_TMP
"
]
;
do
R_TMP
=
"
$(
mktemp
-u
-q
-t
${
packageName
}
_tmp.XXXXXXXX
)
"
done
if
!
$dl_command
"
$1
"
"
$dl_flag
"
"
$R_TMP
"
2>/dev/null
||
[
!
-s
"
$R_TMP
"
]
;
then
if
[
-z
"
$url
"
]
||
!
$dl_command
"
$url
"
"
$dl_flag
"
"
$R_TMP
"
2>/dev/null
||
\
[
!
-s
"
$R_TMP
"
]
;
then
output 1
"
$_FAIL_
"
output 2
"[DL]
$type
$label
$__FAIL__
\\
n"
echo
"errorDownloadingList|
${
1
}
"
>>
"
$sharedMemoryError
"
echo
"errorDownloadingList|
${
url
}
"
>>
"
$sharedMemoryError
"
else
sed
-i
"
$filter
"
"
$R_TMP
"
[
-n
"
$cfg
"
]
&&
new_size
=
"
$(
get_local_filesize
"
$R_TMP
"
)
"
if
[
-n
"
$new_size
"
]
&&
[
"
$size
"
!=
"
$new_size
"
]
;
then
uci
set
"
${
packageName
}
.
${
cfg
}
.size=
$size
"
fi
format
=
"
$(
detect_file_type
"
$R_TMP
"
)
"
case
"
$format
"
in
adBlockPlus
)
filter
=
"
$adBlockPlusFilter
"
;;
# dnsmasqFile) filter="$dnsmasqFileFilter";;
# dnsmasq2File) filter="$dnsmasq2FileFilter";;
domains
)
filter
=
"
$domainsFilter
"
;;
hosts
)
filter
=
"
$hostsFilter
"
;;
esac
[
-n
"
$filter
"
]
&&
sed
-i
"
$filter
"
"
$R_TMP
"
if
[
!
-s
"
$R_TMP
"
]
;
then
output 1
"
$_FAIL_
"
output 2
"[DL]
$type
$label
$__FAIL__
\\
n"
output 2
"[DL]
$type
$label
(
$format
)
$__FAIL__
\\
n"
echo
"errorParsingList|
${
1
}
"
>>
"
$sharedMemoryError
"
else
cat
"
${
R_TMP
}
"
>>
"
$D_TMP
"
output 1
"
$_OK_
"
output 2
"[DL]
$type
$label
$__OK__
\\
n"
output 2
"[DL]
$type
$label
(
$format
)
$__OK__
\\
n"
fi
fi
rm
-f
"
$R_TMP
"
...
...
@@ -798,15 +887,14 @@ download_dnsmasq_file() {
touch
$A_TMP
;
touch
$B_TMP
;
output 1
'Downloading dnsmasq file '
rm
-f
"
$sharedMemoryError
"
process_url
"
$dnsmasq_config_file_url
"
'dnsmasq'
'file'
# output 1 '\n'
process_file_url
''
"
$dnsmasq_config_file_url
"
'file'
if
[
-s
"
$sharedMemoryError
"
]
;
then
while
IFS
=
read
-r
line
;
do
json add error
"
$line
"
done
<
"
$sharedMemoryError
"
rm
-f
"
$sharedMemoryError
"
fi
output 2
'
Creat
ing dnsmasq file '
output 2
'
Mov
ing dnsmasq file '
if
mv
"
$B_TMP
"
"
$outputFile
"
;
then
output 2
"
$__OK__
\\
n"
else
...
...
@@ -834,36 +922,15 @@ download_lists() {
touch
$A_TMP
;
touch
$B_TMP
;
output 1
'Downloading lists '
rm
-f
"
$sharedMemoryError
"
for
hf
in
${
blocked_hosts_url
}
;
do
if
[
"
$parallel_downloads
"
-gt
0
]
;
then
process_url
"
$hf
"
'hosts'
'blocked'
&
else
process_url
"
$hf
"
'hosts'
'blocked'
fi
done
for
hf
in
${
blocked_adblockplus_url
}
;
do
if
[
"
$parallel_downloads
"
-gt
0
]
;
then
process_url
"
$hf
"
'adbp'
'blocked'
&
else
process_url
"
$hf
"
'adbp'
'blocked'
fi
done
for
hf
in
${
blocked_domains_url
}
;
do
if
[
"
$parallel_downloads
"
-gt
0
]
;
then
process_url
"
$hf
"
'domains'
'blocked'
&
else
process_url
"
$hf
"
'domains'
'blocked'
fi
done
for
hf
in
${
allowed_domains_url
}
;
do
if
[
"
$parallel_downloads
"
-gt
0
]
;
then
process_url
"
$hf
"
'domains'
'allowed'
&
else
process_url
"
$hf
"
'domains'
'allowed'
fi
done
config_load
"
$packageName
"
config_foreach load_validate_file_url_section
'file_url'
_process_file_url
wait
if
[
-n
"
$(
uci changes
"
$packageName
"
)
"
]
;
then
output 2
"Saving updated file size(s) "
uci commit
"
$packageName
"
&&
output_okn
||
output_failn
fi
output 1
'\n'
if
[
-s
"
$sharedMemoryError
"
]
;
then
while
IFS
=
read
-r
line
;
do
json add error
"
$line
"
...
...
@@ -1207,65 +1274,26 @@ adb_config_update() {
return
0
}
_config_add_url_size
()
{
local
cfg
=
"
$1
"
url size
config_get url
"
$cfg
"
url
size
=
"
$(
get_url_filesize
"
$url
"
)
"
output
"
$url
${
size
:+:
$size
}
"
if
[
-n
"
$size
"
]
;
then
uci
set
"
${
packageName
}
.
${
cfg
}
.size=
$size
"
output_okn
else
output_failn
fi
}
adb_sizes
()
{
local
i
local
validation_result
=
"
$3
"
load_environment
"
$validation_result
"
'quiet'
||
return
1
echo
"#
$(
date
)
"
for
i
in
${
blocked_adblockplus_url
}
;
do
[
"
${
i
//melmac
}
"
!=
"
$i
"
]
&&
continue
if
$dl_command
"
$i
"
"
$dl_flag
"
/tmp/sast 2>/dev/null
&&
[
-s
/tmp/sast
]
;
then
echo
"# File size:
$(
du
-sh
/tmp/sast |
$awk
'{print $1}'
)
"
if
is_greater
"
$(
du
-sk
/tmp/sast
)
"
"500"
;
then
echo
"# block-list too big for most routers"
elif
is_greater
"
$(
du
-sk
/tmp/sast
)
"
"100"
;
then
echo
"# block-list may be too big for some routers"
fi
rm
-rf
/tmp/sast
echo
" list blocked_adblockplus_url '
$i
'"
echo
""
else
echo
"# site was down on last check"
echo
"# list blocked_adblockplus_url '
$i
'"
echo
""
fi
done
for
i
in
${
blocked_domains_url
}
;
do
[
"
${
i
//melmac
}
"
!=
"
$i
"
]
&&
continue
if
$dl_command
"
$i
"
"
$dl_flag
"
/tmp/sast 2>/dev/null
&&
[
-s
/tmp/sast
]
;
then
echo
"# File size:
$(
du
-sh
/tmp/sast |
$awk
'{print $1}'
)
"
if
is_greater
"
$(
du
-sk
/tmp/sast
)
"
"500"
;
then
echo
"# block-list too big for most routers"
elif
is_greater
"
$(
du
-sk
/tmp/sast
)
"
"100"
;
then
echo
"# block-list may be too big for some routers"
fi
rm
-rf
/tmp/sast
echo
" list blocked_domains_url '
$i
'"
echo
""
else
echo
"# site was down on last check"
echo
"# list blocked_domains_url '
$i
'"
echo
""
fi
done
for
i
in
${
blocked_hosts_url
}
;
do
if
$dl_command
"
$i
"
"
$dl_flag
"
/tmp/sast 2>/dev/null
&&
[
-s
/tmp/sast
]
;
then
echo
"# File size:
$(
du
-sh
/tmp/sast |
$awk
'{print $1}'
)
"
if
is_greater
"
$(
du
-sk
/tmp/sast
)
"
"500"
;
then
echo
"# block-list too big for most routers"
elif
is_greater
"
$(
du
-sk
/tmp/sast
)
"
"100"
;
then
echo
"# block-list may be too big for some routers"
fi
rm
-rf
/tmp/sast
echo
" list blocked_hosts_url '
$i
'"
echo
""
else
echo
"# site was down on last check"
echo
"# list blocked_hosts_url '
$i
'"
echo
""
fi
done
config_load
"
$packageName
"
config_foreach _config_add_url_size
'file_url'
uci commit
"
$packageName
"
}
# shellcheck disable=SC2120
...
...
@@ -1347,7 +1375,7 @@ adb_start() {
output 3
"Starting
$serviceName
...
\\
n"
json
set
status
"statusStarting"
fi
if
[
-n
"
$dnsmasq_config_file_url
"
]
;
then
if
[
"
$dns
"
=
'dnsmasq.conf'
]
&&
[
-n
"
$dnsmasq_config_file_url
"
]
;
then
download_dnsmasq_file
else
download_lists
...
...
@@ -1385,7 +1413,8 @@ adb_start() {
procd_set_param stderr 1
procd_open_data
json_add_string
'status'
"
$(
json get status
)
"
json_add_string
'errors'
"
$(
json get errors
)
"
json_add_string
'errors'
"
$(
json get error
)
"
json_add_string
'warnings'
"
$(
json get warning
)
"
if
[
-s
"
$outputFile
"
]
;
then
json_add_int
'entries'
"
$(
wc
-l
<
"
$outputFile
"
)
"
else
...
...
@@ -1603,6 +1632,14 @@ stop_service() { load_validate_config 'config' adb_stop "'$*'"; }
pause
()
{
load_validate_config
'config'
adb_pause
"'
$*
'"
;
}
version
()
{
echo
"
$PKG_VERSION
"
;
}
load_validate_file_url_section
()
{
uci_load_validate
"
$packageName
"
"
$packageName
"
"
$1
"
"
$2
"
\
'enabled:bool:1'
\
'action:or("allow", "block"):block'
\
'size:or(uinteger, "")'
\
'url:string'
}
load_validate_config
()
{
.
/lib/functions/network.sh
.
/usr/share/libubox/jshn.sh
...
...
@@ -1629,13 +1666,9 @@ load_validate_config() {
local
procd_boot_wan_timeout
local
led
local
dns
local
dns_instance
local
dns
masq
_instance
local
allowed_domain
local
allowed_domains_url
local
blocked_adblockplus_url
local
blocked_domain
local
blocked_domains_url
local
blocked_hosts_url
local
dnsmasq_config_file_url
uci_load_validate
"
$packageName
"
"
$packageName
"
"
$1
"
"
${
2
}${
3
:+
$3
}
"
\
'enabled:bool:0'
\
...
...
@@ -1650,7 +1683,7 @@ load_validate_config() {
'canary_domains_icloud:bool:0'
\
'canary_domains_mozilla:bool:0'
\
'config_update_enabled:bool:0'
\
'config_update_url:string:https://cdn.jsdelivr.net/gh/openwrt/packages/net/
simple-adblock/files/simple-adblock
.conf.update'
\
'config_update_url:string:https://cdn.jsdelivr.net/gh/openwrt/packages/net/
adblock-fast/files/adblock-fast
.conf.update'
\
'download_timeout:range(1,60):20'
\
'pause_timeout:range(10,120):60'
\
'curl_additional_param:or("", string)'
\
...
...
@@ -1661,12 +1694,8 @@ load_validate_config() {
'procd_boot_wan_timeout:integer:60'
\
'led:or("", "none", file, device, string)'
\
'dns:or("dnsmasq.addnhosts", "dnsmasq.conf", "dnsmasq.ipset", "dnsmasq.nftset", "dnsmasq.servers", "unbound.adb_list"):dnsmasq.servers'
\
'dns
_instance:list(or(integer, string)):0
'
\
'dns
masq_instance:list(or(integer, string)):*
'
\
'allowed_domain:list(string)'
\
'allowed_domains_url:list(string)'
\
'blocked_domain:list(string)'
\
'blocked_adblockplus_url:list(string)'
\
'blocked_domains_url:list(string)'
\
'blocked_hosts_url:list(string)'
\
'dnsmasq_config_file_url:string'
}
net/adblock-fast/files/etc/uci-defaults/90-adblock-fast
0 → 100644
浏览文件 @
abb91052
#!/bin/sh
# Copyright 2023 MOSSDeF, Stan Grishin (stangri@melmac.ca)
# shellcheck disable=SC1091,SC2015,SC3037,SC3043,SC2317,SC3060
readonly
packageName
=
'adblock-fast'
readonly
_OK_
=
'\033[0;32m\xe2\x9c\x93\033[0m'
readonly
_FAIL_
=
'\033[0;31m\xe2\x9c\x97\033[0m'
readonly
__OK__
=
'\033[0;32m[\xe2\x9c\x93]\033[0m'
readonly
__FAIL__
=
'\033[0;31m[\xe2\x9c\x97]\033[0m'
readonly
_ERROR_
=
'\033[0;31mERROR\033[0m'
readonly
_WARNING_
=
'\033[0;33mWARNING\033[0m'
output
()
{
# Can take a single parameter (text) to be output at any verbosity
# Or target verbosity level and text to be output at specifc verbosity
local
msg memmsg logmsg
local
sharedMemoryOutput
=
"/dev/shm/
$packageName
-output"
verbosity
=
"
${
verbosity
:-
2
}
"
if
[
"$#"
-ne
1
]
;
then
if
[
$((
verbosity
&
$1
))
-gt
0
]
||
[
"
$verbosity
"
=
"
$1
"
]
;
then
shift
else
return
0
fi
fi
[
-t
1
]
&&
printf
"%b"
"
$1
"
msg
=
"
$1
"
;
if
[
"
$(
printf
"%b"
"
$msg
"
|
wc
-l
)
"
-gt
0
]
;
then
[
-s
"
$sharedMemoryOutput
"
]
&&
memmsg
=
"
$(
cat
"
$sharedMemoryOutput
"
)
"
logmsg
=
"
$(
printf
"%b"
"
${
memmsg
}${
msg
}
"
|
sed
's/\x1b\[[0-9;]*m//g'
)
"
logger
-t
"
${
packageName
:-
service
}
"
"
$(
printf
"%b"
"
$logmsg
"
)
"
rm
-f
"
$sharedMemoryOutput
"
else
printf
"%b"
"
$msg
"
>>
"
$sharedMemoryOutput
"
fi
}
output_ok
()
{
output 1
"
$_OK_
"
;
output 2
"
$__OK__
\\
n"
;
}
output_okn
()
{
output 1
"
$_OK_
\\
n"
;
output 2
"
$__OK__
\\
n"
;
}
output_fail
()
{
output 1
"
$_FAIL_
"
;
output 2
"
$__FAIL__
\\
n"
;
}
output_failn
()
{
output 1
"
$_FAIL_
\\
n"
;
output 2
"
$__FAIL__
\\
n"
;
}
is_present
()
{
command
-v
"
$1
"
>
/dev/null 2>&1
;
}
get_url_filesize
()
{
local
url
=
"
$1
"
size size_command
[
-n
"
$1
"
]
||
return
0
is_present
'curl'
||
return
0
size_command
=
'curl --silent --insecure --fail --head --request GET'
size
=
"
$(
$size_command
"
$url
"
|
grep
-Po
'^[cC]ontent-[lL]ength: \K\w+'
)
"
echo
-en
"
$size
"
}
# Transition from simple-adblock
_enable_url
()
{
local
cfg
=
"
$1
"
url
=
"
$2
"
action
=
"
$3
"
local
u a
config_get u
"
$cfg
"
'url'
config_get a
"
$cfg
"
'action'
'block'
if
[
"
$u
"
=
"
$url
"
]
&&
[
"
$a
"
=
"
$action
"
]
;
then
uci del
"
${
packageName
}
.
${
cfg
}
.enabled"
&&
_found
=
1
fi
}
enable_add_url
()
{
local
url
=
"
$1
"
action
=
"
$2
"
_found
config_load
"
$packageName
"
config_foreach _enable_url
'file_url'
"
$url
"
"
$action
"
if
[
-z
"
$_found
"
]
;
then
uci add
"
${
packageName
}
"
'file_url'
>
/dev/null 2>&1
uci
set
"
${
packageName
}
.@file_url[-1].url=
$url
"
uci
set
"
${
packageName
}
.@file_url[-1].size=
$(
get_url_filesize
"
$url
"
)
"
uci
set
"
${
packageName
}
.@file_url[-1].action=
$action
"
fi
}
if
[
-s
'/etc/config/simple-adblock'
]
\
&&
[
!
-s
'/etc/config/adblock-fast-opkg'
]
\
&&
[
"
$(
uci get adblock-fast.config.enabled
)
"
=
'0'
]
;
then
cp
-f
'/etc/config/adblock-fast'
'/etc/config/adblock-fast-opkg'
enabled
=
"
$(
uci get simple-adblock.config.enabled
)
"
if
[
-x
'/etc/init.d/simple-adblock'
]
;
then
output
"Stopping and disabling simple-adblock "
if
/etc/init.d/simple-adblock stop
>
/dev/null 2>&1
\
&&
/etc/init.d/simple-adblock disable
\
&&
uci
set
simple-adblock.config.enabled
=
0
\
&&
uci commit simple-adblock
;
then
output_okn
else
output_failn
fi
else
output
"Disabling simple-adblock."
if
uci
set
simple-adblock.config.enabled
=
0
\
&&
uci commit simple-adblock
;
then
output_okn
else
output_failn
fi
fi
output
"Migrating simple-adblock config file "
for
i
in
allow_non_ascii canary_domains_icloud canary_domains_mozilla
\
compressed_cache compressed_cache_dir config_update_enabled
\
curl_additional_param curl_max_file_size curl_retry download_timeout
\
debug dns dns_instance dnsmasq_config_file_url force_dns led
\
parallel_downloads procd_trigger_wan6 procd_boot_wan_timeout verbosity
;
do
j
=
"
$(
uci
-q
get simple-adblock.config.
${
i
}
)
"
[
-n
"
$j
"
]
&&
uci
set
"
${
packageName
}
.config.
${
i
}
=
${
j
}
"
done
[
-n
"
$enabled
"
]
&&
uci
set
"
${
packageName
}
.config.enabled=
${
enabled
}
"
j
=
"
$(
uci
-q
get simple-adblock.config.config_update_url
)
"
if
[
"
${
j
//simple-adblock/
}
"
=
"
$j
"
]
;
then
uci
set
"
${
packageName
}
.config.config_update_url=
$j
"
fi
ccd
=
"
$(
uci get simple-adblock.config.compressed_cache_dir
)
"
ccd
=
"
${
ccd
:-
/etc
}
"
for
j
in
$(
uci
-q
get simple-adblock.config.allowed_domain
)
;
do
[
-n
"
$j
"
]
&&
uci add_list
"
${
packageName
}
.config.allowed_domain=
${
j
}
"
done
for
j
in
$(
uci
-q
get simple-adblock.config.blocked_domain
)
;
do
[
-n
"
$j
"
]
&&
uci add_list
"
${
packageName
}
.config.blocked_domain=
${
j
}
"
done
for
j
in
$(
uci
-q
get simple-adblock.config.force_dns_port
)
;
do
[
-n
"
$j
"
]
&&
uci add_list
"
${
packageName
}
.config.force_dns_port=
${
j
}
"
done
output_okn
for
i
in
allowed_domains_url blocked_adblockplus_url blocked_domains_url
\
blocked_hosts_url
;
do
output
"Migrating simple-adblock
${
i
}
"
for
j
in
$(
uci
-q
get simple-adblock.config.
${
i
}
)
;
do
if
[
"
$i
"
=
'allowed_domains_url'
]
;
then
enable_add_url
"
$j
"
'allow'
else
enable_add_url
"
$j
"
'block'
fi
done
output_okn
done
uci commit
"
$packageName
"
output
"Migrating simple-adblock cache file(s) "
for
i
in
'/var/run/simple-adblock/dnsmasq.addnhosts.cache'
\
'/var/run/simple-adblock/dnsmasq.conf.cache'
\
'/var/run/simple-adblock/dnsmasq.ipset.cache'
\
'/var/run/simple-adblock/dnsmasq.nftset.cache'
\
'/var/run/simple-adblock/dnsmasq.servers.cache'
\
'/var/run/simple-adblock/unbound.cache'
;
do
if
[
-s
"
$i
"
]
;
then
current_dir
=
"
$(
dirname
"
$i
"
)
"
mkdir
-p
"
${
current_dir
//simple-adblock/adblock-fast
}
"
mv
-f
"
$i
"
"
${
i
//simple-adblock/adblock-fast
}
"
&&
output_okn
||
output_failn
fi
done
for
i
in
'simple-adblock.dnsmasq.addnhosts.gz'
\
'simple-adblock.dnsmasq.conf.gz'
\
'simple-adblock.dnsmasq.ipset.gz'
\
'simple-adblock.dnsmasq.nftset.gz'
\
'simple-adblock.dnsmasq.servers.gz'
\
'simple-adblock.unbound.gz'
;
do
i
=
"
${
ccd
}
/
${
i
}
"
if
[
-s
"
$i
"
]
;
then
mkdir
-p
"
${
ccd
//simple-adblock/adblock-fast
}
"
mv
-f
"
$i
"
"
${
i
//simple-adblock/adblock-fast
}
"
&&
output_okn
||
output_failn
fi
done
output_okn
fi
exit
0
net/
simple-adblock
/test.sh
→
net/
adblock-fast
/test.sh
浏览文件 @
abb91052
文件已移动
net/simple-adblock/files/README.md
已删除
100644 → 0
浏览文件 @
f25b34fc
# README
README has been moved to
[
https://docs.openwrt.melmac.net/simple-adblock/
](
https://docs.openwrt.melmac.net/simple-adblock/
)
.
net/simple-adblock/files/simple-adblock.conf
已删除
100644 → 0
浏览文件 @
f25b34fc
config
simple
-
adblock
'config'
option
enabled
'0'
list
allowed_domain
'cdn.jsdelivr.net'
option
allow_non_ascii
'0'
option
canary_domains_icloud
'0'
option
canary_domains_mozilla
'0'
option
compressed_cache
'0'
option
compressed_cache_dir
'/etc'
option
config_update_enabled
'0'
option
config_update_url
'https://cdn.jsdelivr.net/gh/openwrt/packages/net/simple-adblock/files/simple-adblock.conf.update'
option
curl_additional_param
''
option
curl_max_file_size
'30000000'
option
curl_retry
'3'
option
download_timeout
'10'
option
debug
'0'
option
dns
'dnsmasq.servers'
option
dns_instance
'0'
option
force_dns
'1'
list
force_dns_port
'53'
list
force_dns_port
'853'
# ports listed below are used by some
# of the dnscrypt-proxy v1 resolvers
# list force_dns_port '553'
# list force_dns_port '1443'
# list force_dns_port '4343'
# list force_dns_port '4434'
# list force_dns_port '5443'
# list force_dns_port '8443'
option
led
'none'
option
parallel_downloads
'1'
option
procd_trigger_wan6
'0'
option
procd_boot_wan_timeout
'60'
option
verbosity
'2'
# File size: 16.0K
list
blocked_hosts_url
'https://adaway.org/hosts.txt'
# File size: 20.0K
list
blocked_hosts_url
'https://cdn.jsdelivr.net/gh/hoshsadiq/adblock-nocoin-list/hosts.txt'
# File size: 80.0K
list
blocked_hosts_url
'https://pgl.yoyo.org/as/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext'
# File size: 388.0K
# block-list may be too big for some routers
# block-list may block some video-streaming content
# list blocked_hosts_url 'https://cdn.jsdelivr.net/gh/jawz101/MobileAdTrackers/hosts'
# File size: 424.0K
# block-list may be too big for some routers
list
blocked_hosts_url
'https://winhelp2002.mvps.org/hosts.txt'
# File size: 432.0K
# block-list may be too big for some routers
list
blocked_hosts_url
'https://someonewhocares.org/hosts/hosts'
# File size: 624.0K
# block-list too big for most routers
# list blocked_hosts_url 'http://sysctl.org/cameleon/hosts'
# File size: 1.4M
# block-list too big for most routers
# list blocked_adblockplus_url 'https://small.oisd.nl/'
# File size: 1.6M
# block-list too big for most routers
# list blocked_hosts_url 'https://cdn.jsdelivr.net/gh/StevenBlack/hosts/hosts'
# File size: 2.0M
# block-list too big for most routers
# list blocked_domains_url https://cdn.jsdelivr.net/gh/bongochong/CombinedPrivacyBlockLists/NoFormatting/cpbl-ctld.txt
# File size: 3.1M
# block-list too big for most routers
# list blocked_hosts_url 'https://hostsfile.mine.nu/Hosts'
# File size: 8.3M
# enabling this will disable processing of any other block/allow-lists
# option dnsmasq_config_file_url 'https://dnsmasq.oisd.nl/'
# File size: 5.0M
# block-list may be too big for some routers
# list blocked_domains_url 'https://raw.githubusercontent.com/AdguardTeam/cname-trackers/master/data/combined_disguised_trackers_justdomains.txt'
# File size: 6.2M
# block-list too big for most routers
# list blocked_adblockplus_url 'https://nsfw.oisd.nl/'
# File size: 6.2M
# block-list too big for most routers
# list blocked_adblockplus_url 'https://big.oisd.nl/'
# File size: 1.5M
# block-list too big for most routers
# list blocked_domains_url 'https://small.oisd.nl/domains'
# File size: 7.8M
# block-list too big for most routers
# list blocked_domains_url 'https://nsfw.oisd.nl/domains'
# File size: 19.9M
# block-list too big for most routers
# list blocked_domains_url 'https://big.oisd.nl/domains'
# site was down on last check
# list blocked_domains_url 'http://support.it-mate.co.uk/downloads/hosts.txt'
net/simple-adblock/files/simple-adblock.hotplug
已删除
100644 → 0
浏览文件 @
f25b34fc
#!/bin/sh
if
[
"
$ACTION
"
=
"ifup"
]
;
then
sleep
10
&&
/etc/init.d/simple-adblock start hotplug &
fi
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录