update 2023-02-09 19:06:24

This commit is contained in:
github-actions[bot]
2023-02-09 19:06:24 +08:00
parent 138b96fd7b
commit 3d77290cf3
29 changed files with 5207 additions and 16867 deletions

View File

@@ -10,7 +10,7 @@ PKG_NAME:=luci-app-cloudflarespeedtest
LUCI_TITLE:=LuCI support for Cloudflares Speed Test LUCI_TITLE:=LuCI support for Cloudflares Speed Test
LUCI_DEPENDS:=+cdnspeedtest +openssl-util +curl LUCI_DEPENDS:=+cdnspeedtest +openssl-util +curl
LUCI_PKGARCH:=all LUCI_PKGARCH:=all
PKG_VERSION:=1.4.9 PKG_VERSION:=1.5.0
PKG_RELEASE:=0 PKG_RELEASE:=0
PKG_LICENSE:=AGPL-3.0 PKG_LICENSE:=AGPL-3.0
PKG_MAINTAINER:=mingxiaoyu <fengying0347@163.com> PKG_MAINTAINER:=mingxiaoyu <fengying0347@163.com>

View File

@@ -249,7 +249,7 @@ function restart_app(){
echolog "passwall2重启完成" echolog "passwall2重启完成"
fi fi
if [ "x${bypass_started}" == "x1" ] ;then if [ "x${vssr_started}" == "x1" ] ;then
if [ $proxy_mode == "close" ] ;then if [ $proxy_mode == "close" ] ;then
uci set vssr.@global[0].global_server="${vssr_original_server}" uci set vssr.@global[0].global_server="${vssr_original_server}"
elif [ $proxy_mode == "gfw" ] ;then elif [ $proxy_mode == "gfw" ] ;then
@@ -260,7 +260,7 @@ function restart_app(){
echolog "Vssr重启完成" echolog "Vssr重启完成"
fi fi
if [ "x${vssr_started}" == "x1" ] ;then if [ "x${bypass_started}" == "x1" ] ;then
if [ $proxy_mode == "close" ] ;then if [ $proxy_mode == "close" ] ;then
uci set bypass.@global[0].global_server="${bypass_original_server}" uci set bypass.@global[0].global_server="${bypass_original_server}"
elif [ $proxy_mode == "gfw" ] ;then elif [ $proxy_mode == "gfw" ] ;then

View File

@@ -3,7 +3,7 @@ config mosdns 'mosdns'
option not_first_start '0' option not_first_start '0'
option enabled '0' option enabled '0'
option geo_auto_update '0' option geo_auto_update '0'
option geo_update_week_time 'all' option geo_update_week_time '*'
option geo_update_day_time '2' option geo_update_day_time '2'
option redirect '1' option redirect '1'
option autoconf '1' option autoconf '1'

View File

@@ -16,6 +16,24 @@ DISTRIB_TARGET = nil
LOG_FILE = "/tmp/log/" .. appname .. ".log" LOG_FILE = "/tmp/log/" .. appname .. ".log"
CACHE_PATH = "/tmp/etc/" .. appname .. "_tmp" CACHE_PATH = "/tmp/etc/" .. appname .. "_tmp"
function exec_call(cmd)
local process = io.popen(cmd .. '; echo -e "\n$?"')
local lines = {}
local result = ""
local return_code
for line in process:lines() do
lines[#lines + 1] = line
end
process:close()
if #lines > 0 then
return_code = lines[#lines]
for i = 1, #lines - 1 do
result = result .. lines[i] .. ((i == #lines - 1) and "" or "\n")
end
end
return tonumber(return_code), trim(result)
end
function base64Decode(text) function base64Decode(text)
local raw = text local raw = text
if not text then return '' end if not text then return '' end
@@ -39,11 +57,7 @@ function curl_base(url, file, args)
args[#args + 1] = "-o " .. file args[#args + 1] = "-o " .. file
end end
local cmd = string.format('curl %s "%s"', table_join(args), url) local cmd = string.format('curl %s "%s"', table_join(args), url)
if file then return exec_call(cmd)
return luci.sys.call(cmd .. " > /dev/null")
else
return trim(luci.sys.exec(cmd))
end
end end
function curl_proxy(url, file, args) function curl_proxy(url, file, args)
@@ -55,15 +69,15 @@ function curl_proxy(url, file, args)
tmp_args[#tmp_args + 1] = "-x socks5h://" .. socks_server tmp_args[#tmp_args + 1] = "-x socks5h://" .. socks_server
return curl_base(url, file, tmp_args) return curl_base(url, file, tmp_args)
end end
return nil return nil, nil
end end
function curl_logic(url, file, args) function curl_logic(url, file, args)
local result = curl_proxy(url, file, args) local return_code, result = curl_proxy(url, file, args)
if not result then if not return_code or return_code ~= 0 then
result = curl_base(url, file, args) return_code, result = curl_base(url, file, args)
end end
return result return return_code, result
end end
function url(...) function url(...)
@@ -628,9 +642,9 @@ end
function get_api_json(url) function get_api_json(url)
local jsonc = require "luci.jsonc" local jsonc = require "luci.jsonc"
local json_content = curl_logic(url, nil, curl_args) local return_code, content = curl_logic(url, nil, curl_args)
if json_content == "" then return {} end if return_code ~= 0 or content == "" then return {} end
return jsonc.parse(json_content) or {} return jsonc.parse(content) or {}
end end
function common_to_check(api_url, local_version, match_file_name) function common_to_check(api_url, local_version, match_file_name)

View File

@@ -63,7 +63,8 @@ function to_download(url, size)
end end
end end
result = api.curl_logic(url, tmp_file, api.curl_args) == 0 local return_code, result = api.curl_logic(url, tmp_file, api.curl_args)
result = return_code == 0
if not result then if not result then
api.exec("/bin/rm", {"-f", tmp_file}) api.exec("/bin/rm", {"-f", tmp_file})

View File

@@ -63,7 +63,8 @@ function to_download(url, size)
end end
end end
result = api.curl_logic(url, tmp_file, api.curl_args) == 0 local return_code, result = api.curl_logic(url, tmp_file, api.curl_args)
result = return_code == 0
if not result then if not result then
api.exec("/bin/rm", {"-f", tmp_file}) api.exec("/bin/rm", {"-f", tmp_file})

View File

@@ -71,7 +71,8 @@ function to_download(url, size)
end end
end end
result = api.curl_logic(url, tmp_file, api.curl_args) == 0 local return_code, result = api.curl_logic(url, tmp_file, api.curl_args)
result = return_code == 0
if not result then if not result then
api.exec("/bin/rm", {"-f", tmp_file}) api.exec("/bin/rm", {"-f", tmp_file})

View File

@@ -69,7 +69,8 @@ function to_download(url, size)
end end
end end
result = api.curl_logic(url, tmp_file, api.curl_args) == 0 local return_code, result = api.curl_logic(url, tmp_file, api.curl_args)
result = return_code == 0
if not result then if not result then
api.exec("/bin/rm", {"-f", tmp_file}) api.exec("/bin/rm", {"-f", tmp_file})

View File

@@ -69,7 +69,8 @@ function to_download(url, size)
end end
end end
result = api.curl_logic(url, tmp_file, api.curl_args) == 0 local return_code, result = api.curl_logic(url, tmp_file, api.curl_args)
result = return_code == 0
if not result then if not result then
api.exec("/bin/rm", {"-f", tmp_file}) api.exec("/bin/rm", {"-f", tmp_file})

View File

@@ -197,9 +197,6 @@ end
if api.is_finded("dns2socks") then if api.is_finded("dns2socks") then
dns_mode:value("dns2socks", "dns2socks") dns_mode:value("dns2socks", "dns2socks")
end end
if has_v2ray then
dns_mode:value("v2ray", "V2ray")
end
if has_xray then if has_xray then
dns_mode:value("xray", "Xray") dns_mode:value("xray", "Xray")
end end
@@ -209,7 +206,6 @@ o = s:taboption("DNS", ListValue, "v2ray_dns_mode", " ")
o:value("tcp", "TCP") o:value("tcp", "TCP")
o:value("doh", "DoH") o:value("doh", "DoH")
o:value("fakedns", "FakeDNS") o:value("fakedns", "FakeDNS")
o:depends("dns_mode", "v2ray")
o:depends("dns_mode", "xray") o:depends("dns_mode", "xray")
o.validate = function(self, value, t) o.validate = function(self, value, t)
if value == "fakedns" then if value == "fakedns" then
@@ -274,8 +270,6 @@ o:depends("v2ray_dns_mode", "doh")
o = s:taboption("DNS", Flag, "dns_cache", translate("Cache Resolved")) o = s:taboption("DNS", Flag, "dns_cache", translate("Cache Resolved"))
o.default = "1" o.default = "1"
o:depends({dns_mode = "dns2socks"}) o:depends({dns_mode = "dns2socks"})
o:depends({dns_mode = "v2ray", v2ray_dns_mode = "tcp"})
o:depends({dns_mode = "v2ray", v2ray_dns_mode = "doh"})
o:depends({dns_mode = "xray", v2ray_dns_mode = "tcp"}) o:depends({dns_mode = "xray", v2ray_dns_mode = "tcp"})
o:depends({dns_mode = "xray", v2ray_dns_mode = "doh"}) o:depends({dns_mode = "xray", v2ray_dns_mode = "doh"})
o.rmempty = false o.rmempty = false
@@ -285,8 +279,6 @@ if has_chnlist and api.is_finded("chinadns-ng") then
o.default = "0" o.default = "0"
o:depends({dns_mode = "dns2socks"}) o:depends({dns_mode = "dns2socks"})
o:depends({dns_mode = "dns2tcp"}) o:depends({dns_mode = "dns2tcp"})
o:depends({dns_mode = "v2ray", v2ray_dns_mode = "tcp"})
o:depends({dns_mode = "v2ray", v2ray_dns_mode = "doh"})
o:depends({dns_mode = "xray", v2ray_dns_mode = "tcp"}) o:depends({dns_mode = "xray", v2ray_dns_mode = "tcp"})
o:depends({dns_mode = "xray", v2ray_dns_mode = "doh"}) o:depends({dns_mode = "xray", v2ray_dns_mode = "doh"})
o:depends({dns_mode = "udp"}) o:depends({dns_mode = "udp"})

View File

@@ -0,0 +1,6 @@
#!/bin/sh
[[ "$ACTION" == "ifup" && $(uci get "passwall.@global[0].enabled") == "1" ]] && {
/etc/init.d/passwall restart
echo "passwall: restart when $INTERFACE ifup" > /dev/kmsg
}

View File

@@ -924,7 +924,7 @@ start_redir() {
start_socks() { start_socks() {
tcp_node_socks=1 tcp_node_socks=1
tcp_node_socks_port=$(config_t_get global tcp_node_socks_port 1070) tcp_node_socks_port=$(get_new_port $(config_t_get global tcp_node_socks_port 1070))
tcp_node_http_port=$(config_t_get global tcp_node_http_port 0) tcp_node_http_port=$(config_t_get global tcp_node_http_port 0)
[ "$tcp_node_http_port" != "0" ] && tcp_node_http=1 [ "$tcp_node_http_port" != "0" ] && tcp_node_http=1
[ "$SOCKS_ENABLED" = "1" ] && { [ "$SOCKS_ENABLED" = "1" ] && {
@@ -1079,7 +1079,7 @@ start_dns() {
local config_file=$TMP_PATH/DNS.json local config_file=$TMP_PATH/DNS.json
local log_file=$TMP_PATH/DNS.log local log_file=$TMP_PATH/DNS.log
local log_file=/dev/null local log_file=/dev/null
local _v2ray_args="config_file=$config_file log_file=$log_file" local _v2ray_args="type=$DNS_MODE config_file=$config_file log_file=$log_file"
[ "${DNS_CACHE}" == "0" ] && _v2ray_args="${_v2ray_args} dns_cache=0" [ "${DNS_CACHE}" == "0" ] && _v2ray_args="${_v2ray_args} dns_cache=0"
_v2ray_args="${_v2ray_args} dns_query_strategy=${DNS_QUERY_STRATEGY}" _v2ray_args="${_v2ray_args} dns_query_strategy=${DNS_QUERY_STRATEGY}"
local _dns_client_ip=$(config_t_get global dns_client_ip) local _dns_client_ip=$(config_t_get global dns_client_ip)

View File

@@ -66,13 +66,8 @@ local function curl(url, file, valifile)
if valifile then if valifile then
args[#args + 1] = "--dump-header " .. valifile args[#args + 1] = "--dump-header " .. valifile
end end
local result = api.curl_logic(url, nil, args) local return_code, result = api.curl_logic(url, nil, args)
return tonumber(result)
if file then
return tonumber(trim(result))
else
return trim(result)
end
end end
--check excluded domain --check excluded domain
@@ -246,7 +241,7 @@ end
local function fetch_geoip() local function fetch_geoip()
--请求geoip --请求geoip
xpcall(function() xpcall(function()
local json_str = curl(geoip_api) local json_str = api.curl_logic(geoip_api)
local json = jsonc.parse(json_str) local json = jsonc.parse(json_str)
if json.tag_name and json.assets then if json.tag_name and json.assets then
for _, v in ipairs(json.assets) do for _, v in ipairs(json.assets) do
@@ -297,7 +292,7 @@ end
local function fetch_geosite() local function fetch_geosite()
--请求geosite --请求geosite
xpcall(function() xpcall(function()
local json_str = curl(geosite_api) local json_str = api.curl_logic(geosite_api)
local json = jsonc.parse(json_str) local json = jsonc.parse(json_str)
if json.tag_name and json.assets then if json.tag_name and json.assets then
for _, v in ipairs(json.assets) do for _, v in ipairs(json.assets) do
@@ -345,24 +340,26 @@ local function fetch_geosite()
end end
if arg[2] then if arg[2] then
if arg[2]:find("gfwlist") then string.gsub(arg[2], '[^' .. "," .. ']+', function(w)
gfwlist_update = 1 if w == "gfwlist" then
end gfwlist_update = 1
if arg[2]:find("chnroute") then end
chnroute_update = 1 if w == "chnroute" then
end chnroute_update = 1
if arg[2]:find("chnroute6") then end
chnroute6_update = 1 if w == "chnroute6" then
end chnroute6_update = 1
if arg[2]:find("chnlist") then end
chnlist_update = 1 if w == "chnlist" then
end chnlist_update = 1
if arg[2]:find("geoip") then end
geoip_update = 1 if w == "geoip" then
end geoip_update = 1
if arg[2]:find("geosite") then end
geosite_update = 1 if w == "geosite" then
end geosite_update = 1
end
end)
else else
gfwlist_update = ucic:get_first(name, 'global_rules', "gfwlist_update", 1) gfwlist_update = ucic:get_first(name, 'global_rules', "gfwlist_update", 1)
chnroute_update = ucic:get_first(name, 'global_rules', "chnroute_update", 1) chnroute_update = ucic:get_first(name, 'global_rules', "chnroute_update", 1)

View File

@@ -1134,6 +1134,7 @@
135309.com 135309.com
135320.com 135320.com
135650.com 135650.com
13567.com
1356789.com 1356789.com
1356net.com 1356net.com
135958.com 135958.com
@@ -1276,6 +1277,7 @@
163663.com 163663.com
163686.com 163686.com
1637.com 1637.com
163888.net
163cdn.com 163cdn.com
163cn.tv 163cn.tv
163cp.com 163cp.com
@@ -1925,6 +1927,7 @@
210997.com 210997.com
210z.com 210z.com
2113.net 2113.net
2114.com
2115.com 2115.com
211600.com 211600.com
211ic.com 211ic.com
@@ -2555,7 +2558,6 @@
3259.com 3259.com
326pay.com 326pay.com
32800.com 32800.com
328888.xyz
328f.com 328f.com
328vip.com 328vip.com
3290.com 3290.com
@@ -3857,7 +3859,6 @@
51job.com 51job.com
51jobcdn.com 51jobcdn.com
51jobdns.com 51jobdns.com
51joyfish.com
51js.com 51js.com
51jt.com 51jt.com
51jucaimi.com 51jucaimi.com
@@ -4473,6 +4474,7 @@
5433.com 5433.com
545c.com 545c.com
5460.net 5460.net
54674479.com
5490146.cc 5490146.cc
5490196.cc 5490196.cc
5499.com 5499.com
@@ -4491,6 +4493,7 @@
54md.com 54md.com
54op.com 54op.com
54pictu.com 54pictu.com
54qs.com
54tf.com 54tf.com
54traveler.com 54traveler.com
54tusi.com 54tusi.com
@@ -4756,6 +4759,7 @@
593yx.com 593yx.com
5947.net 5947.net
59490.com 59490.com
5951835ccc.com
595818.com 595818.com
595led.com 595led.com
595tuchuang.com 595tuchuang.com
@@ -5109,6 +5113,7 @@
6543210.com 6543210.com
654321wan.com 654321wan.com
654h.com 654h.com
65522v.com
655a.com 655a.com
655u.com 655u.com
655yx.com 655yx.com
@@ -5407,6 +5412,7 @@
711pr.com 711pr.com
7120.com 7120.com
712100.com 712100.com
71268924.com
71360.com 71360.com
7139.com 7139.com
715083.com 715083.com
@@ -5979,6 +5985,7 @@
861817.com 861817.com
86215.com 86215.com
8624x.com 8624x.com
86255845.com
86262.com 86262.com
8633.com 8633.com
863347.com 863347.com
@@ -6167,6 +6174,7 @@
89dj.com 89dj.com
89ds.com 89ds.com
89hl.com 89hl.com
89qw.com
89uu.com 89uu.com
8a.hk 8a.hk
8ao8ao.com 8ao8ao.com
@@ -7037,7 +7045,6 @@
9txs.org 9txs.org
9u.net 9u.net
9upk.com 9upk.com
9v.com
9vf.com 9vf.com
9w9.com 9w9.com
9wee.com 9wee.com
@@ -7906,6 +7913,7 @@ aituan.com
aitupian.com aitupian.com
aituwo.com aituwo.com
aityp.com aityp.com
aiufida.com
aiurl.com aiurl.com
aiuw.com aiuw.com
aiuxdesign.com aiuxdesign.com
@@ -8733,7 +8741,6 @@ apgblogs.com
apgoview.com apgoview.com
aphidic.com aphidic.com
api.anythinktech.com api.anythinktech.com
api.bz
apiadmin.org apiadmin.org
apiairasia.com apiairasia.com
apicase.io apicase.io
@@ -11150,6 +11157,7 @@ bjythd.com
bjyunyu.com bjyunyu.com
bjywt.com bjywt.com
bjzaxy.com bjzaxy.com
bjzbb.com
bjzbkj.com bjzbkj.com
bjzcha.com bjzcha.com
bjzcth.com bjzcth.com
@@ -11986,6 +11994,7 @@ bytesmanager.com
bytestacks.com bytestacks.com
bytetcc.com bytetcc.com
bytetos.com bytetos.com
bytewars.cc
bytexns.com bytexns.com
bytexservice.com bytexservice.com
byts.com byts.com
@@ -12651,7 +12660,6 @@ ccpitqd.org
ccpitsd.com ccpitsd.com
ccpittex.com ccpittex.com
ccpittj.org ccpittj.org
ccpitwh.org
ccpitxiamen.org ccpitxiamen.org
ccpitxian.org ccpitxian.org
ccpitxj.org ccpitxj.org
@@ -12872,9 +12880,11 @@ cdnhwc3.com
cdnhwc5.com cdnhwc5.com
cdnhwc6.com cdnhwc6.com
cdnhwc8.com cdnhwc8.com
cdnhwcbzj102.com
cdnhwcedt124.com cdnhwcedt124.com
cdnhwchcg02.com cdnhwchcg02.com
cdnhwcibv122.com cdnhwcibv122.com
cdnhwctnm107.com
cdnidc.net cdnidc.net
cdnjtzy.com cdnjtzy.com
cdnle.com cdnle.com
@@ -13105,6 +13115,7 @@ cf-ns.net
cf.com cf.com
cf69.com cf69.com
cf865.com cf865.com
cf9q4i.xyz
cfachina.org cfachina.org
cfbond.com cfbond.com
cfc365.com cfc365.com
@@ -15412,7 +15423,6 @@ cnhacker.com
cnhaio.com cnhaio.com
cnhalo.net cnhalo.net
cnhan.com cnhan.com
cnhandan.com
cnhanxing.com cnhanxing.com
cnhaoshengyi.com cnhaoshengyi.com
cnhaskell.com cnhaskell.com
@@ -17398,7 +17408,6 @@ dashoucloud.com
dashuihua.com dashuihua.com
dashuju123.com dashuju123.com
dashuye.com dashuye.com
dasougu.com
dasoujia.com dasoujia.com
dassm.com dassm.com
dasung.com dasung.com
@@ -17680,7 +17689,6 @@ ddwhm.com
ddwzh.com ddwzh.com
ddxinwen.com ddxinwen.com
ddxq.mobi ddxq.mobi
ddxs.cc
ddxstxt8.com ddxstxt8.com
ddyqh.com ddyqh.com
ddyun.com ddyun.com
@@ -19095,7 +19103,6 @@ drip.im
dripcar.com dripcar.com
driverdevelop.com driverdevelop.com
drivergenius.com drivergenius.com
driversdown.com
driverzeng.com driverzeng.com
drivethelife.com drivethelife.com
drli.group drli.group
@@ -19741,7 +19748,6 @@ eastcompeace.com
eastcoms.com eastcoms.com
eastday.com eastday.com
eastdesign.net eastdesign.net
eastdigit.com
eastdrama.com eastdrama.com
eastdushi.com eastdushi.com
easteat.com easteat.com
@@ -21608,6 +21614,7 @@ fenglinjiu.com
fengmanginfo.com fengmanginfo.com
fengmaniu.com fengmaniu.com
fengmeng.net fengmeng.net
fengmi-baike.com
fengmk2.com fengmk2.com
fengniao.com fengniao.com
fengniaohuanjing.com fengniaohuanjing.com
@@ -22233,7 +22240,6 @@ fqnovelpic.com
fqnovelstatic.com fqnovelstatic.com
fqnovelvod.com fqnovelvod.com
fqpai.com fqpai.com
fqsszx.com
fqxs.org fqxs.org
fr-odc.samsungapps.com fr-odc.samsungapps.com
fr-trading.com fr-trading.com
@@ -25776,7 +25782,6 @@ hbsia.org
hbskw.com hbskw.com
hbslndx.com hbslndx.com
hbsmservice.com hbsmservice.com
hbsmw.com
hbsocar.com hbsocar.com
hbsoft.net hbsoft.net
hbsogdjt.com hbsogdjt.com
@@ -26181,7 +26186,6 @@ hengxiangtaji.com
hengxinjinshu.com hengxinjinshu.com
hengxueedu.com hengxueedu.com
hengyan.com hengyan.com
hengyer.com
hengyidai.com hengyidai.com
hengyigl.com hengyigl.com
hengyoux.com hengyoux.com
@@ -26661,7 +26665,6 @@ hkwb.net
hkxbjt.com hkxbjt.com
hkxen.com hkxen.com
hkyykq.com hkyykq.com
hkzcdn.com
hkzlcm.com hkzlcm.com
hl-brushes.com hl-brushes.com
hl95.com hl95.com
@@ -27060,6 +27063,7 @@ hookbase.com
hookdll.com hookdll.com
hoolai.com hoolai.com
hoolaigames.com hoolaigames.com
hoolee8.com
hoolinks.com hoolinks.com
hoolo.tv hoolo.tv
hoop-archi.com hoop-archi.com
@@ -27492,7 +27496,6 @@ huaguoshan.com
huahanart.com huahanart.com
huahua777.com huahua777.com
huahuacaocao.com huahuacaocao.com
huahuakon.com
huahuo.com huahuo.com
huaibaobei.com huaibaobei.com
huaibei.com huaibei.com
@@ -28257,6 +28260,7 @@ hxsd.tv
hxsec.com hxsec.com
hxshx.com hxshx.com
hxsme.org hxsme.org
hxstrive.com
hxtk.com hxtk.com
hxwglm.com hxwglm.com
hxxkw.org hxxkw.org
@@ -28796,6 +28800,7 @@ icloudgslb.com
icloudnative.io icloudnative.io
icloudnews.net icloudnews.net
iclouds.work iclouds.work
icloudv6.com
icloudwaf.com icloudwaf.com
icmade.com icmade.com
icme14.org icme14.org
@@ -29097,6 +29102,7 @@ ifjing.com
iflyhealth.com iflyhealth.com
iflying.com iflying.com
iflyink.com iflyink.com
iflynote.com
iflyos.vip iflyos.vip
iflyread.com iflyread.com
iflyrec.com iflyrec.com
@@ -29517,7 +29523,6 @@ imgii.com
imgkr.com imgkr.com
imglefeng.com imglefeng.com
imglink.win imglink.win
imgloc.com
imgo.tv imgo.tv
imgscdn.com imgscdn.com
imgse.com imgse.com
@@ -30223,6 +30228,7 @@ itaoyun.com
itavcn.com itavcn.com
itbegin.com itbegin.com
itbeihe.com itbeihe.com
itbiancheng.com
itbiaoju.com itbiaoju.com
itbilu.com itbilu.com
itbkz.com itbkz.com
@@ -30412,6 +30418,7 @@ iuctrip.com
iudodo.com iudodo.com
iufida.com iufida.com
iuinns.com iuinns.com
iun2s8.xyz
iuni.com iuni.com
iuoooo.com iuoooo.com
iuplus.com iuplus.com
@@ -32155,7 +32162,6 @@ jocat.com
joe92.com joe92.com
joenchen.com joenchen.com
johhan.com johhan.com
johnwatsondev.com
johogames.com johogames.com
joiest.com joiest.com
joinchitchat.com joinchitchat.com
@@ -33664,7 +33670,6 @@ kintiger.com
kinval.com kinval.com
kinzoncap.com kinzoncap.com
kirgen.com kirgen.com
kirikira.com
kirimasharo.com kirimasharo.com
kirin-tech.com kirin-tech.com
kirincloud.net kirincloud.net
@@ -34410,7 +34415,6 @@ kx516.com
kx7p.com kx7p.com
kxapp.com kxapp.com
kxapps.com kxapps.com
kxbaidu.com
kxbox.com kxbox.com
kxcblog.com kxcblog.com
kxceping.com kxceping.com
@@ -34440,6 +34444,7 @@ kxxsc.com
kxxxl.com kxxxl.com
kxzmw.com kxzmw.com
ky-express.com ky-express.com
ky0001.vip
ky0048.cc ky0048.cc
ky010.vip ky010.vip
ky107.co ky107.co
@@ -34661,6 +34666,7 @@ langren8.com
langrencard.com langrencard.com
langrenclub.com langrenclub.com
langrensha.net langrensha.net
langtao.cc
langtaojin.com langtaojin.com
langtze.com langtze.com
languangdy.com languangdy.com
@@ -36153,6 +36159,7 @@ lm284.com
lm335.com lm335.com
lm553.com lm553.com
lm685.com lm685.com
lm7979.com
lm9999.com lm9999.com
lmacc.com lmacc.com
lmanmo.com lmanmo.com
@@ -37698,6 +37705,7 @@ mdvoo.com
mdy-edu.com mdy-edu.com
mdybk.com mdybk.com
mdydt.net mdydt.net
mdzgjx.com
me-city.com me-city.com
me361.com me361.com
me4399.com me4399.com
@@ -39669,6 +39677,7 @@ n127.com
n12m.cc n12m.cc
n18081.com n18081.com
n21.cc n21.cc
n28082.com
n3293.com n3293.com
n3762.com n3762.com
n3875.com n3875.com
@@ -39885,7 +39894,6 @@ ncacg.org
ncartfoundation.org ncartfoundation.org
ncdxbbs.com ncdxbbs.com
ncfcsa.org ncfcsa.org
ncfcw.net
ncfgroup.com ncfgroup.com
ncfwx.com ncfwx.com
ncfxwhjjh.com ncfxwhjjh.com
@@ -41016,7 +41024,6 @@ okii.com
okinfo.org okinfo.org
okjike.com okjike.com
okjk.co okjk.co
okjoys.com
okjx.cc okjx.cc
okki.com okki.com
okkkk.com okkkk.com
@@ -43434,7 +43441,6 @@ qiansw.com
qiantucdn.com qiantucdn.com
qianvisa.com qianvisa.com
qianwa.com qianwa.com
qianwee.com
qianxiangbank.com qianxiangbank.com
qianxibj.net qianxibj.net
qianxin.com qianxin.com
@@ -44802,6 +44808,7 @@ rdbuy.com
rdcy.org rdcy.org
rddoc.com rddoc.com
rdgz.org rdgz.org
rdhyw.com
rdidc.com rdidc.com
rdnsdb.com rdnsdb.com
rdplat.com rdplat.com
@@ -49409,6 +49416,7 @@ suobuy.com
suofeiya.com suofeiya.com
suofeiyashop.com suofeiyashop.com
suoge.net suoge.net
suokao.com
suosihulian.com suosihulian.com
suoxin5.com suoxin5.com
suoyiren.com suoyiren.com
@@ -49911,6 +49919,7 @@ szider.com
szisland.com szisland.com
szjcyyy.com szjcyyy.com
szjhxjt.com szjhxjt.com
szjinhuanyu.com
szjlwul.com szjlwul.com
szjunfei.com szjunfei.com
szjuquan.com szjuquan.com
@@ -50507,6 +50516,7 @@ tciplay.com
tcl.com tcl.com
tclbusiness.com tclbusiness.com
tclclouds.com tclclouds.com
tcljd.com
tclking.com tclking.com
tclkqn.com tclkqn.com
tcloudbase.com tcloudbase.com
@@ -51200,6 +51210,7 @@ tingke8.com
tingliku.com tingliku.com
tingmall.com tingmall.com
tingmimi.net tingmimi.net
tingniukeji.com
tingroom.com tingroom.com
tingshuge.com tingshuge.com
tingsonglaw.com tingsonglaw.com
@@ -51453,6 +51464,7 @@ toec.com
toecsec.com toecsec.com
toecsoft.com toecsoft.com
toecxy.com toecxy.com
tofengmi.com
togj.com togj.com
togocareer.com togocareer.com
togogo.net togogo.net
@@ -52586,6 +52598,7 @@ u6u.com
u77.com u77.com
u78.com u78.com
u7u9.com u7u9.com
u8376.com
u8sy.com u8sy.com
u8yx.com u8yx.com
u9game.net u9game.net
@@ -52594,7 +52607,6 @@ u9time.com
u9u8.com u9u8.com
u9u9.com u9u9.com
u9wan.com u9wan.com
ua168.com
uahh.site uahh.site
uami-global.org uami-global.org
uao-online.com uao-online.com
@@ -55666,7 +55678,6 @@ wj001.com
wj166.com wj166.com
wjajw.com wjajw.com
wjasset.com wjasset.com
wjbb.com
wjbk.site wjbk.site
wjceo.com wjceo.com
wjdaily.com wjdaily.com
@@ -55829,6 +55840,7 @@ wnzhuishu.com
wnzy.net wnzy.net
wo-smart.com wo-smart.com
wo-xa.com wo-xa.com
wo.cc
wo113.net wo113.net
wo116114.com wo116114.com
wo123.com wo123.com
@@ -60726,7 +60738,6 @@ yoolin.cc
yoooooooooo.com yoooooooooo.com
yoopu.me yoopu.me
yootou.com yootou.com
yoouxi.com
yooxun.com yooxun.com
yooxuu.com yooxuu.com
yooyoo360.com yooyoo360.com
@@ -61232,7 +61243,6 @@ ytcos.com
ytcutv.com ytcutv.com
ytdaily.com ytdaily.com
ytdcloud.com ytdcloud.com
ytdfcw.com
yte1.com yte1.com
yteng.net yteng.net
ytesting.com ytesting.com
@@ -62165,7 +62175,6 @@ zampdmp.com
zampdsp.com zampdsp.com
zamplink.net zamplink.net
zamplus.com zamplus.com
zan-shang.com
zanba.com zanba.com
zanbai.com zanbai.com
zangaifamily.com zangaifamily.com
@@ -63593,6 +63602,7 @@ zichenit.com
zidan.chat zidan.chat
zidanduanxin.com zidanduanxin.com
zidanduanxin.net zidanduanxin.net
zidg.com
zidian8.com zidian8.com
zidianwang.com zidianwang.com
zidoo.tv zidoo.tv

View File

@@ -170,7 +170,6 @@
2400:3fc0::/32 2400:3fc0::/32
2400:4440::/32 2400:4440::/32
2400:44c0::/32 2400:44c0::/32
2400:44e0::/32
2400:4540::/32 2400:4540::/32
2400:4600::/32 2400:4600::/32
2400:4640::/32 2400:4640::/32

File diff suppressed because it is too large Load Diff

View File

@@ -837,8 +837,8 @@ local function curl(url, file, ua)
local args = { local args = {
"-skL", "--retry 3", "--connect-timeout 3", '--user-agent "' .. ua .. '"' "-skL", "--retry 3", "--connect-timeout 3", '--user-agent "' .. ua .. '"'
} }
local result = api.curl_logic(url, file, args) local return_code, result = api.curl_logic(url, file, args)
return result return return_code
end end
local function truncate_nodes(add_from) local function truncate_nodes(add_from)

View File

@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall2 PKG_NAME:=luci-app-passwall2
PKG_VERSION:=1.8 PKG_VERSION:=1.8
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_CONFIG_DEPENDS:= \ PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_$(PKG_NAME)_Transparent_Proxy \ CONFIG_PACKAGE_$(PKG_NAME)_Transparent_Proxy \

View File

@@ -13,6 +13,24 @@ command_timeout = 300
LEDE_BOARD = nil LEDE_BOARD = nil
DISTRIB_TARGET = nil DISTRIB_TARGET = nil
function exec_call(cmd)
local process = io.popen(cmd .. '; echo -e "\n$?"')
local lines = {}
local result = ""
local return_code
for line in process:lines() do
lines[#lines + 1] = line
end
process:close()
if #lines > 0 then
return_code = lines[#lines]
for i = 1, #lines - 1 do
result = result .. lines[i] .. ((i == #lines - 1) and "" or "\n")
end
end
return tonumber(return_code), trim(result)
end
function base64Decode(text) function base64Decode(text)
local raw = text local raw = text
if not text then return '' end if not text then return '' end
@@ -36,11 +54,7 @@ function curl_base(url, file, args)
args[#args + 1] = "-o " .. file args[#args + 1] = "-o " .. file
end end
local cmd = string.format('curl %s "%s"', table_join(args), url) local cmd = string.format('curl %s "%s"', table_join(args), url)
if file then return exec_call(cmd)
return luci.sys.call(cmd .. " > /dev/null")
else
return trim(luci.sys.exec(cmd))
end
end end
function curl_proxy(url, file, args) function curl_proxy(url, file, args)
@@ -52,15 +66,15 @@ function curl_proxy(url, file, args)
tmp_args[#tmp_args + 1] = "-x socks5h://" .. socks_server tmp_args[#tmp_args + 1] = "-x socks5h://" .. socks_server
return curl_base(url, file, tmp_args) return curl_base(url, file, tmp_args)
end end
return nil return nil, nil
end end
function curl_logic(url, file, args) function curl_logic(url, file, args)
local result = curl_proxy(url, file, args) local return_code, result = curl_proxy(url, file, args)
if not result then if not return_code or return_code ~= 0 then
result = curl_base(url, file, args) return_code, result = curl_base(url, file, args)
end end
return result return return_code, result
end end
function url(...) function url(...)
@@ -600,9 +614,9 @@ end
function get_api_json(url) function get_api_json(url)
local jsonc = require "luci.jsonc" local jsonc = require "luci.jsonc"
local json_content = curl_logic(url, nil, curl_args) local return_code, content = curl_logic(url, nil, curl_args)
if json_content == "" then return {} end if return_code ~= 0 or content == "" then return {} end
return jsonc.parse(json_content) or {} return jsonc.parse(content) or {}
end end
function common_to_check(api_url, local_version, match_file_name) function common_to_check(api_url, local_version, match_file_name)

View File

@@ -63,7 +63,8 @@ function to_download(url, size)
end end
end end
result = api.curl_logic(url, tmp_file, api.curl_args) == 0 local return_code, result = api.curl_logic(url, tmp_file, api.curl_args)
result = return_code == 0
if not result then if not result then
api.exec("/bin/rm", {"-f", tmp_file}) api.exec("/bin/rm", {"-f", tmp_file})

View File

@@ -63,7 +63,8 @@ function to_download(url, size)
end end
end end
result = api.curl_logic(url, tmp_file, api.curl_args) == 0 local return_code, result = api.curl_logic(url, tmp_file, api.curl_args)
result = return_code == 0
if not result then if not result then
api.exec("/bin/rm", {"-f", tmp_file}) api.exec("/bin/rm", {"-f", tmp_file})

View File

@@ -69,7 +69,8 @@ function to_download(url, size)
end end
end end
result = api.curl_logic(url, tmp_file, api.curl_args) == 0 local return_code, result = api.curl_logic(url, tmp_file, api.curl_args)
result = return_code == 0
if not result then if not result then
api.exec("/bin/rm", {"-f", tmp_file}) api.exec("/bin/rm", {"-f", tmp_file})

View File

@@ -69,7 +69,8 @@ function to_download(url, size)
end end
end end
result = api.curl_logic(url, tmp_file, api.curl_args) == 0 local return_code, result = api.curl_logic(url, tmp_file, api.curl_args)
result = return_code == 0
if not result then if not result then
api.exec("/bin/rm", {"-f", tmp_file}) api.exec("/bin/rm", {"-f", tmp_file})

View File

@@ -34,12 +34,6 @@ local log = function(...)
end end
end end
-- trim
local function trim(text)
if not text or text == "" then return "" end
return (string.gsub(text, "^%s*(.-)%s*$", "%1"))
end
-- curl -- curl
local function curl(url, file) local function curl(url, file)
local args = { local args = {
@@ -48,20 +42,15 @@ local function curl(url, file)
if file then if file then
args[#args + 1] = "-o " .. file args[#args + 1] = "-o " .. file
end end
local result = api.curl_logic(url, nil, args) local return_code, result = api.curl_logic(url, nil, args)
return tonumber(result)
if file then
return tonumber(trim(result))
else
return trim(result)
end
end end
--获取geoip --获取geoip
local function fetch_geoip() local function fetch_geoip()
--请求geoip --请求geoip
xpcall(function() xpcall(function()
local json_str = curl(geoip_api) local json_str = api.curl_logic(geoip_api)
local json = jsonc.parse(json_str) local json = jsonc.parse(json_str)
if json.tag_name and json.assets then if json.tag_name and json.assets then
for _, v in ipairs(json.assets) do for _, v in ipairs(json.assets) do
@@ -112,7 +101,7 @@ end
local function fetch_geosite() local function fetch_geosite()
--请求geosite --请求geosite
xpcall(function() xpcall(function()
local json_str = curl(geosite_api) local json_str = api.curl_logic(geosite_api)
local json = jsonc.parse(json_str) local json = jsonc.parse(json_str)
if json.tag_name and json.assets then if json.tag_name and json.assets then
for _, v in ipairs(json.assets) do for _, v in ipairs(json.assets) do
@@ -160,12 +149,14 @@ local function fetch_geosite()
end end
if arg[2] then if arg[2] then
if arg[2]:find("geoip") then string.gsub(arg[2], '[^' .. "," .. ']+', function(w)
geoip_update = 1 if w == "geoip" then
end geoip_update = 1
if arg[2]:find("geosite") then end
geosite_update = 1 if w == "geosite" then
end geosite_update = 1
end
end)
else else
geoip_update = ucic:get_first(name, 'global_rules', "geoip_update", 1) geoip_update = ucic:get_first(name, 'global_rules', "geoip_update", 1)
geosite_update = ucic:get_first(name, 'global_rules', "geosite_update", 1) geosite_update = ucic:get_first(name, 'global_rules', "geosite_update", 1)

View File

@@ -706,8 +706,8 @@ local function curl(url, file, ua)
local args = { local args = {
"-skL", "--retry 3", "--connect-timeout 3", '--user-agent "' .. ua .. '"' "-skL", "--retry 3", "--connect-timeout 3", '--user-agent "' .. ua .. '"'
} }
local result = api.curl_logic(url, file, args) local return_code, result = api.curl_logic(url, file, args)
return result return return_code
end end
local function truncate_nodes(add_from) local function truncate_nodes(add_from)

View File

@@ -11,7 +11,7 @@ LUCI_DEPENDS:=+curl +opkg +luci-base +tar +coreutils +coreutils-stat +libuci-lua
LUCI_EXTRA_DEPENDS:=luci-lib-taskd (>=1.0.17) LUCI_EXTRA_DEPENDS:=luci-lib-taskd (>=1.0.17)
LUCI_PKGARCH:=all LUCI_PKGARCH:=all
PKG_VERSION:=0.1.12-9 PKG_VERSION:=0.1.12-10
# PKG_RELEASE MUST be empty for luci.mk # PKG_RELEASE MUST be empty for luci.mk
PKG_RELEASE:= PKG_RELEASE:=

View File

@@ -230,12 +230,15 @@ function store_action(param)
local pkg local pkg
for pkg in itr do for pkg in itr do
if pkg:match("^.*%.json$") then if pkg:match("^.*%.json$") then
local meta = json_parse(fs.readfile(metadir .. "/" .. pkg)) local metadata = fs.readfile(metadir .. "/" .. pkg)
local metapkg = metapkgpre .. meta.name if metadata ~= nil then
local status = ipkg.status(metapkg) local meta = json_parse(metadata)
if next(status) ~= nil then local metapkg = metapkgpre .. meta.name
meta.time = tonumber(status[metapkg]["Installed-Time"]) local status = ipkg.status(metapkg)
data[#data+1] = meta if next(status) ~= nil then
meta.time = tonumber(status[metapkg]["Installed-Time"])
data[#data+1] = meta
end
end end
end end
end end

View File

@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=xray-plugin PKG_NAME:=xray-plugin
PKG_VERSION:=1.7.3 PKG_VERSION:=1.7.5
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/teddysun/xray-plugin/tar.gz/v$(PKG_VERSION)? PKG_SOURCE_URL:=https://codeload.github.com/teddysun/xray-plugin/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=87e1b67e2a6c6181a7090fb3c16b839781bc56573187aba36d03397ede2ebaed PKG_HASH:=e22aef7ce8c98a492c6fcafd182cfd0ebe27fa3c1e74c6b08d0cff8088895e04
PKG_LICENSE:=MIT PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE PKG_LICENSE_FILES:=LICENSE

View File

@@ -1,26 +0,0 @@
diff --git a/go.mod b/go.mod
index cadbf87..8de8b96 100644
--- a/go.mod
+++ b/go.mod
@@ -4,7 +4,7 @@ go 1.18
require (
github.com/golang/protobuf v1.5.2
- github.com/xtls/xray-core v1.7.3
+ github.com/xtls/xray-core v1.7.4-0.20230204132713-00c957611891
)
require (
diff --git a/go.sum b/go.sum
index 19e79c0..3057c8f 100644
--- a/go.sum
+++ b/go.sum
@@ -149,6 +149,8 @@ github.com/xtls/go v0.0.0-20230107031059-4610f88d00f3 h1:a3Y4WVjCxwoyO4E2xdNvq57
github.com/xtls/go v0.0.0-20230107031059-4610f88d00f3/go.mod h1:YJTRELIWrGxR1s8xcEBgxcxBfwQfMGjdvNLTjN9XFgY=
github.com/xtls/xray-core v1.7.3 h1:yGkFCHqRJxziFWQiWlMThVY2Mg3TxzDzJHRrRsZZNPE=
github.com/xtls/xray-core v1.7.3/go.mod h1:FS9w01bxhsvGjNtCBEcstwtYhqt512kKkXUvudnn5h0=
+github.com/xtls/xray-core v1.7.4-0.20230204132713-00c957611891 h1:x3u/b/qr4o1de07FTH5tGR5pqLj1WPggvkrIYxnwjDs=
+github.com/xtls/xray-core v1.7.4-0.20230204132713-00c957611891/go.mod h1:gkMXXAQOvSG57XiQwjwzQkRBkRwBtf9pQGbE3++XPtI=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
go.starlark.net v0.0.0-20230128213706-3f75dec8e403 h1:jPeC7Exc+m8OBJUlWbBLh0O5UZPM7yU5W4adnhhbG4U=