luci-app-vssr: bump to v1.16

This commit is contained in:
CN_SZTL 2020-08-26 15:31:34 +08:00
parent 42b5144652
commit 5dfc9cc357
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
32 changed files with 1544 additions and 1702 deletions

View File

@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-vssr
PKG_VERSION:=1.15
PKG_RELEASE:=20200825
PKG_VERSION:=1.16
PKG_RELEASE:=20200826
include $(INCLUDE_DIR)/package.mk

View File

@ -97,19 +97,26 @@ end
-- 切换节点
function change_node()
local sockets = require "socket"
local e = {}
local uci = luci.model.uci.cursor()
local sid = luci.http.formvalue("set")
local server = luci.http.formvalue("server")
local flow_table = {"youtube","tw_video","netflix","disney","prime","tvb","custom"}
e.status = false
e.sid = sid
if sid ~= "" and server ~= "" then
uci:set("vssr", '@global[0]', server..'_server', sid)
if( server ~= "global" ) then
if( server ~= "global" and server ~= "udp_relay" ) then
uci:set("vssr", '@global[0]', 'v2ray_flow', "1")
for i, v in pairs(flow_table) do
if( v ~= server) then
uci:set("vssr", '@global[0]', v..'_server', 'nil')
end
end
end
uci:commit("vssr")
luci.sys.exec("/etc/init.d/vssr restart")
luci.sys.call("/etc/init.d/vssr restart >/www/restartlog.htm 2>&1")
e.status = true
end
luci.http.prepare_content("application/json")
@ -178,12 +185,18 @@ function check_ip()
local d = {}
local mm = require 'maxminddb'
local vssr = require "vssrutil"
local port = 80
local db = mm.open('/usr/share/vssr/GeoLite2-Country.mmdb')
local ip = vssr.wget("http://api.ipify.org/")
if (ip ~= "") then
local res = db:lookup(ip)
local port = 80
d.flag = string.lower(res:get("country", "iso_code"))
d.country = res:get("country", "names", "zh-CN")
else
d.flag = "un"
d.country = "Unknown"
ip = "Unknown"
end
e.outboard = ip
e.outboardip = d
e.baidu = vssr.check_site("www.baidu.com",port)

View File

@ -6,6 +6,7 @@ local gfwmode = 0
local gfw_count = 0
local ip_count = 0
local ad_count = 0
local server_count = 0
if nixio.fs.access("/etc/dnsmasq.ssr/gfw_list.conf") then gfwmode = 1 end
@ -23,24 +24,11 @@ if nixio.fs.access("/etc/china_ssr.txt") then
ip_count = sys.exec("cat /etc/china_ssr.txt | wc -l")
end
uci:foreach(vssr, "servers", function(s)
if s["type"] == "v2ray" then
if s.alias then
server_table[s[".name"]] = "[%s]:%s" %
{string.upper(s.type), s.alias}
elseif s.server and s.server_port then
server_table[s[".name"]] = "[%s]:%s:%s" %
{
string.upper(s.type), s.server, s.server_port
}
end
end
uci:foreach("vssr", "servers", function(s)
server_count = server_count + 1
end)
local key_table = {}
for key, _ in pairs(server_table) do table.insert(key_table, key) end
table.sort(key_table)
m = Map(vssr)
-- [[ 服务器节点故障自动切换设置 ]]--
@ -98,14 +86,22 @@ o = s:option(DummyValue, "", "")
o.rawhtml = true
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:delete_all("vssr", "servers", function(s)
if s.hashkey or s.isSubscribe then
return true
else
return false
end
end)
uci:save("vssr")
uci:commit("vssr")
luci.sys.exec("/etc/init.d/vssr stop")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "vssr",
"advanced"))
luci.sys.exec("/etc/init.d/vssr restart")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "vssr", "servers"))
return
end
-- [[ adblock ]]--

View File

