diff --git a/package/ctcgfw/luci-app-vssr/Makefile b/package/ctcgfw/luci-app-vssr/Makefile
index 1c6ec47218..16624f87c3 100644
--- a/package/ctcgfw/luci-app-vssr/Makefile
+++ b/package/ctcgfw/luci-app-vssr/Makefile
@@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-vssr
-PKG_VERSION:=1.19
-PKG_RELEASE:=20201205
+PKG_VERSION:=1.20
+PKG_RELEASE:=20201209
include $(INCLUDE_DIR)/package.mk
diff --git a/package/ctcgfw/luci-app-vssr/luasrc/controller/vssr.lua b/package/ctcgfw/luci-app-vssr/luasrc/controller/vssr.lua
index 662cbfc169..55c4eef4fe 100644
--- a/package/ctcgfw/luci-app-vssr/luasrc/controller/vssr.lua
+++ b/package/ctcgfw/luci-app-vssr/luasrc/controller/vssr.lua
@@ -13,10 +13,11 @@ function index()
entry({'admin', 'services', 'vssr', 'servers'}, cbi('vssr/servers'), _('Severs Nodes'), 11).leaf = true -- 服务器节点
entry({'admin', 'services', 'vssr', 'servers'}, arcombine(cbi('vssr/servers'), cbi('vssr/client-config')), _('Severs Nodes'), 11).leaf = true -- 编辑节点
entry({'admin', 'services', 'vssr', 'control'}, cbi('vssr/control'), _('Access Control'), 12).leaf = true -- 访问控制
- if nixio.fs.access('/usr/bin/v2ray/v2ray') then
- entry({'admin', 'services', 'vssr', 'socks5'}, cbi('vssr/socks5'), _('Socks5'), 13).leaf = true -- Socks5代理
+ entry({'admin', 'services', 'vssr', 'router'}, cbi('vssr/router'), _('Router Config'), 13).leaf = true -- 访问控制
+ if nixio.fs.access('/usr/bin/v2ray/v2ray') or nixio.fs.access('/usr/bin/v2ray') or nixio.fs.access('/usr/bin/xray') or nixio.fs.access('/usr/bin/xray/xray') then
+ entry({'admin', 'services', 'vssr', 'socks5'}, cbi('vssr/socks5'), _('Socks5'), 14).leaf = true -- Socks5代理
end
- entry({'admin', 'services', 'vssr', 'advanced'}, cbi('vssr/advanced'), _('Advanced Settings'), 14).leaf = true -- 高级设置
+ entry({'admin', 'services', 'vssr', 'advanced'}, cbi('vssr/advanced'), _('Advanced Settings'), 15).leaf = true -- 高级设置
elseif nixio.fs.access('/usr/bin/ssr-server') then
entry({'admin', 'services', 'vssr'}, alias('admin', 'services', 'vssr', 'server'), _('vssr'), 10).dependent = true
else
@@ -39,6 +40,7 @@ function index()
entry({'admin', 'services', 'vssr', 'flag'}, call('get_flag')) -- 获取节点国旗 iso code
entry({'admin', 'services', 'vssr', 'ip'}, call('check_ip')) -- 获取ip情况
entry({'admin', 'services', 'vssr', 'switch'}, call('switch')) -- 设置节点为自动切换
+ entry({'admin', 'services', 'vssr', 'delnode'}, call('del_node')) -- 删除某个节点
end
-- 执行订阅
@@ -86,6 +88,23 @@ function get_servers()
luci.http.write_json(server_table)
end
+-- 删除指定节点
+function del_node()
+ local e = {}
+ local uci = luci.model.uci.cursor()
+ local node = luci.http.formvalue('node')
+ e.status = false
+ e.node = node
+ if node ~= '' then
+ uci:delete('vssr', node)
+ uci:save('vssr')
+ uci:commit('vssr')
+ e.status = true
+ end
+ luci.http.prepare_content('application/json')
+ luci.http.write_json(e)
+end
+
-- 切换节点
function change_node()
local sockets = require 'socket'
@@ -246,7 +265,7 @@ function refresh_data()
retstring = '-1'
end
elseif set == 'ip_data' then
- refresh_cmd = "wget -O- 'https://ispip.clang.cn/all_cn.txt' > /tmp/china_ssr.txt"
+ refresh_cmd ="wget -O- 'https://ispip.clang.cn/all_cn.txt' > /tmp/china_ssr.txt 2>/dev/null"
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
@@ -300,4 +319,4 @@ function refresh_data()
end
luci.http.prepare_content('application/json')
luci.http.write_json({ret = retstring, retcount = icount})
-end
+end
\ No newline at end of file
diff --git a/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/client-config.lua b/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/client-config.lua
index 33aec5600b..f5452ecd3e 100644
--- a/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/client-config.lua
+++ b/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/client-config.lua
@@ -129,7 +129,7 @@ o:value('ssr', translate('ShadowsocksR'))
if nixio.fs.access('/usr/bin/ss-redir') then
o:value('ss', translate('Shadowsocks New Version'))
end
-if nixio.fs.access('/usr/bin/v2ray/v2ray') or nixio.fs.access('/usr/bin/v2ray') then
+if nixio.fs.access('/usr/bin/v2ray/v2ray') or nixio.fs.access('/usr/bin/v2ray') or nixio.fs.access('/usr/bin/xray') or nixio.fs.access('/usr/bin/xray/xray') then
o:value('v2ray', translate('V2Ray'))
o:value('vless', translate('VLESS'))
end
diff --git a/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/client.lua b/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/client.lua
index 0c016becd4..9d77400f59 100644
--- a/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/client.lua
+++ b/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/client.lua
@@ -6,7 +6,7 @@ local vssr = 'vssr'
local gfwmode = 0
-if nixio.fs.access('/etc/dnsmasq.ssr/gfw_list.conf') then
+if nixio.fs.access('/etc/vssr/gfw_list.conf') then
gfwmode = 1
end
@@ -26,9 +26,12 @@ uci:foreach(
'vssr',
'servers',
function(s)
- s['name'] = s['.name']
- s['gname'] = '[%s]:%s' % {string.upper(s.type), s.alias}
- table.insert(server_table, s)
+ if s.type ~= nil then
+ s['name'] = s['.name']
+ local alias = (s.alias ~= nil) and s.alias or "未命名节点"
+ s['gname'] = '[%s]:%s' % {string.upper(s.type), alias}
+ table.insert(server_table, s)
+ end
end
)
function my_sort(a,b)
@@ -52,7 +55,7 @@ local route_label = {
'Youtube Proxy',
'TaiWan Video Proxy',
'Netflix Proxy',
- 'Diseny+ Proxy',
+ 'Disney+ Proxy',
'Prime Video Proxy',
'TVB Video Proxy',
'Custom Proxy'
@@ -119,7 +122,6 @@ o:value('router', translate('IP Route Mode'))
o:value('all', translate('Global Mode'))
o:value('oversea', translate('Oversea Mode'))
o.default = 'router'
-
o = s:option(ListValue, 'dports', translate('Proxy Ports'))
o:value('1', translate('All Ports'))
o:value('2', translate('Only Common Ports'))
diff --git a/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/control.lua b/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/control.lua
index e537fd5596..2ee6581431 100644
--- a/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/control.lua
+++ b/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/control.lua
@@ -18,16 +18,21 @@ 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.datatype = 'ipaddr'
-luci.ip.neighbors(
- {family = 4},
- function(entry)
- if entry.reachable then
- o:value(entry.dest:string())
- end
- end
-)
+o = s:taboption("lan_ac", ListValue, "lan_ac_mode", translate("LAN Access Control"))
+o:value("0", translate("Disable"))
+o:value("w", translate("Allow listed only"))
+o:value("b", translate("Allow all except listed"))
+o.rmempty = false
+
+o = s:taboption("lan_ac", DynamicList, "lan_ac_ips", translate("LAN Host List"))
+o.datatype = "ipaddr"
+luci.ip.neighbors({ family = 4 }, function(entry)
+ if entry.reachable then
+ o:value(entry.dest:string())
+ end
+end)
+o:depends("lan_ac_mode", "w")
+o:depends("lan_ac_mode", "b")
o = s:taboption('lan_ac', DynamicList, 'lan_fp_ips', translate('LAN Force Proxy Host List'))
o.datatype = 'ipaddr'
@@ -93,9 +98,4 @@ 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
+return m
\ No newline at end of file
diff --git a/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/router.lua b/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/router.lua
new file mode 100644
index 0000000000..3ac396f22b
--- /dev/null
+++ b/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/router.lua
@@ -0,0 +1,55 @@
+local m, s, o
+local NXFS = require 'nixio.fs'
+local router_table = {
+ yotube = {
+ name = 'youtube',
+ des = 'Youtube Domain'
+ },
+ tw_video = {
+ name = 'tw_video',
+ des = 'Tw Video Domain'
+ },
+ netflix = {
+ name = 'netflix',
+ des = 'Netflix Domain'
+ },
+ disney = {
+ name = 'disney',
+ des = 'Disney+ Domain'
+ },
+ prime = {
+ name = 'prime',
+ des = 'Prime Video Domain'
+ },
+ tvb = {
+ name = 'tvb',
+ des = 'TVB Domain'
+ },
+ custom = {
+ name = 'custom',
+ des = 'Custom Domain'
+ }
+}
+
+m = Map('vssr', translate('Router domain config'))
+s = m:section(TypedSection, 'access_control')
+s.anonymous = true
+for _, v in pairs(router_table) do
+ s:tab(v.name, translate(v.des))
+ local conf = '/etc/vssr/'.. v.name ..'_domain.list'
+ o = s:taboption(v.name, TextValue, v.name ..'conf')
+ o.rows = 13
+ o.wrap = 'off'
+ o.rmempty = true
+ o.cfgvalue = function(self, section)
+ return NXFS.readfile(conf) or ' '
+ end
+ o.write = function(self, section, value)
+ NXFS.writefile(conf, value:gsub('\r\n', '\n'))
+ end
+ o.remove = function(self, section, value)
+ NXFS.writefile(conf, '')
+ end
+end
+
+return m
diff --git a/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/servers.lua b/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/servers.lua
index 93e82b575c..5d2b0c6d50 100644
--- a/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/servers.lua
+++ b/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/servers.lua
@@ -12,6 +12,9 @@ uci:foreach(
function(s)
server_count = server_count + 1
s['name'] = s['.name']
+ if(s.alias == nil) then
+ s.alias = "未命名节点"
+ end
table.insert(server_table, s)
end
)
diff --git a/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/socks5.lua b/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/socks5.lua
index 7f82219bbb..d477e3adc1 100644
--- a/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/socks5.lua
+++ b/package/ctcgfw/luci-app-vssr/luasrc/model/cbi/vssr/socks5.lua
@@ -7,7 +7,7 @@ local sys = require 'luci.sys'
m = Map(vssr)
-- [[ SOCKS5 Proxy ]]--
-if nixio.fs.access('/usr/bin/v2ray/v2ray') then
+if nixio.fs.access('/usr/bin/v2ray/v2ray') or nixio.fs.access('/usr/bin/v2ray') or nixio.fs.access('/usr/bin/xray') or nixio.fs.access('/usr/bin/xray/xray') then
s = m:section(TypedSection, 'socks5_proxy', translate('V2ray SOCKS5 Proxy'))
s.anonymous = true
diff --git a/package/ctcgfw/luci-app-vssr/luasrc/view/vssr/ssrurl.htm b/package/ctcgfw/luci-app-vssr/luasrc/view/vssr/ssrurl.htm
index 9d8075c515..f6b5bff640 100644
--- a/package/ctcgfw/luci-app-vssr/luasrc/view/vssr/ssrurl.htm
+++ b/package/ctcgfw/luci-app-vssr/luasrc/view/vssr/ssrurl.htm
@@ -219,7 +219,7 @@
}
el('.server').value = part2[0];
el('.server_port').value = others[0];
- el('.password').value = part1[1];
+ el('.password').value = part1[0];
if (queryParam.peer || queryParam.sni) {
el('.tls').checked = true;
el('.peer').value = queryParam.peer || queryParam.sni;
diff --git a/package/ctcgfw/luci-app-vssr/luasrc/view/vssr/tblsection.htm b/package/ctcgfw/luci-app-vssr/luasrc/view/vssr/tblsection.htm
index 527055d268..c77c412093 100644
--- a/package/ctcgfw/luci-app-vssr/luasrc/view/vssr/tblsection.htm
+++ b/package/ctcgfw/luci-app-vssr/luasrc/view/vssr/tblsection.htm
@@ -1,7 +1,6 @@
-