luci-app-vssr: bump to v1.16-r4

This commit is contained in:
CN_SZTL 2020-03-01 20:48:50 +08:00
parent 921b23f2a3
commit e35b881882
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
5 changed files with 50 additions and 31 deletions

View File

@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-vssr
PKG_VERSION:=1.15
PKG_RELEASE:=20200229-4
PKG_VERSION:=1.16
PKG_RELEASE:=20200301-4
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \

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="20200229.1.15"
local IPK_Version="20200301.1.16"
local m, s, o
local redir_run=0
local reudp_run=0

View File

@ -1,3 +1,6 @@
-- Licensed to the public under the GNU General Public License v3.
local m, s, o
local vssr = "vssr"
local uci = luci.model.uci.cursor()
local server_table = {}
@ -9,6 +12,13 @@ if nixio.fs.access("/etc/dnsmasq.ssr/gfw_list.conf") then
gfwmode=1
end
local uci = luci.model.uci.cursor()
local server_count = 0
uci:foreach("vssr", "servers", function(s)
server_count = server_count + 1
end)
local fs = require "nixio.fs"
local sys = require "luci.sys"
if gfwmode==1 then
@ -51,21 +61,24 @@ o.template = "vssr/update_subscribe"
o = s:option(Button,"delete",translate("Delete all severs"))
o = s:option(Button,"delete",translate("Delete All Subscribe Severs"))
o.inputstyle = "reset"
o.description = string.format(translate("Server Count") .. ": %d", server_count)
o.write = function()
uci:delete_all("vssr", "servers", function(s) return true end)
uci:commit("vssr")
luci.sys.call("uci commit vssr && /etc/init.d/vssr stop")
luci.http.redirect(luci.dispatcher.build_url("admin", "vpn", "vssr", "servers"))
return
uci:delete_all("vssr", "servers", function(s)
if s["hashkey"] then
return true
else
return false
end
end)
uci:save("vssr")
luci.sys.call("uci commit vssr && /etc/init.d/vssr stop")
luci.http.redirect(luci.dispatcher.build_url("admin", "vpn", "vssr", "servers"))
return
end
m:section(SimpleSection).template = "vssr/status2"
return m

View File

@ -538,7 +538,7 @@ msgid "Auto Update Server subscription, GFW list and CHN route"
msgstr "自动更新服务器订阅、GFW列表和 CHN路由表"
msgid "Subscribe URL"
msgstr "SS/SSR/V2RAY订阅URL地址"
msgstr "SS/SSR/V2RAY/Trojan订阅URL地址"
msgid "Update"
msgstr "更新"
@ -851,6 +851,7 @@ msgstr "V2服务器"
msgid "SS/SSR/V2RAY Server"
msgstr "SS/SSR/V2RAY 服务端"
msgid "Delete All Subscribe Severs"
msgstr "删除所有订阅服务器节点"

View File

@ -96,14 +96,8 @@ end
-- 处理数据
local function processData(szType, content)
local result = {
-- auth_enable = '0',
-- switch_enable = '1',
type = szType,
local_port = 1234,
-- timeout = 60, -- 不太确定 好像是死的
-- fast_open = 0,
-- kcp_enable = 0,
-- kcp_port = 0,
kcp_param = '--nocomp'
}
if szType == 'ssr' then
@ -238,6 +232,9 @@ local function processData(szType, content)
result.alias = UrlDecode(alias)
result.type = "trojan"
result.server = host[1]
-- 按照官方的建议 默认验证ssl证书
result.insecure = "0"
result.tls = "1"
if host[2]:find("?") then
local query = split(host[2], "?")
result.server_port = query[1]
@ -246,10 +243,17 @@ local function processData(szType, content)
local t = split(v, '=')
params[t[1]] = t[2]
end
if params.peer then
result.tls = "1"
-- 未指定peersni默认使用remote addr
result.tls_host = params.peer
end
if params.allowInsecure == "1" then
result.insecure = "1"
else
result.insecure = "0"
end
else
result.server_port = host[2]
end
@ -298,10 +302,10 @@ local execute = function()
nodes = base64Decode(raw:sub(nEnd + 1, #raw))
nodes = jsonParse(nodes)
local extra = {
airport = nodes.airport,
port = nodes.port,
encryption = nodes.encryption,
password = nodes.password
airport = nodes.airport,
port = nodes.port,
encryption = nodes.encryption,
password = nodes.password
}
local servers = {}
-- SS里面包着 干脆直接这样
@ -338,8 +342,9 @@ local execute = function()
result.alias:find("QQ群") or
result.alias:find("官网") or
result.alias:find("防失联地址") or
not result.server
then
not result.server or
result.server:match("[^0-9a-zA-Z%-%.%s]") -- 中文做地址的 也没有人拿中文域名搞就算中文域也有Puny Code SB 机场
then
log('丢弃无效节点: ' .. result.type ..' 节点, ' .. result.alias)
else
log('成功解析: ' .. result.type ..' 节点, ' .. result.alias)
@ -376,11 +381,11 @@ local execute = function()
end
else
if not old.alias then
old.alias = old.server .. ':' .. old.server_port
end
old.alias = old.server .. ':' .. old.server_port
end
log('忽略手动添加的节点: ' .. old.alias)
end
end)
for k, v in ipairs(nodeResult) do
for kk, vv in ipairs(v) do