@ -18,85 +18,33 @@ end
local server_table = {}
local encrypt_methods = {
"none",
"table",
"rc4",
"rc4-md5-6",
"rc4-md5",
"aes-128-cfb",
"aes-192-cfb",
"aes-256-cfb",
"aes-128-ctr",
"aes-192-ctr",
"aes-256-ctr",
"bf-cfb",
"camellia-128-cfb",
"camellia-192-cfb",
"camellia-256-cfb",
"cast5-cfb",
"des-cfb",
"idea-cfb",
"rc2-cfb",
"seed-cfb",
"salsa20",
"chacha20",
"chacha20-ietf",
"none", "table", "rc4", "rc4-md5-6", "rc4-md5", "aes-128-cfb",
"aes-192-cfb", "aes-256-cfb", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr",
"bf-cfb", "camellia-128-cfb", "camellia-192-cfb", "camellia-256-cfb",
"cast5-cfb", "des-cfb", "idea-cfb", "rc2-cfb", "seed-cfb", "salsa20",
"chacha20", "chacha20-ietf"
}
local encrypt_methods_ss = {
-- aead
"aes-128-gcm",
"aes-192-gcm",
"aes-256-gcm",
"chacha20-ietf-poly1305",
"xchacha20-ietf-poly1305",
-- stream
"table",
"rc4",
"rc4-md5",
"aes-128-cfb",
"aes-192-cfb",
"aes-256-cfb",
"aes-128-ctr",
"aes-192-ctr",
"aes-256-ctr",
"bf-cfb",
"camellia-128-cfb",
"camellia-192-cfb",
"camellia-256-cfb",
"salsa20",
"chacha20",
"chacha20-ietf",
"aes-128-gcm", "aes-192-gcm", "aes-256-gcm", "chacha20-ietf-poly1305",
"xchacha20-ietf-poly1305", -- stream
"table", "rc4", "rc4-md5", "aes-128-cfb", "aes-192-cfb", "aes-256-cfb",
"aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "bf-cfb", "camellia-128-cfb",
"camellia-192-cfb", "camellia-256-cfb", "salsa20", "chacha20",
"chacha20-ietf"
}
local protocol = {
"origin",
"verify_deflate",
"auth_sha1_v4",
"auth_aes128_sha1",
"auth_aes128_md5",
"auth_chain_a",
"auth_chain_b",
"auth_chain_c",
"auth_chain_d",
"auth_chain_e",
"auth_chain_f",
"origin", "verify_deflate", "auth_sha1_v4", "auth_aes128_sha1",
"auth_aes128_md5", "auth_chain_a", "auth_chain_b", "auth_chain_c",
"auth_chain_d", "auth_chain_e", "auth_chain_f"
}
obfs = {
"plain",
"http_simple",
"http_post",
"random_head",
"tls1.2_ticket_auth",
"plain", "http_simple", "http_post", "random_head", "tls1.2_ticket_auth"
}
local securitys = {
"auto",
"none",
"aes-128-gcm",
"chacha20-poly1305"
}
local securitys = {"auto", "none", "aes-128-gcm", "chacha20-poly1305"}
m = Map(vssr, translate("Edit vssr Server"))
m.redirect = luci.dispatcher.build_url("admin/services/vssr/servers")
@ -180,7 +128,6 @@ o = s:option(Value, "plugin_opts", translate("Plugin Opts"))
o.rmempty = true
o:depends("type", "ss")
o = s:option(ListValue, "protocol", translate("Protocol"))
for _, v in ipairs(protocol) do o:value(v) end
o.rmempty = true
@ -194,8 +141,6 @@ for _, v in ipairs(obfs) do o:value(v) end
o.rmempty = true
o:depends("type", "ssr")
o = s:option(Value, "obfs_param", translate("Obfs param(optional)"))
o:depends("type", "ssr")

View File

