luci-app-vssr: sync with upstream source

This commit is contained in:
CN_SZTL 2020-02-24 00:36:26 +08:00
parent 475782665a
commit 7cb16e1636
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
8 changed files with 4899 additions and 4058 deletions

View File

@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-vssr
PKG_VERSION:=1.11
PKG_RELEASE:=20200220-4
PKG_VERSION:=1.12
PKG_RELEASE:=20200222-4
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \

View File

@ -336,21 +336,25 @@ else
retstring ="-1"
end
elseif set == "ip_data" then
refresh_cmd="wget -O- 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' 2>/dev/null| awk -F\\| '/CN\\|ipv4/ { printf(\"%s/%d\\n\", $4, 32-log($5)/log(2)) }' > /tmp/china_ssr.txt"
sret=luci.sys.call(refresh_cmd)
icount = luci.sys.exec("cat /tmp/china_ssr.txt | wc -l")
if sret== 0 and tonumber(icount)>1000 then
oldcount=luci.sys.exec("cat /etc/china_ssr.txt | wc -l")
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/china_ssr.txt /etc/china_ssr.txt")
retstring=tostring(tonumber(icount))
if (luci.model.uci.cursor():get_first('vssr', 'global', 'chnroute', '0') == '1') then
refresh_cmd="wget-ssl --no-check-certificate -O - " .. luci.model.uci.cursor():get_first('vssr', 'global', 'chnroute_url', 'https://pexcn.me/daily/chnroute/chnroute.txt') .. ' > /tmp/china_ssr.txt 2>/dev/null'
else
retstring ="0"
refresh_cmd="wget -O- 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' 2>/dev/null| awk -F\\| '/CN\\|ipv4/ { printf(\"%s/%d\\n\", $4, 32-log($5)/log(2)) }' > /tmp/china_ssr.txt"
end
else
retstring ="-1"
end
luci.sys.exec("rm -f /tmp/china_ssr.txt ")
sret=luci.sys.call(refresh_cmd)
icount = luci.sys.exec("cat /tmp/china_ssr.txt | wc -l")
if sret== 0 and tonumber(icount)>1000 then
oldcount=luci.sys.exec("cat /etc/china_ssr.txt | wc -l")
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/china_ssr.txt /etc/china_ssr.txt")
retstring=tostring(tonumber(icount))
else
retstring ="0"
end
else
retstring ="-1"
end
luci.sys.exec("rm -f /tmp/china_ssr.txt ")
else
if nixio.fs.access("/usr/bin/wget-ssl") then
refresh_cmd="wget-ssl --no-check-certificate -O - ".. luci.model.uci.cursor():get_first('vssr', 'global', 'adblock_url','https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt') .." > /tmp/adnew.conf"

View File

@ -67,35 +67,6 @@ o.datatype = "uinteger"
o:depends("enable_switch", "1")
o.default = 3
-- [[ adblock ]]--
s = m:section(TypedSection, "global", translate("adblock settings"))
s.anonymous = true
o = s:option(Flag, "adblock", translate("Enable adblock"))
o.rmempty = false
o = s:option(Value, "adblock_url", translate("adblock_url"))
o.default = "https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt"
-- [[ haProxy ]]--
s = m:section(TypedSection, "global_haproxy", translate("haProxy settings"))
s.anonymous = true
o = s:option(Flag, "admin_enable", translate("Enabling the Management Console"))
o.rmempty = false
o.default = 1
o = s:option(Value, "admin_port", translate("Service Port"))
o.datatype = "uinteger"
o.default = 1111
o = s:option(Value, "admin_user", translate("User name"))
o.default = "admin"
o = s:option(Value, "admin_password", translate("Password"))
o.default = "root"
-- [[ SOCKS5 Proxy ]]--
if nixio.fs.access("/usr/bin/ssr-local") then
s = m:section(TypedSection, "socks5_proxy", translate("SOCKS5 Proxy"))
@ -121,16 +92,47 @@ o = s:option(Value, "http_port", translate("HTTP Port"))
o.datatype = "port"
o.default = 1081
o.rmempty = false
end
-- [[ adblock ]]--
s = m:section(TypedSection, "global", translate("adblock settings"))
s.anonymous = true
o = s:option(Flag, "adblock", translate("Enable adblock"))
o.rmempty = false
o = s:option(Value, "adblock_url", translate("adblock_url"))
o.default = "https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt"
-- [[ chnroute ]]
s = m:section(TypedSection, "global", translate("Chnroute Setting"))
s.anonymous = true
o = s:option(Flag, "chnroute", translate("Enable custom chnroute"))
o.rmempty = false
o = s:option(Value, "chnroute_url", translate("Update url"))
o.default = "https://cdn.jsdelivr.net/gh/17mon/china_ip_list/china_ip_list.txt"
-- [[ haProxy ]]--
s = m:section(TypedSection, "global_haproxy", translate("haProxy settings"))
s.anonymous = true
o = s:option(Flag, "admin_enable", translate("Enabling the Management Console"))
o.rmempty = false
o.default = 1
o = s:option(Value, "admin_port", translate("Service Port"))
o.datatype = "uinteger"
o.default = 1111
o = s:option(Value, "admin_user", translate("User name"))
o.default = "admin"
o = s:option(Value, "admin_password", translate("Password"))
o.default = "root"
end
end
return m

