Adblock Openwrt X86

基于 DNS/Dnsmasq 的开源 adblock 方案

首先下载安装包:

wget --no-check-certificate https://downloads.lede-project.org/snapshots/packages/x86_64/packages/adblock_1.4.8-1_all.ipk
wget --no-check-certificate https://downloads.lede-project.org/snapshots/packages/x86_64/luci/luci-app-adblock_git-16.251.61906-44bf3f0-1_all.ipk

然后分别 opkg install 安装。

修改 luci 的监听端口:/etc/config/uhttpd

config uhttpd 'main'
	list listen_http '0.0.0.0:88'
	list listen_http '[::]:88'
	list listen_https '0.0.0.0:333'
	list listen_https '[::]:333'

修改 adblock 配置文件,添加 chinalist:/etc/config/adblock

config source 'Chinalist'
	option adb_src 'https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt'
	option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
	option adb_src_desc 'Easylist China'
	option enabled '1'

config source 'EasylistChinaLite'
	option adb_src 'https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjxlist.txt'
	option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
	option adb_src_desc 'CJX EasyList China Lite'
	option enabled '1'

config source 'CJX'
	option adb_src 'https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjx-annoyance.txt'
	option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
	option adb_src_desc 'CJX Annoyance List'
	option enabled '1'

进入到 luci 界面,保存一次 adblock 设置,然后执行以下命令更新 list 列表:

/etc/init.d/adblock start

添加定时更新:

0 3 * * *    /etc/init.d/adblock start

大功告成,开源的 project,总会让人放心很多。

2 thoughts on “Adblock Openwrt X86”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.