luci-app-turboacc: drop support for AdGuardHome

This commit is contained in:
CN_SZTL 2020-07-21 13:38:08 +08:00
parent a593e58cc3
commit 54d80c9cce
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
10 changed files with 17 additions and 443 deletions

View File

@ -10,7 +10,6 @@ LUCI_DEPENDS:=+pdnsd-alt \
+PACKAGE_luci-app-turboacc_INCLUDE_shortcut-fe:kmod-fast-classifier \
+PACKAGE_luci-app-turboacc_INCLUDE_flow-offload:kmod-ipt-offload \
+PACKAGE_luci-app-turboacc_INCLUDE_bbr-cca:kmod-tcp-bbr \
+PACKAGE_luci-app-turboacc_INCLUDE_adguardhome:AdGuardHome \
+PACKAGE_luci-app-turboacc_INCLUDE_dnsforwarder:dnsforwarder
LUCI_PKGARCH:=all
@ -37,10 +36,6 @@ config PACKAGE_luci-app-turboacc_INCLUDE_bbr-cca
default n if LINUX_4_9
default y
config PACKAGE_luci-app-turboacc_INCLUDE_adguardhome
bool "Include AdGuardHome"
default n
config PACKAGE_luci-app-turboacc_INCLUDE_dnsforwarder
bool "Include DNSForwarder"
default n

View File

@ -25,11 +25,7 @@ local function fullconebat_status()
end
local function dnscaching_status()
return luci.sys.call("[ x$(uci -q get turboacc.config.dns_caching_mode) != x3 ] && pgrep dnscache >/dev/null || pgrep AdGuardHome >/dev/null") == 0
end
local function adguardhome_status()
return luci.sys.call("pgrep AdGuardHome >/dev/null") == 0
return luci.sys.call("pgrep dnscache >/dev/null") == 0
end
function action_status()
@ -38,7 +34,6 @@ function action_status()
fastpath_state = fastpath_status(),
bbr_state = bbr_status(),
fullconenat_state = fullconebat_status(),
dnscaching_state = dnscaching_status(),
adguardhome_state = adguardhome_status()
dnscaching_state = dnscaching_status()
})
end
end

View File

@ -69,14 +69,11 @@ dns_caching.default = 0
dns_caching.rmempty = false
dns_caching.description = translate("Enable DNS Caching and anti ISP DNS pollution")
dns_caching_mode = s:option(ListValue, "dns_caching_mode", translate("Resolve Dns Mode"), translate("AdGuardHome login username/password: AdGuardHome/AdGuardHome"))
dns_caching_mode = s:option(ListValue, "dns_caching_mode", translate("Resolve DNS Mode"), translate("Only PDNSD and DNSForwarder is suppoted now"))
dns_caching_mode:value("1", translate("Using PDNSD to query and cache"))
if nixio.fs.access("/usr/bin/dnsforwarder") then
dns_caching_mode:value("2", translate("Using DNSForwarder to query and cache"))
end
if nixio.fs.access("/usr/bin/AdGuardHome") then
dns_caching_mode:value("3", translate("Using AdGuardHome to query and cache"))
end
dns_caching_mode.default = 1
dns_caching_mode:depends("dns_caching", 1)

View File

@ -5,7 +5,6 @@
<tr><td width="33%"><%:BBR CCA%></td><td id="_bbr_state"><em><%:Collecting data...%></em></td></tr>
<tr><td width="33%"><%:FullCone NAT%></td><td id="_fullconenat_state"><em><%:Collecting data...%></em></td></tr>
<tr><td width="33%"><%:DNS Caching%></td><td id="_dnscaching_state"><em><%:Collecting data...%></em></td></tr>
<tr><td width="33%"><%:AdGuardHome Anti-AD%></td><td id="_adguardhome_state"><em><%:Collecting data...%></em></td></tr>
</table>
</fieldset>
@ -14,14 +13,12 @@
var bbr_state = document.getElementById('_bbr_state');
var fullconenat_state = document.getElementById('_fullconenat_state');
var dnscaching_state = document.getElementById('_dnscaching_state');
var adguardhome_state = document.getElementById('_adguardhome_state');
XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "turboacc", "status")%>', null, function(x, status) {
if ( x && x.status == 200 ) {
fastpath_state.innerHTML = status.fastpath_state ? '<em><b><font color=green><%:RUNNING%></font></b></em>' : '<em><b><font color=red><%:NOT RUNNING%></font></b></em>';
bbr_state.innerHTML = status.bbr_state ? '<em><b><font color=green><%:RUNNING%></font></b></em>' : '<em><b><font color=red><%:NOT RUNNING%></font></b></em>';
fullconenat_state.innerHTML = status.fullconenat_state ? '<em><b><font color=green><%:RUNNING%></font></b></em>' : '<em><b><font color=red><%:NOT RUNNING%></font></b></em>';
dnscaching_state.innerHTML = status.dnscaching_state ? '<em><b><font color=green><%:RUNNING%></font></b></em>' : '<em><b><font color=red><%:NOT RUNNING%></font></b></em>';
adguardhome_state.innerHTML = status.adguardhome_state ? '<em><b><font color=green><%:RUNNING%></font></b></em><input class="cbi-button mar-10" type="button" value="<%:Open Web Interface%>" onclick="openwebui();" />' : '<em><b><font color=red><%:NOT RUNNING%></font></b></em>';
}
});

