luci-app-vssr: bump to v1.14
This commit is contained in:
parent
36d86399cc
commit
1e5c661912
@ -1,8 +1,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-vssr
|
||||
PKG_VERSION:=1.13
|
||||
PKG_RELEASE:=20200823
|
||||
PKG_VERSION:=1.14
|
||||
PKG_RELEASE:=20200824
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ function index()
|
||||
|
||||
if nixio.fs.access("/usr/bin/ssr-redir") then
|
||||
entry({"admin", "services", "vssr"},
|
||||
alias("admin", "services", "vssr", "client"), _("Hello World"), 10).dependent =
|
||||
alias("admin", "services", "vssr", "client"), _("Hello World"), 0).dependent =
|
||||
true -- 首页
|
||||
entry({"admin", "services", "vssr", "client"}, cbi("vssr/client"),
|
||||
_("SSR Client"), 10).leaf = true -- 基本设置
|
||||
@ -47,7 +47,7 @@ function index()
|
||||
entry({"admin", "services", "vssr", "checkport"}, call("check_port")) -- 检测单个端口并返回Ping
|
||||
entry({"admin", "services", "vssr", "run"}, call("act_status")) -- 检测全局服务器状态
|
||||
entry({"admin", "services", "vssr", "change"}, call("change_node")) -- 切换节点
|
||||
entry({"admin", "services", "vssr", "allserver"}, call("get_servers")) -- 获取所有节点Json
|
||||
--entry({"admin", "services", "vssr", "allserver"}, call("get_servers")) -- 获取所有节点Json
|
||||
entry({"admin", "services", "vssr", "subscribe"}, call("get_subscribe")) -- 执行订阅
|
||||
entry({"admin", "services", "vssr", "flag"}, call("get_flag")) -- 获取节点国旗 iso code
|
||||
entry({"admin", "services", "vssr", "ip"}, call("check_ip")) -- 获取ip情况
|
||||
@ -99,10 +99,6 @@ function get_servers()
|
||||
uci:foreach("vssr", "servers", function(s)
|
||||
local e = {}
|
||||
e["name"] = s[".name"]
|
||||
local t1 = luci.sys.exec(
|
||||
"ping -c 1 -W 1 %q 2>&1 | grep -o 'time=[0-9]*.[0-9]' | awk -F '=' '{print$2}'" %
|
||||
s["server"])
|
||||
e["t1"] = t1
|
||||
table.insert(server_table, e)
|
||||
end)
|
||||
luci.http.prepare_content("application/json")
|
||||
@ -114,14 +110,12 @@ function change_node()
|
||||
local e = {}
|
||||
local uci = luci.model.uci.cursor()
|
||||
local sid = luci.http.formvalue("set")
|
||||
local name = ""
|
||||
uci:foreach("vssr", "global", function(s) name = s[".name"] end)
|
||||
e.status = false
|
||||
e.sid = sid
|
||||
if sid ~= "" then
|
||||
uci:set("vssr", name, "global_server", sid)
|
||||
uci:set("vssr", '@global[0]', 'global_server', sid)
|
||||
uci:commit("vssr")
|
||||
luci.sys.call("/etc/init.d/vssr restart")
|
||||
luci.sys.exec("/etc/init.d/vssr reload")
|
||||
e.status = true
|
||||
end
|
||||
luci.http.prepare_content("application/json")
|
||||
|
||||
@ -103,7 +103,7 @@ o.inputstyle = "reset"
|
||||
o.write = function()
|
||||
uci:delete_all("vssr", "servers", function(s) return true end)
|
||||
uci:commit("vssr")
|
||||
luci.sys.call("/etc/init.d/vssr stop")
|
||||
luci.sys.exec("/etc/init.d/vssr stop")
|
||||
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "vssr",
|
||||
"advanced"))
|
||||
end
|
||||
|
||||
@ -132,7 +132,7 @@ o.description = translate(
|
||||
|
||||
o = s:option(Value, "alias", translate("Alias(optional)"))
|
||||
|
||||
o = s:option(Value, "flag", translate("Country"))
|
||||
o = s:option(Value, "flag", translate("Area"))
|
||||
o.description = translate("请自己指定。格式:cn us hk 等")
|
||||
o.rmempty = true
|
||||
|
||||
|
||||
@ -6,6 +6,8 @@ local m, s, sec, o, kcp_enable
|
||||
local vssr = "vssr"
|
||||
local gfwmode=0
|
||||
|
||||
|
||||
|
||||
if nixio.fs.access("/etc/dnsmasq.ssr/gfw_list.conf") then
|
||||
gfwmode=1
|
||||
end
|
||||
@ -34,6 +36,9 @@ end
|
||||
|
||||
table.sort(key_table)
|
||||
|
||||
local route_name = {"youtube_server","tw_video_server","netflix_server","disney_server","prime_server","tvb_server","custom_server"}
|
||||
local route_label = {"Youtube Proxy","TaiWan Video Proxy","Netflix Proxy","Diseny+ Proxy","Prime Video Proxy","TVB Video Proxy","Custom Proxy"}
|
||||
|
||||
-- [[ Global Setting ]]--
|
||||
s = m:section(TypedSection, "global",translate("Basic Settings [SS|SSR|V2ray|Trojan]"))
|
||||
s.anonymous = true
|
||||
@ -53,46 +58,13 @@ o = s:option(Flag, "v2ray_flow", translate("Open v2ray route"))
|
||||
o.rmempty = false
|
||||
o.description = translate("When open v2ray routed,Apply may take more time.")
|
||||
|
||||
o = s:option(ListValue, "youtube_server", translate("Youtube Proxy"))
|
||||
o:value("nil", translate("Same as Main Server"))
|
||||
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
|
||||
o:depends("v2ray_flow", "1")
|
||||
o.default = "nil"
|
||||
|
||||
|
||||
|
||||
o = s:option(ListValue, "tw_video_server", translate("TaiWan Video Proxy"))
|
||||
o:value("nil", translate("Same as Main Server"))
|
||||
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
|
||||
o:depends("v2ray_flow", "1")
|
||||
o.default = "nil"
|
||||
|
||||
|
||||
o = s:option(ListValue, "netflix_server", translate("Netflix Proxy"))
|
||||
o:value("nil", translate("Same as Main Server"))
|
||||
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
|
||||
o:depends("v2ray_flow", "1")
|
||||
o.default = "nil"
|
||||
|
||||
|
||||
o = s:option(ListValue, "disney_server", translate("Diseny+ Proxy"))
|
||||
o:value("nil", translate("Same as Main Server"))
|
||||
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
|
||||
o:depends("v2ray_flow", "1")
|
||||
o.default = "nil"
|
||||
|
||||
|
||||
o = s:option(ListValue, "prime_server", translate("Prime Video Proxy"))
|
||||
o:value("nil", translate("Same as Main Server"))
|
||||
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
|
||||
o:depends("v2ray_flow", "1")
|
||||
o.default = "nil"
|
||||
|
||||
o = s:option(ListValue, "tvb_server", translate("TVB Video Proxy"))
|
||||
o:value("nil", translate("Same as Main Server"))
|
||||
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
|
||||
o:depends("v2ray_flow", "1")
|
||||
o.default = "nil"
|
||||
for i,v in pairs(route_name) do
|
||||
o = s:option(ListValue, v, translate(route_label[i]))
|
||||
o:value("nil", translate("Same as Main Server"))
|
||||
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
|
||||
o:depends("v2ray_flow", "1")
|
||||
o.default = "nil"
|
||||
end
|
||||
|
||||
o = s:option(ListValue, "threads", translate("Multi Threads Option"))
|
||||
o:value("0", translate("Auto Threads"))
|
||||
|
||||
@ -85,4 +85,9 @@ o.remove = function(self, section, value)
|
||||
NXFS.writefile(blockconf, "")
|
||||
end
|
||||
|
||||
s:tab("proxy", translate("Custom Proxy Domain Name"))
|
||||
|
||||
o = s:taboption("proxy", DynamicList, "proxy_domain_name", translate("Proxy Domain Name"))
|
||||
o.datatype = "hostname"
|
||||
|
||||
return m
|
||||
@ -130,33 +130,66 @@
|
||||
s.innerHTML = "<font color='green'><%:Import%>ShadowsocksR<%:Configuration Succeeded%></font>";
|
||||
return false;
|
||||
} else if (ssu[0] == "ss") {
|
||||
var ploc = ssu[1].indexOf("#");
|
||||
if (ploc > 0) {
|
||||
url0 = ssu[1].substr(0, ploc);
|
||||
param = ssu[1].substr(ploc + 1);
|
||||
} else {
|
||||
url0 = ssu[1]
|
||||
}
|
||||
var sstr = b64decsafe(url0);
|
||||
var url0, param = "";
|
||||
var sipIndex = ssu[1].indexOf("@");
|
||||
var ploc = ssu[1].indexOf("#");
|
||||
if (ploc > 0) {
|
||||
url0 = ssu[1].substr(0, ploc);
|
||||
param = ssu[1].substr(ploc + 1);
|
||||
} else {
|
||||
url0 = ssu[1];
|
||||
}
|
||||
|
||||
if (sipIndex != -1) {
|
||||
// SIP002
|
||||
var userInfo = b64decsafe(url0.substr(0, sipIndex));
|
||||
var temp = url0.substr(sipIndex + 1).split("/?");
|
||||
var serverInfo = temp[0].split(":");
|
||||
var server = serverInfo[0];
|
||||
var port = serverInfo[1];
|
||||
var method, password, plugin, pluginOpts;
|
||||
if (temp[1]) {
|
||||
var pluginInfo = decodeURIComponent(temp[1]);
|
||||
var pluginIndex = pluginInfo.indexOf(";");
|
||||
var pluginNameInfo = pluginInfo.substr(0, pluginIndex);
|
||||
plugin = pluginNameInfo.substr(pluginNameInfo.indexOf("=") + 1)
|
||||
pluginOpts = pluginInfo.substr(pluginIndex + 1);
|
||||
}
|
||||
|
||||
el('.type').value = "ss";
|
||||
|
||||
el('.type').dispatchEvent(event);
|
||||
var team = sstr.split('@');
|
||||
console.log(param);
|
||||
var part1 = team[0].split(':');
|
||||
var part2 = team[1].split(':');
|
||||
el('.server').value = part2[0];
|
||||
el('.server_port').value = part2[1];
|
||||
el('.password').value = part1[1];
|
||||
el('.encrypt_method_ss').value = part1[0];
|
||||
var userInfoSplitIndex = userInfo.indexOf(":");
|
||||
if (userInfoSplitIndex != -1) {
|
||||
method = userInfo.substr(0, userInfoSplitIndex);
|
||||
password = userInfo.substr(userInfoSplitIndex + 1);
|
||||
}
|
||||
el('.type').value = "ss";
|
||||
el('.type').dispatchEvent(event);
|
||||
el('.server').value = server;
|
||||
el('.server_port').value = port;
|
||||
el('.password').value = password || "";
|
||||
el('.encrypt_method_ss').value = method || "";
|
||||
el('.plugin').value = plugin || "";
|
||||
el('.plugin_opts').value = pluginOpts || "";
|
||||
} else {
|
||||
var sstr = b64decsafe(url0);
|
||||
el('.type').value = "ss";
|
||||
el('.type').dispatchEvent(event);
|
||||
var team = sstr.split('@');
|
||||
console.log(param);
|
||||
var part1 = team[0].split(':');
|
||||
var part2 = team[1].split(':');
|
||||
el('.server').value = part2[0];
|
||||
el('.server_port').value = part2[1];
|
||||
el('.password').value = part1[1];
|
||||
el('.encrypt_method_ss').value = part1[0];
|
||||
el('.plugin').value = "";
|
||||
el('.plugin_opts').value = "";
|
||||
}
|
||||
|
||||
if (param != undefined) {
|
||||
rema = decodeURI(param)
|
||||
el('.alias').value = decodeURI(param);
|
||||
}
|
||||
getFlag(rema, part2[0], sid); //get flag iso code
|
||||
getFlag(rema, server, sid); //get flag iso code
|
||||
s.innerHTML = "<font color='green'><%:Import%>Shadowsocks<%:Configuration Succeeded%></font>";
|
||||
return false;
|
||||
} else if (ssu[0] == "trojan") {
|
||||
|
||||
@ -639,6 +639,15 @@ msgstr "Prime Video 代理"
|
||||
msgid "TVB Video Proxy"
|
||||
msgstr "TVB 视频代理"
|
||||
|
||||
msgid "Custom Proxy"
|
||||
msgstr "自定义代理"
|
||||
|
||||
msgid "Custom Proxy Domain Name"
|
||||
msgstr "自定义分流域名"
|
||||
|
||||
msgid "Proxy Domain Name"
|
||||
msgstr "需要被分流的域名"
|
||||
|
||||
msgid "adblock settings"
|
||||
msgstr "广告屏蔽设置"
|
||||
|
||||
@ -649,4 +658,4 @@ msgid "Licence"
|
||||
msgstr "许可"
|
||||
|
||||
msgid "Area"
|
||||
msgstr "区域"
|
||||
msgstr "国家或地区"
|
||||
|
||||
@ -34,9 +34,9 @@ switch_server=$1
|
||||
MAXFD=32768
|
||||
CRON_FILE=/etc/crontabs/root
|
||||
threads=1
|
||||
shunt_type=("global" "youtube" "tw_video" "netflix" "disney" "prime" "tvb")
|
||||
shunt_port=(2080 2081 2082 2083 2084 2085 2086)
|
||||
shunt_array=("youtube" "tw_video" "netflix" "disney" "prime" "tvb")
|
||||
shunt_type=("global" "youtube" "tw_video" "netflix" "disney" "prime" "tvb" "custom")
|
||||
shunt_port=(2080 2081 2082 2083 2084 2085 2086 2087)
|
||||
shunt_array=("youtube" "tw_video" "netflix" "disney" "prime" "tvb" "custom")
|
||||
scount=0
|
||||
uci_get_by_name() {
|
||||
local ret=$(uci get $NAME.$1.$2 2>/dev/null)
|
||||
|
||||
@ -14,6 +14,8 @@ local netflix_server = ucursor:get_first(name, 'global', 'netflix_server')
|
||||
local disney_server = ucursor:get_first(name, 'global', 'disney_server')
|
||||
local prime_server = ucursor:get_first(name, 'global', 'prime_server')
|
||||
local tvb_server = ucursor:get_first(name, 'global', 'tvb_server')
|
||||
local custom_server = ucursor:get_first(name, 'global', 'custom_server')
|
||||
local proxy_domain_name = ucursor:get_list(name,"@access_control[0]","proxy_domain_name")
|
||||
|
||||
function gen_outbound(server_node, tags, local_ports)
|
||||
local bound = {}
|
||||
@ -107,6 +109,7 @@ if v2ray_flow == "1" then
|
||||
table.insert(outbounds_table, gen_outbound(disney_server, "disney",2084))
|
||||
table.insert(outbounds_table, gen_outbound(prime_server, "prime",2085))
|
||||
table.insert(outbounds_table, gen_outbound(tvb_server, "tvb",2086))
|
||||
table.insert(outbounds_table, gen_outbound(custom_server, "custom",2087))
|
||||
else
|
||||
table.insert(outbounds_table, gen_outbound(server_section, "main",local_port))
|
||||
end
|
||||
@ -207,6 +210,12 @@ local tvb_rule = {
|
||||
outboundTag = "tvb"
|
||||
}
|
||||
|
||||
local custom_rule = {
|
||||
type = "field",
|
||||
domain = proxy_domain_name,
|
||||
outboundTag = "custom"
|
||||
}
|
||||
|
||||
local rules_table = {}
|
||||
|
||||
if (youtube_server ~= "nil" and v2ray_flow == "1") then
|
||||
@ -233,6 +242,10 @@ if (tvb_server ~= "nil" and v2ray_flow == "1") then
|
||||
table.insert(rules_table, tvb_rule)
|
||||
end
|
||||
|
||||
if (custom_server ~= "nil" and v2ray_flow == "1") then
|
||||
table.insert(rules_table, custom_rule)
|
||||
end
|
||||
|
||||
local v2ray = {
|
||||
log = {
|
||||
-- error = "/var/vssrsss.log",
|
||||
|
||||
@ -27,7 +27,7 @@ cd "$PWD/src"
|
||||
# AFDO profile
|
||||
[ ! -f "chrome/android/profiles/afdo.prof" ] && {
|
||||
AFDO_NAME="$(cat "chrome/android/profiles/newest.txt")"
|
||||
[ ! -f "${dl_dir}/${AFDO_NAME}" ] && curl -L "https://storage.googleapis.com/chromeos-prebuilt/afdo-job/llvm/${AFDO_NAME}" -o "${dl_dir}/${AFDO_NAME}"
|
||||
[ ! -f "${dl_dir}/${AFDO_NAME}" ] && curl -f --connect-timeout 20 --retry 5 --location --insecure "https://storage.googleapis.com/chromeos-prebuilt/afdo-job/llvm/${AFDO_NAME}" -o "${dl_dir}/${AFDO_NAME}"
|
||||
bzip2 -cd > "chrome/android/profiles/afdo.prof" < "${dl_dir}/${AFDO_NAME}"
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ cd "$PWD/src"
|
||||
[ ! -d "third_party/llvm-build/Release+Asserts/bin" ] && {
|
||||
mkdir -p "third_party/llvm-build/Release+Asserts"
|
||||
CLANG_REVISION="$(python3 "tools/clang/scripts/update.py" --print-revision)"
|
||||
[ ! -f "${dl_dir}/clang-${CLANG_REVISION}.tgz" ] && curl -L "https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-${CLANG_REVISION}.tgz" -o "${dl_dir}/clang-${CLANG_REVISION}.tgz"
|
||||
[ ! -f "${dl_dir}/clang-${CLANG_REVISION}.tgz" ] && curl -f --connect-timeout 20 --retry 5 --location --insecure "https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-${CLANG_REVISION}.tgz" -o "${dl_dir}/clang-${CLANG_REVISION}.tgz"
|
||||
tar -xzf "${dl_dir}/clang-${CLANG_REVISION}.tgz" -C "third_party/llvm-build/Release+Asserts"
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ cd "$PWD/src"
|
||||
[ ! -f "gn/out/gn" ] && {
|
||||
mkdir -p "gn/out"
|
||||
GN_VERSION="$(grep "'gn_version':" "buildtools/DEPS" | cut -d"'" -f4)"
|
||||
[ ! -f "${dl_dir}/gn-${GN_VERSION}.zip" ] && curl -L "https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/${GN_VERSION}" -o "${dl_dir}/gn-${GN_VERSION}.zip"
|
||||
[ ! -f "${dl_dir}/gn-${GN_VERSION}.zip" ] && curl -f --connect-timeout 20 --retry 5 --location --insecure "https://chrome-infra-packages.appspot.com/dl/gn/gn/linux-amd64/+/${GN_VERSION}" -o "${dl_dir}/gn-${GN_VERSION}.zip"
|
||||
unzip -o "${dl_dir}/gn-${GN_VERSION}.zip" -d "gn/out"
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user