mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-07-28 12:02:00 +08:00
533 lines
19 KiB
Diff
533 lines
19 KiB
Diff
--- a/luci-app-passwall/root/etc/uci-defaults/luci-passwall
|
|
+++ b/luci-app-passwall/root/etc/uci-defaults/luci-passwall
|
|
@@ -1,5 +1,10 @@
|
|
#!/bin/sh
|
|
|
|
+[ "`which nft`" ] && uci -q set passwall.@global_forwarding[0].use_nft=1
|
|
+
|
|
+grep -q ip-api.com /usr/share/passwall/rules/proxy_host ||
|
|
+ sed -i '$a ip-api.com' /usr/share/passwall/rules/proxy_host
|
|
+
|
|
if [ -e "/etc/config/ucitrack" ]; then
|
|
uci -q batch <<-EOF
|
|
delete ucitrack.@passwall[-1]
|
|
|
|
--- a/luci-app-passwall/Makefile
|
|
+++ b/luci-app-passwall/Makefile
|
|
@@ -35,7 +35,25 @@ LUCI_PKGARCH:=all
|
|
LUCI_DEPENDS:=+coreutils +coreutils-base64 +coreutils-nohup +curl \
|
|
+chinadns-ng +dns2socks +dnsmasq-full +ip-full \
|
|
+libuci-lua +lua +luci-compat +luci-lib-jsonc \
|
|
- +microsocks +resolveip +tcping +lyaml
|
|
+ +microsocks +resolveip +tcping +lyaml \
|
|
+ +ipt2socks \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_Geoview:geoview \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_Haproxy:haproxy \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria:hysteria \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_NaiveProxy:naiveproxy \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Client:shadowsocks-rust-sslocal \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Server:shadowsocks-rust-ssserver \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Libev_Client:shadowsocksr-libev-ssr-local \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Libev_Client:shadowsocksr-libev-ssr-redir \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Libev_Server:shadowsocksr-libev-ssr-server \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_Simple_Obfs:simple-obfs-client \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_SingBox:sing-box \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_Geodata:v2ray-geoip \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_Geodata:v2ray-geosite \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_Plugin:v2ray-plugin \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_Xray:xray-core \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_Xray:unzip \
|
|
+ +PACKAGE_$(PKG_NAME)_INCLUDE_Xray_Plugin:xray-plugin
|
|
|
|
define Package/$(PKG_NAME)/config
|
|
menu "Configuration"
|
|
@@ -70,8 +88,7 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_Geoview
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Haproxy
|
|
bool "Include Haproxy"
|
|
- select PACKAGE_haproxy
|
|
- default y if aarch64||arm||i386||x86_64
|
|
+ default y if aarch64||i386||x86_64
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Hysteria
|
|
bool "Include Hysteria"
|
|
@@ -87,7 +104,6 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_NaiveProxy
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Client
|
|
bool "Include Shadowsocks Rust Client"
|
|
depends on !i386
|
|
- select PACKAGE_shadowsocks-rust-sslocal
|
|
default y if aarch64||x86_64
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Server
|
|
@@ -98,8 +114,6 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Rust_Server
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Libev_Client
|
|
bool "Include ShadowsocksR Libev Client"
|
|
- select PACKAGE_shadowsocksr-libev-ssr-local
|
|
- select PACKAGE_shadowsocksr-libev-ssr-redir
|
|
default y
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Libev_Server
|
|
@@ -115,13 +129,12 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_Shadow_TLS
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Simple_Obfs
|
|
bool "Include Simple-Obfs (Shadowsocks Plugin)"
|
|
- select PACKAGE_simple-obfs-client
|
|
default y
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_SingBox
|
|
bool "Include Sing-Box"
|
|
select PACKAGE_sing-box
|
|
- default y if aarch64||arm||i386||x86_64
|
|
+ default y if aarch64||i386||x86_64
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_Geodata
|
|
bool "Include V2ray_Geodata"
|
|
@@ -131,14 +144,11 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_Geodata
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray_Plugin
|
|
bool "Include V2ray-Plugin (Shadowsocks Plugin)"
|
|
- select PACKAGE_v2ray-plugin
|
|
- default y if aarch64||arm||i386||x86_64
|
|
+ default y if aarch64||i386||x86_64
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Xray
|
|
bool "Include Xray"
|
|
- select PACKAGE_xray-core
|
|
- select PACKAGE_unzip
|
|
- default y if aarch64||arm||i386||x86_64
|
|
+ default y
|
|
|
|
config PACKAGE_$(PKG_NAME)_INCLUDE_Xray_Plugin
|
|
bool "Include Xray-Plugin (Shadowsocks Plugin)"
|
|
|
|
--- a/luci-app-passwall/luasrc/controller/passwall.lua
|
|
+++ b/luci-app-passwall/luasrc/controller/passwall.lua
|
|
@@ -21,6 +21,8 @@ function index()
|
|
entry({"admin", "services", appname, "reset_config"}, call("reset_config")).leaf = true
|
|
entry({"admin", "services", appname, "show"}, call("show_menu")).leaf = true
|
|
entry({"admin", "services", appname, "hide"}, call("hide_menu")).leaf = true
|
|
+ entry({"admin", "services", appname, "ip"}, call('check_ip')).leaf = true
|
|
+ entry({"admin", "services", appname, "adblock_refresh"}, call('adblock_refresh')).leaf = true
|
|
local e
|
|
if uci:get(appname, "@global[0]", "hide_from_luci") ~= "1" then
|
|
e = entry({"admin", "services", appname}, alias("admin", "services", appname, "settings"), _("Pass Wall"), -1)
|
|
@@ -211,6 +213,81 @@ function clear_log()
|
|
luci.sys.call("echo '' > /tmp/log/passwall.log")
|
|
end
|
|
|
|
+function adblock_refresh()
|
|
+ local icount = 0
|
|
+
|
|
+ local status = luci.sys.call("/usr/share/passwall/adblock.sh >/dev/null 2>&1")
|
|
+ if status == 0 then
|
|
+ icount = tonumber(luci.sys.exec("wc -l < /usr/share/passwall/rules/block_host"))
|
|
+ if icount>0 then
|
|
+ retstring = tostring(math.ceil(icount))
|
|
+ else
|
|
+ retstring = "-1"
|
|
+ end
|
|
+ elseif status == 2 then
|
|
+ retstring = "0"
|
|
+ else
|
|
+ retstring = "-1"
|
|
+ end
|
|
+ luci.http.prepare_content("application/json")
|
|
+ luci.http.write_json({ret=retstring})
|
|
+end
|
|
+
|
|
+function check_site(host, port)
|
|
+ local nixio = require "nixio"
|
|
+ local socket = nixio.socket("inet", "stream")
|
|
+ socket:setopt("socket", "rcvtimeo", 2)
|
|
+ socket:setopt("socket", "sndtimeo", 2)
|
|
+ local ret = socket:connect(host, port)
|
|
+ socket:close()
|
|
+ return ret
|
|
+end
|
|
+
|
|
+function get_ip_geo_info()
|
|
+ local result = luci.sys.exec('curl --retry 3 -m 10 -LfsA "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36" http://ip-api.com/json/')
|
|
+ local json = require "luci.jsonc"
|
|
+ local info = json.parse(result)
|
|
+
|
|
+ return {
|
|
+ flag = string.lower(info.countryCode) or "un",
|
|
+ country = get_country_name(info.countryCode) or "Unknown",
|
|
+ ip = info.query,
|
|
+ isp = info.isp
|
|
+ }
|
|
+end
|
|
+
|
|
+function get_country_name(countryCode)
|
|
+ local country_names = {
|
|
+ US = "美国", CN = "中国", JP = "日本", GB = "英国", DE = "德国",
|
|
+ FR = "法国", BR = "巴西", IT = "意大利", RU = "俄罗斯", CA = "加拿大",
|
|
+ KR = "韩国", ES = "西班牙", AU = "澳大利亚", MX = "墨西哥", ID = "印度尼西亚",
|
|
+ NL = "荷兰", TR = "土耳其", CH = "瑞士", SA = "沙特阿拉伯", SE = "瑞典",
|
|
+ PL = "波兰", BE = "比利时", AR = "阿根廷", NO = "挪威", AT = "奥地利",
|
|
+ TW = "台湾", ZA = "南非", TH = "泰国", DK = "丹麦", MY = "马来西亚",
|
|
+ PH = "菲律宾", SG = "新加坡", IE = "爱尔兰", HK = "香港", FI = "芬兰",
|
|
+ CL = "智利", PT = "葡萄牙", GR = "希腊", IL = "以色列", NZ = "新西兰",
|
|
+ CZ = "捷克", RO = "罗马尼亚", VN = "越南", UA = "乌克兰", HU = "匈牙利",
|
|
+ AE = "阿联酋", CO = "哥伦比亚", IN = "印度", EG = "埃及", PE = "秘鲁", TW = "台湾"
|
|
+ }
|
|
+ return country_names[countryCode]
|
|
+end
|
|
+
|
|
+function check_ip()
|
|
+ local e = {}
|
|
+ local port = 80
|
|
+ local geo_info = get_ip_geo_info(ip)
|
|
+ e.ip = geo_info.ip
|
|
+ e.flag = geo_info.flag
|
|
+ e.country = geo_info.country
|
|
+ e.isp = geo_info.isp
|
|
+ e.baidu = check_site('www.baidu.com', port)
|
|
+ e.taobao = check_site('www.taobao.com', port)
|
|
+ e.google = check_site('www.google.com', port)
|
|
+ e.youtube = check_site('www.youtube.com', port)
|
|
+ luci.http.prepare_content('application/json')
|
|
+ luci.http.write_json(e)
|
|
+end
|
|
+
|
|
function index_status()
|
|
local e = {}
|
|
e.dns_mode_status = luci.sys.call("netstat -apn | grep ':15353 ' >/dev/null") == 0
|
|
|
|
--- a/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
|
|
+++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/global.lua
|
|
@@ -547,6 +547,45 @@ function o.cfgvalue(self, section)
|
|
api.url("flush_set") .. "?redirect=1&reload=1", set_title)
|
|
end
|
|
|
|
+o = s:taboption("DNS", Flag, "adblock", translate("Enable adblock"))
|
|
+o.rmempty = false
|
|
+
|
|
+local UD="" rule_count="0"
|
|
+if nixio.fs.access("/usr/share/passwall/rules/block_host") then
|
|
+UD = os.date("%Y-%m-%d %H:%M", nixio.fs.stat("/usr/share/passwall/rules/block_host").ctime)
|
|
+rule_count = tonumber(luci.sys.exec("wc -l < /usr/share/passwall/rules/block_host"))
|
|
+end
|
|
+o = s:taboption("DNS", DummyValue, "refresh_data", translate("Subscribe Rules Data"))
|
|
+o.rawhtml = true
|
|
+o.template = appname .. "/global/adblock_refresh"
|
|
+o.value = rule_count.." "..translate("Records")
|
|
+o.description = string.format("<strong>"..translate("Last Update Checked")..":</strong> %s<br/>",UD)
|
|
+o:depends("adblock",1)
|
|
+
|
|
+o = s:taboption("DNS", DynamicList, "ad_url", translate("Adblock Rules Subscribe"))
|
|
+o:value("https://cdn.jsdelivr.net/gh/217heidai/adblockfilters@main/rules/adblockdomainlite.txt", translate("AdBlock DNS Filters"))
|
|
+o:value("https://cdn.jsdelivr.net/gh/privacy-protection-tools/anti-AD@master/anti-ad-domains.txt", translate("anti-AD"))
|
|
+o.default = "https://cdn.jsdelivr.net/gh/217heidai/adblockfilters@main/rules/adblockdomainlite.txt"
|
|
+o.description = translate("Support Domain / Dnsmasq / AdGuardHome / Hosts format list")
|
|
+o:depends("adblock",1)
|
|
+
|
|
+o = s:taboption("DNS", DynamicList, "white_list", translate("Adblock white list"))
|
|
+o.rmempty = true
|
|
+o:depends("adblock",1)
|
|
+function o.validate(self, value)
|
|
+ local vlist = (type(value) == "table") and value or { value }
|
|
+
|
|
+ for _, v in ipairs(vlist) do
|
|
+ if v and v ~= "" and not (
|
|
+ #v < 254 and v:match("^[a-zA-Z0-9][a-zA-Z0-9%-%.]*[a-zA-Z0-9]$") and v:match("%.")
|
|
+ ) then
|
|
+ return nil, translate("Invalid domain name") .. ": " .. v
|
|
+ end
|
|
+ end
|
|
+
|
|
+ return value
|
|
+end
|
|
+
|
|
s:tab("Proxy", translate("Mode"))
|
|
|
|
o = s:taboption("Proxy", Flag, "use_direct_list", translatef("Use %s", translate("Direct List")))
|
|
@@ -834,5 +855,6 @@ footer.api = api
|
|
footer.global_cfgid = global_cfgid
|
|
footer.shunt_list = api.jsonc.stringify(shunt_list)
|
|
m:append(footer)
|
|
+m:append(Template(appname .. "/global/status_bottom"))
|
|
|
|
return m
|
|
|
|
new file mode 100644
|
|
index 000000000000..a00fff9c79b3
|
|
--- /dev/null
|
|
+++ b/luci-app-passwall/luasrc/view/passwall/global/status_bottom.htm
|
|
@@ -0,0 +1,128 @@
|
|
+<style>
|
|
+.pure-img {
|
|
+ max-height: 100%;
|
|
+ width: auto;
|
|
+}
|
|
+.flag .pure-img {
|
|
+ max-height: none;
|
|
+ margin-top: -0.34rem;
|
|
+}
|
|
+.status-bar {
|
|
+ position: fixed;
|
|
+ bottom: 0;
|
|
+ right: 0;
|
|
+ box-shadow: 0 0 2rem 0 rgba(136, 152, 170, .3);
|
|
+ color: #525f7f;
|
|
+ background: #fff;
|
|
+ z-index: 5;
|
|
+ box-sizing: border-box;
|
|
+}
|
|
+
|
|
+.status-bar .inner {
|
|
+ margin: 0.5em;
|
|
+}
|
|
+
|
|
+.status-bar .inner .flag {
|
|
+ height: 2.6em;
|
|
+ display: block;
|
|
+ float: left;
|
|
+ margin-right: 1em;
|
|
+}
|
|
+
|
|
+.status-bar .inner .status-info {
|
|
+ font-weight: bold;
|
|
+}
|
|
+
|
|
+.status-bar .icon-con {
|
|
+ height: 2.6em;
|
|
+ text-align: right;
|
|
+}
|
|
+
|
|
+#cbi-passwall+.cbi-page-actions.control-group.fixed {
|
|
+ bottom: 3.3rem;
|
|
+}
|
|
+
|
|
+footer{
|
|
+display:block !important;
|
|
+}
|
|
+
|
|
+@media screen and (max-width: 700px) {
|
|
+.status-bar .icon-con {
|
|
+ height: 2.5em;
|
|
+}
|
|
+}
|
|
+</style>
|
|
+<div class="status-bar">
|
|
+ <div class="inner">
|
|
+ <div class="pure-g">
|
|
+ <div class="pure-u-1-2">
|
|
+ <span class="flag"><img src="/luci-static/passwall/flags/loading.svg" class="pure-img"></span> <span
|
|
+ class="status-info">获取中...</span>
|
|
+ </div>
|
|
+ <div class="pure-u-1-2">
|
|
+ <div class="icon-con">
|
|
+ <img src="/luci-static/passwall/img/site_icon1_01.png" class="pure-img i1">
|
|
+ <img src="/luci-static/passwall/img/site_icon1_02.png" class="pure-img i2">
|
|
+ <img src="/luci-static/passwall/img/site_icon1_03.png" class="pure-img i3">
|
|
+ <img src="/luci-static/passwall/img/site_icon1_04.png" class="pure-img i4">
|
|
+ </div>
|
|
+ </div>
|
|
+ </div>
|
|
+ </div>
|
|
+</div>
|
|
+
|
|
+<script>
|
|
+const _ASSETS = '/luci-static/passwall/';
|
|
+const CHECK_IP_URL = '<%=url([[admin]], [[services]], [[passwall]], [[ip]])%>';
|
|
+
|
|
+let wW = window.innerWidth;
|
|
+
|
|
+function resize() {
|
|
+ wW = window.innerWidth;
|
|
+ let lw = document.querySelector(".main-left")?.offsetWidth ?? 5;
|
|
+ let statusBar = document.querySelector(".status-bar");
|
|
+ statusBar.style.width = (wW - lw) + 'px';
|
|
+ let flagElement = statusBar.querySelector(".flag");
|
|
+ flagElement.style.width = (flagElement.offsetHeight / 3 * 4) + 'px';
|
|
+
|
|
+ document.querySelectorAll(".flag-icon").forEach(function(el) {
|
|
+ if (el.offsetHeight < 60) {
|
|
+ el.parentElement.style.height = '60px';
|
|
+ el.style.width = '60px';
|
|
+ } else {
|
|
+ el.style.width = el.offsetHeight + 'px';
|
|
+ }
|
|
+ });
|
|
+}
|
|
+
|
|
+function write_status(data) {
|
|
+ document.querySelector(".flag img").src = _ASSETS + "flags/" + data.flag + ".svg";
|
|
+ document.querySelector(".status-info").innerHTML = data.ip + "<br>" + data.country + " " + data.isp;
|
|
+ document.querySelector(".i1").src = data.baidu ? _ASSETS + "img/site_icon_01.png" : _ASSETS + "img/site_icon1_01.png";
|
|
+ document.querySelector(".i2").src = data.taobao ? _ASSETS + "img/site_icon_02.png" : _ASSETS + "img/site_icon1_02.png";
|
|
+ document.querySelector(".i3").src = data.google ? _ASSETS + "img/site_icon_03.png" : _ASSETS + "img/site_icon1_03.png";
|
|
+ document.querySelector(".i4").src = data.youtube ? _ASSETS + "img/site_icon_04.png" : _ASSETS + "img/site_icon1_04.png";
|
|
+ setTimeout(function() {
|
|
+ let event = new Event('iploaded');
|
|
+ document.body.dispatchEvent(event);
|
|
+ }, 200);
|
|
+}
|
|
+
|
|
+XHR.poll(5, CHECK_IP_URL, null,
|
|
+ function (x, data) {
|
|
+ write_status(data);
|
|
+ }
|
|
+ );
|
|
+
|
|
+document.addEventListener('DOMContentLoaded', function() {
|
|
+ setTimeout("resize()",200)
|
|
+ fetch(CHECK_IP_URL)
|
|
+ .then(response => response.json())
|
|
+ .then(data => {
|
|
+ write_status(data);
|
|
+ })
|
|
+ .catch(error => console.error('Error:', error));
|
|
+});
|
|
+
|
|
+window.addEventListener('resize', resize);
|
|
+</script>
|
|
|
|
--- a/luci-app-passwall/root/usr/share/passwall/0_default_config
|
|
+++ b/luci-app-passwall/root/usr/share/passwall/0_default_config
|
|
@@ -32,7 +32,7 @@ config global_haproxy
|
|
|
|
config global_delay
|
|
option start_daemon '1'
|
|
- option start_delay '60'
|
|
+ option start_delay '30'
|
|
|
|
config global_forwarding
|
|
option tcp_no_redir_ports 'disable'
|
|
@@ -57,13 +57,17 @@ config global_other
|
|
option show_node_info '0'
|
|
|
|
config global_rules
|
|
- option auto_update '0'
|
|
+ option auto_update '1'
|
|
option chnlist_update '1'
|
|
option chnroute_update '1'
|
|
option chnroute6_update '1'
|
|
option gfwlist_update '1'
|
|
- option geosite_update '0'
|
|
- option geoip_update '0'
|
|
+ option geosite_update '1'
|
|
+ option geoip_update '1'
|
|
+ option enable_geoview '1'
|
|
+ option geo2rule '1'
|
|
+ option week_update '7'
|
|
+ option time_update '4'
|
|
list gfwlist_url 'https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/gfw.txt'
|
|
list chnroute_url 'https://ispip.clang.cn/all_cn.txt'
|
|
list chnroute_url 'https://cdn.jsdelivr.net/gh/gaoyifan/china-operator-ip@ip-lists/china.txt'
|
|
@@ -72,8 +76,8 @@ config global_rules
|
|
list chnlist_url 'https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/accelerated-domains.china.conf'
|
|
list chnlist_url 'https://cdn.jsdelivr.net/gh/felixonmars/dnsmasq-china-list/apple.china.conf'
|
|
option v2ray_location_asset '/usr/share/v2ray/'
|
|
- option geoip_url 'https://github.com/Loyalsoldier/geoip/releases/latest/download/geoip.dat'
|
|
- option geosite_url 'https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat'
|
|
+ option geoip_url 'https://cdn.jsdelivr.net/gh/Loyalsoldier/geoip@release/geoip.dat'
|
|
+ option geosite_url 'https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat'
|
|
|
|
config global_app
|
|
option sing_box_file '/usr/bin/sing-box'
|
|
|
|
--- a/luci-app-passwall/root/usr/share/passwall/app.sh
|
|
+++ b/luci-app-passwall/root/usr/share/passwall/app.sh
|
|
@@ -1539,6 +1539,14 @@ start_dns() {
|
|
fi
|
|
}
|
|
|
|
+start_adblock() {
|
|
+ [ "$(config_t_get global adblock 0)" != "1" ] && {
|
|
+ [ -s $RULES_PATH/my_block_host ] && ln -sf $RULES_PATH/my_block_host $RULES_PATH/block_host || > $RULES_PATH/block_host
|
|
+ return
|
|
+ }
|
|
+ "$APP_PATH/adblock.sh" > /dev/null 2>&1 &
|
|
+}
|
|
+
|
|
start_haproxy() {
|
|
[ "$(config_t_get global_haproxy balancing_enable 0)" != "1" ] && return
|
|
haproxy_path=$TMP_PATH/haproxy
|
|
@@ -1853,6 +1861,7 @@ start() {
|
|
export ENABLE_DEPRECATED_GEOIP=true
|
|
export SS_SYSTEM_DNS_RESOLVER_FORCE_BUILTIN=1
|
|
ulimit -n 65535
|
|
+ start_adblock
|
|
start_haproxy
|
|
start_socks
|
|
nftflag=0
|
|
|
|
--- a/luci-app-passwall/luasrc/model/cbi/passwall/client/rule_list.lua
|
|
+++ b/luci-app-passwall/luasrc/model/cbi/passwall/client/rule_list.lua
|
|
@@ -152,7 +152,7 @@ o.validate = function(self, value)
|
|
end
|
|
|
|
---- Block Hosts
|
|
-local block_host = path .. "block_host"
|
|
+local block_host = path .. "my_block_host"
|
|
o = s:taboption("block_list", TextValue, "block_host", "", "<font color='red'>" .. translate("These had been joined websites will be block. Please input the domain names of websites, every line can input only one website domain. For example: twitter.com.") .. "</font>")
|
|
o.rows = 15
|
|
o.wrap = "off"
|
|
|
|
--- a/luci-app-passwall/po/zh-cn/passwall.po
|
|
+++ b/luci-app-passwall/po/zh-cn/passwall.po
|
|
@@ -1,6 +1,48 @@
|
|
msgid "Pass Wall"
|
|
msgstr "PassWall"
|
|
|
|
+msgid "Enable adblock"
|
|
+msgstr "启用广告屏蔽"
|
|
+
|
|
+msgid "Records"
|
|
+msgstr "条记录"
|
|
+
|
|
+msgid "Refresh..."
|
|
+msgstr "正在更新,请稍候.."
|
|
+
|
|
+msgid "No new data!"
|
|
+msgstr "已经是最新数据,无需更新"
|
|
+
|
|
+msgid "Refresh Error!"
|
|
+msgstr "更新失败!"
|
|
+
|
|
+msgid "Refresh OK!"
|
|
+msgstr "更新成功~"
|
|
+
|
|
+msgid "Total Records:"
|
|
+msgstr "新的总规则数:"
|
|
+
|
|
+msgid "Refresh Data"
|
|
+msgstr "更新订阅规则"
|
|
+
|
|
+msgid "Last Update Checked"
|
|
+msgstr "上一次规则更新时间"
|
|
+
|
|
+msgid "Subscribe Rules Data"
|
|
+msgstr "去广告规则"
|
|
+
|
|
+msgid "Support Domain / Dnsmasq / AdGuardHome / Hosts format list"
|
|
+msgstr "支持 域名/Dnsmasq/AdGuardHome/Hosts 格式的过滤列表"
|
|
+
|
|
+msgid "Adblock Rules Subscribe"
|
|
+msgstr "广告过滤列表URL"
|
|
+
|
|
+msgid "Adblock white list"
|
|
+msgstr "广告过滤白名单"
|
|
+
|
|
+msgid "Invalid domain name"
|
|
+msgstr "无效域名"
|
|
+
|
|
msgid "Auto"
|
|
msgstr "自动"
|
|
|
|
|
|
--- a/luci-app-passwall/luasrc/passwall/util_xray.lua
|
|
+++ b/luci-app-passwall/luasrc/passwall/util_xray.lua
|
|
@@ -152,7 +152,7 @@ function gen_outbound(flag, node, tag, proxy_table)
|
|
serverName = node.tls_serverName,
|
|
allowInsecure = (function()
|
|
if node.tls_pinSHA256 and node.tls_pinSHA256 ~= "" then return nil end
|
|
- if api.compare_versions(os.date("%Y.%m.%d"), "<", "2026.6.1") and node.tls_allowInsecure == "1" then return true end
|
|
+ if node.tls_allowInsecure == "1" then return true end
|
|
end)(),
|
|
fingerprint = (node.type == "Xray" and node.utls == "1" and node.fingerprint and node.fingerprint ~= "") and node.fingerprint or nil,
|
|
pinnedPeerCertSha256 = (function()
|