View File

@ -1,7 +1,7 @@
-- Copyright (C) 2017 yushi studio <ywb94@qq.com>
-- Licensed to the public under the GNU General Public License v3.
local IPK_Version="20200219.1.10"
local IPK_Version="20200222.1.12"
local m, s, o
local redir_run=0
local reudp_run=0

View File

@ -783,5 +783,38 @@ msgstr "插件参数"
msgid "Before subscribing please click below to delete all servers in the subscription"
msgstr "订阅前请点击下面的删除所有服务器在订阅"
msgid "Chnroute Setting"
msgstr "国内IP段数据库更新设置"
msgid "Enable custom chnroute"
msgstr "启用自定义更新地址"
msgid "Update url"
msgstr "更新链接"
msgid "HTTP Proxy"
msgstr "HTTP代理"
msgid "Raw Mode"
msgstr "模式"
msgid "Seq Mode"
msgstr "Seq模式"
msgid "Cipher Mode"
msgstr "加密模式"
msgid "Auth Mode"
msgstr "校验模式"
msgid "Speeder Mode"
msgstr "Speeder模式"
msgid "Fec"
msgstr "fec参数"
msgid "Mtu"
msgstr "mtu参数"

File diff suppressed because it is too large Load Diff

View File

@ -38,22 +38,21 @@ function gen_outbound(server_node, tags)
}
},
-- 底层传输配置
streamSettings = {
network = server.transport,
security = (server.tls == '1') and "tls" or "none",
tlsSettings = {
allowInsecure = (server.insecure == "1") and true or false,
serverName = server.ws_host
},
kcpSettings = (server.transport == "kcp") and {
mtu = tonumber(server.mtu),
tti = tonumber(server.tti),
uplinkCapacity = tonumber(server.uplink_capacity),
downlinkCapacity = tonumber(server.downlink_capacity),
congestion = (server.congestion == "1") and true or false,
readBufferSize = tonumber(server.read_buffer_size),
writeBufferSize = tonumber(server.write_buffer_size),
header = {type = server.kcp_guise}
streamSettings = {
network = server.transport,
security = (server.tls == '1') and "tls" or "none",
tlsSettings = {allowInsecure = (server.insecure == "1") and true or false,serverName=server.tls_host,},
kcpSettings = (server.transport == "kcp") and {
mtu = tonumber(server.mtu),
tti = tonumber(server.tti),
uplinkCapacity = tonumber(server.uplink_capacity),
downlinkCapacity = tonumber(server.downlink_capacity),
congestion = (server.congestion == "1") and true or false,
readBufferSize = tonumber(server.read_buffer_size),
writeBufferSize = tonumber(server.write_buffer_size),
header = {
type = server.kcp_guise
}
} or nil,
wsSettings = (server.transport == "ws") and
(server.ws_path ~= nil or server.ws_host ~= nil) and {

View File

@ -42,13 +42,17 @@ else
end
log('正在更新【国内IP段】数据库')
refresh_cmd="wget -O- 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' 2>/dev/null| awk -F\\| '/CN\\|ipv4/ { printf(\"%s/%d\\n\", $4, 32-log($5)/log(2)) }' > /tmp/china_ssr.txt"
if (ucic:get_first('vssr', 'global', 'chnroute','0') == '1' ) then
refresh_cmd="wget-ssl --no-check-certificate -O - ".. ucic:get_first('vssr', 'global', 'chnroute_url','https://cdn.jsdelivr.net/gh/17mon/china_ip_list/china_ip_list.txt') .." > /tmp/china_ssr.txt 2>/dev/null"
else
refresh_cmd="wget -O- 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' 2>/dev/null| awk -F\\| '/CN\\|ipv4/ { printf(\"%s/%d\\n\", $4, 32-log($5)/log(2)) }' > /tmp/china_ssr.txt"
end
sret=luci.sys.call(refresh_cmd)
icount = luci.sys.exec("cat /tmp/china_ssr.txt | wc -l")
if sret== 0 then
if sret== 0 then
icount = luci.sys.exec("cat /tmp/china_ssr.txt | wc -l")
if tonumber(icount)>1000 then
oldcount=luci.sys.exec("cat /etc/china_ssr.txt | wc -l")
oldcount=luci.sys.exec("cat /etc/china_ssr.txt | wc -l")
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/china_ssr.txt /etc/china_ssr.txt")
-- retstring=tostring(math.ceil(tonumber(icount)/2))
@ -57,7 +61,7 @@ icount = luci.sys.exec("cat /tmp/china_ssr.txt | wc -l")
log('你已经是最新数据,无需更新!')
end
else
log('更新失败!')
log('更新失败!')
end
luci.sys.exec("rm -f /tmp/china_ssr.txt")
else
@ -96,4 +100,4 @@ if sret== 0 then
else
log('更新失败!')
end
end
end