View File

@ -64,18 +64,18 @@ msgstr "DNS 缓存"
msgid "Enable DNS Caching and anti ISP DNS pollution"
msgstr "启用 DNS 多线程查询、缓存,并防止 ISP 的 DNS 广告和域名劫持"
msgid "Resolve Dns Mode"
msgid "Resolve DNS Mode"
msgstr "DNS 解析方式"
msgid "Only PDNSD and DNSForwarder is suppoted now"
msgstr "目前仅支持 PDNSD 和 DNSForwarder"
msgid "Using PDNSD to query and cache"
msgstr "使用 PDNSD 解析"
msgid "Using DNSForwarder to query and cache"
msgstr "使用 DNSForwarder 解析"
msgid "Using AdGuardHome to query and cache"
msgstr "使用 AdGuardHome 解析"
msgid "Upsteam IPv4 DNS Server"
msgstr "上游 IPv4 DNS 服务器"
@ -88,9 +88,6 @@ msgstr "上游 IPv6 DNS 服务器"
msgid "Muitiple IPv6 DNS server can saperate with ','"
msgstr "多个上游 IPv6 DNS 服务器请用 ',' 分隔(注意用英文逗号)"
msgid "AdGuardHome login username/password: AdGuardHome/AdGuardHome"
msgstr "AdGuardHome 登录账号/密码AdGuardHome/AdGuardHome"
msgid "Running Status"
msgstr "运行状态"
@ -106,8 +103,5 @@ msgstr "全锥型 NAT"
msgid "DNS Caching"
msgstr "DNS 缓存"
msgid "AdGuardHome Anti-AD"
msgstr "AdGuardHome 去广告"
msgid "Open Web Interface"
msgstr "打开 Web 界面"

View File

