mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-10 19:12:33 +08:00
luci-app-vssr: sync with upstream source
This commit is contained in:
parent
635c3a5338
commit
c21a0f61d7
@ -1,8 +1,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-vssr
|
||||
PKG_VERSION:=1.12
|
||||
PKG_RELEASE:=20200222-4
|
||||
PKG_VERSION:=1.13
|
||||
PKG_RELEASE:=20200225-4
|
||||
|
||||
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \
|
||||
|
@ -129,6 +129,12 @@ o:value("1", translate("1 Thread"))
|
||||
o:value("2", translate("2 Threads"))
|
||||
o:value("4", translate("4 Threads"))
|
||||
o:value("8", translate("8 Threads"))
|
||||
o:value("16", translate("16 Threads"))
|
||||
o:value("32", translate("32 Threads"))
|
||||
o:value("64", translate("64 Threads"))
|
||||
o:value("128", translate("128 Threads"))
|
||||
o:value("256", translate("256 Threads"))
|
||||
o:value("512", translate("512 Threads"))
|
||||
o.default = "0"
|
||||
o.rmempty = false
|
||||
|
||||
|
@ -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="20200222.1.12"
|
||||
local IPK_Version="20200225.1.13"
|
||||
local m, s, o
|
||||
local redir_run=0
|
||||
local reudp_run=0
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
<fieldset id="ShadowSocksR " class="cbi-section">
|
||||
|
||||
<h2 name=''content''> SS/SSR/V2RAY 服务端</h2>
|
||||
<h2 name=''content''><%:SS/SSR/V2RAY Server%></h2>
|
||||
|
||||
<style>
|
||||
.pure-g{letter-spacing:-.31em;text-rendering:optimizespeed;font-family:FreeSans,Arimo,"Droid Sans",Helvetica,Arial,sans-serif;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-flow:row wrap;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-align-content:flex-start;-ms-flex-line-pack:start;align-content:flex-start}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){table .pure-g{display:block}}.opera-only :-o-prefocus,.pure-g{word-spacing:-.43em}.pure-u,.pure-u-1,.pure-u-1-1,.pure-u-1-12,.pure-u-1-2,.pure-u-1-24,.pure-u-1-3,.pure-u-1-4,.pure-u-1-5,.pure-u-1-6,.pure-u-1-8,.pure-u-10-24,.pure-u-11-12,.pure-u-11-24,.pure-u-12-24,.pure-u-13-24,.pure-u-14-24,.pure-u-15-24,.pure-u-16-24,.pure-u-17-24,.pure-u-18-24,.pure-u-19-24,.pure-u-2-24,.pure-u-2-3,.pure-u-2-5,.pure-u-20-24,.pure-u-21-24,.pure-u-22-24,.pure-u-23-24,.pure-u-24-24,.pure-u-3-24,.pure-u-3-4,.pure-u-3-5,.pure-u-3-8,.pure-u-4-24,.pure-u-4-5,.pure-u-5-12,.pure-u-5-24,.pure-u-5-5,.pure-u-5-6,.pure-u-5-8,.pure-u-6-24,.pure-u-7-12,.pure-u-7-24,.pure-u-7-8,.pure-u-8-24,.pure-u-9-24{display:inline-block;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-g [class*=pure-u]{font-family:sans-serif}.pure-u-1-24{width:4.1667%}.pure-u-1-12,.pure-u-2-24{width:8.3333%}.pure-u-1-8,.pure-u-3-24{width:12.5%}.pure-u-1-6,.pure-u-4-24{width:16.6667%}.pure-u-1-5{width:20%}.pure-u-5-24{width:20.8333%}.pure-u-1-4,.pure-u-6-24{width:25%}.pure-u-7-24{width:29.1667%}.pure-u-1-3,.pure-u-8-24{width:33.3333%}.pure-u-3-8,.pure-u-9-24{width:37.5%}.pure-u-2-5{width:40%}.pure-u-10-24,.pure-u-5-12{width:41.6667%}.pure-u-11-24{width:45.8333%}.pure-u-1-2,.pure-u-12-24{width:50%}.pure-u-13-24{width:54.1667%}.pure-u-14-24,.pure-u-7-12{width:58.3333%}.pure-u-3-5{width:60%}.pure-u-15-24,.pure-u-5-8{width:62.5%}.pure-u-16-24,.pure-u-2-3{width:66.6667%}.pure-u-17-24{width:70.8333%}.pure-u-18-24,.pure-u-3-4{width:75%}.pure-u-19-24{width:79.1667%}.pure-u-4-5{width:80%}.pure-u-20-24,.pure-u-5-6{width:83.3333%}.pure-u-21-24,.pure-u-7-8{width:87.5%}.pure-u-11-12,.pure-u-22-24{width:91.6667%}.pure-u-23-24{width:95.8333%}.pure-u-1,.pure-u-1-1,.pure-u-24-24,.pure-u-6-6{width:100%}
|
||||
@ -122,7 +122,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="pure-u-5-8">
|
||||
<h4 id="ss_server_status">SS服务器<br><span class="red"><%:Not Running%></span></h4>
|
||||
<h4 id="ss_server_status"><%:SS Servers%><br><span class="red"><%:Not Running%></span></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -134,7 +134,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="pure-u-5-8">
|
||||
<h4 id="ssr_server_status">SSR服务器<br><span class="red"><%:Not Running%></span></h4>
|
||||
<h4 id="ssr_server_status"><%:SSR Servers%><br><span class="red"><%:Not Running%></span></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -146,7 +146,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="pure-u-5-8">
|
||||
<h4 id="v2_server_status">V2服务器<br><span class="red"><%:Not Running%></span></h4>
|
||||
<h4 id="v2_server_status"><%:V2 Servers%><br><span class="red"><%:Not Running%></span></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -177,20 +177,20 @@
|
||||
} else {
|
||||
tb2.innerHTML = '<%:Visit domestic website%><br><span class="red"><%:Problem detected%></span>';
|
||||
}
|
||||
if (data.ss_server) {
|
||||
tb3.innerHTML = 'SS服务器<br><span class="green"><%:Running%></span>';
|
||||
if (data.ss_server) {
|
||||
tb3.innerHTML = '<%:SS Servers%><br><span class="green"><%:Running%></span>';
|
||||
} else {
|
||||
tb3.innerHTML = 'SS服务器<br><span class="red"><%:Not Running%></span>';
|
||||
tb3.innerHTML = '<%:SS Servers%><br><span class="red"><%:Not Running%></span>';
|
||||
}
|
||||
if (data.ssr_server) {
|
||||
tb4.innerHTML = 'SSR服务器<br><span class="green"><%:Running%></span>';
|
||||
tb4.innerHTML = '<%:SSR Servers%><br><span class="green"><%:Running%></span>';
|
||||
} else {
|
||||
tb4.innerHTML = 'SSR服务器<br><span class="red"><%:Not Running%></span>';
|
||||
tb4.innerHTML = '<%:SSR Servers%><br><span class="red"><%:Not Running%></span>';
|
||||
}
|
||||
if (data.v2_server ) {
|
||||
tb5.innerHTML = 'V2服务器<br><span class="green"><%:Running%></span>';
|
||||
tb5.innerHTML = '<%:V2 Servers%><br><span class="green"><%:Running%></span>';
|
||||
} else {
|
||||
tb5.innerHTML = 'V2服务器<br><span class="red"><%:Not Running%></span>';
|
||||
tb5.innerHTML = '<%:V2 Servers%><br><span class="red"><%:Not Running%></span>';
|
||||
|
||||
}
|
||||
}
|
||||
@ -198,4 +198,4 @@
|
||||
);
|
||||
//]]>
|
||||
</script>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
|
@ -63,6 +63,8 @@ msgstr "SSR SOCKS5代理"
|
||||
msgid "Subscription"
|
||||
msgstr "订阅管理"
|
||||
|
||||
|
||||
|
||||
msgid "Subscribing,Please do not refresh!"
|
||||
msgstr "订阅,请不要刷新!"
|
||||
|
||||
@ -124,10 +126,10 @@ msgid "Client"
|
||||
msgstr "客户端"
|
||||
|
||||
msgid "Visit foreign websites"
|
||||
msgstr "访问国外网站"
|
||||
msgstr "国外网站"
|
||||
|
||||
msgid "Visit domestic website"
|
||||
msgstr "访问国内网站"
|
||||
msgstr "国内网站"
|
||||
|
||||
msgid "Problem detected"
|
||||
msgstr "无法访问"
|
||||
@ -251,8 +253,6 @@ msgstr "内网主机列表"
|
||||
msgid "SSR Client"
|
||||
msgstr "客户端"
|
||||
|
||||
msgid "SSR Server"
|
||||
msgstr "服务端"
|
||||
|
||||
msgid "ShadowSocksR Server"
|
||||
msgstr "ShadowSocksR 服务端"
|
||||
@ -639,6 +639,25 @@ msgstr "4 线程"
|
||||
msgid "8 Threads"
|
||||
msgstr "8 线程"
|
||||
|
||||
msgid "16 Threads"
|
||||
msgstr "16 线程"
|
||||
|
||||
msgid "32 Threads"
|
||||
msgstr "32 线程"
|
||||
|
||||
msgid "64 Threads"
|
||||
msgstr "64 线程"
|
||||
|
||||
msgid "128 Threads"
|
||||
msgstr "128 线程"
|
||||
|
||||
msgid "256 Threads"
|
||||
msgstr "256 线程"
|
||||
|
||||
msgid "512 Threads"
|
||||
msgstr "512 线程"
|
||||
|
||||
|
||||
msgid "Proxy Ports"
|
||||
msgstr "需要代理的端口"
|
||||
|
||||
@ -816,5 +835,22 @@ msgstr "fec参数"
|
||||
msgid "Mtu"
|
||||
msgstr "mtu参数"
|
||||
|
||||
msgid "SS Servers"
|
||||
msgstr "SS服务器"
|
||||
|
||||
|
||||
msgid "SSR Servers"
|
||||
msgstr "SSR服务器"
|
||||
|
||||
msgid "SSR Server"
|
||||
msgstr "服务端"
|
||||
|
||||
msgid "V2 Servers"
|
||||
msgstr "V2服务器"
|
||||
|
||||
msgid "SS/SSR/V2RAY Server"
|
||||
msgstr "SS/SSR/V2RAY 服务端"
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -3630,7 +3630,6 @@ address=/s.baidu.com/0.0.0.0
|
||||
address=/sestat.baidu.com/0.0.0.0
|
||||
address=/shadu.baidu.com/0.0.0.0
|
||||
address=/sobar.baidu.com/0.0.0.0
|
||||
address=/sp0.baidu.com/0.0.0.0
|
||||
address=/tk.baidu.com/0.0.0.0
|
||||
address=/tracker.baidu.com/0.0.0.0
|
||||
address=/tuijian.baidu.com/0.0.0.0
|
||||
@ -10971,7 +10970,6 @@ address=/gjghy.com/0.0.0.0
|
||||
address=/gjijrevdp.com/0.0.0.0
|
||||
address=/gjkpo.com/0.0.0.0
|
||||
address=/gjmlseezqjy.com/0.0.0.0
|
||||
address=/mmstat.com/0.0.0.0
|
||||
address=/gjnusfiby.com/0.0.0.0
|
||||
address=/gjproyrwjv.com/0.0.0.0
|
||||
address=/gjqbidroh.com/0.0.0.0
|
||||
@ -27949,7 +27947,6 @@ address=/cnnic.cn/0.0.0.0
|
||||
address=/cnnic.net/0.0.0.0
|
||||
address=/cnnic.net.cn/0.0.0.0
|
||||
address=/c.ns8d.com/0.0.0.0
|
||||
address=/ultraiso.net/0.0.0.0
|
||||
address=/cnzz.pygold.net/0.0.0.0
|
||||
address=/coaha.frenchgerlemanelectric.com/0.0.0.0
|
||||
address=/dofeb.frenchgerlemanelectric.com/0.0.0.0
|
||||
@ -28000,7 +27997,6 @@ address=/c.panqishu.com/0.0.0.0
|
||||
address=/cp.ggyapp.com/0.0.0.0
|
||||
address=/cpro.fangtoo.com/0.0.0.0
|
||||
address=/ubm.fangtoo.com/0.0.0.0
|
||||
address=/cps.kaola.com/0.0.0.0
|
||||
address=/cps.yaoqing.com/0.0.0.0
|
||||
address=/cpv-adv.ggytc.com/0.0.0.0
|
||||
address=/crackspider.us/0.0.0.0
|
||||
|
@ -646,7 +646,9 @@ start_redir() {
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") $($sscmd -version | head -1) 已启动!" >> /tmp/vssr.log
|
||||
|
||||
elif [ "$stype" == "trojan" ] ;then
|
||||
for i in $(seq 1 $threads); do
|
||||
$sscmd --config /var/etc/trojan-ssr-retcp.json >/dev/null 2>&1 &
|
||||
done
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") $($sscmd --version 2>&1 | head -1) 已启动!" >> /tmp/vssr.log
|
||||
|
||||
fi
|
||||
|
@ -30,6 +30,7 @@ local trojan = {
|
||||
tcp = {
|
||||
no_delay = true,
|
||||
keep_alive = true,
|
||||
reuse_port = true,
|
||||
fast_open = (server.fast_open == "1") and true or false,
|
||||
fast_open_qlen = 20
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ local name = 'vssr'
|
||||
local uciType = 'servers'
|
||||
local ucic = luci.model.uci.cursor()
|
||||
local proxy = ucic:get_first(name, 'server_subscribe', 'proxy', '0')
|
||||
local switch = ucic:get_first(name, 'server_subscribe', 'switch', '1')
|
||||
local subscribe_url = ucic:get_first(name, 'server_subscribe', 'subscribe_url', {})
|
||||
|
||||
local log = function(...)
|
||||
@ -96,7 +97,7 @@ end
|
||||
local function processData(szType, content)
|
||||
local result = {
|
||||
-- auth_enable = '0',
|
||||
switch_enable = '1',
|
||||
-- switch_enable = '1',
|
||||
type = szType,
|
||||
local_port = 1234,
|
||||
-- timeout = 60, -- 不太确定 好像是死的
|
||||
@ -135,6 +136,7 @@ local function processData(szType, content)
|
||||
result.alter_id = info.aid
|
||||
result.vmess_id = info.id
|
||||
result.alias = info.ps
|
||||
result.insecure = 1
|
||||
-- result.mux = 1
|
||||
-- result.concurrency = 8
|
||||
if info.net == 'ws' then
|
||||
@ -225,15 +227,16 @@ local function processData(szType, content)
|
||||
if not result.alias then
|
||||
result.alias = result.server .. ':' .. result.server_port
|
||||
end
|
||||
|
||||
local flag = luci.sys.exec('/usr/share/'..name..'/getflag.sh "'..result.alias..'" '..result.server)
|
||||
result.flag = string.gsub(flag, '\n', '')
|
||||
|
||||
local flag = luci.sys.exec('/usr/share/'..name..'/getflag.sh "'..result.alias..'" '..result.server)
|
||||
result.flag = string.gsub(flag, '\n', '')
|
||||
-- alias 不参与 hashkey 计算
|
||||
local alias = result.alias
|
||||
result.alias = nil
|
||||
local switch_enable = result.switch_enable
|
||||
result.switch_enable = nil
|
||||
result.hashkey = md5(jsonStringify(result))
|
||||
result.alias = alias
|
||||
result.switch_enable = switch_enable
|
||||
return result
|
||||
end
|
||||
-- wget
|
||||
@ -337,36 +340,45 @@ local execute = function()
|
||||
else
|
||||
log('忽略手动添加的节点: ' .. old.alias)
|
||||
end
|
||||
|
||||
end)
|
||||
|
||||
for k, v in ipairs(nodeResult) do
|
||||
for kk, vv in ipairs(v) do
|
||||
if not vv._ignore then
|
||||
local section = ucic:add(name, uciType)
|
||||
ucic:tset(name, section, vv)
|
||||
ucic:set(name, section, "switch_enable", switch)
|
||||
add = add + 1
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
ucic:commit(name)
|
||||
-- 如果服务器已经不见了把帮换一个
|
||||
|
||||
-- 如果原有服务器节点已经不见了就尝试换为第一个节点
|
||||
local globalServer = ucic:get_first(name, 'global', 'global_server', '')
|
||||
local firstServer = ucic:get_first(name, uciType)
|
||||
if not ucic:get(name, globalServer) then
|
||||
if firstServer then
|
||||
ucic:set(name, ucic:get_first(name, 'global'), 'global_server', firstServer)
|
||||
ucic:commit(name)
|
||||
log('当前主服务器已更新,正在自动更换。')
|
||||
end
|
||||
end
|
||||
|
||||
if firstServer then
|
||||
luci.sys.call("/etc/init.d/" .. name .. " restart > /dev/null 2>&1 &") -- 不加&的话日志会出现的更早
|
||||
if not ucic:get(name, globalServer) then
|
||||
luci.sys.call("/etc/init.d/" .. name .. " stop > /dev/null 2>&1 &")
|
||||
ucic:commit(name)
|
||||
ucic:set(name, ucic:get_first(name, 'global'), 'global_server', ucic:get_first(name, uciType))
|
||||
ucic:commit(name)
|
||||
log('当前主服务器节点已被删除,正在自动更换为第一个节点。')
|
||||
luci.sys.call("/etc/init.d/" .. name .. " start > /dev/null 2>&1 &")
|
||||
else
|
||||
log('维持当前主服务器节点。')
|
||||
luci.sys.call("/etc/init.d/" .. name .." restart > /dev/null 2>&1 &")
|
||||
end
|
||||
else
|
||||
luci.sys.call("/etc/init.d/" .. name .. " stop > /dev/null 2>&1 &") -- 不加&的话日志会出现的更早
|
||||
log('没有服务器节点了,停止服务')
|
||||
luci.sys.call("/etc/init.d/" .. name .. " stop > /dev/null 2>&1 &")
|
||||
end
|
||||
log('新增节点数量: ' ..add, '删除节点数量: ' .. del)
|
||||
log("END SUBSCRIBE")
|
||||
log('更新成功服务正在启动')
|
||||
log('订阅更新成功')
|
||||
end
|
||||
end
|
||||
|
||||
@ -379,9 +391,10 @@ if subscribe_url and #subscribe_url > 0 then
|
||||
local firstServer = ucic:get_first(name, uciType)
|
||||
if firstServer then
|
||||
luci.sys.call("/etc/init.d/" .. name .." restart > /dev/null 2>&1 &") -- 不加&的话日志会出现的更早
|
||||
log('重启服务成功')
|
||||
else
|
||||
luci.sys.call("/etc/init.d/" .. name .." stop > /dev/null 2>&1 &") -- 不加&的话日志会出现的更早
|
||||
log('停止服务成功')
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user