luci-app-vssr: sync with upstream source

This commit is contained in:
CN_SZTL 2020-03-24 05:09:41 +08:00
parent c73762f9cd
commit 7758c8bb01
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
14 changed files with 518 additions and 289 deletions

View File

@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-vssr
PKG_VERSION:=1.26
PKG_RELEASE:=20200319-4
PKG_VERSION:=1.27
PKG_RELEASE:=20200323-4
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \
@ -130,7 +130,7 @@ define Package/luci-app-vssr
SUBMENU:=3. Applications
TITLE:=A New SS/SSR/V2Ray/Trojan LuCI interface
PKGARCH:=all
DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +bash +pdnsd-alt +wget +lua +luasocket +jshn +lua-cjson +coreutils-nohup +python3-maxminddb +curl \
DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +bash +pdnsd-alt +wget +tcpping +lua-maxminddb +lua +luasocket +jshn +lua-cjson +coreutils-nohup +python3-maxminddb +curl \
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-redir \
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \
+PACKAGE_$(PKG_NAME)_INCLUDE_Trojan:trojan \

View File

@ -1,4 +1,4 @@
-- Copyright (C) 2018 jerrykuku <jerrykuku@qq.com>
-- Copyright (C) 2020 yushi studio <ywb94@qq.com>
-- Licensed to the public under the GNU General Public License v3.
module("luci.controller.vssr", package.seeall)
@ -6,7 +6,6 @@ function index()
if not nixio.fs.access("/etc/config/vssr") then
return
end
if nixio.fs.access("/usr/bin/ssr-redir") then
entry({"admin", "vpn"}, firstchild(), "VPN", 45).dependent = false
entry({"admin", "vpn", "vssr"},alias("admin", "vpn", "vssr", "client"), _("Hello World"), 10).dependent=true
@ -15,7 +14,7 @@ end
entry({"admin", "vpn", "vssr", "servers"}, arcombine(cbi("vssr/servers"), cbi("vssr/client-config")), _("Node List"), 20).leaf =true
entry({"admin", "vpn", "vssr", "subscription"},cbi("vssr/subscription"),_("Subscription"),30).leaf=true
entry({"admin", "vpn", "vssr", "control"}, cbi("vssr/control"), _("Access Control"), 40).leaf=true
entry({"admin", "vpn", "vssr", "servers-list"}, cbi("vssr/servers-list"), _("Severs Nodes"), 50).leaf =true
entry({"admin", "vpn", "vssr", "servers-list"}, arcombine(cbi("vssr/servers-list"), cbi("vssr/client-config")), _("Severs Nodes"), 50).leaf =true
entry({"admin", "vpn", "vssr", "appointlist"},form("vssr/appointlist"),_("Appointlist List"),60).leaf =true
entry({"admin", "vpn", "vssr", "udp2raw"},cbi("vssr/udp2raw"),_("udp2raw tunnel"),70).leaf = true
entry({"admin", "vpn", "vssr", "advanced"}, cbi("vssr/advanced"),_("Advanced Settings"), 80).leaf =true
@ -41,9 +40,7 @@ end
entry({"admin", "vpn", "vssr", "subscribe"}, call("get_subscribe"))
entry({"admin", "vpn", "vssr", "flag"}, call("get_flag"))
entry({"admin", "vpn", "vssr", "ip"}, call("check_ip"))
end
-- 执行订阅
function get_subscribe()
local cjson = require "cjson"
@ -75,12 +72,9 @@ function get_subscribe()
else
e.error = 1
end
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
-- 获取所有节点
function get_servers()
local uci = luci.model.uci.cursor()
@ -97,7 +91,6 @@ function get_servers()
luci.http.prepare_content("application/json")
luci.http.write_json(server_table)
end
-- 切换节点
function change_node()
local e = {}
@ -116,7 +109,6 @@ function change_node()
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
function switch()
local e = {}
local uci = luci.model.uci.cursor()
@ -134,8 +126,6 @@ function switch()
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
-- 检测全局服务器状态
function act_status()
math.randomseed(os.time())
@ -144,205 +134,197 @@ function act_status()
e.global=luci.sys.call("ps -w | grep ssr-retcp | grep -v grep >/dev/null") == 0
-- 检测Socks5
if tonumber(luci.sys.exec("ps -w | grep ssr-local |grep -v grep| wc -l"))>0 then
e.socks5 = true
elseif tonumber(luci.sys.exec("ps -w | grep ss-local |grep -v grep| wc -l"))>0 then
e.socks5 = true
elseif tonumber(luci.sys.exec("ps -w | grep v2-ssr-local |grep -v grep| wc -l"))>0 then
if tonumber(luci.sys.exec("ps -w | grep ssr-local |grep -v grep| wc -l"))>0 then
e.socks5 = true
elseif tonumber(luci.sys.exec("ps -w | grep ss-local |grep -v grep| wc -l"))>0 then
e.socks5 = true
elseif tonumber(luci.sys.exec("ps -w | grep v2-ssr-local |grep -v grep| wc -l"))>0 then
end
--检测chinadns状态
if tonumber(luci.sys.exec("ps -w | grep chinadns |grep -v grep| wc -l"))>0 then
e.chinadns= true
elseif tonumber(luci.sys.exec("ps -w | grep dnsparsing |grep -v grep| wc -l"))>0 then
e.chinadns= true
elseif tonumber(luci.sys.exec("ps -w | grep dnscrypt-proxy |grep -v grep| wc -l"))>0 then
e.chinadns= true
elseif tonumber(luci.sys.exec("ps -w | grep pdnsd |grep -v grep| wc -l"))>0 then
e.chinadns= true
elseif tonumber(luci.sys.exec("ps -w | grep dns2socks |grep -v grep| wc -l"))>0 then
e.chinadns= true
elseif tonumber(luci.sys.exec("ps -w | grep dnsforwarder |grep -v grep| wc -l"))>0 then
e.chinadns= true
if tonumber(luci.sys.exec("ps -w | grep chinadns |grep -v grep| wc -l"))>0 then
e.chinadns= true
elseif tonumber(luci.sys.exec("ps -w | grep dnsparsing |grep -v grep| wc -l"))>0 then
e.chinadns= true
elseif tonumber(luci.sys.exec("ps -w | grep dnscrypt-proxy |grep -v grep| wc -l"))>0 then
e.chinadns= true
elseif tonumber(luci.sys.exec("ps -w | grep pdnsd |grep -v grep| wc -l"))>0 then
e.chinadns= true
elseif tonumber(luci.sys.exec("ps -w | grep dns2socks |grep -v grep| wc -l"))>0 then
e.chinadns= true
elseif tonumber(luci.sys.exec("ps -w | grep dnsforwarder |grep -v grep| wc -l"))>0 then
e.chinadns= true
end
--检测服务端状态
if tonumber(luci.sys.exec("ps -w | grep ssr-server |grep -v grep| wc -l"))>0 then
e.server= true
if tonumber(luci.sys.exec("ps -w | grep ssr-server |grep -v grep| wc -l"))>0 then
e.server= true
end
if luci.sys.call("pidof ssr-server >/dev/null") == 0 then
e.ssr_server= true
if luci.sys.call("pidof ssr-server >/dev/null") == 0 then
e.ssr_server= true
end
if luci.sys.call("pidof ss-server >/dev/null") == 0 then
e.ss_server= true
if luci.sys.call("pidof ss-server >/dev/null") == 0 then
e.ss_server= true
end
if luci.sys.call("ps -w | grep v2ray-server | grep -v grep >/dev/null") == 0 then
e.v2_server= true
if luci.sys.call("ps -w | grep v2ray-server | grep -v grep >/dev/null") == 0 then
e.v2_server= true
end
-- 检测国内通道
e.baidu = false
sret = luci.sys.call("/usr/bin/ssr-check www.baidu.com 80 3 1")
if sret == 0 then
e.baidu = true
-- 检测国内通道
e.baidu = false
sret = luci.sys.call("/usr/bin/ssr-check www.baidu.com 80 3 1")
if sret == 0 then
e.baidu = true
end
-- 检测国外通道
e.google = false
sret = luci.sys.call("/usr/bin/ssr-check www.google.com 80 3 1")
if sret == 0 then
e.google = true
-- 检测国外通道
e.google = false
sret = luci.sys.call("/usr/bin/ssr-check www.google.com 80 3 1")
if sret == 0 then
e.google = true
end
-- 检测游戏模式状态
e.game = false
if tonumber(luci.sys.exec("ps -w | grep ssr-reudp |grep -v grep| wc -l"))>0 then
e.game= true
else
if tonumber(luci.sys.exec("ps -w | grep ssr-retcp |grep \"\\-u\"|grep -v grep| wc -l"))>0 then
e.game= true
e.game = false
if tonumber(luci.sys.exec("ps -w | grep ssr-reudp |grep -v grep| wc -l"))>0 then
e.game= true
else
if tonumber(luci.sys.exec("ps -w | grep ssr-retcp |grep \"\\-u\"|grep -v grep| wc -l"))>0 then
e.game= true
end
end
luci.http.prepare_content("application/json")
luci.http.write_json(e)
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
function act_ping()
local e = {}
local domain = luci.http.formvalue("domain")
local port = luci.http.formvalue("port")
e.index = luci.http.formvalue("index")
local iret = luci.sys.call(" ipset add ss_spec_wan_ac " .. domain .. " 2>/dev/null")
local socket = nixio.socket("inet", "stream")
socket:setopt("socket", "rcvtimeo", 3)
socket:setopt("socket", "sndtimeo", 3)
e.socket = socket:connect(domain, port)
socket:close()
e.ping = luci.sys.exec("ping -c 1 -W 1 %q 2>&1 | grep -o 'time=[0-9]*.[0-9]' | awk -F '=' '{print$2}'" % domain)
if (iret == 0) then
luci.sys.call(" ipset del ss_spec_wan_ac " .. domain)
end
luci.http.prepare_content("application/json")
luci.http.write_json(e)
local e = {}
local domain = luci.http.formvalue("domain")
local port = luci.http.formvalue("port")
e.index = luci.http.formvalue("index")
local iret = luci.sys.call(" ipset add ss_spec_wan_ac " .. domain .. " 2>/dev/null")
local socket = nixio.socket("inet", "stream")
socket:setopt("socket", "rcvtimeo", 3)
socket:setopt("socket", "sndtimeo", 3)
e.socket = socket:connect(domain, port)
socket:close()
e.ping = luci.sys.exec(string.format("echo -n $(tcpping -c 1 -i 1 -p %s %s 2>&1 | grep -o 'time=[0-9]*.[0-9]' | awk -F '=' '{print$2}') 2>/dev/null",port, domain))
if (e.ping == "") then
e.ping = luci.sys.exec("ping -c 1 -W 1 %q 2>&1 | grep -o 'time=[0-9]*.[0-9]' | awk -F '=' '{print$2}'" % domain)
end
if (iret == 0) then
luci.sys.call(" ipset del ss_spec_wan_ac " .. domain)
end
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
function check_status()
local set ="/usr/bin/ssr-check www." .. luci.http.formvalue("set") .. ".com 80 3 1"
sret=luci.sys.call(set)
if sret== 0 then
retstring ="0"
else
retstring ="1"
end
luci.http.prepare_content("application/json")
luci.http.write_json({ ret=retstring })
local set ="/usr/bin/ssr-check www." .. luci.http.formvalue("set") .. ".com 80 3 1"
sret=luci.sys.call(set)
if sret== 0 then
retstring ="0"
else
retstring ="1"
end
luci.http.prepare_content("application/json")
luci.http.write_json({ ret=retstring })
end
-- 刷新检测文件
function refresh_data()
local set =luci.http.formvalue("set")
local icount =0
function refresh_data()
local set =luci.http.formvalue("set")
local icount =0
if set == "gfw_data" then
refresh_cmd="wget-ssl --no-check-certificate https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt -O /tmp/gfw.b64"
sret=luci.sys.call(refresh_cmd .. " 2>/dev/null")
if sret== 0 then
luci.sys.call("/usr/bin/vssr-gfw")
icount = luci.sys.exec("cat /tmp/gfwnew.txt | wc -l")
if tonumber(icount)>1000 then
oldcount=luci.sys.exec("cat /etc/dnsmasq.ssr/gfw_list.conf | wc -l")
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/gfwnew.txt /etc/dnsmasq.ssr/gfw_list.conf")
luci.sys.exec("cp -f /tmp/gfwnew.txt /tmp/dnsmasq.ssr/gfw_list.conf")
luci.sys.call("/etc/init.d/dnsmasq restart")
retstring=tostring(math.ceil(tonumber(icount)/2))
else
retstring ="0"
if set == "gfw_data" then
refresh_cmd="wget-ssl --no-check-certificate https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt -O /tmp/gfw.b64"
sret=luci.sys.call(refresh_cmd .. " 2>/dev/null")
if sret== 0 then
luci.sys.call("/usr/bin/vssr-gfw")
icount = luci.sys.exec("cat /tmp/gfwnew.txt | wc -l")
if tonumber(icount)>1000 then
oldcount=luci.sys.exec("cat /etc/dnsmasq.ssr/gfw_list.conf | wc -l")
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/gfwnew.txt /etc/dnsmasq.ssr/gfw_list.conf")
luci.sys.exec("cp -f /tmp/gfwnew.txt /tmp/dnsmasq.ssr/gfw_list.conf")
luci.sys.call("/etc/init.d/dnsmasq restart")
retstring=tostring(math.ceil(tonumber(icount)/2))
else
retstring ="0"
end
else
retstring ="-1"
else
retstring ="-1"
end
luci.sys.exec("rm -f /tmp/gfwnew.txt ")
else
retstring ="-1"
luci.sys.exec("rm -f /tmp/gfwnew.txt ")
else
retstring ="-1"
end
elseif set == "ip_data" then
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://ispip.clang.cn/all_cn.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 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"
elseif set == "ip_data" then
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://ispip.clang.cn/all_cn.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 .. " 2>/dev/null")
if sret== 0 then
luci.sys.call("/usr/bin/vssr-ad")
icount = luci.sys.exec("cat /tmp/ad.conf | wc -l")
if tonumber(icount)>1000 then
if nixio.fs.access("/etc/dnsmasq.ssr/ad.conf") then
oldcount=luci.sys.exec("cat /etc/dnsmasq.ssr/ad.conf | wc -l")
else
oldcount=0
end
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/ad.conf /etc/dnsmasq.ssr/ad.conf")
luci.sys.exec("cp -f /tmp/ad.conf /tmp/dnsmasq.ssr/ad.conf")
luci.sys.call("/etc/init.d/dnsmasq restart")
retstring=tostring(math.ceil(tonumber(icount)))
else
retstring ="0"
end
else
retstring ="-1"
end
luci.sys.exec("rm -f /tmp/ad.conf")
else
retstring ="-1"
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"
end
sret=luci.sys.call(refresh_cmd .. " 2>/dev/null")
if sret== 0 then
luci.sys.call("/usr/bin/vssr-ad")
icount = luci.sys.exec("cat /tmp/ad.conf | wc -l")
if tonumber(icount)>1000 then
if nixio.fs.access("/etc/dnsmasq.ssr/ad.conf") then
oldcount=luci.sys.exec("cat /etc/dnsmasq.ssr/ad.conf | wc -l")
else
oldcount=0
end
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/ad.conf /etc/dnsmasq.ssr/ad.conf")
luci.sys.exec("cp -f /tmp/ad.conf /tmp/dnsmasq.ssr/ad.conf")
luci.sys.call("/etc/init.d/dnsmasq restart")
retstring=tostring(math.ceil(tonumber(icount)))
else
retstring ="0"
end
else
retstring ="-1"
end
luci.sys.exec("rm -f /tmp/ad.conf")
else
retstring ="-1"
end
end
luci.http.prepare_content("application/json")
luci.http.write_json({ ret=retstring ,retcount=icount})
luci.http.prepare_content("application/json")
luci.http.write_json({ ret=retstring ,retcount=icount})
end
-- 检测所有服务器
function check_ports()
local set = ""
local retstring = "<br /><br />"
local s
local server_name = ""
local vssr = "vssr"
local uci = luci.model.uci.cursor()
local iret = 1
uci:foreach(
vssr,
"servers",
function(s)
if s.alias then
function check_ports()
local set = ""
local retstring = "<br /><br />"
local s
local server_name = ""
local vssr = "vssr"
local uci = luci.model.uci.cursor()
local iret = 1
uci:foreach(
vssr,
"servers",
function(s)
if s.alias then
server_name = s.alias
elseif s.server and s.server_port then
server_name = "%s:%s" % {s.server, s.server_port}
end
end
iret = luci.sys.call(" ipset add ss_spec_wan_ac " .. s.server .. " 2>/dev/null")
socket = nixio.socket("inet", "stream")
socket:setopt("socket", "rcvtimeo", 3)
@ -467,14 +449,14 @@ function get_flag()
end
function act_read(lfile)
local NXFS = require "nixio.fs"
local HTTP = require "luci.http"
local lfile = HTTP.formvalue("lfile")
local ldata={}
ldata[#ldata+1] = NXFS.readfile(lfile) or "_nofile_"
if ldata[1] == "" then
local NXFS = require "nixio.fs"
local HTTP = require "luci.http"
local lfile = HTTP.formvalue("lfile")
local ldata={}
ldata[#ldata+1] = NXFS.readfile(lfile) or "_nofile_"
if ldata[1] == "" then
ldata[1] = "_nodata_"
end
HTTP.prepare_content("application/json")
HTTP.write_json(ldata)
HTTP.prepare_content("application/json")
HTTP.write_json(ldata)
end

View File

@ -83,7 +83,39 @@ o:value("", translate("Disable"))
o:value("same", translate("Same as Global Server"))
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
o = s:option(Flag, "v2ray_flow", translate("Open v2ray split-flow") .."</font>")
o.rmempty = false
o.description = ("<font color='red'>" ..translate("When open v2ray split-flow,your main server must be a v2ray server").."</font>")
o = s:option(ListValue, "youtube_server", translate("Youtube Proxy"))
o:value("nil", translate("Same as Global Server"))
for _,key in pairs(key_table_v2) do o:value(key,v2ray_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 Global Server"))
for _,key in pairs(key_table_v2) do o:value(key,v2ray_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 Global Server"))
for _,key in pairs(key_table_v2) do o:value(key,v2ray_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 Global Server"))
for _,key in pairs(key_table_v2) do o:value(key,v2ray_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 Global Server"))
for _,key in pairs(key_table_v2) do o:value(key,v2ray_table[key]) end
o:depends("v2ray_flow", "1")
o.default = "nil"
o = s:option(ListValue, "threads", translate("Multi Threads Option"))
o:value("0", translate("Auto Threads"))
@ -138,6 +170,13 @@ if nixio.fs.access("/usr/bin/dnscrypt-proxy") then
o:value("5", translate("Use dnscrypt-proxy query and cache"))
end
if nixio.fs.access("/usr/sbin/smartdns") then
o:value("6", translate("Use smartdns query and cache"))
end
if nixio.fs.access("/usr/sbin/https_dns_proxy") then
o:value("7", translate("Use https_dns_proxy query and cache"))
end
o.default = 1
o:depends("pdnsd_enable", "6")
@ -167,72 +206,6 @@ o:depends("pdnsd_enable", "7")
o.default = "8.8.4.4:53"
-- [[ SOCKS5 Proxy ]]--
if nixio.fs.access("/usr/bin/ssr-local") then
s = m:section(TypedSection, "socks5_proxy", translate("SOCKS5 Proxy"))
s.anonymous = true
o = s:option(ListValue, "server", translate("Server"))
o:value("nil", translate("Disable"))
for _,key in pairs(key_table) do o:value(key,server_table[key]) end
o.default = "nil"
o.rmempty = false
o = s:option(Value, "local_port", translate("Local Port"))
o.datatype = "port"
o.default = 1080
o.rmempty = false
-- [[ HTTP Proxy ]]--
if nixio.fs.access("/usr/sbin/privoxy") then
o = s:option(Flag, "http_enable", translate("Enable HTTP Proxy"))
o.rmempty = false
o = s:option(Value, "http_port", translate("HTTP Port"))
o.datatype = "port"
o.default = 1081
o.rmempty = false
end
end
o = s:option(Flag, "v2ray_flow", translate("Open v2ray split-flow") .."</font>")
o.rmempty = false
o.description = ("<font color='blue'>" ..translate("When open v2ray split-flow,your main server must be a v2ray server").."</font>")
o = s:option(ListValue, "youtube_server", translate("Youtube Proxy"))
o:value("nil", translate("Same as Global Server"))
for _,key in pairs(key_table_v2) do o:value(key,v2ray_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 Global Server"))
for _,key in pairs(key_table_v2) do o:value(key,v2ray_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 Global Server"))
for _,key in pairs(key_table_v2) do o:value(key,v2ray_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 Global Server"))
for _,key in pairs(key_table_v2) do o:value(key,v2ray_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 Global Server"))
for _,key in pairs(key_table_v2) do o:value(key,v2ray_table[key]) end
o:depends("v2ray_flow", "1")
o.default = "nil"
o = s:option(Button,"gfw_data",translate("GFW List Data"))
o.rawhtml = true
o.template = "vssr/refresh"

View File

@ -15,8 +15,8 @@ end)
m = Map(vssr)
m:section(SimpleSection).template = "vssr/status"
m = Map(vssr, translate("Node List"))
m:section(SimpleSection).template = "vssr/status1"
-- [[ Servers Manage ]]--
@ -34,35 +34,43 @@ function s.create(...)
return
end
end
o = s:option(DummyValue, "type", translate("Type"))
o.width="1%"
o = s:option(DummyValue, "alias", translate("Alias"))
o.width="1%"
o.width="10%"
o = s:option(DummyValue, "type", translate("Type"))
o.width="15%"
o = s:option(DummyValue, "server", translate("Server Address"))
o.width="30%"
o.width="10%"
o = s:option(DummyValue, "server_port", translate("Server Port"))
o.width="30%"
o.width="10%"
o = s:option(DummyValue, "encrypt_method", translate("Encrypt Method"))
o.width="10%"
o = s:option(DummyValue,"security",translate("Encrypt Method"))
o.width="1%"
o = s:option(DummyValue, "protocol", translate("Protocol"))
o.width="10%"
o = s:option(DummyValue, "obfs", translate("Obfs"))
o.width="10%"
o = s:option(Flag, "switch_enable", translate("Enable Auto Switch"))
o.width="1%"
o.width="10%"
if nixio.fs.access("/usr/bin/kcptun-client") then
o = s:option(Flag, "kcp_enable", translate("KcpTun"))
o.width="10%"
end
o = s:option(DummyValue, "server_port", translate("Socket Connected"))
o.template="vssr/socket"
o.width="1%"
o.width="10%"
o = s:option(DummyValue,"server",translate("Ping Latency"))
o.template="vssr/ping"
o.width="1%"
o.width="10%"
m:append(Template("vssr/server_list"))
m:section(SimpleSection).template = "vssr/status2"
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="20200319.1.26"
local IPK_Version="20200323.1.27"
local m, s, o
local redir_run=0
local reudp_run=0

View File

@ -48,4 +48,6 @@ local dsp = require "luci.dispatcher"
for (let i = 0; i < 10; i++) {
thread()
}
</script>
</script>

View File

@ -28,7 +28,7 @@ math.randomseed(os.time())
<div class="pure-u-1-6">
<div class="block pure-g">
<div class="pure-u-3-5">
<h4 id="baidu_status"><%:domestic website%><br /><span class="red"><%:Problem detected%>✘</span></h4>
<h4 id="baidu_status"><%:baidu%><br /><span class="red"><%:Problem detected%>✘</span></h4>
</div>
<div class="pure-u-2-5">
<div class="img-con">
@ -41,7 +41,7 @@ math.randomseed(os.time())
<div class="pure-u-1-6">
<div class="block pure-g">
<div class="pure-u-3-5">
<h4 id="google_status"><%:foreign websites%><br /><span class="red"><%:Problem detected%>✘</span></h4>
<h4 id="google_status"><%:youtube%><br /><span class="red"><%:Problem detected%>✘</span></h4>
</div>
<div class="pure-u-2-5">
<div class="img-con">
@ -115,14 +115,14 @@ math.randomseed(os.time())
tb.innerHTML = '<%:Client%><br><span class="red"><%:Not Running%>✘</span>';
}
if (data.google) {
tb1.innerHTML = '<%:foreign websites%><br><span class="green"><%:Connect OK%>✔</span>';
tb1.innerHTML = '<%:youtube%><br><span class="green"><%:Connect OK%>✔</span>';
} else {
tb1.innerHTML = '<%:foreign websites%><br><span class="red"><%:Problem detected%>✘</span>';
tb1.innerHTML = '<%:youtube%><br><span class="red"><%:Problem detected%>✘</span>';
}
if (data.baidu) {
tb2.innerHTML = '<%:domestic website%><br><span class="green"><%:Connect OK%>✔</span>';
tb2.innerHTML = '<%:baidu%><br><span class="green"><%:Connect OK%>✔</span>';
} else {
tb2.innerHTML = '<%:domestic website%><br><span class="red"><%:Problem detected%>✘</span>';
tb2.innerHTML = '<%:baidu%><br><span class="red"><%:Problem detected%>✘</span>';
}
if (data.game) {
tb3.innerHTML = '<%:Game Mode%><br><span class="green"><%:Running%>✔</span>';

View File

@ -0,0 +1,247 @@
<fieldset id="_vssr_status_fieldset" class="cbi-section">
<legend>
<%:Running Status%>
</legend>
<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%}
.status{
margin: 0rem -0.5rem -0.7rem -0.5rem;
}
.block{
margin: 0.5rem 0.5rem;
padding: 0;
font-weight: normal;
font-style: normal;
line-height: 1;
font-family: inherit;
min-width: inherit;
overflow-x: auto;
overflow-y: hidden;
padding: 6px 10px 7px 8px;
border: 1px solid rgba(0,0,0,.05);
border-radius: .375rem;
background-color: #f4;
box-shadow: 0 0 2rem 0 rgba(136,152,170,.15);
}
.img-con{
margin: 1rem;
}
.green{
font-size:1.25rem;
color: #2dce89;
}
.red{
font-size:1.25rem;
color: #fb6340;
}
.sk-text-success{
color: #2dce89;
}
.sk-text-error{
color: #fb6340;
}
.gap{
margin-right:0.5rem;
}
.block img{
width: 48px;
height: auto;
float:right;
}
.pure-u-5-8{
display:flex;
align-items:center;
}
.block h4{
font-size: .8125rem;
font-weight: 600;
margin: 1rem;
color:#8898aa!important;
line-height: 1.8em;
}
@media screen and (max-width: 1920px) {
.block h4{
font-size: 1.2rem;
}
}
@media screen and (max-width: 1690px) {
.block h4{
font-size: 1rem;
}
}
@media screen and (max-width: 1290px) {
.block h4{
font-size: 0.8rem;
}
.pure-u-1-6{
width:33.333%;
}
}
@media screen and (max-width: 700px) {
.pure-u-1-6{
width:50%;
}
.img-con{
margin: 0.5rem;
}
.block h4{
font-size: 0.81rem;
}
}
</style>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
</head>
<body>
<div class="pure-g status">
<div class="pure-u-1-6">
<div class="block pure-g">
<div class="pure-u-3-5">
<h4 id="vssr_status"><%:Client%><br /><span class="red"><%:Not Running%>✘</span></h4>
</div>
<div class="pure-u-2-5">
<div class="img-con">
<img src="https://i.imgur.com/wzbtvXp.png" >
</div>
</div>
</div>
</div>
<div class="pure-u-1-6">
<div class="block pure-g">
<div class="pure-u-3-5">
<h4 id="baidu_status"><%:baidu%><br /><span class="red"><%:Problem detected%>✘</span></h4>
</div>
<div class="pure-u-2-5">
<div class="img-con">
<img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjEsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0i5Zu+5bGCXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTAwIDEwMDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4NCgkuc3Qwe2ZpbGw6IzMzODhGRjt9DQoJLnN0MXtmaWxsLXJ1bGU6ZXZlbm9kZDtjbGlwLXJ1bGU6ZXZlbm9kZDtmaWxsOiNGRkZGRkY7fQ0KPC9zdHlsZT4NCjxjaXJjbGUgY2xhc3M9InN0MCIgY3g9IjUwIiBjeT0iNTAiIHI9IjUwIi8+DQo8ZyBpZD0i5pCc57SiX+eGiuaOjF82Nmljb24iPg0KCTxnIGlkPSJsb2dvIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMjEuMjEyMTIxLCA5MC45MDkwOTEpIj4NCgkJPHBhdGggaWQ9IkZpbGwtMSIgY2xhc3M9InN0MSIgZD0iTS03OS43LTU1LjRjNC41LDAsOC41LTUuNCw4LjUtMTEuOWMwLTYuNS0zLjctMTEuOS04LjUtMTEuOWMtNC41LDAtOC41LDUuNC04LjUsMTEuOQ0KCQkJQy04Ny45LTYwLjctODQuMi01NS40LTc5LjctNTUuNCIvPg0KCQk8cGF0aCBpZD0iRmlsbC0zIiBjbGFzcz0ic3QxIiBkPSJNLTU5LjktNTQuNWM2LjIsMC44LDEwLjItNS43LDExLTEwLjhjMC44LTQuOC0zLjEtMTAuOC03LjYtMTEuNmMtNC4yLTEuMS05LjksNS45LTEwLjIsMTAuNQ0KCQkJQy02Ny4yLTYxLTY2LjEtNTUuNC01OS45LTU0LjUiLz4NCgkJPHBhdGggaWQ9IkZpbGwtNSIgY2xhc3M9InN0MSIgZD0iTS05NS4zLTM4LjZjOC41LTEuNyw3LjEtMTEuNiw3LjEtMTMuOWMtMC4zLTMuNC00LjItOS4zLTkuOS04LjhjLTYuOCwwLjYtNy42LDEwLjItNy42LDEwLjINCgkJCUMtMTA2LjktNDYuNi0xMDMuOC0zNi45LTk1LjMtMzguNiIvPg0KCQk8cGF0aCBpZD0iRmlsbC03IiBjbGFzcz0ic3QxIiBkPSJNLTM1LjItNDYuM2MwLTIuNS0yLTkuNi05LjMtOS42Yy03LjQsMC04LjUsNi44LTguNSwxMS42YzAsNC41LDAuMywxMSw5LjYsMTAuOA0KCQkJQy0zNC40LTMzLjgtMzUuMi00NC0zNS4yLTQ2LjMiLz4NCgkJPHBhdGggaWQ9IkZpbGwtOSIgY2xhc3M9InN0MSIgZD0iTS04Ni41LTIxLjRjLTAuMywwLjYtMC44LDIuNS0wLjMsNGMwLjgsMy40LDQsMy43LDQsMy43aDQuMnYtMTAuOGgtNC44DQoJCQlDLTg1LjEtMjMuNi04Ni4yLTIxLjktODYuNS0yMS40Ii8+DQoJCTxwYXRoIGlkPSJGaWxsLTExIiBjbGFzcz0ic3QxIiBkPSJNLTUzLjEtOS41aC0xMi43Yy00LjgtMS4xLTUuMS00LjgtNS4xLTQuOHYtMTMuOWg1LjF2MTIuNWMwLjMsMS40LDIsMS43LDIsMS43aDUuNHYtMTMuOWg1LjQNCgkJCVYtOS41eiBNLTczLjItOS4ySC04NGMtNC44LTAuOC02LjgtNC4yLTYuOC00LjhjLTAuMy0wLjYtMS43LTMuMS0wLjgtNy42YzItNi41LDcuOS03LjEsNy45LTcuMWg1Ljd2LTcuMWg0LjgNCgkJCUMtNzMuMi0zNS44LTczLjItOS4yLTczLjItOS4yeiBNLTQ0LjYtMjUuM2MwLDAtOS42LTcuNC0xNS4zLTE1LjNjLTcuNi0xMS42LTE4LjQtNy4xLTIxLjgtMS4xYy0zLjQsNS45LTkuMSw5LjktOS45LDEwLjgNCgkJCWMtMC44LDAuOC0xMS42LDYuOC05LjEsMTcuM0MtOTguMS0zLjItODkuOS0zLjUtODkuOS0zLjVzNi4yLDAuNiwxMy4zLTEuMWM3LjEtMS43LDEzLjMsMC4zLDEzLjMsMC4zUy00Ni42LDEuMy00Mi05LjcNCgkJCUMtMzcuNS0xOS43LTQ0LjYtMjUuMy00NC42LTI1LjNMLTQ0LjYtMjUuM3oiLz4NCgk8L2c+DQo8L2c+DQo8L3N2Zz4NCg==">
</div>
</div>
</div>
</div>
<div class="pure-u-1-6">
<div class="block pure-g">
<div class="pure-u-3-5">
<h4 id="google_status"><%:youtube%><br /><span class="red"><%:Problem detected%>✘</span></h4>
</div>
<div class="pure-u-2-5">
<div class="img-con">
<img src="https://i.imgur.com/3mE04AZ.png">
</div>
</div>
</div>
</div>
<div class="pure-u-1-6">
<div class="block pure-g">
<div class="pure-u-3-5">
<h4 id="game_status"><%:Game Mode%><br /><span class="red"><%:Not Running%>✘</span></h4>
</div>
<div class="pure-u-2-5">
<div class="img-con">
<img src="/luci-static/vssr/img/udp.svg">
</div>
</div>
</div>
</div>
<div class="pure-u-1-6">
<div class="block pure-g">
<div class="pure-u-3-5">
<h4 id="chinadns_status">𝐂𝐡𝐢𝐧𝐚𝐃𝐍𝐒<br /><span class="red"><%:Not Running%>✘</span></h4>
</div>
<div class="pure-u-2-5">
<div class="img-con">
<img src="https://i.imgur.com/3hkGjsK.png" >
</div>
</div>
</div>
</div>
<div class="pure-u-1-6">
<div class="block pure-g">
<div class="pure-u-3-5">
<h4 id="socks5_status">𝙎𝙊𝘾𝙆𝙎5<br /><span class="red"><%:Not Running%>✘</span></h4>
</div>
<div class="pure-u-2-5">
<div class="img-con">
<img src="https://i.imgur.com/bYz9YoR.png" >
</div>
</div>
</div>
</div>
</div>
<script>
const $$ = document;
function get_state(){
$.get('<%=url([[admin]], [[vpn]], [[vssr]], [[run]])%>',
function (data) {
console.log(data);
}, "json");
}
//get_state();
//<![CDATA[
XHR.poll(5, '<%=url([[admin]], [[vpn]], [[vssr]], [[run]])%>', null,
function (x, data) {
var tb = document.getElementById('vssr_status');
var tb1 = document.getElementById('google_status');
var tb2 = document.getElementById('baidu_status');
var tb3 = document.getElementById('game_status');
var tb4 = document.getElementById('chinadns_status');
var tb5 = document.getElementById('socks5_status');
if (data && tb) {
if (data.global) {
tb.innerHTML = '<%:Client%><br><span class="green"><%:Running%>✔</span>';
} else {
tb.innerHTML = '<%:Client%><br><span class="red"><%:Not Running%>✘</span>';
}
if (data.google) {
tb1.innerHTML = '<%:youtube%><br><span class="green"><%:Connect OK%>✔</span>';
} else {
tb1.innerHTML = '<%:youtube%><br><span class="red"><%:Problem detected%>✘</span>';
}
if (data.baidu) {
tb2.innerHTML = '<%:baidu%><br><span class="green"><%:Connect OK%>✔</span>';
} else {
tb2.innerHTML = '<%:baidu%><br><span class="red"><%:Problem detected%>✘</span>';
}
if (data.game) {
tb3.innerHTML = '<%:Game Mode%><br><span class="green"><%:Running%>✔</span>';
} else {
tb3.innerHTML = '<%:Game Mode%><br><span class="red"><%:Not Running%>✘</span>';
}
if (data.chinadns) {
tb4.innerHTML = '𝐂𝐡𝐢𝐧𝐚𝐃𝐍𝐒<br><span class="green"><%:Running%>✔</span>';
} else {
tb4.innerHTML = '𝐂𝐡𝐢𝐧𝐚𝐃𝐍𝐒<br><span class="red"><%:Not Running%>✘</span>';
}
if (data.socks5) {
tb5.innerHTML = '𝙎𝙊𝘾𝙆𝙎5<br><span class="green"><%:Running%>✔</span>';
} else {
tb5.innerHTML = '𝙎𝙊𝘾𝙆𝙎5<br><span class="red"><%:Not Running%>✘</span>';
}
}
}
);
//]]>
</script>
</body>
</html></fieldset>

View File

@ -97,7 +97,7 @@
<div class="block pure-g">
<div class="pure-u-3-5">
<h4 id="baidu_status"><%:domestic website%><br><span class="red"><%:Problem detected%>✘</span></h4>
<h4 id="baidu_status"><%:baidu%><br><span class="red"><%:Problem detected%>✘</span></h4>
</div>
<div class="pure-u-2-5">
<div class="img-con">
@ -109,7 +109,7 @@
<div class="pure-u-1-6">
<div class="block pure-g">
<div class="pure-u-3-5">
<h4 id="google_status"><%:foreign websites%><br><span class="red"><%:Problem detected%>✘</span></h4>
<h4 id="google_status"><%:youtube%><br><span class="red"><%:Problem detected%>✘</span></h4>
</div>
<div class="pure-u-2-5">
<div class="img-con">
@ -166,8 +166,8 @@
function (x, data) {
if (data) {
document.getElementById('vssr_status').innerHTML = data.global?'<%:Client%><br><span class="green"><%:Running%>✔</span>':'<%:Client%><br><span class="red"><%:Not Running%>✘</span>';
document.getElementById('baidu_status').innerHTML = data.baidu?'<%:domestic website%><br><span class="green"><%:Connect OK%>✔</span>':'<%:domestic website%><br><span class="red"><%:Problem detected%>✘</span>';
document.getElementById('google_status').innerHTML = data.google?'<%:foreign websites%><br><span class="green"><%:Connect OK%>✔</span>':'<%:foreign websites%><br><span class="red"><%:Problem detected%>✘</span>';
document.getElementById('baidu_status').innerHTML = data.baidu?'<%:baidu%><br><span class="green"><%:Connect OK%>✔</span>':'<%:baidu%><br><span class="red"><%:Problem detected%>✘</span>';
document.getElementById('google_status').innerHTML = data.google?'<%:youtube%><br><span class="green"><%:Connect OK%>✔</span>':'<%:youtube%><br><span class="red"><%:Problem detected%>✘</span>';
document.getElementById('ss_server_status').innerHTML = data.ss_server?'<%:SS Servers%><br><span class="green"><%:Running%>✔</span>':'<%:SS Servers%><br><span class="red"><%:Not Running%>✘</span>';
document.getElementById('ssr_server_status').innerHTML = data.ssr_server?'<%:SSR Servers%><br><span class="green"><%:Running%>✔</span>':'<%:SSR Servers%><br><span class="red"><%:Not Running%>✘</span>';
document.getElementById('v2_server_status').innerHTML = data.v2_server?'<%:V2 Servers%><br><span class="green"><%:Running%>✔</span>':'<%:V2 Servers%><br><span class="red"><%:Not Running%>✘</span>';

View File

@ -125,10 +125,10 @@ msgstr "个节点"
msgid "Client"
msgstr "客户端"
msgid "foreign websites"
msgid "youtube"
msgstr "国外网站"
msgid "domestic website"
msgid "baidu"
msgstr "国内网站"
msgid "Problem detected"

View File

@ -1062,13 +1062,16 @@ stop() {
killall -q -9 haproxy
killall -q -9 privoxy
killall -q -9 ipt2socks
killall -q -9 dns2socks
killall -q -9 dns2socks
killall -q -9 v2ray-plugin
killall -q -9 gq-client
killall -q -9 gq-server
killall -q -9 obfs-local
killall -q -9 obfs-server
killall -q -9 chinadns
killall -q -9 dnscrypt-proxy
killall -q -9 dnsforwarder
killall -q -9 pdnsd
killall -q -9 udp2raw
killall -q -9 udpspeeder
if [ -f /var/run/pdnsd.pid ]; then

View File

@ -17,7 +17,7 @@ EOF
/etc/init.d/dnscrypt-proxy disable
/etc/init.d/privoxy stop
/etc/init.d/privoxy disable
killall -q -9 v2ray-plugin
killall -q -9 v2ray-plugin dnscrypt-proxy dns2socks dnsforwarder chinadns
/usr/share/vssr/gfw2ipset.sh
rm -f /tmp/luci-indexcache

View File

@ -1,12 +1,13 @@
#!/bin/bash
# Copyright (C) 2019 Jerryk <jerrykuku@qq.com>
python=python3
lua=/usr/bin/lua
name="$1"
host=$2
code=''
iso_array=(AC AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CP CR CU CV CW CX CY CZ DE DG DJ DK DM DO DZ EA EC EE EG EH ER ES ET EU FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU IC ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TA TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM UN US UY UZ VA VC VE VG VI VN VU WF WS XK YE YT ZA ZM ZW)
iso_array=(AC AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CP CR CU CV CW CX CY CZ DE DG DJ DK DM DO DZ EA EC EE EG EH ER ES ET EU FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU IC ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TA TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM UN US UY UZ VA VC VE VG VI VN VU WF WS XK YE YT ZA ZM ZW US HK TW JP GB GB DE FR IN TR SG KR RU IE CA )
emoji_array=(🇦🇨 🇦🇩 🇦🇪 🇦🇫 🇦🇬 🇦🇮 🇦🇱 🇦🇲 🇦🇴 🇦🇶 🇦🇷 🇦🇸 🇦🇹 🇦🇺 🇦🇼 🇦🇽 🇦🇿 🇧🇦 🇧🇧 🇧🇩 🇧🇪 🇧🇫 🇧🇬 🇧🇭 🇧🇮 🇧🇯 🇧🇱 🇧🇲 🇧🇳 🇧🇴 🇧🇶 🇧🇷 🇧🇸 🇧🇹 🇧🇻 🇧🇼 🇧🇾 🇧🇿 🇨🇦 🇨🇨 🇨🇩 🇨🇫 🇨🇬 🇨🇭 🇨🇮 🇨🇰 🇨🇱 🇨🇲 🇨🇳 🇨🇴 🇨🇵 🇨🇷 🇨🇺 🇨🇻 🇨🇼 🇨🇽 🇨🇾 🇨🇿 🇩🇪 🇩🇬 🇩🇯 🇩🇰 🇩🇲 🇩🇴 🇩🇿 🇪🇦 🇪🇨 🇪🇪 🇪🇬 🇪🇭 🇪🇷 🇪🇸 🇪🇹 🇪🇺 🇫🇮 🇫🇯 🇫🇰 🇫🇲 🇫🇴 🇫🇷 🇬🇦 🇬🇧 🇬🇩 🇬🇪 🇬🇫 🇬🇬 🇬🇭 🇬🇮 🇬🇱 🇬🇲 🇬🇳 🇬🇵 🇬🇶 🇬🇷 🇬🇸 🇬🇹 🇬🇺 🇬🇼 🇬🇾 🇭🇰 🇭🇲 🇭🇳 🇭🇷 🇭🇹 🇭🇺 🇮🇨 🇮🇩 🇮🇪 🇮🇱 🇮🇲 🇮🇳 🇮🇴 🇮🇶 🇮🇷 🇮🇸 🇮🇹 🇯🇪 🇯🇲 🇯🇴 🇯🇵 🇰🇪 🇰🇬 🇰🇭 🇰🇮 🇰🇲 🇰🇳 🇰🇵 🇰🇷 🇰🇼 🇰🇾 🇰🇿 🇱🇦 🇱🇧 🇱🇨 🇱🇮 🇱🇰 🇱🇷 🇱🇸 🇱🇹 🇱🇺 🇱🇻 🇱🇾 🇲🇦 🇲🇨 🇲🇩 🇲🇪 🇲🇫 🇲🇬 🇲🇭 🇲🇰 🇲🇱 🇲🇲 🇲🇳 🇲🇴 🇲🇵 🇲🇶 🇲🇷 🇲🇸 🇲🇹 🇲🇺 🇲🇻 🇲🇼 🇲🇽 🇲🇾 🇲🇿 🇳🇦 🇳🇨 🇳🇪 🇳🇫 🇳🇬 🇳🇮 🇳🇱 🇳🇴 🇳🇵 🇳🇷 🇳🇺 🇳🇿 🇴🇲 🇵🇦 🇵🇪 🇵🇫 🇵🇬 🇵🇭 🇵🇰 🇵🇱 🇵🇲 🇵🇳 🇵🇷 🇵🇸 🇵🇹 🇵🇼 🇵🇾 🇶🇦 🇷🇪 🇷🇴 🇷🇸 🇷🇺 🇷🇼 🇸🇦 🇸🇧 🇸🇨 🇸🇩 🇸🇪 🇸🇬 🇸🇭 🇸🇮 🇸🇯 🇸🇰 🇸🇱 🇸🇲 🇸🇳 🇸🇴 🇸🇷 🇸🇸 🇸🇹 🇸🇻 🇸🇽 🇸🇾 🇸🇿 🇹🇦 🇹🇨 🇹🇩 🇹🇫 🇹🇬 🇹🇭 🇹🇯 🇹🇰 🇹🇱 🇹🇲 🇹🇳 🇹🇴 🇹🇷 🇹🇹 🇹🇻 🇹🇼 🇹🇿 🇺🇦 🇺🇬 🇺🇲 🇺🇳 🇺🇸 🇺🇾 🇺🇿 🇻🇦 🇻🇨 🇻🇪 🇻🇬 🇻🇮 🇻🇳 🇻🇺 🇼🇫 🇼🇸 🇽🇰 🇾🇪 🇾🇹 🇿🇦 🇿🇲 🇿🇼 美国 香港 台湾 日本 英国 UK 德国 法国 印度 土耳其 新加坡 韩国 俄罗斯 爱尔兰 加拿大 )
emoji_array=(🇦🇨 🇦🇩 🇦🇪 🇦🇫 🇦🇬 🇦🇮 🇦🇱 🇦🇲 🇦🇴 🇦🇶 🇦🇷 🇦🇸 🇦🇹 🇦🇺 🇦🇼 🇦🇽 🇦🇿 🇧🇦 🇧🇧 🇧🇩 🇧🇪 🇧🇫 🇧🇬 🇧🇭 🇧🇮 🇧🇯 🇧🇱 🇧🇲 🇧🇳 🇧🇴 🇧🇶 🇧🇷 🇧🇸 🇧🇹 🇧🇻 🇧🇼 🇧🇾 🇧🇿 🇨🇦 🇨🇨 🇨🇩 🇨🇫 🇨🇬 🇨🇭 🇨🇮 🇨🇰 🇨🇱 🇨🇲 🇨🇳 🇨🇴 🇨🇵 🇨🇷 🇨🇺 🇨🇻 🇨🇼 🇨🇽 🇨🇾 🇨🇿 🇩🇪 🇩🇬 🇩🇯 🇩🇰 🇩🇲 🇩🇴 🇩🇿 🇪🇦 🇪🇨 🇪🇪 🇪🇬 🇪🇭 🇪🇷 🇪🇸 🇪🇹 🇪🇺 🇫🇮 🇫🇯 🇫🇰 🇫🇲 🇫🇴 🇫🇷 🇬🇦 🇬🇧 🇬🇩 🇬🇪 🇬🇫 🇬🇬 🇬🇭 🇬🇮 🇬🇱 🇬🇲 🇬🇳 🇬🇵 🇬🇶 🇬🇷 🇬🇸 🇬🇹 🇬🇺 🇬🇼 🇬🇾 🇭🇰 🇭🇲 🇭🇳 🇭🇷 🇭🇹 🇭🇺 🇮🇨 🇮🇩 🇮🇪 🇮🇱 🇮🇲 🇮🇳 🇮🇴 🇮🇶 🇮🇷 🇮🇸 🇮🇹 🇯🇪 🇯🇲 🇯🇴 🇯🇵 🇰🇪 🇰🇬 🇰🇭 🇰🇮 🇰🇲 🇰🇳 🇰🇵 🇰🇷 🇰🇼 🇰🇾 🇰🇿 🇱🇦 🇱🇧 🇱🇨 🇱🇮 🇱🇰 🇱🇷 🇱🇸 🇱🇹 🇱🇺 🇱🇻 🇱🇾 🇲🇦 🇲🇨 🇲🇩 🇲🇪 🇲🇫 🇲🇬 🇲🇭 🇲🇰 🇲🇱 🇲🇲 🇲🇳 🇲🇴 🇲🇵 🇲🇶 🇲🇷 🇲🇸 🇲🇹 🇲🇺 🇲🇻 🇲🇼 🇲🇽 🇲🇾 🇲🇿 🇳🇦 🇳🇨 🇳🇪 🇳🇫 🇳🇬 🇳🇮 🇳🇱 🇳🇴 🇳🇵 🇳🇷 🇳🇺 🇳🇿 🇴🇲 🇵🇦 🇵🇪 🇵🇫 🇵🇬 🇵🇭 🇵🇰 🇵🇱 🇵🇲 🇵🇳 🇵🇷 🇵🇸 🇵🇹 🇵🇼 🇵🇾 🇶🇦 🇷🇪 🇷🇴 🇷🇸 🇷🇺 🇷🇼 🇸🇦 🇸🇧 🇸🇨 🇸🇩 🇸🇪 🇸🇬 🇸🇭 🇸🇮 🇸🇯 🇸🇰 🇸🇱 🇸🇲 🇸🇳 🇸🇴 🇸🇷 🇸🇸 🇸🇹 🇸🇻 🇸🇽 🇸🇾 🇸🇿 🇹🇦 🇹🇨 🇹🇩 🇹🇫 🇹🇬 🇹🇭 🇹🇯 🇹🇰 🇹🇱 🇹🇲 🇹🇳 🇹🇴 🇹🇷 🇹🇹 🇹🇻 🇹🇼 🇹🇿 🇺🇦 🇺🇬 🇺🇲 🇺🇳 🇺🇸 🇺🇾 🇺🇿 🇻🇦 🇻🇨 🇻🇪 🇻🇬 🇻🇮 🇻🇳 🇻🇺 🇼🇫 🇼🇸 🇽🇰 🇾🇪 🇾🇹 🇿🇦 🇿🇲 🇿🇼)
for i in "${!emoji_array[@]}"; do
if [[ $name == *${emoji_array[$i]}* ]]; then
@ -18,6 +19,8 @@ done
if [ ! -z $code ]; then
echo $code | tr "[A-Z]" "[a-z]"
else
if echo $host | grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" >/dev/null; then
hostip=${host}
elif [ "$host" != "${host#*:[0-9a-fA-F]}" ]; then
@ -30,5 +33,6 @@ else
hostip=$(cat /etc/ssr_ip)
fi
fi
$python -c "import maxminddb;import json;reader = maxminddb.open_database('/usr/share/vssr/GeoLite2-Country.mmdb');aa = reader.get('${hostip}');reader.close();print(aa['country']['iso_code'].lower())"
lua /usr/share/vssr/iso_code.lua $hostip
fi

View File

@ -0,0 +1,10 @@
#!/usr/bin/lua
------------------------------------------------
-- This file is converter ip to country iso code
-- @author Jerryk <jerrykuku@qq.com>
------------------------------------------------
local mm = require 'maxminddb'
local db = mm.open('/usr/share/vssr/GeoLite2-Country.mmdb')
local res = db:lookup(arg[1])
print(string.lower(res:get("country", "iso_code")))