@ -20,9 +20,6 @@ inital_conf(){
config_get "dns_caching_mode" "config" "dns_caching_mode" "0"
config_get "dns_caching_v4_dns" "config" "dns_caching_v4_dns"
config_get "dns_caching_v6_dns" "config" "dns_caching_v6_dns"
config_load "network"
config_get "lan_addr" "lan" "ipaddr" "192.168.1.1"
}
start_pdnsd() {
@ -247,10 +244,6 @@ start(){
start_pdnsd
elif [ "${dns_caching_mode}" = "2" ]; then
start_dnsforwarder
elif [ "${dns_caching_mode}" = "3" ]; then
mkdir -p "/etc/AdGuardHome"
AdGuardHome -c "/etc/AdGuardHome/AdGuardHome.yaml" -w "/etc/AdGuardHome" -h "${lan_addr}" -p "3001" --no-check-update &
fi
change_dns
nohup "/usr/share/dnscache/dnscache-while.sh" > "/var/log/dnscache.file" 2>&1 &
else
@ -295,4 +288,4 @@ restart(){
start
/etc/init.d/dnsmasq restart >/dev/null 2>&1 && echo "DNSMASQ restart"
/etc/init.d/firewall restart >/dev/null 2>&1
}
}

View File

@ -2,45 +2,30 @@
sleeptime=60
logfile="/var/log/dnscache.file"
adg_logfile="/etc/AdGuardHome/data/querylog.json"
dns_caching="$(uci -q get turboacc.config.dns_caching)"
dns_caching_mode="$(uci -q get turboacc.config.dns_caching_mode 2>/dev/null)"
lan_addr="$(uci get network.lan.ipaddr)"
clean_log(){
logrow="$(grep -c "" "${logfile}")"
if [ "${logrow}" -ge "500" ];then
echo "${curtime} Log条数超限清空处理" > "${logfile}"
fi
if [ "${dns_caching_mode}" = "3" ]; then
adg_logrow="$(grep -c "" "${adg_logfile}")"
if [ "${adg_logrow}" -ge "500" ];then
echo "${curtime} Log条数超限清空处理" > "${adg_logfile}"
fi
fi
}
while [ "${dns_caching}" -eq "1" ];
do
curtime="$(date "+%H:%M:%S")"
echo "${curtime} online!"
if [ "${dns_caching_mode}" = "3" ]; then
pidof AdGuardHome>/dev/null || {
AdGuardHome -c "/etc/AdGuardHome/AdGuardHome.yaml" -w "/etc/AdGuardHome" -h "${lan_addr}" -p "3001" --no-check-update &
echo "${curtime} 重启服务!" >> ${logfile}
pidof dnscache>/dev/null || {
if [ "${dns_caching_mode}" = "1" ]; then
/var/sbin/dnscache -c "/var/etc/dnscache.conf" &
elif [ "${dns_caching_mode}" = "2" ]; then
/var/sbin/dnscache -f "/var/run/dnscache/dnscache.conf" &
fi
echo "${curtime} 重启服务!" >> ${logfile}
}
else
pidof dnscache>/dev/null || {
if [ "${dns_caching_mode}" = "1" ]; then
/var/sbin/dnscache -c "/var/etc/dnscache.conf" &
elif [ "${dns_caching_mode}" = "2" ]; then
/var/sbin/dnscache -f "/var/run/dnscache/dnscache.conf" &
fi
echo "${curtime} 重启服务!" >> ${logfile}
}
fi
clean_log
sleep "${sleeptime}"
continue
done
done

View File

@ -62,8 +62,6 @@ endef
define Package/AdGuardHome/install
$(call GoPackage/Package/Install/Bin,$(1))
$(INSTALL_DIR) $(1)/etc/AdGuardHome
$(INSTALL_CONF) ./conf/$(ADG_CONF_NAME).yaml $(1)/etc/AdGuardHome/AdGuardHome.yaml
endef
$(eval $(call GoBinPackage,AdGuardHome))

View File

@ -1,230 +0,0 @@
bind_host: 0.0.0.0
bind_port: 3001
users:
- name: AdGuardHome
password: $2y$05$r.WXZfS0JbDj01xXmScIiuFPirVYB2FXmH0o1CUgyECxPNMlkWorq
language: zh-cn
rlimit_nofile: 61500
web_session_ttl: 720
dns:
bind_host: 0.0.0.0
port: 5333
statistics_interval: 30
querylog_enabled: true
querylog_interval: 30
querylog_memsize: 0
protection_enabled: true
blocking_mode: nxdomain
blocking_ipv4: ""
blocking_ipv6: ""
blocked_response_ttl: 3000
ratelimit: 0
ratelimit_whitelist: []
refuse_any: false
bootstrap_dns:
- 1.0.0.1:53
- 2606:4700:4700::1001:53
all_servers: true
edns_client_subnet: true
allowed_clients:
- 127.0.0.1
disallowed_clients: []
blocked_hosts: []
parental_block_host: family-block.dns.adguard.com
safebrowsing_block_host: standard-block.dns.adguard.com
cache_size: 2000000
upstream_dns:
- 202.141.178.13:5353
- 202.38.93.153:5353
- 202.141.162.123:5353
- https://neatdns.ustclug.org/resolve
- https://dns.rubyfish.cn/dns-query
- https://ndns.233py.com/dns-query
- https://edns.233py.com/dns-query
- https://wdns.233py.com/dns-query
- https://sdns.233py.com/dns-query
- 1.1.1.1
- 9.9.9.9
- 117.50.10.10
- 119.29.29.29
- 114.114.114.114
- 223.5.5.5
- 208.67.222.222:5353
- 2606:4700:4700::1111
- 2606:4700:4700::1001
- tcp://8.8.8.8
- tcp://8.8.4.4
- tcp://2001:4860:4860::8888
- tcp://2001:4860:4860::8844
- tls://dns.google
- tls://1dot1dot1dot1.cloudflare-dns.com
- https://dns9.quad9.net/dns-query
filtering_enabled: true
filters_update_interval: 24
parental_sensitivity: 0
parental_enabled: false
safesearch_enabled: false
safebrowsing_enabled: false
safebrowsing_cache_size: 1048576
safesearch_cache_size: 1048576
parental_cache_size: 1048576
cache_time: 30
rewrites: []
blocked_services: []
tls:
enabled: false
server_name: ""
force_https: false
port_https: 443
port_dns_over_tls: 853
certificate_chain: ""
private_key: ""
certificate_path: ""
private_key_path: ""
filters:
- enabled: true
url: https://gitlab.com/xuhaiyang1234/AAK-Cont/raw/master/FINAL_BUILD/aak-cont-list-notubo.txt
name: AAK-Cont Filter For AdBlock, Adblock Plus, etc
id: 1565484163
- enabled: true
url: https://raw.githubusercontent.com/reek/anti-adblock-killer/master/anti-adblock-killer-filters.txt
name: AakList (Anti-Adblock Killer)
id: 1565484164
- enabled: true
url: https://raw.githubusercontent.com/cjx82630/cjxlist/master/cjxlist.txt
name: CJX's EasyList Lite
id: 1565484165
- enabled: true
url: https://easylist-downloads.adblockplus.org/easylistchina.txt
name: EasyList China
id: 1565484166
- enabled: true
url: https://hosts-file.net/.%5Cad_servers.txt
name: hpHosts Ad and tracking servers
id: 1565484167
- enabled: true
url: https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext
name: Peter Lowes Ad and tracking server list
id: 1565484168
- enabled: true
url: https://easylist.to/easylist/fanboy-social.txt
name: Fanboy's Social Blocking List
id: 1565484169
- enabled: true
url: https://easylist.to/easylist/fanboy-annoyance.txt
name: Fanboy's Annoyance List
id: 1565484170
- enabled: true
url: https://secure.fanboy.co.nz/fanboy-cookiemonster.txt
name: Fanboy's Cookie List
id: 1565484171
- enabled: true
url: https://fanboy.co.nz/fanboy-antifacebook.txt
name: Anti-Facebook List
id: 1565484172
- enabled: true
url: https://filters.adtidy.org/extension/ublock/filters/14.txt
name: AdGuard Annoyances filter
id: 1565484173
- enabled: true
url: https://raw.githubusercontent.com/Spam404/lists/master/adblock-list.txt
name: Spam404
id: 1565484174
- enabled: true
url: https://gitcdn.xyz/repo/NanoMeow/MDLMirror/master/hosts.txt
name: Malware Domain List
id: 1565484176
- enabled: true
url: https://www.fanboy.co.nz/enhancedstats.txt
name: Fanboy's Enhanced Tracking List
id: 1565484178
- enabled: true
url: https://easylist.to/easylist/easyprivacy.txt
name: EasyPrivacy
id: 1565484179
- enabled: true
url: https://filters.adtidy.org/extension/ublock/filters/3.txt
name: AdGuard Tracking Protection filter
id: 1565484180
- enabled: true
url: https://easylist.to/easylist/easylist.txt
name: EasyList
id: 1565484181
- enabled: true
url: https://filters.adtidy.org/extension/ublock/filters/11.txt
name: AdGuard Mobile Ads filter
id: 1565484182
- enabled: true
url: https://filters.adtidy.org/extension/ublock/filters/2_without_easylist.txt
name: AdGuard Base filter
id: 1565484183
- enabled: true
url: https://easylist-downloads.adblockplus.org/antiadblockfilters.txt
name: Adblock Warning Removal List
id: 1565484184
- enabled: true
url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: AdGuard Simplified Domain Names filter
id: 1565484185
- enabled: true
url: http://tools.yiclear.com/ChinaList2.0.txt
name: ChinaListV2.0[20190801000]
id: 1565484186
- enabled: true
url: https://fanboy.co.nz/fanboy-problematic-sites.txt
name: Fanboy's problematic-sites
id: 1565484187
- enabled: true
url: http://sub.adtchrome.com/adt-chinalist-easylist.txt
name: ChinaList+EasyList(修正)
id: 1565484188
- enabled: true
url: https://hosts.nfz.moe/127.0.0.1/full/hosts
name: NeoFelhz Hosts
id: 1565484189
- enabled: true
url: https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/lazy.txt
name: Adbyby Lazy Rule
id: 1565484190
- enabled: true
url: https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/video.txt
name: Adbyby Video Rule
id: 1565484191
- enabled: true
url: https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/resource-abuse.txt
name: uBlock filters Resource abuse
id: 1565486406
- enabled: true
url: https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/filters.txt
name: uBlock filters
id: 1565486407
- enabled: true
url: https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/badware.txt
name: uBlock filters Badware risks
id: 1565486408
- enabled: true
url: https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/experimental.txt
name: uBlock filters Experimental
id: 1565486409
- enabled: true
url: https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/privacy.txt
name: uBlock filters Privacy
id: 1565486410
- enabled: true
url: https://raw.githubusercontent.com/uBlockOrigin/uAssets/master/filters/unbreak.txt
name: uBlock filters -- Unbreak
id: 1565486411
user_rules: []
dhcp:
enabled: false
interface_name: ""
gateway_ip: ""
subnet_mask: ""
range_start: ""
range_end: ""
lease_duration: 0
icmp_timeout_msec: 1000
clients: []
log_file: ""
verbose: false
schema_version: 6

View File

@ -1,150 +0,0 @@
bind_host: 0.0.0.0
bind_port: 3001
users:
- name: AdGuardHome
password: $2y$05$r.WXZfS0JbDj01xXmScIiuFPirVYB2FXmH0o1CUgyECxPNMlkWorq
language: zh-cn
rlimit_nofile: 61500
web_session_ttl: 720
dns:
bind_host: 0.0.0.0
port: 5333
statistics_interval: 30
querylog_enabled: true
querylog_interval: 30
querylog_memsize: 0
protection_enabled: true
blocking_mode: nxdomain
blocking_ipv4: ""
blocking_ipv6: ""
blocked_response_ttl: 3000
ratelimit: 0
ratelimit_whitelist: []
refuse_any: false
bootstrap_dns:
- 1.0.0.1:53
- 2606:4700:4700::1001:53
all_servers: true
edns_client_subnet: true
allowed_clients:
- 127.0.0.1
disallowed_clients: []
blocked_hosts: []
parental_block_host: family-block.dns.adguard.com
safebrowsing_block_host: standard-block.dns.adguard.com
cache_size: 100000
upstream_dns:
- 202.141.178.13:5353
- 202.38.93.153:5353
- 202.141.162.123:5353
- https://neatdns.ustclug.org/resolve
- https://dns.rubyfish.cn/dns-query
- https://ndns.233py.com/dns-query
- https://edns.233py.com/dns-query
- https://wdns.233py.com/dns-query
- https://sdns.233py.com/dns-query
- 1.1.1.1
- 9.9.9.9
- 117.50.10.10
- 119.29.29.29
- 114.114.114.114
- 223.5.5.5
- 208.67.222.222:5353
- 2606:4700:4700::1111
- 2606:4700:4700::1001
- tcp://8.8.8.8
- tcp://8.8.4.4
- tcp://2001:4860:4860::8888
- tcp://2001:4860:4860::8844
- tls://dns.google
- tls://1dot1dot1dot1.cloudflare-dns.com
- https://dns9.quad9.net/dns-query
filtering_enabled: true
filters_update_interval: 24
parental_sensitivity: 0
parental_enabled: false
safesearch_enabled: false
safebrowsing_enabled: false
safebrowsing_cache_size: 1048576
safesearch_cache_size: 1048576
parental_cache_size: 1048576
cache_time: 30
rewrites: []
blocked_services: []
tls:
enabled: false
server_name: ""
force_https: false
port_https: 443
port_dns_over_tls: 853
certificate_chain: ""
private_key: ""
certificate_path: ""
private_key_path: ""
filters:
- enabled: true
url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
name: AdGuard Simplified Domain Names filter
id: 1
- enabled: true
url: https://adaway.org/hosts.txt
name: AdAway
id: 2
- enabled: true
url: https://hosts-file.net/ad_servers.txt
name: hpHosts - Ad and Tracking servers only
id: 3
- enabled: true
url: http://www.malwaredomainlist.com/hostslist/hosts.txt
name: MalwareDomainList.com Hosts List
id: 4
- enabled: true
url: https://raw.githubusercontent.com/523860169/list/master/ad.txt
name: My AdFilters
id: 1553073381
- enabled: true
url: http://tools.yiclear.com/ChinaList2.0.txt
name: ChinaListV2.0[20191126000]
id: 1553073382
- enabled: true
url: https://easylist-downloads.adblockplus.org/antiadblockfilters.txt
name: Adblock Warning Removal List
id: 1553073383
- enabled: true
url: https://fanboy.co.nz/fanboy-problematic-sites.txt
name: Fanboy's problematic-sites
id: 1553073384
- enabled: true
url: https://raw.githubusercontent.com/xinggsf/Adblock-Plus-Rule/master/ABP-FX.txt
name: "5"
id: 1553073385
- enabled: true
url: https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/lazy.txt
name: "6"
id: 1553073386
- enabled: true
url: https://hosts.nfz.moe/127.0.0.1/full/hosts
name: "7"
id: 1553073387
- enabled: true
url: https://raw.githubusercontent.com/vokins/yhosts/master/hosts
name: "8"
id: 1553073388
- enabled: true
url: http://sub.adtchrome.com/adt-chinalist-easylist.txt
name: ChinaList+EasyList(修正)
id: 1553073405
user_rules: []
dhcp:
enabled: false
interface_name: ""
gateway_ip: ""
subnet_mask: ""
range_start: ""
range_end: ""
lease_duration: 0
icmp_timeout_msec: 1000
clients: []
log_file: ""
verbose: false
schema_version: 6