@ -1,14 +1,11 @@
-- Copyright (C) 2017 yushi studio <ywb94@qq.com> github.com/ywb94
-- Copyright (C) 2018 lean <coolsnowwolf@gmail.com> github.com/coolsnowwolf
-- Licensed to the public under the GNU General Public License v3.
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
if nixio.fs.access("/etc/dnsmasq.ssr/gfw_list.conf") then gfwmode = 1 end
local uci = luci.model.uci.cursor()
@ -23,14 +20,20 @@ uci:foreach(vssr, "servers", function(s)
if s.alias then
server_table[s[".name"]] = "[%s]:%s" % {string.upper(s.type), s.alias}
elseif s.server and s.server_port then
server_table[s[".name"]] = "[%s]:%s:%s" %{string.upper(s.type), s.server, s.server_port}
server_table[s[".name"]] = "[%s]:%s:%s" %
{
string.upper(s.type), s.server, s.server_port
}
end
if s.flag == "tw" then
if s.alias then
tw_table[s[".name"]] = "[%s]:%s" % {string.upper(s.type), s.alias}
elseif s.server and s.server_port then
tw_table[s[".name"]] = "[%s]:%s:%s" %{string.upper(s.type), s.server, s.server_port}
tw_table[s[".name"]] = "[%s]:%s:%s" %
{
string.upper(s.type), s.server, s.server_port
}
end
end
@ -38,37 +41,39 @@ uci:foreach(vssr, "servers", function(s)
if s.alias then
tvb_table[s[".name"]] = "[%s]:%s" % {string.upper(s.type), s.alias}
elseif s.server and s.server_port then
tvb_table[s[".name"]] = "[%s]:%s:%s" %{string.upper(s.type), s.server, s.server_port}
tvb_table[s[".name"]] = "[%s]:%s:%s" %
{
string.upper(s.type), s.server, s.server_port
}
end
end
end)
local key_table = {}
for key,_ in pairs(server_table) do
table.insert(key_table,key)
end
for key, _ in pairs(server_table) do table.insert(key_table, key) end
local key_table_tw = {}
for key,_ in pairs(tw_table) do
table.insert(key_table_tw,key)
end
for key, _ in pairs(tw_table) do table.insert(key_table_tw, key) end
local key_table_tvb = {}
for key,_ in pairs(tvb_table) do
table.insert(key_table_tvb,key)
end
for key, _ in pairs(tvb_table) do table.insert(key_table_tvb, key) end
table.sort(key_table)
table.sort(key_table_tw)
table.sort(key_table_tvb)
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"}
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 = m:section(TypedSection, "global",
translate("Basic Settings [SS|SSR|V2ray|Trojan]"))
s.anonymous = true
o = s:option(ListValue, "global_server", translate("Main Server"))
@ -92,7 +97,9 @@ for i,v in pairs(route_name) do
if (v == "tw_video_server") then
for _, key in pairs(key_table_tw) do o:value(key, tw_table[key]) end
elseif (v == "tvb_server") then
for _,key in pairs(key_table_tvb) do o:value(key,tvb_table[key]) end
for _, key in pairs(key_table_tvb) do
o:value(key, tvb_table[key])
end
else
for _, key in pairs(key_table) do o:value(key, server_table[key]) end
end

View File

@ -9,37 +9,36 @@ s.anonymous = true
-- Part of WAN
s:tab("wan_ac", translate("WAN IP AC"))
o = s:taboption("wan_ac", DynamicList, "wan_bp_ips", translate("WAN White List IP"))
o = s:taboption("wan_ac", DynamicList, "wan_bp_ips",
translate("WAN White List IP"))
o.datatype = "ip4addr"
o = s:taboption("wan_ac", DynamicList, "wan_fw_ips", translate("WAN Force Proxy IP"))
o = s:taboption("wan_ac", DynamicList, "wan_fw_ips",
translate("WAN Force Proxy IP"))
o.datatype = "ip4addr"
-- Part of LAN
s:tab("lan_ac", translate("LAN IP AC"))
o = s:taboption("lan_ac", DynamicList, "lan_ac_ips", translate("LAN Bypassed Host List"))
o = s:taboption("lan_ac", DynamicList, "lan_ac_ips",
translate("LAN Bypassed Host List"))
o.datatype = "ipaddr"
luci.ip.neighbors({family = 4}, function(entry)
if entry.reachable then
o:value(entry.dest:string())
end
if entry.reachable then o:value(entry.dest:string()) end
end)
o = s:taboption("lan_ac", DynamicList, "lan_fp_ips", translate("LAN Force Proxy Host List"))
o = s:taboption("lan_ac", DynamicList, "lan_fp_ips",
translate("LAN Force Proxy Host List"))
o.datatype = "ipaddr"
luci.ip.neighbors({family = 4}, function(entry)
if entry.reachable then
o:value(entry.dest:string())
end
if entry.reachable then o:value(entry.dest:string()) end
end)
o = s:taboption("lan_ac", DynamicList, "lan_gm_ips", translate("Game Mode Host List"))
o = s:taboption("lan_ac", DynamicList, "lan_gm_ips",
translate("Game Mode Host List"))
o.datatype = "ipaddr"
luci.ip.neighbors({family = 4}, function(entry)
if entry.reachable then
o:value(entry.dest:string())
end
if entry.reachable then o:value(entry.dest:string()) end
end)
-- Part of Self
@ -57,16 +56,11 @@ o = s:taboption("esc", TextValue, "escconf")
o.rows = 13
o.wrap = "off"
o.rmempty = true
o.cfgvalue = function(self, section)
return NXFS.readfile(escconf) or ""
end
o.cfgvalue = function(self, section) return NXFS.readfile(escconf) or "" end
o.write = function(self, section, value)
NXFS.writefile(escconf, value:gsub("\r\n", "\n"))
end
o.remove = function(self, section, value)
NXFS.writefile(escconf, "")
end
o.remove = function(self, section, value) NXFS.writefile(escconf, "") end
s:tab("block", translate("Black Domain List"))
@ -75,19 +69,16 @@ o = s:taboption("block", TextValue, "blockconf")
o.rows = 13
o.wrap = "off"
o.rmempty = true
o.cfgvalue = function(self, section)
return NXFS.readfile(blockconf) or " "
end
o.cfgvalue = function(self, section) return NXFS.readfile(blockconf) or " " end
o.write = function(self, section, value)
NXFS.writefile(blockconf, value:gsub("\r\n", "\n"))
end
o.remove = function(self, section, value)
NXFS.writefile(blockconf, "")
end
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 = s:taboption("proxy", DynamicList, "proxy_domain_name",
translate("Proxy Domain Name"))
o.datatype = "hostname"
return m

View File

@ -7,7 +7,8 @@ t = f:field(TextValue, "conf")
t.rmempty = true
t.rows = 20
function t.cfgvalue()
luci.sys.exec("[ -f /tmp/vssr.log ] && sed '1!G;h;$!d' /tmp/vssr.log > /tmp/ssrpro.log")
luci.sys.exec(
"[ -f /tmp/vssr.log ] && sed '1!G;h;$!d' /tmp/vssr.log > /tmp/ssrpro.log")
return fs.readfile(conffile) or ""
end
t.readonly = "readonly"

View File

@ -1,44 +1,20 @@
-- Copyright (C) 2017 yushi studio <ywb94@qq.com>
-- Licensed to the public under the GNU General Public License v3.
local m, s, o
local vssr = "vssr"
local sid = arg[1]
local encrypt_methods = {
"rc4-md5",
"rc4-md5-6",
"rc4",
"table",
"aes-128-cfb",
"aes-192-cfb",
"aes-256-cfb",
"aes-128-ctr",
"aes-192-ctr",
"aes-256-ctr",
"bf-cfb",
"camellia-128-cfb",
"camellia-192-cfb",
"camellia-256-cfb",
"cast5-cfb",
"des-cfb",
"idea-cfb",
"rc2-cfb",
"seed-cfb",
"salsa20",
"chacha20",
"chacha20-ietf",
"rc4-md5", "rc4-md5-6", "rc4", "table", "aes-128-cfb", "aes-192-cfb",
"aes-256-cfb", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "bf-cfb",
"camellia-128-cfb", "camellia-192-cfb", "camellia-256-cfb", "cast5-cfb",
"des-cfb", "idea-cfb", "rc2-cfb", "seed-cfb", "salsa20", "chacha20",
"chacha20-ietf"
}
local protocol = {
"origin",
}
local protocol = {"origin"}
obfs = {
"plain",
"http_simple",
"http_post",
}
obfs = {"plain", "http_simple", "http_post"}
m = Map(vssr, translate("Edit vssr Server"))
@ -48,9 +24,6 @@ if m.uci:get(vssr, sid) ~= "server_config" then
return
end
-- [[ Server Setting ]]--
s = m:section(NamedSection, sid, "server_config")
s.anonymous = true
@ -82,7 +55,6 @@ o = s:option(ListValue, "protocol", translate("Protocol"))
for _, v in ipairs(protocol) do o:value(v) end
o.rmempty = false
o = s:option(ListValue, "obfs", translate("Obfs"))
for _, v in ipairs(obfs) do o:value(v) end
o.rmempty = false

View File

@ -1,67 +1,34 @@
-- Copyright (C) 2017 yushi studio <ywb94@qq.com>
-- Licensed to the public under the GNU General Public License v3.
local m, sec, o
local vssr = "vssr"
local uci = luci.model.uci.cursor()
local ipkg = require("luci.model.ipkg")
m = Map(vssr, translate("vssr Server"))
local encrypt_methods = {
"table",
"rc4",
"rc4-md5",
"rc4-md5-6",
"aes-128-cfb",
"aes-192-cfb",
"aes-256-cfb",
"aes-128-ctr",
"aes-192-ctr",
"aes-256-ctr",
"bf-cfb",
"camellia-128-cfb",
"camellia-192-cfb",
"camellia-256-cfb",
"cast5-cfb",
"des-cfb",
"idea-cfb",
"rc2-cfb",
"seed-cfb",
"salsa20",
"chacha20",
"chacha20-ietf",
"table", "rc4", "rc4-md5", "rc4-md5-6", "aes-128-cfb", "aes-192-cfb",
"aes-256-cfb", "aes-128-ctr", "aes-192-ctr", "aes-256-ctr", "bf-cfb",
"camellia-128-cfb", "camellia-192-cfb", "camellia-256-cfb", "cast5-cfb",
"des-cfb", "idea-cfb", "rc2-cfb", "seed-cfb", "salsa20", "chacha20",
"chacha20-ietf"
}
local protocol = {
"origin",
"verify_deflate",
"auth_sha1_v4",
"auth_aes128_sha1",
"auth_aes128_md5",
"auth_chain_a",
"origin", "verify_deflate", "auth_sha1_v4", "auth_aes128_sha1",
"auth_aes128_md5", "auth_chain_a"
}
obfs = {
"plain",
"http_simple",
"http_post",
"random_head",
"tls1.2_ticket_auth",
"tls1.2_ticket_fastauth",
"plain", "http_simple", "http_post", "random_head", "tls1.2_ticket_auth",
"tls1.2_ticket_fastauth"
}
-- [[ Global Setting ]]--
sec = m:section(TypedSection, "server_global", translate("Global Setting"))
sec.anonymous = true
o = sec:option(Flag, "enable_server", translate("Enable Server"))
o.rmempty = false
@ -80,16 +47,11 @@ function sec.create(...)
end
o = sec:option(Flag, "enable", translate("Enable"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or translate("0")
end
function o.cfgvalue(...) return Value.cfgvalue(...) or translate("0") end
o.rmempty = false
o = sec:option(DummyValue, "server_port", translate("Server Port"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or "?"
end
function o.cfgvalue(...) return Value.cfgvalue(...) or "?" end
o = sec:option(DummyValue, "encrypt_method", translate("Encrypt Method"))
function o.cfgvalue(...)
@ -98,17 +60,9 @@ function o.cfgvalue(...)
end
o = sec:option(DummyValue, "protocol", translate("Protocol"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or "?"
end
function o.cfgvalue(...) return Value.cfgvalue(...) or "?" end
o = sec:option(DummyValue, "obfs", translate("Obfs"))
function o.cfgvalue(...)
return Value.cfgvalue(...) or "?"
end
function o.cfgvalue(...) return Value.cfgvalue(...) or "?" end
return m

View File

@ -2,7 +2,6 @@ local vssr = "vssr"
local uci = luci.model.uci.cursor()
local server_table = {}
local sys = require "luci.sys"
m = Map(vssr)
@ -34,8 +33,6 @@ o.datatype = "port"
o.default = 1080
o.rmempty = false
end
return m

View File

@ -11,7 +11,8 @@
<a href="https://www.maxmind.com">https://www.maxmind.com</a>.</p>
<h4 id="vssr_status"><span class="green" style="color: #404040;">Flag-icon-css</span></h4>
<p style="margin: 1rem; line-height: 1.8em;">A collection of all country flags in SVG — plus the CSS for easier integration <a href="https://flagicons.lipis.dev">https://flagicons.lipis.dev</a></p>
<p style="margin: 1rem; line-height: 1.8em;">A collection of all country flags in SVG — plus the CSS for
easier integration <a href="https://flagicons.lipis.dev">https://flagicons.lipis.dev</a></p>
</div>
</div>

View File

@ -40,7 +40,6 @@
}
function wirte_status(data) {
if (data.outboard) {
json = data.outboardip;
country = (json.flag == "tw") ? "中国 台湾" : json.country;
@ -52,7 +51,6 @@
data.google ? $(".i3").attr("src", VSSR_ASSETS + "img/site_icon_03.png") : $(".i3").attr("src", VSSR_ASSETS + "img/site_icon1_03.png");
data.youtube ? $(".i4").attr("src", VSSR_ASSETS + "img/site_icon_04.png") : $(".i4").attr("src", VSSR_ASSETS + "img/site_icon1_04.png");
setTimeout(function () { $("body").trigger("iploaded", [true]); }, 200);
}
XHR.poll(10, CHECK_IP_URL, null,
function (x, data) {

View File

@ -1,4 +1,4 @@
<link rel="stylesheet" href="/luci-static/vssr/css/vssr.css?v=202000825-1">
<link rel="stylesheet" href="/luci-static/vssr/css/vssr.css?v=<%=math.random(1,100000)%>">
<script src="<%=media%>/js/jquery.min.js"></script>

View File

@ -1,6 +1,6 @@
<script type="text/javascript" src="/luci-static/vssr/emoji.js"></script>
<script type="text/javascript" src="/luci-static/vssr/sweetalert.js"></script>
<script type="text/javascript" src="/luci-static/vssr/polyfill.js"></script>
<script type="text/javascript" src="/luci-static/vssr/emoji.js?v=1.16"></script>
<script type="text/javascript" src="/luci-static/vssr/sweetalert.js?v=1.16"></script>
<script type="text/javascript" src="/luci-static/vssr/polyfill.js?v=1.16"></script>
<!-- tblsection -->
<fieldset class="cbi-section" id="cbi-<%=self.config%>-<%=self.sectiontype%>">
@ -135,10 +135,10 @@
//切换节点
function apply_node(node) {
//$("#cbi-apply-vssr1").show(); //显示应用中
var $html = "";
$html += '<div class="pure-g choose_node">';
$html += '<div class="pure-u-1-2"><div class="gap"><button class="cbi-button cbi-button-apply change-node" data-server="global" data-node="' + node + '"> 主服务器 </button></div></div>';
$html += '<div class="pure-u-1-2"><div class="gap"><button class="cbi-button cbi-button-apply change-node" data-server="udp_relay" data-node="' + node + '"> UDP游戏模式 </button></div></div>';
$html += '<div class="pure-u-1-2"><div class="gap"><button class="cbi-button cbi-button-apply change-node" data-server="youtube" data-node="' + node + '"> Youtube </button></div></div>';
if ($('#cbi-' + CONFIG + '-' + node).attr("data-flag") == "tw") {
$html += '<div class="pure-u-1-2"><div class="gap"><button class="cbi-button cbi-button-apply change-node" data-server="tw_video" data-node="' + node + '"> TW Video </button></div></div>';
@ -177,7 +177,6 @@
$(".cbi-section-table-row").removeClass("fast");
$(id).addClass("fast");
}
Swal.close();
XHR.run();
}
@ -185,23 +184,9 @@
})
}
})
/*$.get(CHANGE_NODE_URL, { set: node },
function (data, status) {
$("#cbi-apply-vssr1").hide(); //隐藏应用中
if (data.status) {
var id = '#cbi-<%=self.config%>-' + node;
$(".cbi-section-table-row").removeClass("fast");
$(id).addClass("fast");
}
});*/
}
//设定自动切换台
//设定自动切换
$(".incon").click(function () {
$.each(ajaxArray, function (n, value) { value.abort(); }) //中断所有的ajax请求
$node_switch_icon = $(this).find(".pure-imgw");
@ -233,7 +218,6 @@
if (host != undefined) {
check_port(host, port, this);
}
});
}
@ -275,8 +259,6 @@
}
$(document).ready(function () {
//setTimeout(function () { check(); }, 500); //延迟500MS开始检测
$("body").on("iploaded", function (event, param1) {
if (!iploaded) {
iploaded = true;

View File

@ -1,9 +1,9 @@
<%+cbi/valueheader%>
<link rel="stylesheet" href="/luci-static/vssr/css/vssr.css?v=72883">
<link rel="stylesheet" href="/luci-static/vssr/css/vssr.css?v=<%=math.random(1,100000)%>">
<label class="cbi-value-title"><%= translate("Update") %></label>
<div class="cbi-value-field">
<input class="cbi-button cbi-button-reload" id="update_subscribe" type="button"
size="0" value="<%= translate("Save And Start Subscribe") %>">
<input class="cbi-button cbi-button-reload" id="update_subscribe" type="button" size="0"
value="<%= translate("Save And Start Subscribe") %>">
</div>
<script type="text/javascript">

View File

@ -479,8 +479,8 @@ msgstr "游戏模式UDP中继"
msgid "Server failsafe auto swith settings"
msgstr "服务器节点故障自动切换设置"
msgid "Delete all severs"
msgstr "删除所有服务器"
msgid "Delete All Subscribe Severs"
msgstr "删除所有订阅服务器"
msgid "Severs Nodes"
msgstr "节点列表"

View File

@ -174,8 +174,8 @@ ac_rule() {
create ssr_gen_router hash:net
$(gen_spec_iplist | sed -e "s/^/add ssr_gen_router /")
EOF
$IPT -N SS_SPEC_ROUTER && \
$IPT -A SS_SPEC_ROUTER -m set --match-set ssr_gen_router dst -j RETURN && \
$IPT -N SS_SPEC_ROUTER &&
$IPT -A SS_SPEC_ROUTER -m set --match-set ssr_gen_router dst -j RETURN &&
$IPT -A SS_SPEC_ROUTER -j SS_SPEC_WAN_FW
$IPT -I OUTPUT 1 -p tcp -m comment --comment "$TAG" -j SS_SPEC_ROUTER
fi
@ -286,7 +286,7 @@ gen_include() {
[ -n "$FWI" ] || return 0
extract_rules() {
echo "*$1"
iptables-save -t $1 | grep SS_SPEC_ |\
iptables-save -t $1 | grep SS_SPEC_ |
sed -e "s/^-A \(OUTPUT\|PREROUTING\)/-I \1 1/"
echo 'COMMIT'
}

View File

@ -99,10 +99,14 @@ function _M.get_flag(remark, host)
end
if (iso_code == nil ) then
if( host ~= "") then
local ret = nixio.getaddrinfo(host, "any")
local hostip = ret[1].address
local res = db:lookup(hostip)
iso_code = string.lower(res:get("country", "iso_code"))
else
iso_code = "un"
end
end
return string.gsub(iso_code, '\n', '')
end
@ -119,16 +123,15 @@ function _M.check_site(host, port)
return ret
end
function _M.trim(text)
if not text or text == "" then
return ""
end
if not text or text == "" then return "" end
return (string.gsub(text, "^%s*(.-)%s*$", "%1"))
end
function _M.wget(url)
local stdout = luci.sys.exec('wget-ssl -q --user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36" --no-check-certificate -t 3 -T 10 -O- "' .. url .. '"')
local stdout = luci.sys.exec(
'wget-ssl -q --user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36" --no-check-certificate -t 3 -T 10 -O- "' ..
url .. '"')
return _M.trim(stdout)
end

View File

@ -18,6 +18,6 @@ local ss = {
reuse_port = true,
fast_open = (server.fast_open == "1") and true or false,
plugin = (server.plugin ~= nil) and server.plugin or nil,
plugin_opts = (server.plugin ~= nil) and server.plugin_opts or nil,
plugin_opts = (server.plugin ~= nil) and server.plugin_opts or nil
}
print(json.stringify(ss, 1))

View File

@ -20,6 +20,6 @@ local ssr = {
obfs = server.obfs,
obfs_param = server.obfs_param,
reuse_port = true,
fast_open = (server.fast_open == "1") and true or false,
fast_open = (server.fast_open == "1") and true or false
}
print(json.stringify(ssr, 1))

View File

@ -27,7 +27,7 @@ local trojan = {
alpn = {"h2", "http/1.1"},
curve = "",
reuse_session = true,
session_ticket = false,
session_ticket = false
},
tcp = {
no_delay = true,

View File

@ -15,7 +15,8 @@ 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")
local proxy_domain_name = ucursor:get_list(name, "@access_control[0]",
"proxy_domain_name")
function gen_outbound(server_node, tags, local_ports)
local bound = {}
@ -30,10 +31,7 @@ function gen_outbound(server_node, tags, local_ports)
protocol = "socks",
settings = {
servers = {
{
address = "127.0.0.1",
port = tonumber(local_ports)
}
{address = "127.0.0.1", port = tonumber(local_ports)}
}
}
}
@ -61,7 +59,8 @@ function gen_outbound(server_node, tags, local_ports)
network = server.transport,
security = (server.tls == '1') and "tls" or "none",
tlsSettings = {
allowInsecure = (server.insecure == "1") and true or false,
allowInsecure = (server.insecure == "1") and true or
false,
serverName = server.ws_host
},
kcpSettings = (server.transport == "kcp") and {
@ -69,7 +68,8 @@ function gen_outbound(server_node, tags, local_ports)
tti = tonumber(server.tti),
uplinkCapacity = tonumber(server.uplink_capacity),
downlinkCapacity = tonumber(server.downlink_capacity),
congestion = (server.congestion == "1") and true or false,
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}
@ -100,7 +100,6 @@ end
local outbounds_table = {}
if v2ray_flow == "1" then
table.insert(outbounds_table, gen_outbound(server_section, "global", 2080))
table.insert(outbounds_table, gen_outbound(youtube_server, "youtube", 2081))
@ -111,7 +110,8 @@ if v2ray_flow == "1" then
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))
table.insert(outbounds_table,
gen_outbound(server_section, "main", local_port))
end
-- rules gen
@ -119,20 +119,10 @@ end
local youtube_rule = {
type = "field",
domain = {
"youtube",
"ggpht.com",
"googlevideo.com",
"withyoutube.com",
"youtu.be",
"youtube-nocookie.com",
"youtube.com",
"youtubeeducation.com",
"youtubegaming.com",
"youtubei.googleapis.com",
"youtubekids.com",
"youtubemobilesupport.com",
"yt.be",
"ytimg.com"
"youtube", "ggpht.com", "googlevideo.com", "withyoutube.com",
"youtu.be", "youtube-nocookie.com", "youtube.com",
"youtubeeducation.com", "youtubegaming.com", "youtubei.googleapis.com",
"youtubekids.com", "youtubemobilesupport.com", "yt.be", "ytimg.com"
},
outboundTag = "youtube"
}
@ -140,15 +130,8 @@ local youtube_rule = {
local tw_video_rule = {
type = "field",
domain = {
"vidol.tv",
"hinet.net",
"books.com",
"litv.tv",
"pstatic.net",
"app-measurement.com",
"kktv.com.tw",
"gamer.com.tw",
"wetv.vip"
"vidol.tv", "hinet.net", "books.com", "litv.tv", "pstatic.net",
"app-measurement.com", "kktv.com.tw", "gamer.com.tw", "wetv.vip"
},
outboundTag = "twvideo"
}
@ -156,17 +139,9 @@ local tw_video_rule = {
local netflix_rule = {
type = "field",
domain = {
"fast.com",
"netflix.ca",
"netflix.com",
"netflix.net",
"netflixinvestor.com",
"netflixtechblog.com",
"nflxext.com",
"nflximg.com",
"nflximg.net",
"nflxsearch.net",
"nflxso.net",
"fast.com", "netflix.ca", "netflix.com", "netflix.net",
"netflixinvestor.com", "netflixtechblog.com", "nflxext.com",
"nflximg.com", "nflximg.net", "nflxsearch.net", "nflxso.net",
"nflxvideo.net"
},
@ -185,17 +160,9 @@ local disney_rule = {
local prime_rule = {
type = "field",
domain = {
"aiv-cdn.net",
"amazonaws.com",
"amazonvideo.com",
"llnwd.net",
"amazonprimevideos.com",
"amazonvideo.cc",
"prime-video.com",
"primevideo.cc",
"primevideo.com",
"primevideo.info",
"primevideo.org",
"aiv-cdn.net", "amazonaws.com", "amazonvideo.com", "llnwd.net",
"amazonprimevideos.com", "amazonvideo.cc", "prime-video.com",
"primevideo.cc", "primevideo.com", "primevideo.info", "primevideo.org",
"rimevideo.tv"
},
outboundTag = "prime"
@ -203,10 +170,7 @@ local prime_rule = {
local tvb_rule = {
type = "field",
domain = {
"tvsuper.com",
"tvb.com"
},
domain = {"tvsuper.com", "tvb.com"},
outboundTag = "tvb"
}
@ -259,7 +223,9 @@ local v2ray = {
protocol = "dokodemo-door",
settings = {network = proto, followRedirect = true},
sniffing = {enabled = true, destOverride = {"http", "tls"}},
streamSettings = {sockopt = { tproxy = (proto == "tcp") and "redirect" or "tproxy"}}
streamSettings = {
sockopt = {tproxy = (proto == "tcp") and "redirect" or "tproxy"}
}
}
},

View File

@ -7,7 +7,6 @@ local local_port = ucursor:get_first(name, 'socks5_proxy', 'local_port')
local Socks_user = ucursor:get_first(name, 'socks5_proxy', 'Socks_user')
local Socks_pass = ucursor:get_first(name, 'socks5_proxy', 'Socks_pass')
local v2ray = {
log = {
-- error = "/var/log/v2ray.log",
@ -19,24 +18,14 @@ local v2ray = {
protocol = proto,
settings = {
auth = (auth_type == '1') and "password" or "noauth",
accounts =(auth_type == "1") and {
{
user = (auth_type == '1') and Socks_user,
pass = Socks_pass
}
} or nil,
accounts = (auth_type == "1") and
{{user = (auth_type == '1') and Socks_user, pass = Socks_pass}} or
nil
}
},
-- 传出连接
outbound = {
protocol = "freedom"
},
outbound = {protocol = "freedom"},
-- 额外传出连接
outboundDetour = {
{
protocol = "blackhole",
tag = "blocked"
}
}
outboundDetour = {{protocol = "blackhole", tag = "blocked"}}
}
print(json.stringify(v2ray, 1))

View File

@ -11,15 +11,11 @@ awk '!/^$/&&!/^#/{printf("server=/.%s/'"127.0.0.1#5335"'\n",$0)}' /etc/config/bl
awk '!/^$/&&!/^#/{printf("ipset=/.%s/'"whitelist"'\n",$0)}' /etc/config/white.list >/tmp/dnsmasq.ssr/whitelist_forward.conf
function valid_ip()
{
function valid_ip() {
ip=$1
read_ip=$(echo $ip | awk -F. '$1<=255&&$2<=255&&$3<=255&&$4<=255{print "yes"}')
if echo $ip|grep -E '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$' >/dev/null
then
if [ $read_ip == "yes" ]
then
if echo $ip | grep -E '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$' >/dev/null; then
if [ $read_ip == "yes" ]; then
return 0
else
return 1

View File

@ -9,7 +9,6 @@ require 'luci.util'
require 'luci.jsonc'
require 'luci.sys'
-- these global functions are accessed all the time by the event handler
-- so caching them is worth the effort
local luci = luci
@ -269,7 +268,9 @@ local function processData(szType, content)
end
-- wget
local function wget(url)
local stdout = luci.sys.exec('wget-ssl -q --user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36" --no-check-certificate -t 3 -T 10 -O- "' .. url .. '"')
local stdout = luci.sys.exec(
'wget-ssl -q --user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36" --no-check-certificate -t 3 -T 10 -O- "' ..
url .. '"')
return trim(stdout)
end

View File

@ -1,4 +1,5 @@
#!/usr/bin/lua
------------------------------------------------
-- This file is part of the luci-app-ssr-plus update.lua
-- By Mattraks
@ -16,7 +17,8 @@ end
log('正在更新【GFW列表】数据库')
if nixio.fs.access("/usr/bin/wget-ssl") then
refresh_cmd="wget-ssl --no-check-certificate https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt -O /tmp/gfw.b64"
refresh_cmd =
"wget-ssl --no-check-certificate https://cdn.jsdelivr.net/gh/gfwlist/gfwlist/gfwlist.txt -O /tmp/gfw.b64"
else
refresh_cmd = "wget -O /tmp/gfw.b64 http://iytc.net/tools/list.b64"
end
@ -27,7 +29,8 @@ if nixio.fs.access("/usr/bin/wget-ssl") then
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 /etc/dnsmasq.ssr/gfw_list.conf")
-- retstring=tostring(math.ceil(tonumber(icount)/2))
log('更新成功! 新的总纪录数:' .. icount)
else
@ -42,7 +45,8 @@ 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"
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 then
@ -69,16 +73,15 @@ if ucic:get_first('vssr', 'global', 'adblock', '') == '1' then
log('正在更新【广告屏蔽】数据库')
local need_process = 0
if nixio.fs.access("/usr/bin/wget-ssl") then
refresh_cmd="wget-ssl --no-check-certificate -O - https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt > /tmp/adnew.conf"
refresh_cmd =
"wget-ssl --no-check-certificate -O - https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt > /tmp/adnew.conf"
need_process = 1
else
refresh_cmd = "wget -O /tmp/ad.conf http://iytc.net/tools/ad.conf"
end
sret = luci.sys.call(refresh_cmd .. " 2>/dev/null")
if sret == 0 then
if need_process == 1 then
luci.sys.call("/usr/bin/vssr-ad")
end
if need_process == 1 then luci.sys.call("/usr/bin/vssr-ad") end
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

View File

@ -1,5 +1,5 @@
@import url("flag-icon.min.css");
@import url("sweetalert2.css?v=2");
@import url("flag-icon.min.css?v=1.16");
@import url("sweetalert2.css?v=1.16");
/*!
Pure v1.0.1
Copyright 2013 Yahoo!
@ -259,14 +259,17 @@ https://github.com/pure-css/pure/blob/master/LICENSE.md
margin: 1rem;
}
.pure-img {
max-height: 100%;
width: auto;
}
.pure-imgw {
max-width: 100%;
height: auto;
}
.green {
font-size: 1.25rem;
color: #2dce89;
@ -308,9 +311,11 @@ https://github.com/pure-css/pure/blob/master/LICENSE.md
color: #8898aa !important;
line-height: 1.8em;
}
.p-in5 {
padding: 8px;
}
.flag-icon:before {
position: absolute;
}
@ -330,6 +335,7 @@ https://github.com/pure-css/pure/blob/master/LICENSE.md
letter-spacing: normal;
}
.cbi-section-table-row:hover {
background: #fff;
@ -343,6 +349,7 @@ https://github.com/pure-css/pure/blob/master/LICENSE.md
.cbi-section-table-row.fast .ssr-button {
color: #fff;
}
.cbi-section-table-row.fast .ssr-button:hover,
.cbi-section-table-row.fast .ssr-button:focus,
.cbi-section-table-row.fast .ssr-button:active {
@ -389,12 +396,15 @@ https://github.com/pure-css/pure/blob/master/LICENSE.md
.alias {
margin-bottom: 1px;
}
.incon {
cursor: pointer;
}
.incon .pure-imgw {
transition: all 0.2s;
}
.incon:nth-child(2) {
position: absolute;
left: 0;
@ -406,6 +416,7 @@ https://github.com/pure-css/pure/blob/master/LICENSE.md
background-position: top;
}
.incon:nth-child(2) .tp {
position: absolute;
left: 0;
@ -492,11 +503,15 @@ https://github.com/pure-css/pure/blob/master/LICENSE.md
padding: 0.1rem 0.5rem;
border-radius: 0.2rem;
}
footer.mobile-hide {
display: block;
}
.mar-10 {margin-left: 50px; margin-right: 10px;}
.mar-10 {
margin-left: 50px;
margin-right: 10px;
}
.status-bar {
position: fixed;
@ -519,9 +534,11 @@ footer.mobile-hide{
float: left;
margin-right: 1em;
}
.status-bar .inner .status-info {
font-weight: bold;
}
.status-bar .icon-con {
height: 3em;
text-align: right;
@ -531,9 +548,11 @@ footer.mobile-hide{
margin: 0.5rem 1rem;
position: relative;
}
.choose_node .gap .cbi-button {
width: 100% !important;
}
@media screen and (max-width: 2000px) {
.pure-u-1-5 {
width: 25%;
@ -589,6 +608,7 @@ footer.mobile-hide{
border-color: #fb6340 !important;
box-shadow: 0 0 1rem 0 rgba(136, 152, 170, .75);
}
.choose_node .pure-u-1-2 {
width: 50%;
}
@ -626,6 +646,8 @@ footer.mobile-hide{
.modals h2 {
padding: 0 !important;
background-color: transparent !important;
color: #fff !important;
}
.modals h3 {
@ -642,6 +664,7 @@ footer.mobile-hide{
height: calc(100% - 4rem);
font-family: 'Lucida Console';
font-size: 11px;
line-height: 1.5em;
background: transparent;
color: #FFFFFF;
outline: none;
@ -678,15 +701,18 @@ footer.mobile-hide{
left: 0;
top: 0;
}
.status-bar .pure-u-1-2 {
width: 50%;
}
.status-bar .inner .flag {
height: 3em;
display: block;
float: left;
margin-right: 1em;
}
.status-bar .icon-con {
height: 2.5em;
text-align: right;
@ -704,6 +730,7 @@ footer.mobile-hide{
background-color: #3c3c3c !important;
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.35);
}
.incon:nth-child(2) {
border-right: #1e1e1e 1px solid;
}