luci-app-ssr-plus-jo: add package
This commit is contained in:
parent
2cf7e47956
commit
7ef35d1071
@ -56,7 +56,8 @@ Package zxlhhyccc: [zxlhhyccc/MY-lede](https://github.com/zxlhhyccc/MY-lede).<br
|
||||
luci-theme-argonv3 source: [jerrykuku/luci-theme-argon](https://github.com/jerrykuku/luci-theme-argon).<br/>
|
||||
luci-theme-darkmatter source: [apollo-ng/luci-theme-darkmatter](https://github.com/apollo-ng/luci-theme-darkmatter).<br/>
|
||||
luci-app-koolproxyR source: [Ameykyl/luci-app-koolproxyR](https://github.com/Ameykyl/luci-app-koolproxyR).<br/>
|
||||
openwrt-chinadns-ng source: [pexcn/openwrt-chinadns-ng](https://github.com/pexcn/openwrt-chinadns-ng).
|
||||
openwrt-chinadns-ng source: [pexcn/openwrt-chinadns-ng](https://github.com/pexcn/openwrt-chinadns-ng).<br/>
|
||||
luci-app-ssr-plus-jo source: [brokeld/luci-app-ssr-plus-jo](https://github.com/brokeld/luci-app-ssr-plus-jo).
|
||||
|
||||
# License
|
||||
### [GPL v3](https://www.gnu.org/licenses/gpl-3.0.html).
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-ssr-plus-jsda
|
||||
PKG_NAME:=luci-app-ssr-plus-jo
|
||||
PKG_VERSION:=1
|
||||
PKG_RELEASE:=140
|
||||
PKG_RELEASE:=116.5
|
||||
|
||||
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \
|
||||
@ -11,11 +11,15 @@ PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Server \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Socks \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Simple_Ofbs \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs\
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs-server\
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_privoxy \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_V2Ray \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_dnscrypt_proxy \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_dnsforwarder \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_udp2raw-tunnel \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_udpspeeder \
|
||||
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_haproxy
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@ -23,11 +27,11 @@ include $(INCLUDE_DIR)/package.mk
|
||||
define Package/$(PKG_NAME)/config
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks
|
||||
bool "Include Shadowsocks New Version"
|
||||
default n
|
||||
default y
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_V2ray
|
||||
bool "Include V2ray"
|
||||
default n
|
||||
default y
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun
|
||||
bool "Include Kcptun"
|
||||
@ -35,22 +39,30 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server
|
||||
bool "Include ShadowsocksR Server"
|
||||
default n
|
||||
default y
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Server
|
||||
bool "Include Shadowsocks Server"
|
||||
default n
|
||||
default y
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks
|
||||
bool "Include ShadowsocksR Socks and Tunnel"
|
||||
default n
|
||||
default y
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Socks
|
||||
bool "Include Shadowsocks Socks and Tunnel"
|
||||
default y
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_privoxy
|
||||
bool "privoxy http local"
|
||||
default n
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Simple_Obfs
|
||||
bool "Include Shadowsocks Simple Obfs Plugin"
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs
|
||||
bool "simple-obfsl"
|
||||
default n
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs-server
|
||||
bool "simple-obfs-server"
|
||||
default n
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_V2Ray
|
||||
@ -69,49 +81,63 @@ config PACKAGE_$(PKG_NAME)_INCLUDE_dnsforwarder
|
||||
bool "dnsforwarder"
|
||||
default n
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_udp2raw-tunnel
|
||||
bool "udp2raw-tunnel"
|
||||
default n
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_udpspeeder
|
||||
bool "udpspeeder"
|
||||
default n
|
||||
|
||||
config PACKAGE_$(PKG_NAME)_INCLUDE_haproxy
|
||||
bool "haproxy"
|
||||
default n
|
||||
endef
|
||||
|
||||
define Package/luci-app-ssr-plus-jsda
|
||||
define Package/luci-app-ssr-plus-jo
|
||||
SECTION:=luci
|
||||
CATEGORY:=LuCI
|
||||
SUBMENU:=3. Applications
|
||||
TITLE:=SS/SSR/V2Ray LuCI interface
|
||||
PKGARCH:=all
|
||||
DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +bash +pdnsd-alt +wget +unzip \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-redir \
|
||||
|
||||
DEPENDS:=+shadowsocksr-libev-alt +ipset +ip-full +iptables-mod-tproxy +dnsmasq-full +coreutils +coreutils-base64 +bash +pdnsd-alt +wget \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks:shadowsocks-libev-ss-redir \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_V2ray:v2ray \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun:kcptun-client \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Kcptun:kcptun \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Server:shadowsocksr-libev-server \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Server:shadowsocks-libev-ss-server \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_ShadowsocksR_Socks:shadowsocksr-libev-ssr-local \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Socks:shadowsocks-libev-ss-local \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_Simple_Obfs:simple-obfs \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_privoxy:privoxy \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs:simple-obfs \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_simple-obfs-server:simple-obfs-server \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks_V2Ray:v2ray-plugin \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS:openwrt_chinadns \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_dnscrypt_proxy:dnscrypt-proxy-full \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_dnsforwarder:openwrt-dnsforwarder \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_dnsforwarder:dnsforwarder \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_udp2raw-tunnel:udp2raw-tunnel \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_udpspeeder:udpspeeder \
|
||||
+PACKAGE_$(PKG_NAME)_INCLUDE_haproxy:haproxy
|
||||
endef
|
||||
|
||||
|
||||
define Build/Prepare
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/luci-app-ssr-plus-jsda/install
|
||||
define Package/luci-app-ssr-plus-jo/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci
|
||||
cp -pR ./luasrc/* $(1)/usr/lib/lua/luci
|
||||
$(INSTALL_DIR) $(1)/
|
||||
cp -pR ./root/* $(1)/
|
||||
$(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n
|
||||
cp -pR ./po/zh-cn/ssr-plus.zh-cn.lmo $(1)/usr/lib/lua/luci/i18n/ssr-plus.zh-cn.lmo
|
||||
po2lmo ./po/zh-cn/ssr-plus.po $(1)/usr/lib/lua/luci/i18n/ssr-plus.zh-cn.lmo
|
||||
endef
|
||||
|
||||
define Package/luci-app-ssr-plus-jsda/postinst
|
||||
define Package/luci-app-ssr-plus-jo/postinst
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
( . /etc/uci-defaults/luci-ssr-plus ) && rm -f /etc/uci-defaults/luci-ssr-plus
|
||||
@ -122,7 +148,7 @@ fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/luci-app-ssr-plus-jsda/prerm
|
||||
define Package/luci-app-ssr-plus-jo/prerm
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
/etc/init.d/shadowsocksr disable
|
||||
@ -131,4 +157,4 @@ fi
|
||||
exit 0
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,luci-app-ssr-plus-jsda))
|
||||
$(eval $(call BuildPackage,luci-app-ssr-plus-jo))
|
||||
@ -0,0 +1,253 @@
|
||||
-- Copyright (C) 2017 yushi studio <ywb94@qq.com>
|
||||
-- Licensed to the public under the GNU General Public License v3.
|
||||
|
||||
module("luci.controller.shadowsocksr", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/shadowsocksr") then
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
entry({"admin", "services", "shadowsocksr"},alias("admin", "services", "shadowsocksr", "client"),_("ShadowSocksR Plus+"), 10).dependent = true
|
||||
|
||||
entry({"admin", "services", "shadowsocksr", "client"},cbi("shadowsocksr/client"),_("SSR Client"), 10).leaf = true
|
||||
|
||||
entry({"admin", "services", "shadowsocksr", "servers"}, arcombine(cbi("shadowsocksr/servers"), cbi("shadowsocksr/client-config")),_("Severs Nodes"), 20).leaf = true
|
||||
|
||||
|
||||
entry({"admin", "services", "shadowsocksr", "subscription"},cbi("shadowsocksr/subscription"), _("Subscription Managenent"),25).leaf = true
|
||||
|
||||
entry({"admin", "services", "shadowsocksr", "control"},cbi("shadowsocksr/control"),_("Access Control"), 30).leaf = true
|
||||
|
||||
entry({"admin", "services", "shadowsocksr", "list"},form("shadowsocksr/list"),_("GFW List"), 40).leaf = true
|
||||
|
||||
entry({"admin", "services", "shadowsocksr", "automatic"},cbi("shadowsocksr/automatic"), _("Automatic Switching"),45).leaf = true
|
||||
|
||||
entry({"admin", "services", "shadowsocksr", "advanced"},cbi("shadowsocksr/advanced"),_("Advanced Settings"), 50).leaf = true
|
||||
|
||||
if nixio.fs.access("/usr/bin/ssr-server") then
|
||||
entry({"admin", "services", "shadowsocksr", "server"},arcombine(cbi("shadowsocksr/server"), cbi("shadowsocksr/server-config")),_("SSR Server"),60).leaf = true
|
||||
end
|
||||
|
||||
|
||||
entry({"admin", "services", "shadowsocksr", "status"},form("shadowsocksr/status"),_("Status"), 70).leaf = true
|
||||
|
||||
entry({"admin", "services", "shadowsocksr", "check"}, call("check_status"))
|
||||
entry({"admin", "services", "shadowsocksr", "refresh"}, call("refresh_data"))
|
||||
entry({"admin", "services", "shadowsocksr", "checkport"}, call("check_port"))
|
||||
entry({"admin", "services", "shadowsocksr", "log"},form("shadowsocksr/log"),_("Log"), 80).leaf = true
|
||||
entry({"admin", "services", "shadowsocksr", "run"},call("act_status")).leaf=true
|
||||
entry({"admin", "services", "shadowsocksr", "ping"}, call("act_ping")).leaf=true
|
||||
|
||||
end
|
||||
|
||||
-- 检测全局服务器状态
|
||||
function act_status()
|
||||
local e={}
|
||||
--全局服务器
|
||||
e.global=luci.sys.call("ps -w | grep ssr-retcp | grep -v grep >/dev/null") == 0
|
||||
--检测PDNSD状态
|
||||
if tonumber(luci.sys.exec("ps -w | grep pdnsd |grep -v grep| wc -l"))>0 then
|
||||
e.pdnsd= true
|
||||
elseif tonumber(luci.sys.exec("ps -w | grep dnsparsing |grep -v grep| wc -l"))>0 then
|
||||
e.pdnsd= true
|
||||
elseif tonumber(luci.sys.exec("ps -w | grep dnscrypt-proxy |grep -v grep| wc -l"))>0 then
|
||||
e.pdnsd= true
|
||||
elseif tonumber(luci.sys.exec("ps -w | grep dns-forwarder |grep -v grep| wc -l"))>0 then
|
||||
e.pdnsd= true
|
||||
elseif tonumber(luci.sys.exec("ps -w | grep dnsforwarder |grep -v grep| wc -l"))>0 then
|
||||
e.pdnsd= true
|
||||
|
||||
|
||||
end
|
||||
--检测UDP2RAW状态
|
||||
if tonumber(luci.sys.exec("ps -w | grep udp2raw |grep -v grep| wc -l"))>0 then
|
||||
e.udp2raw= true
|
||||
end
|
||||
--检测UDPspeeder状态
|
||||
if tonumber(luci.sys.exec("ps -w | grep udpspeeder |grep -v grep| wc -l"))>0 then
|
||||
e.udpspeeder= true
|
||||
end
|
||||
--检测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
|
||||
e.SOCKS5= 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
|
||||
end
|
||||
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
|
||||
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
|
||||
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 })
|
||||
end
|
||||
|
||||
function refresh_data()
|
||||
local set =luci.http.formvalue("set")
|
||||
local icount =0
|
||||
|
||||
if set == "gfw_data" then
|
||||
if nixio.fs.access("/usr/bin/wget-ssl") then
|
||||
refresh_cmd="wget-ssl --no-check-certificate https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt -O /tmp/gfw.b64"
|
||||
else
|
||||
refresh_cmd="wget -O /tmp/gfw.b64 http://iytc.net/tools/list.b64"
|
||||
end
|
||||
sret=luci.sys.call(refresh_cmd .. " 2>/dev/null")
|
||||
if sret== 0 then
|
||||
luci.sys.call("/usr/bin/ssr-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")
|
||||
retstring=tostring(math.ceil(tonumber(icount)/2))
|
||||
else
|
||||
retstring ="0"
|
||||
end
|
||||
else
|
||||
retstring ="-1"
|
||||
end
|
||||
luci.sys.exec("rm -f /tmp/gfwnew.txt ")
|
||||
else
|
||||
retstring ="-1"
|
||||
end
|
||||
elseif set == "ip_data" then
|
||||
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 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
|
||||
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"
|
||||
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/ssr-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
|
||||
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")
|
||||
retstring=tostring(math.ceil(tonumber(icount)))
|
||||
if oldcount==0 then
|
||||
luci.sys.call("/etc/init.d/dnsmasq restart")
|
||||
end
|
||||
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})
|
||||
end
|
||||
|
||||
function act_ping()
|
||||
local e={}
|
||||
e.index=luci.http.formvalue("index")
|
||||
e.ping=luci.sys.exec("ping -c 1 -W 1 %q 2>&1 | grep -o 'time=[0-9]*.[0-9]' | awk -F '=' '{print$2}'"%luci.http.formvalue("domain"))
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json(e)
|
||||
end
|
||||
|
||||
|
||||
function check_port()
|
||||
local set=""
|
||||
local retstring="<br /><br />"
|
||||
local s
|
||||
local server_name = ""
|
||||
local shadowsocksr = "shadowsocksr"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local iret=1
|
||||
|
||||
uci:foreach(shadowsocksr, "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
|
||||
|
||||
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)
|
||||
socket:setopt("socket", "sndtimeo", 3)
|
||||
ret=socket:connect(s.server,s.server_port)
|
||||
if tostring(ret) == "true" then
|
||||
socket:close()
|
||||
retstring =retstring .. "<font color='green'>[" .. server_name .. "] OK.</font><br />"
|
||||
else
|
||||
retstring =retstring .. "<font color='red'>[" .. server_name .. "] Error.</font><br />"
|
||||
end
|
||||
|
||||
if iret== 0 then
|
||||
luci.sys.call(" ipset del ss_spec_wan_ac " .. s.server)
|
||||
end
|
||||
end)
|
||||
|
||||
luci.http.prepare_content("application/json")
|
||||
luci.http.write_json({ ret=retstring })
|
||||
end
|
||||
@ -0,0 +1,255 @@
|
||||
local shadowsocksr = "shadowsocksr"
|
||||
local uci = luci.model.uci.cursor()
|
||||
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",
|
||||
}
|
||||
|
||||
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",
|
||||
}
|
||||
|
||||
obfs = {
|
||||
"plain",
|
||||
"http_simple",
|
||||
"http_post",
|
||||
"random_head",
|
||||
"tls1.2_ticket_auth",
|
||||
}
|
||||
|
||||
local raw_mode = {
|
||||
"faketcp",
|
||||
"udp",
|
||||
"icmp",
|
||||
}
|
||||
|
||||
local seq_mode = {
|
||||
"0",
|
||||
"1",
|
||||
"2",
|
||||
"3",
|
||||
"4",
|
||||
}
|
||||
|
||||
local cipher_mode = {
|
||||
"none",
|
||||
"xor",
|
||||
"aes128cbc",
|
||||
}
|
||||
|
||||
local auth_mode = {
|
||||
"none",
|
||||
"simple",
|
||||
"md5",
|
||||
"crc32",
|
||||
}
|
||||
|
||||
local speeder_mode = {
|
||||
"0",
|
||||
"1",
|
||||
}
|
||||
|
||||
uci:foreach(shadowsocksr, "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}
|
||||
end
|
||||
end)
|
||||
|
||||
local key_table = {}
|
||||
for key,_ in pairs(server_table) do
|
||||
table.insert(key_table,key)
|
||||
end
|
||||
|
||||
table.sort(key_table)
|
||||
|
||||
m = Map(shadowsocksr)
|
||||
|
||||
|
||||
|
||||
-- [[ haProxy ]]--
|
||||
|
||||
s = m:section(TypedSection, "global_haproxy", translate("haProxy settings"))
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Flag, "admin_enable", translate("Enabling the Management Console"))
|
||||
o.rmempty = false
|
||||
o.default = 1
|
||||
|
||||
o = s:option(Value, "admin_port", translate("Service Port"))
|
||||
o.datatype = "uinteger"
|
||||
o.default = 1111
|
||||
|
||||
o = s:option(Value, "admin_user", translate("User name"))
|
||||
o.default = "admin"
|
||||
|
||||
o = s:option(Value, "admin_password", translate("Password"))
|
||||
o.default = "root"
|
||||
|
||||
-- [[ 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
|
||||
|
||||
|
||||
|
||||
-- [[ udp2raw ]]--
|
||||
if nixio.fs.access("/usr/bin/udp2raw") then
|
||||
|
||||
s = m:section(TypedSection, "udp2raw", translate("udp2raw tunnel"))
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Flag, "udp2raw_enable", translate("Enable udp2raw"))
|
||||
o.default = 0
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "server", translate("Server Address"))
|
||||
o.datatype = "host"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "server_port", translate("Server Port"))
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "local_port", translate("Local Port"))
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "key", translate("Password"))
|
||||
o.password = true
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, "raw_mode", translate("Raw Mode"))
|
||||
for _, v in ipairs(raw_mode) do o:value(v) end
|
||||
o.default = "faketcp"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, "seq_mode", translate("Seq Mode"))
|
||||
for _, v in ipairs(seq_mode) do o:value(v) end
|
||||
o.default = "3"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, "cipher_mode", translate("Cipher Mode"))
|
||||
for _, v in ipairs(cipher_mode) do o:value(v) end
|
||||
o.default = "xor"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, "auth_mode", translate("Auth Mode"))
|
||||
for _, v in ipairs(auth_mode) do o:value(v) end
|
||||
o.default = "simple"
|
||||
o.rmempty = false
|
||||
|
||||
end
|
||||
|
||||
-- [[ udpspeeder ]]--
|
||||
if nixio.fs.access("/usr/bin/udpspeeder") then
|
||||
|
||||
s = m:section(TypedSection, "udpspeeder", translate("UDPspeeder"))
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Flag, "udpspeeder_enable", translate("Enable UDPspeeder"))
|
||||
o.default = 0
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "server", translate("Server Address"))
|
||||
o.datatype = "host"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "server_port", translate("Server Port"))
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "local_port", translate("Local Port"))
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "key", translate("Password"))
|
||||
o.password = true
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, "speeder_mode", translate("Speeder Mode"))
|
||||
for _, v in ipairs(speeder_mode) do o:value(v) end
|
||||
o.default = "0"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "fec", translate("Fec"))
|
||||
o.default = "20:10"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "mtu", translate("Mtu"))
|
||||
o.datatype = "uinteger"
|
||||
o.default = 1250
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "queue_len", translate("Queue Len"))
|
||||
o.datatype = "uinteger"
|
||||
o.default = 200
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "timeout", translate("Fec Timeout"))
|
||||
o.datatype = "uinteger"
|
||||
o.default = 8
|
||||
o.rmempty = false
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
||||
return m
|
||||
@ -0,0 +1,45 @@
|
||||
local shadowsocksr = "shadowsocksr"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local server_table = {}
|
||||
|
||||
uci:foreach(shadowsocksr, "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}
|
||||
end
|
||||
end)
|
||||
|
||||
local key_table = {}
|
||||
for key,_ in pairs(server_table) do
|
||||
table.insert(key_table,key)
|
||||
end
|
||||
|
||||
table.sort(key_table)
|
||||
|
||||
m = Map(shadowsocksr)
|
||||
|
||||
|
||||
s = m:section(TypedSection, "global", translate("Server failsafe auto swith settings"))
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Flag, "monitor_enable", translate("Enable Process Deamon"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Flag, "enable_switch", translate("Enable Auto Switch"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "switch_time", translate("Switch check cycly(second)"))
|
||||
o.datatype = "uinteger"
|
||||
o:depends("enable_switch", "1")
|
||||
o.default = 3600
|
||||
|
||||
o = s:option(Value, "switch_timeout", translate("Check timout(second)"))
|
||||
o.datatype = "uinteger"
|
||||
o:depends("enable_switch", "1")
|
||||
o.default = 5
|
||||
|
||||
|
||||
|
||||
|
||||
return m
|
||||
@ -89,7 +89,7 @@ local protocol = {
|
||||
"auth_chain_f",
|
||||
}
|
||||
|
||||
local obfs = {
|
||||
obfs = {
|
||||
"plain",
|
||||
"http_simple",
|
||||
"http_post",
|
||||
@ -97,6 +97,12 @@ local obfs = {
|
||||
"tls1.2_ticket_auth",
|
||||
}
|
||||
|
||||
local obfs_opts = {
|
||||
"none",
|
||||
"http",
|
||||
"tls",
|
||||
}
|
||||
|
||||
local securitys = {
|
||||
"auto",
|
||||
"none",
|
||||
@ -105,6 +111,7 @@ local securitys = {
|
||||
}
|
||||
|
||||
|
||||
|
||||
m = Map(shadowsocksr, translate("Edit ShadowSocksR Server"))
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/shadowsocksr/servers")
|
||||
if m.uci:get(shadowsocksr, sid) ~= "servers" then
|
||||
@ -117,7 +124,7 @@ s = m:section(NamedSection, sid, "servers")
|
||||
s.anonymous = true
|
||||
s.addremove = false
|
||||
|
||||
o = s:option(DummyValue,"ssr_url","SSR URL")
|
||||
o = s:option(DummyValue,"ssr_url","配置链接")
|
||||
o.rawhtml = true
|
||||
o.template = "shadowsocksr/ssrurl"
|
||||
o.value =sid
|
||||
@ -133,67 +140,12 @@ o:value("v2ray", translate("V2Ray"))
|
||||
end
|
||||
o.description = translate("Using incorrect encryption mothod may causes service fail to start")
|
||||
|
||||
use_conf_file = s:option(Flag, "use_conf_file", translate("Use Config File"), translate("Use Config File"))
|
||||
use_conf_file:depends("type", "v2ray")
|
||||
use_conf_file.rmempty = false
|
||||
|
||||
conf_file_path = s:option(Value, "conf_file_path", translate("Config File Path"),
|
||||
translate("Add the file name. JSON after the path."))
|
||||
conf_file_path.default = "/etc/shadowsocksr/"
|
||||
conf_file_path:depends("use_conf_file", 1)
|
||||
|
||||
upload_conf = s:option(FileUpload, "")
|
||||
upload_conf.template = "cbi/ssr_other_upload2"
|
||||
upload_conf:depends("use_conf_file", 1)
|
||||
|
||||
um = s:option(DummyValue, "", nil)
|
||||
um.template = "cbi/ssr_other_dvalue"
|
||||
um:depends("use_conf_file", 1)
|
||||
|
||||
local conf_dir, fd
|
||||
conf_dir = "/etc/shadowsocksr/"
|
||||
nixio.fs.mkdir(conf_dir)
|
||||
http.setfilehandler(
|
||||
function(meta, chunk, eof)
|
||||
if not fd then
|
||||
if not meta then return end
|
||||
|
||||
if meta and chunk then fd = nixio.open(conf_dir .. meta.file, "w") end
|
||||
|
||||
if not fd then
|
||||
um.value = translate("Create upload file error.")
|
||||
return
|
||||
end
|
||||
end
|
||||
if chunk and fd then
|
||||
fd:write(chunk)
|
||||
end
|
||||
if eof and fd then
|
||||
fd:close()
|
||||
fd = nil
|
||||
um.value = translate("File saved to") .. ' "/etc/shadowsocksr/' .. meta.file .. '"'
|
||||
ucursor:set("v2ray","v2ray","conf_file_path","/etc/shadowsocksr/" .. meta.file)
|
||||
ucursor:commit("v2ray")
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
if luci.http.formvalue("upload") then
|
||||
local f = luci.http.formvalue("ulfile")
|
||||
if #f <= 0 then
|
||||
um.value = translate("No specify upload file.")
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(Value, "alias", translate("Alias(optional)"))
|
||||
o.default = "test"
|
||||
|
||||
o = s:option(Value, "server", translate("Server Address"))
|
||||
o.default = "1.2.3.4"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "server_port", translate("Server Port"))
|
||||
o.default = "1234"
|
||||
o.datatype = "port"
|
||||
o.rmempty = false
|
||||
|
||||
@ -223,28 +175,6 @@ for _, v in ipairs(encrypt_methods_ss) do o:value(v) end
|
||||
o.rmempty = true
|
||||
o:depends("type", "ss")
|
||||
|
||||
o = s:option(ListValue, "plugin", translate("plugin"))
|
||||
o:value("none", "None")
|
||||
if nixio.fs.access("/usr/bin/v2ray-plugin") then
|
||||
o:value("/usr/bin/v2ray-plugin", "v2ray-plugin")
|
||||
end
|
||||
if nixio.fs.access("/usr/bin/obfs-local") then
|
||||
o:value("/usr/bin/obfs-local", "obfs-local")
|
||||
end
|
||||
if nixio.fs.access("/usr/bin/gq-client") then
|
||||
o:value("/usr/bin/gq-client", "GoQuiet")
|
||||
end
|
||||
o.rmempty = false
|
||||
o.default = "none"
|
||||
o:depends("type", "ss")
|
||||
|
||||
o = s:option(Value, "plugin_opts", translate("Plugin Opts"))
|
||||
o.rmempty = true
|
||||
o:depends("plugin", "/usr/bin/v2ray-plugin")
|
||||
o:depends("plugin", "/usr/bin/obfs-local")
|
||||
o:depends("plugin", "/usr/bin/gq-client")
|
||||
|
||||
|
||||
o = s:option(ListValue, "protocol", translate("Protocol"))
|
||||
for _, v in ipairs(protocol) do o:value(v) end
|
||||
o.rmempty = true
|
||||
@ -258,9 +188,21 @@ for _, v in ipairs(obfs) do o:value(v) end
|
||||
o.rmempty = true
|
||||
o:depends("type", "ssr")
|
||||
|
||||
o = s:option(ListValue, "obfs_opts", translate("Obfs (可选)"))
|
||||
for _, v in ipairs(obfs_opts) do o:value(v) end
|
||||
o.rmempty = true
|
||||
o:depends("type", "ss")
|
||||
|
||||
|
||||
o = s:option(Value, "obfs_host", translate("Obfs-host (可选)"))
|
||||
o:depends("type", "ss")
|
||||
|
||||
o = s:option(Value, "obfs_param", translate("Obfs param(optional)"))
|
||||
o:depends("type", "ssr")
|
||||
|
||||
|
||||
|
||||
|
||||
-- AlterId
|
||||
o = s:option(Value, "alter_id", translate("AlterId"))
|
||||
o.default = 100
|
||||
@ -4,11 +4,31 @@
|
||||
|
||||
local m, s, sec, o, kcp_enable
|
||||
local shadowsocksr = "shadowsocksr"
|
||||
local gfw_count=0
|
||||
local ad_count=0
|
||||
local ip_count=0
|
||||
local gfwmode=0
|
||||
|
||||
if nixio.fs.access("/etc/dnsmasq.ssr/gfw_list.conf") then
|
||||
gfwmode=1
|
||||
end
|
||||
|
||||
local uci = luci.model.uci.cursor()
|
||||
|
||||
local sys = require "luci.sys"
|
||||
|
||||
m = Map(shadowsocksr, translate("ShadowSocksR Plus+ Settings"))
|
||||
if gfwmode==1 then
|
||||
gfw_count = tonumber(sys.exec("cat /etc/dnsmasq.ssr/gfw_list.conf | wc -l"))/2
|
||||
if nixio.fs.access("/etc/dnsmasq.ssr/ad.conf") then
|
||||
ad_count=tonumber(sys.exec("cat /etc/dnsmasq.ssr/ad.conf | wc -l"))
|
||||
end
|
||||
end
|
||||
|
||||
if nixio.fs.access("/etc/china_ssr.txt") then
|
||||
ip_count = sys.exec("cat /etc/china_ssr.txt | wc -l")
|
||||
end
|
||||
|
||||
m = Map(shadowsocksr)
|
||||
|
||||
m:section(SimpleSection).template = "shadowsocksr/status"
|
||||
|
||||
@ -59,7 +79,6 @@ o = s:option(ListValue, "run_mode", translate("Running Mode"))
|
||||
o:value("gfw", translate("GFW List Mode"))
|
||||
o:value("router", translate("IP Route Mode"))
|
||||
o:value("routers", translate("Oversea IP Route Mode"))
|
||||
o:value("oversea", translate("Oversea GFW List Mode"))
|
||||
o:value("all", translate("Global Mode"))
|
||||
o.default = gfw
|
||||
|
||||
@ -77,10 +96,10 @@ end
|
||||
if nixio.fs.access("/usr/bin/chinadns") then
|
||||
o:value("6", translate("Use chinadns query and cache"))
|
||||
end
|
||||
o:value("7", translate("使用系统DNS"))
|
||||
|
||||
o.default = 1
|
||||
|
||||
o = s:option(ListValue, "chinadns_enable", translate("Chinadns Resolve Dns Mode"))
|
||||
o = s:option(ListValue, "chinadns_enable", translate("Chiadns Resolve Dns Mode"))
|
||||
o:value("0", translate("Use Local DNS Service"))
|
||||
o:value("1", translate("Use Pdnsd tcp query and cache"))
|
||||
o:value("2", translate("Use Pdnsd udp query and cache"))
|
||||
@ -91,10 +110,19 @@ end
|
||||
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")
|
||||
|
||||
o = s:option(Value, "tunnel_forward", translate("Anti-pollution DNS Server"))
|
||||
o:value("0.0.0.0:53", translate("Using System Default DNS"))
|
||||
o:value("8.8.4.4:53", translate("Google Public DNS (8.8.4.4)"))
|
||||
o:value("8.8.8.8:53", translate("Google Public DNS (8.8.8.8)"))
|
||||
o:value("208.67.222.222:53", translate("OpenDNS (208.67.222.222)"))
|
||||
@ -125,6 +153,18 @@ o.default = "1236:65535"
|
||||
o.rmempty = true
|
||||
o:depends("bt", "1")
|
||||
|
||||
m:section(SimpleSection).template = "shadowsocksr/ip_info"
|
||||
o = s:option(Button,"gfw_data",translate("GFW List Data"))
|
||||
o.rawhtml = true
|
||||
o.template = "shadowsocksr/refresh"
|
||||
o.value =tostring(math.ceil(gfw_count)) .. " " .. translate("Records")
|
||||
|
||||
o = s:option(Button,"ip_data",translate("China IP Data"))
|
||||
o.rawhtml = true
|
||||
o.template = "shadowsocksr/refresh"
|
||||
o.value =ip_count .. " " .. translate("Records")
|
||||
|
||||
o = s:option(Button,"check_port",translate("Check Server Port"))
|
||||
o.template = "shadowsocksr/checkport"
|
||||
o.value =translate("No Check")
|
||||
m:section(SimpleSection).template = "shadowsocksr/myip"
|
||||
return m
|
||||
@ -14,8 +14,7 @@ o.datatype = "ip4addr"
|
||||
o = s:taboption("wan_ac", DynamicList, "wan_fw_ips", translate("WAN Force Proxy IP"))
|
||||
o.datatype = "ip4addr"
|
||||
|
||||
o = s:taboption("wan_ac", DynamicList, "wan_fk_ips", translate("WAN Fk Proxy IP"))
|
||||
o.datatype = "ip4addr"
|
||||
|
||||
|
||||
-- Part of LAN
|
||||
s:tab("lan_ac", translate("LAN IP AC"))
|
||||
@ -35,7 +34,6 @@ luci.ip.neighbors({ family = 4 }, function(entry)
|
||||
o:value(entry.dest:string())
|
||||
end
|
||||
end)
|
||||
|
||||
o = s:taboption("lan_ac", DynamicList, "lan_gm_ips", translate("Game Mode Host List"))
|
||||
o.datatype = "ipaddr"
|
||||
luci.ip.neighbors({ family = 4 }, function(entry)
|
||||
@ -44,6 +42,7 @@ luci.ip.neighbors({ family = 4 }, function(entry)
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
s = m:section(TypedSection, "domain_white_list", translate("Domain White List"))
|
||||
s.template = "cbi/tblsection"
|
||||
s.anonymous = true
|
||||
@ -60,4 +59,4 @@ o = s:option(Value, "domain_names", translate("Domain name (keyword only)"))
|
||||
-- o:value("2", translatef("Forwarded Proxy"))
|
||||
-- o.rmempty = false
|
||||
|
||||
return m
|
||||
return m
|
||||
@ -14,10 +14,11 @@ function f.handle(self, state, data)
|
||||
if state == FORM_VALID then
|
||||
if data.conf then
|
||||
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
|
||||
luci.sys.call("/usr/share/shadowsocksr/gfw2ipset.sh && /etc/init.d/shadowsocksr restart")
|
||||
luci.sys.call("/usr/share/shadowsocksr/gfw2ipset.sh && /etc/init.d/dnsmasq restart")
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
return f
|
||||
|
||||
return f
|
||||
@ -12,4 +12,5 @@ function t.cfgvalue()
|
||||
end
|
||||
t.readonly="readonly"
|
||||
|
||||
return f
|
||||
|
||||
return f
|
||||
@ -11,23 +11,19 @@ local uuid = luci.sys.exec("cat /proc/sys/kernel/random/uuid")
|
||||
local http = luci.http
|
||||
local ucursor = require "luci.model.uci".cursor()
|
||||
|
||||
local server_table = {}
|
||||
local encrypt_methods = {
|
||||
"rc4-md5",
|
||||
"rc4-md5-6",
|
||||
"rc4",
|
||||
"none",
|
||||
"table",
|
||||
"aes-128-gcm",
|
||||
"aes-192-gcm",
|
||||
"aes-256-gcm",
|
||||
"rc4",
|
||||
"rc4-md5-6",
|
||||
"rc4-md5",
|
||||
"aes-128-cfb",
|
||||
"aes-192-cfb",
|
||||
"aes-256-cfb",
|
||||
"aes-128-ctr",
|
||||
"aes-192-ctr",
|
||||
"aes-256-ctr",
|
||||
"aes-128-gcm",
|
||||
"aes-192-gcm",
|
||||
"aes-256-gcm",
|
||||
"aes-256-ctr",
|
||||
"bf-cfb",
|
||||
"camellia-128-cfb",
|
||||
"camellia-192-cfb",
|
||||
@ -40,18 +36,60 @@ local encrypt_methods = {
|
||||
"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",
|
||||
}
|
||||
|
||||
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",
|
||||
}
|
||||
|
||||
local obfs = {
|
||||
obfs = {
|
||||
"plain",
|
||||
"http_simple",
|
||||
"http_post",
|
||||
"random_head",
|
||||
"tls1.2_ticket_auth",
|
||||
}
|
||||
|
||||
local obfs_opts = {
|
||||
"none",
|
||||
"http",
|
||||
"tls",
|
||||
}
|
||||
|
||||
local securitys = {
|
||||
@ -62,6 +100,7 @@ local securitys = {
|
||||
}
|
||||
|
||||
|
||||
|
||||
m = Map(shadowsocksr, translate("Edit ShadowSocksR Server"))
|
||||
|
||||
m.redirect = luci.dispatcher.build_url("admin/services/shadowsocksr/server")
|
||||
@ -94,57 +133,7 @@ o:value("v2ray", translate("V2Ray"))
|
||||
end
|
||||
o.description = translate("Using incorrect encryption mothod may causes service fail to start")
|
||||
|
||||
use_conf_file = s:option(Flag, "use_conf_file", translate("Use Config File"), translate("Use Config File"))
|
||||
use_conf_file:depends("type", "v2ray")
|
||||
use_conf_file.rmempty = false
|
||||
|
||||
conf_file_path = s:option(Value, "conf_file_path", translate("Config File Path"),
|
||||
translate("Add the file name. JSON after the path."))
|
||||
conf_file_path.default = "/etc/shadowsocksr/"
|
||||
conf_file_path:depends("use_conf_file", 1)
|
||||
|
||||
upload_conf = s:option(FileUpload, "")
|
||||
upload_conf.template = "cbi/ssr_other_upload2"
|
||||
upload_conf:depends("use_conf_file", 1)
|
||||
|
||||
um = s:option(DummyValue, "", nil)
|
||||
um.template = "cbi/ssr_other_dvalue"
|
||||
um:depends("use_conf_file", 1)
|
||||
|
||||
local conf_dir, fd
|
||||
conf_dir = "/etc/shadowsocksr/"
|
||||
nixio.fs.mkdir(conf_dir)
|
||||
http.setfilehandler(
|
||||
function(meta, chunk, eof)
|
||||
if not fd then
|
||||
if not meta then return end
|
||||
|
||||
if meta and chunk then fd = nixio.open(conf_dir .. meta.file, "w") end
|
||||
|
||||
if not fd then
|
||||
um.value = translate("Create upload file error.")
|
||||
return
|
||||
end
|
||||
end
|
||||
if chunk and fd then
|
||||
fd:write(chunk)
|
||||
end
|
||||
if eof and fd then
|
||||
fd:close()
|
||||
fd = nil
|
||||
um.value = translate("File saved to") .. ' "/etc/shadowsocksr/' .. meta.file .. '"'
|
||||
ucursor:set("v2ray","v2ray","conf_file_path","/etc/shadowsocksr/" .. meta.file)
|
||||
ucursor:commit("v2ray")
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
if luci.http.formvalue("upload") then
|
||||
local f = luci.http.formvalue("ulfile")
|
||||
if #f <= 0 then
|
||||
um.value = translate("No specify upload file.")
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(Flag, "ipv4_ipv6", translate("Enabling IPv6 server"))
|
||||
o.default = 0
|
||||
@ -172,37 +161,23 @@ o.rmempty = true
|
||||
o:depends("type", "ssr")
|
||||
o:depends("type", "ss")
|
||||
|
||||
o = s:option(ListValue, "plugin", translate("plugin"))
|
||||
o:value("none", "None")
|
||||
if nixio.fs.access("/usr/bin/v2ray-plugin") then
|
||||
o:value("/usr/bin/v2ray-plugin", "v2ray-plugin")
|
||||
end
|
||||
if nixio.fs.access("/usr/bin/obfs-server") then
|
||||
o:value("/usr/bin/obfs-server", "obfs-server")
|
||||
end
|
||||
if nixio.fs.access("/usr/bin/gq-server") then
|
||||
o:value("/usr/bin/gq-server", "GoQuiet")
|
||||
end
|
||||
o.rmempty = false
|
||||
o.default = "none"
|
||||
o:depends("type", "ss")
|
||||
|
||||
o = s:option(Value, "plugin_opts", translate("Plugin Opts"))
|
||||
o.rmempty = true
|
||||
o:depends("plugin", "/usr/bin/v2ray-plugin")
|
||||
o:depends("plugin", "/usr/bin/obfs-server")
|
||||
o:depends("plugin", "/usr/bin/gq-server")
|
||||
|
||||
o = s:option(ListValue, "protocol", translate("Protocol"))
|
||||
for _, v in ipairs(protocol) do o:value(v) end
|
||||
o.rmempty = true
|
||||
o:depends("type", "ssr")
|
||||
|
||||
o = s:option(Value, "protocol_param", translate("Protocol param(optional)"))
|
||||
o:depends("type", "ssr")
|
||||
|
||||
o = s:option(ListValue, "obfs", translate("Obfs"))
|
||||
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")
|
||||
|
||||
@ -0,0 +1,84 @@
|
||||
-- Licensed to the public under the GNU General Public License v3.
|
||||
local d = require "luci.dispatcher"
|
||||
local fs = require "nixio.fs"
|
||||
local sys = require "luci.sys"
|
||||
local uci = require "luci.model.uci".cursor()
|
||||
local m, s, o
|
||||
local shadowsocksr = "shadowsocksr"
|
||||
|
||||
local uci = luci.model.uci.cursor()
|
||||
local server_count = 0
|
||||
uci:foreach("shadowsocksr", "servers", function(s)
|
||||
server_count = server_count + 1
|
||||
end)
|
||||
|
||||
m = Map(shadowsocksr)
|
||||
|
||||
|
||||
m:section(SimpleSection).template = "shadowsocksr/status"
|
||||
-- [[ Servers Manage ]]--
|
||||
s = m:section(TypedSection, "servers")
|
||||
s.anonymous = true
|
||||
s.addremove = true
|
||||
s.sortable = true
|
||||
s.template = "cbi/tblsection"
|
||||
s.description = string.format(translate("Server Count") .. ": %d", server_count)
|
||||
s.extedit = d.build_url("admin", "services", "shadowsocksr", "servers", "%s")
|
||||
|
||||
function s.create(e, t)
|
||||
local e = TypedSection.create(e, t)
|
||||
luci.http.redirect(
|
||||
d.build_url("admin", "services", "shadowsocksr", "servers", e))
|
||||
end
|
||||
|
||||
function s.remove(t, a)
|
||||
s.map.proceed = true
|
||||
s.map:del(a)
|
||||
luci.http.redirect(d.build_url("admin", "services", "shadowsocksr", "servers"))
|
||||
end
|
||||
o = s:option(DummyValue, "type", translate("Type"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "alias", translate("Alias"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "server", translate("Server Address"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or "?"
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "encrypt_method", translate("Encrypt Method"))
|
||||
o.width="10%"
|
||||
|
||||
|
||||
o = s:option(DummyValue, "server_port", translate("Server Port"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or "?"
|
||||
end
|
||||
|
||||
if nixio.fs.access("/usr/bin/kcptun-client") then
|
||||
|
||||
o = s:option(Flag, "kcp_enable", translate("KcpTun"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or "?"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "switch_enable", translate("Auto Switch"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
|
||||
o = s:option(DummyValue,"server",translate("Ping Latency"))
|
||||
o.template="shadowsocksr/ping"
|
||||
o.width="10%"
|
||||
|
||||
|
||||
m:append(Template("shadowsocksr/server_list"))
|
||||
return m
|
||||
@ -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="3.0.9"
|
||||
local IPK_Version="20190829.116.5"
|
||||
local m, s, o
|
||||
local redir_run=0
|
||||
local reudp_run=0
|
||||
@ -53,6 +53,34 @@ else
|
||||
|
||||
end
|
||||
|
||||
local udp2raw_version=translate("Unknown")
|
||||
local udp2raw_file="/usr/bin/udp2raw"
|
||||
if not fs.access(udp2raw_file) then
|
||||
udp2raw_version=translate("Not exist")
|
||||
else
|
||||
if not fs.access(udp2raw_file, "rwx", "rx", "rx") then
|
||||
fs.chmod(udp2raw_file, 755)
|
||||
end
|
||||
udp2raw_version=sys.exec(udp2raw_file .. " -h |grep 'git version' |awk -F ':' '{print $2}'|awk '{print $1}'")
|
||||
if not udp2raw_version or udp2raw_version == "" then
|
||||
udp2raw_version = translate("Unknown")
|
||||
end
|
||||
end
|
||||
|
||||
local udpspeeder_version=translate("Unknown")
|
||||
local udpspeeder_file="/usr/bin/udpspeeder"
|
||||
if not fs.access(udpspeeder_file) then
|
||||
udpspeeder_version=translate("Not exist")
|
||||
else
|
||||
if not fs.access(udpspeeder_file, "rwx", "rx", "rx") then
|
||||
fs.chmod(udpspeeder_file, 755)
|
||||
end
|
||||
udpspeeder_version=sys.exec(udpspeeder_file .. " -h |grep 'git version' |awk -F ':' '{print $2}'|awk '{print $1}'")
|
||||
if not udpspeeder_version or udpspeeder_version == "" then
|
||||
udpspeeder_version = translate("Unknown")
|
||||
end
|
||||
end
|
||||
|
||||
if gfwmode==1 then
|
||||
gfw_count = tonumber(sys.exec("cat /etc/dnsmasq.ssr/gfw_list.conf | wc -l"))/2
|
||||
if nixio.fs.access("/etc/dnsmasq.ssr/ad.conf") then
|
||||
@ -113,6 +141,14 @@ end
|
||||
|
||||
if luci.sys.call("ps -w | grep ssr-tunnel |grep -v grep >/dev/null") == 0 then
|
||||
tunnel_run=1
|
||||
end
|
||||
|
||||
if luci.sys.call("pidof udp2raw >/dev/null") == 0 then
|
||||
udp2raw_run=1
|
||||
end
|
||||
|
||||
if luci.sys.call("pidof udpspeeder >/dev/null") == 0 then
|
||||
udpspeeder_run=1
|
||||
end
|
||||
|
||||
if luci.sys.call("pidof pdnsd >/dev/null") == 0 then
|
||||
@ -183,6 +219,9 @@ else
|
||||
s.value = translate("Not Running")
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
if nixio.fs.access("/usr/bin/ssr-local") then
|
||||
s=m:field(DummyValue,"sock5_run",translate("SOCKS5 Proxy"))
|
||||
s.rawhtml = true
|
||||
@ -266,14 +305,40 @@ else
|
||||
s.value = translate("Not Running")
|
||||
end
|
||||
end
|
||||
s=m:field(DummyValue,"version",translate("IPK Version"))
|
||||
s.rawhtml = true
|
||||
s.value =IPK_Version
|
||||
|
||||
s=m:field(DummyValue,"google",translate("Google Connectivity"))
|
||||
s.value = translate("No Check")
|
||||
s.template = "shadowsocksr/check"
|
||||
s=m:field(DummyValue,"udp2raw_version",translate("udp2raw Version"))
|
||||
s.rawhtml = true
|
||||
s.value =udp2raw_version
|
||||
s=m:field(DummyValue,"udp2raw_run",translate("udp2raw"))
|
||||
s.rawhtml = true
|
||||
if udp2raw_run == 1 then
|
||||
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
|
||||
else
|
||||
s.value = translate("Not Running")
|
||||
end
|
||||
s=m:field(DummyValue,"udp2raw_project",translate("udp2raw tunnel Project"))
|
||||
s.rawhtml = true
|
||||
s.value =bold_on .. [[<a href="]] .. "https://github.com/wangyu-/udp2raw-tunnel" .. [[" >]]
|
||||
.. "https://github.com/wangyu-/udp2raw-tunnel" .. [[</a>]] .. bold_off
|
||||
|
||||
s=m:field(DummyValue,"baidu",translate("Baidu Connectivity"))
|
||||
s.value = translate("No Check")
|
||||
s.template = "shadowsocksr/check"
|
||||
s=m:field(DummyValue,"udpspeeder_version",translate("UDPspeeder Version"))
|
||||
s.rawhtml = true
|
||||
s.value =udpspeeder_version
|
||||
s=m:field(DummyValue,"udpspeeder_run",translate("UDPspeeder"))
|
||||
s.rawhtml = true
|
||||
if udpspeeder_run == 1 then
|
||||
s.value =font_blue .. bold_on .. translate("Running") .. bold_off .. font_off
|
||||
else
|
||||
s.value = translate("Not Running")
|
||||
end
|
||||
s=m:field(DummyValue,"udpspeeder_project",translate("UDPspeeder Project"))
|
||||
s.rawhtml = true
|
||||
s.value =bold_on .. [[<a href="]] .. "https://github.com/wangyu-/UDPspeeder" .. [[" >]]
|
||||
.. "https://github.com/wangyu-/UDPspeeder" .. [[</a>]] .. bold_off
|
||||
|
||||
|
||||
if gfwmode==1 then
|
||||
s=m:field(DummyValue,"gfw_data",translate("GFW List Data"))
|
||||
@ -281,8 +346,12 @@ s.rawhtml = true
|
||||
s.template = "shadowsocksr/refresh"
|
||||
s.value =tostring(math.ceil(gfw_count)) .. " " .. translate("Records")
|
||||
|
||||
end
|
||||
|
||||
s=m:field(DummyValue,"ad_data",translate("Advertising Data"))
|
||||
s.rawhtml = true
|
||||
s.template = "shadowsocksr/refresh"
|
||||
s.value =tostring(math.ceil(ad_count)) .. " " .. translate("Records")
|
||||
end
|
||||
s=m:field(DummyValue,"ip_data",translate("China IP Data"))
|
||||
s.rawhtml = true
|
||||
s.template = "shadowsocksr/refresh"
|
||||
@ -292,4 +361,6 @@ s=m:field(DummyValue,"check_port",translate("Check Server Port"))
|
||||
s.template = "shadowsocksr/checkport"
|
||||
s.value =translate("No Check")
|
||||
|
||||
|
||||
|
||||
return m
|
||||
@ -20,8 +20,6 @@ o = s:option(Flag, "auto_update", translate("Auto Update"))
|
||||
o.rmempty = false
|
||||
o.description = translate("Auto Update Server subscription, GFW list and CHN route")
|
||||
|
||||
o = s:option(Flag, "v2ray_update", translate("Enable V2ray Update"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(ListValue, "auto_update_time", translate("Update time (every day)"))
|
||||
for t = 0,23 do
|
||||
@ -88,7 +86,7 @@ function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or "?"
|
||||
end
|
||||
|
||||
if nixio.fs.access("/usr/bin/ssr-kcptun") then
|
||||
if nixio.fs.access("/usr/bin/kcptun-client") then
|
||||
|
||||
o = s:option(DummyValue, "kcp_enable", translate("KcpTun"))
|
||||
function o.cfgvalue(...)
|
||||
@ -102,14 +100,4 @@ function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
o = s:option(DummyValue, "weight", translate("weight"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or "0"
|
||||
end
|
||||
|
||||
o = s:option(DummyValue,"server",translate("Ping Latency"))
|
||||
o.template="shadowsocksr/ping"
|
||||
|
||||
m:append(Template("shadowsocksr/server_list"))
|
||||
|
||||
return m
|
||||
@ -35,4 +35,4 @@
|
||||
<input type="button" class="cbi-button cbi-button-apply" value="<%:Check Connect%>" onclick="return check_connect(this,'<%=self.option%>')" />
|
||||
<span id="<%=self.option%>-status"><em><%=self.value%></em></span>
|
||||
|
||||
<%+cbi/valuefooter%>
|
||||
<%+cbi/valuefooter%>
|
||||
@ -6,7 +6,7 @@
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Check...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "shadowsocksr","checkport")%>',
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "shadowsocksr","checkports")%>',
|
||||
null,
|
||||
function(x,rv)
|
||||
{
|
||||
@ -33,4 +33,4 @@
|
||||
|
||||
|
||||
|
||||
<%+cbi/valuefooter%>
|
||||
<%+cbi/valuefooter%>
|
||||
@ -0,0 +1,339 @@
|
||||
</DIV>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-dns-prefetch-control" content="on">
|
||||
<link rel="dns-prefetch" href="//cdn.jsdelivr.net">
|
||||
<link rel="dns-prefetch" href="//whois.pconline.com.cn">
|
||||
<link rel="dns-prefetch" href="//ipv4.ip.sb">
|
||||
<link rel="dns-prefetch" href="//myip.ipip.net">
|
||||
<link rel="dns-prefetch" href="//api.ipify.org">
|
||||
<link rel="dns-prefetch" href="//api.ttt.sh">
|
||||
<link rel="dns-prefetch" href="//api.skk.moe">
|
||||
<link rel="dns-prefetch" href="//d.skk.moe">
|
||||
<link rel="preconnect" href="https://whois.pconline.com.cn">
|
||||
<link rel="preconnect" href="https://ip.sb">
|
||||
<link rel="preconnect" href="https://myip.ipip.net">
|
||||
<link rel="preconnect" href="https://api.ipify.org">
|
||||
<link rel="preconnect" href="https://api.ttt.sh">
|
||||
<link rel="preconnect" href="https://api.skk.moe">
|
||||
<link rel="preconnect" href="https://d.skk.moe">
|
||||
<link rel="shortcut icon" type="image/ico" href="https://cdn.jsdelivr.net/npm/skx@0.0.1">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,minimal-ui">
|
||||
<style>
|
||||
.ip-title {
|
||||
font-weight: bold;
|
||||
color: #444;
|
||||
font-size:15px;
|
||||
display: inline-block;
|
||||
width: 25%;
|
||||
vertical-align:bottom;
|
||||
}
|
||||
|
||||
.ip-state_title {
|
||||
font-weight: bold;
|
||||
color: #444;
|
||||
font-size:15px;
|
||||
display: inline-block;
|
||||
width: 52%;
|
||||
vertical-align:bottom;
|
||||
transform:translateY(10%);
|
||||
}
|
||||
|
||||
.ip-result {
|
||||
color: #444;
|
||||
font-size:16px;
|
||||
white-space: nowrap; /*强制span不换行*/
|
||||
display: inline-block; /*将span当做块级元素对待*/
|
||||
width: 29%; /*限制宽度*/
|
||||
overflow: hidden; /*超出宽度部分隐藏*/
|
||||
text-overflow: ellipsis; /*超出部分以点号代替*/
|
||||
vertical-align:bottom;
|
||||
transform:translateY(8%);
|
||||
}
|
||||
|
||||
.ip-geo {
|
||||
color: #444;
|
||||
font-size:15px;
|
||||
white-space: nowrap; /*强制span不换行*/
|
||||
display: inline-block; /*将span当做块级元素对待*/
|
||||
width: 40%; /*限制宽度*/
|
||||
overflow: hidden; /*超出宽度部分隐藏*/
|
||||
text-overflow: ellipsis; /*超出部分以点号代替*/
|
||||
vertical-align:bottom;
|
||||
transform:translateY(2%);
|
||||
}
|
||||
|
||||
.ip-checking {
|
||||
color: #444;
|
||||
font-size:15px;
|
||||
display: inline-block;
|
||||
vertical-align:bottom;
|
||||
width: 29%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
transform:translateY(10%);
|
||||
}
|
||||
|
||||
.sk-text-success {
|
||||
color: #32b643;
|
||||
font-size:15px;
|
||||
display: inline-block;
|
||||
vertical-align:bottom;
|
||||
width: 48%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-align: left;
|
||||
transform:translateY(10%);
|
||||
}
|
||||
|
||||
.sk-text-error {
|
||||
color: #e85600;
|
||||
font-size:15px;
|
||||
display: inline-block;
|
||||
vertical-align:bottom;
|
||||
width: 48%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-align: left;
|
||||
transform:translateY(10%);
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin: 5px 0 6px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<fieldset class="cbi-section">
|
||||
|
||||
<table>
|
||||
<tr><td width="100%">
|
||||
<body>
|
||||
<div style="display: flex;">
|
||||
<div style="width: 51%">
|
||||
<h1><font color="#2E8B57"><B>IP 地址查询</B></font></h1>
|
||||
<p>
|
||||
<span class="ip-title">IP 登录设备:</span><span class="ip-result" id="ip-webrtc"></span> <span class="ip-geo" id="ip-webrtc-cz88"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-title">IPIP 国内:</span><span class="ip-result" id="ip-ipipnet"></span> <span class="ip-geo" id="ip-ipipnet-geo"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-title">太平洋 国内:</span><span class="ip-result" id="ip-pcol"></span> <span class="ip-geo" id="ip-pcol-ipip"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-title">IP.SB 海外:</span><span class="ip-result" id="ip-ipsb"></span> <span class="ip-geo" id="ip-ipsb-geo"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-title">IPIFY 海外:</span><span class="ip-result" id="ip-ipify"></span> <span class="ip-geo" id="ip-ipify-ipip"></span>
|
||||
</p>
|
||||
</div>
|
||||
<div style="width: 49%">
|
||||
<h1><font color="#2E8B57"><B>网站访问检查</B></font></h1>
|
||||
<p>
|
||||
<span class="ip-state_title">百度搜索:</span><span id="http-baidu"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-state_title">网易云音乐:</span><span id="http-163"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-state_title">GitHub:</span><span id="http-github"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-state_title">Facebook:</span><span id="http-facebook"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-state_title">YouTube:</span><span id="http-youtube"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<p style="float: right; margin-top: 4px; font-size:15px; padding-right: 10px">由 <a onclick="return ip_skk()" href="javascript:void(0);">ip.skk.moe 提供支持</a></p>
|
||||
</div>
|
||||
</td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<script>
|
||||
function ip_skk()
|
||||
{
|
||||
url2='https://ip.skk.moe';
|
||||
window.open(url2);
|
||||
}
|
||||
const $$ = document;
|
||||
$$.getElementById('ip-webrtc').innerHTML = '查询中...';
|
||||
$$.getElementById('ip-pcol').innerHTML = '查询中...';
|
||||
$$.getElementById('ip-ipify').innerHTML = '查询中...';
|
||||
$$.getElementById('ip-ipipnet').innerHTML = '查询中...';
|
||||
$$.getElementById('ip-ipsb').innerHTML = '查询中...';
|
||||
let random = parseInt(Math.random() * 100000000);
|
||||
let IP = {
|
||||
get: (url, type) =>
|
||||
fetch(url, { method: 'GET' }).then((resp) => {
|
||||
if (type === 'text')
|
||||
return Promise.all([resp.ok, resp.status, resp.text(), resp.headers]);
|
||||
else {
|
||||
return Promise.all([resp.ok, resp.status, resp.json(), resp.headers]);
|
||||
}
|
||||
}).then(([ok, status, data, headers]) => {
|
||||
if (ok) {
|
||||
let json = {
|
||||
ok,
|
||||
status,
|
||||
data,
|
||||
headers
|
||||
}
|
||||
return json;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(json.error));
|
||||
}
|
||||
}).catch(error => {
|
||||
throw error;
|
||||
}),
|
||||
parseIPIpip: (ip, elID) => {
|
||||
IP.get(`https://api.skk.moe/network/parseIp/ipip/${ip}`, 'json')
|
||||
.then(resp => {
|
||||
let x = '';
|
||||
for (let i of resp.data) {
|
||||
x += (i !== '') ? `${i} ` : '';
|
||||
}
|
||||
$$.getElementById(elID).innerHTML = x;
|
||||
//$$.getElementById(elID).innerHTML = `${resp.data.country} ${resp.data.regionName} ${resp.data.city} ${resp.data.isp}`;
|
||||
})
|
||||
},
|
||||
getWebrtcIP: () => {
|
||||
window.RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;
|
||||
let pc = new RTCPeerConnection({ iceServers: [] }),
|
||||
noop = () => { };
|
||||
|
||||
pc.createDataChannel('');
|
||||
pc.createOffer(pc.setLocalDescription.bind(pc), noop);
|
||||
pc.onicecandidate = (ice) => {
|
||||
if (!ice || !ice.candidate || !ice.candidate.candidate) {
|
||||
$$.getElementById('ip-webrtc').innerHTML = '没有查询到 IP';
|
||||
return;
|
||||
}
|
||||
let ip = /([0-9]{1,3}(\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/.exec(ice.candidate.candidate)[1];
|
||||
$$.getElementById('ip-webrtc').innerHTML = ip;
|
||||
IP.parseIPIpip(ip, 'ip-webrtc-cz88');
|
||||
pc.onicecandidate = noop;
|
||||
};
|
||||
},
|
||||
getIpipnetIP: () => {
|
||||
IP.get(`https://myip.ipip.net/?z=${random}`, 'text')
|
||||
.then((resp) => {
|
||||
let data = resp.data.replace('当前 IP:', '').split(' 来自于:');
|
||||
$$.getElementById('ip-ipipnet').innerHTML = `${data[0]}`;
|
||||
$$.getElementById('ip-ipipnet-geo').innerHTML = `${data[1]}`;
|
||||
});
|
||||
},
|
||||
getIPApiIP: () => {
|
||||
IP.get(`https://ipapi.co/json?z=${random}`, 'json')
|
||||
.then(resp => {
|
||||
$$.getElementById('ip-ipapi').innerHTML = resp.data.ip;
|
||||
IP.parseIPIpip(resp.data.ip, 'ip-ipapi-geo');
|
||||
})
|
||||
},
|
||||
getIpifyIP: () => {
|
||||
IP.get(`https://api.ipify.org/?format=json&z=${random}`, 'json')
|
||||
.then(resp => {
|
||||
$$.getElementById('ip-ipify').innerHTML = resp.data.ip;
|
||||
return resp.data.ip;
|
||||
})
|
||||
.then(ip => {
|
||||
IP.parseIPIpip(ip, 'ip-ipify-ipip');
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
$$.getElementById('http-baidu').innerHTML = '<span class="ip-checking">检测中...</span>';
|
||||
$$.getElementById('http-163').innerHTML = '<span class="ip-checking">检测中...</span>';
|
||||
$$.getElementById('http-github').innerHTML = '<span class="ip-checking">检测中...</span>';
|
||||
$$.getElementById('http-facebook').innerHTML = '<span class="ip-checking">检测中...</span>';
|
||||
$$.getElementById('http-youtube').innerHTML = '<span class="ip-checking">检测中...</span>';
|
||||
let HTTP = {
|
||||
checker: (domain, cbElID) => {
|
||||
let img = new Image;
|
||||
let timeout = setTimeout(() => {
|
||||
img.onerror = img.onload = null;
|
||||
$$.getElementById(cbElID).innerHTML = '<span class="sk-text-error">连接超时</span>'
|
||||
}, 5000);
|
||||
|
||||
img.onerror = () => {
|
||||
clearTimeout(timeout);
|
||||
$$.getElementById(cbElID).innerHTML = '<span class="sk-text-error">无法访问</span>'
|
||||
}
|
||||
|
||||
img.onload = () => {
|
||||
clearTimeout(timeout);
|
||||
$$.getElementById(cbElID).innerHTML = '<span class="sk-text-success">连接正常</span>'
|
||||
}
|
||||
|
||||
img.src = `https://${domain}/favicon.ico?${+(new Date)}`
|
||||
},
|
||||
runcheck: () => {
|
||||
HTTP.checker('www.baidu.com', 'http-baidu');
|
||||
HTTP.checker('s1.music.126.net/style', 'http-163');
|
||||
HTTP.checker('github.com', 'http-github');
|
||||
HTTP.checker('www.facebook.com', 'http-facebook');
|
||||
HTTP.checker('www.youtube.com', 'http-youtube');
|
||||
}
|
||||
};
|
||||
|
||||
HTTP.runcheck();
|
||||
IP.getIpipnetIP();
|
||||
IP.getIpifyIP();
|
||||
IP.getWebrtcIP();
|
||||
|
||||
function getPcolIP(data){
|
||||
$$.getElementById('ip-pcol').innerHTML = data.ip;
|
||||
IP.parseIPIpip(data.ip, 'ip-pcol-ipip');
|
||||
};
|
||||
function getIpsbIP(data){
|
||||
$$.getElementById('ip-ipsb').innerHTML = data.address;
|
||||
$$.getElementById('ip-ipsb-geo').innerHTML = `${data.country} ${data.province} ${data.city} ${data.isp.name}`
|
||||
};
|
||||
|
||||
window.onload=myip_Load();
|
||||
|
||||
function myip_Load()
|
||||
{
|
||||
var pcip = document.getElementsByTagName('HEAD').item(0);
|
||||
var pcipScript= document.createElement("script");
|
||||
pcipScript.defer = "defer";
|
||||
pcipScript.src='https://whois.pconline.com.cn/ipJson.jsp?callback=getPcolIP';
|
||||
pcip.appendChild(pcipScript);
|
||||
|
||||
var sbip = document.getElementsByTagName('HEAD').item(0);
|
||||
var sbipScript= document.createElement("script");
|
||||
sbipScript.defer = "defer";
|
||||
sbipScript.src='https://ip.sb/addrinfo?callback=getIpsbIP';
|
||||
sbip.appendChild(sbipScript);
|
||||
|
||||
const $$ = document;
|
||||
random = parseInt(Math.random() * 100000000);
|
||||
HTTP.runcheck();
|
||||
IP.getIpipnetIP();
|
||||
IP.getIpifyIP();
|
||||
IP.getWebrtcIP();
|
||||
|
||||
setTimeout("myip_Load()",1000*20);
|
||||
}
|
||||
|
||||
</script>
|
||||
<script defer="defer" src="https://whois.pconline.com.cn/ipJson.jsp?callback=getPcolIP"></script>
|
||||
<script defer="defer" src="https://ip.sb/addrinfo?callback=getIpsbIP"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -41,4 +41,4 @@
|
||||
<input type="button" class="cbi-button cbi-input-reload" value="<%:Refresh Data%> " onclick="return refresh_data(this,'<%=self.option%>')" />
|
||||
<span id="<%=self.option%>-status"><em><%=self.value%></em></span>
|
||||
|
||||
<%+cbi/valuefooter%>
|
||||
<%+cbi/valuefooter%>
|
||||
@ -188,11 +188,7 @@
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.vmess_id').value = ssm.id;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.security').value = ssm.type;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.transport').value = ssm.net;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.ws_host').value = ssm.host;
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.ws_path').value = ssm.path;
|
||||
if (ssm.net = tls) {
|
||||
document.getElementById('cbid.shadowsocksr.' + sid + '.tls').value = 1;
|
||||
}
|
||||
|
||||
s.innerHTML = "<font color='green'>导入V2ray配置信息成功</font>";
|
||||
return false;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,247 @@
|
||||
<%+cbi/valueheader%>
|
||||
<style>
|
||||
.modals-bg{
|
||||
position: fixed;
|
||||
z-index: 90;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
background: rgba(0,0,0,0.8);
|
||||
display: none;
|
||||
}
|
||||
.modals {
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
width: 60%;
|
||||
height: 500px;
|
||||
background: #CC99CC;
|
||||
left: 20%;
|
||||
top: 15%;
|
||||
color: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
/* Firefox */
|
||||
-webkit-box-sizing: border-box;
|
||||
/* Safari */
|
||||
}
|
||||
|
||||
.modals h2 {}
|
||||
|
||||
.modals h3 {
|
||||
font-size: 14px;
|
||||
color: #ffcc00;
|
||||
background: transparent;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
@media screen and (max-width: 1024px) {
|
||||
.modals {
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
width: 80%;
|
||||
height: 500px;
|
||||
background: #172b4d;
|
||||
left: 10%;
|
||||
top: 15%;
|
||||
color: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 700px) {
|
||||
.modals-bg{
|
||||
position: fixed;
|
||||
z-index: 100000;
|
||||
|
||||
}
|
||||
.modals {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var _responseLen;
|
||||
var noChange = 0;
|
||||
var x = 5;
|
||||
function update_subscribe() {
|
||||
$(".modals-bg").show();
|
||||
setTimeout("get_realtime_log();", 500);
|
||||
}
|
||||
|
||||
var btn = document.getElementsByClassName("cbi-input-reload");
|
||||
btn[0].addEventListener("click", function () {
|
||||
update_subscribe()
|
||||
}, false);
|
||||
|
||||
function get_realtime_log() {
|
||||
$.ajax({
|
||||
url: '/check_update.htm',
|
||||
dataType: 'html',
|
||||
error: function (xhr) {
|
||||
setTimeout("get_realtime_log();", 1000);
|
||||
},
|
||||
success: function (response) {
|
||||
var retArea = document.getElementById("log_content3");
|
||||
if (response.search("XU6J03M6") != -1) {
|
||||
console.log(response);
|
||||
retArea.value = response;
|
||||
retArea.scrollTop = retArea.scrollHeight;
|
||||
x = 5;
|
||||
return true;
|
||||
}
|
||||
if (_responseLen == response.length) {
|
||||
noChange++;
|
||||
} else {
|
||||
noChange = 0;
|
||||
}
|
||||
console.log(noChange);
|
||||
if (noChange > 100) {
|
||||
return false;
|
||||
} else {
|
||||
setTimeout("get_realtime_log();", 250);
|
||||
}
|
||||
retArea.value = response;
|
||||
retArea.scrollTop = retArea.scrollHeight;
|
||||
_responseLen = response.length;
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("get_realtime_log();", 500);
|
||||
}
|
||||
});
|
||||
}
|
||||
//]]>
|
||||
</script>
|
||||
<div class="modals-bg">
|
||||
<div class="modals">
|
||||
<h2>节点订阅</h2>
|
||||
<h3 style="margin-left:0;">请勿刷新本页面,正在订阅中 ...</h3>
|
||||
<textarea cols="63" rows="28" wrap="on" readonly="readonly" id="log_content3" autocomplete="off" autocorrect="off" autocapitalize="off"
|
||||
spellcheck="false" style="border:0;width:99%; font-family:'Lucida Console'; font-size:11px;background:transparent;color:#FFFFFF;outline: none;padding-left:3px;padding-right:22px;overflow:hidden"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var _responseLen;
|
||||
var noChange = 0;
|
||||
var x = 5;
|
||||
function update_subscribe() {
|
||||
$(".modals-bg").show();
|
||||
setTimeout("get_realtime_log();", 500);
|
||||
}
|
||||
|
||||
function submit_url(){
|
||||
prefix_array = $("#cbi-shadowsocksr-server_subscribe .cbi-section-node").attr("id").split("-");
|
||||
prefix_array[0] = "cbid";
|
||||
prefix = prefix_array.join(".");
|
||||
if($("[name='"+prefix+".auto_update']").is(":checked")){
|
||||
var auto_update = "1";
|
||||
}else{
|
||||
var auto_update = "0";
|
||||
}
|
||||
var auto_update_time = $("[name='"+prefix+".auto_update_time']").val();
|
||||
var subscribe_url = [];
|
||||
$("[name='"+prefix+".subscribe_url']").each(function(){
|
||||
if($(this).val() != ""){
|
||||
subscribe_url.push($(this).val());
|
||||
}
|
||||
});
|
||||
if($("[name='"+prefix+".proxy']").is(":checked")){
|
||||
var proxy = "1";
|
||||
}else{
|
||||
var proxy = "0";
|
||||
}
|
||||
|
||||
var data = {
|
||||
auto_update:auto_update,
|
||||
auto_update_time : auto_update_time,
|
||||
subscribe_url: JSON.stringify(subscribe_url),
|
||||
proxy: proxy
|
||||
}
|
||||
//console.log(data);
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "<%=luci.dispatcher.build_url("admin", "services", "shadowsocksr","subscribe")%>",
|
||||
dataType : "json",
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if(d.error == 0){
|
||||
//console.log("开始订阅");
|
||||
update_subscribe();
|
||||
}else{
|
||||
alert("请至少填写一个订阅链接");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$("#update_subscribe").click(function(){
|
||||
//console.log("提交数据");
|
||||
$.get("/lock.htm?v="+parseInt(Math.random() * 100000000), function(result){
|
||||
//console.log(result);
|
||||
if(parseInt(result) == 1){
|
||||
alert("订阅程序正在后台执行中");
|
||||
}else{
|
||||
submit_url();
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
function refresh_page(){
|
||||
location.reload();
|
||||
return false;
|
||||
}
|
||||
|
||||
function get_realtime_log() {
|
||||
//console.log("马上开始");
|
||||
$.ajax({
|
||||
url: '/lock.htm?v='+parseInt(Math.random() * 100000000),
|
||||
dataType: 'text',
|
||||
error: function (xhr) {
|
||||
setTimeout("get_realtime_log();", 1000);
|
||||
},
|
||||
success: function (response) {
|
||||
//console.log(response);
|
||||
if(parseInt(response) == 1){
|
||||
//console.log(response);
|
||||
$.get("/check_update.htm?v="+parseInt(Math.random() * 100000000), function(result){
|
||||
//console.log(result);
|
||||
var retArea = document.getElementById("log_content3");
|
||||
retArea.value = result;
|
||||
retArea.scrollTop = retArea.scrollHeight;
|
||||
|
||||
});
|
||||
setTimeout("get_realtime_log();", 250);
|
||||
}else if(parseInt(response) == 0){
|
||||
|
||||
setTimeout("refresh_page();", 2000);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
setTimeout("get_realtime_log();", 500);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
<% if (tonumber(lock) == 1) then %>
|
||||
update_subscribe();
|
||||
<% end %>
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<%+cbi/valuefooter%>
|
||||
712
package/ctcgfw/luci-app-ssr-plus-jo/po/zh-cn/ssr-plus.po
Normal file
712
package/ctcgfw/luci-app-ssr-plus-jo/po/zh-cn/ssr-plus.po
Normal file
@ -0,0 +1,712 @@
|
||||
msgid ""
|
||||
msgstr "Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
||||
msgid "ShadowSocksR Client"
|
||||
msgstr "ShadowSocksR 客户端"
|
||||
|
||||
msgid "Enable"
|
||||
msgstr "启用"
|
||||
|
||||
msgid "Disable"
|
||||
msgstr "停用"
|
||||
|
||||
msgid "Log"
|
||||
msgstr "日志"
|
||||
|
||||
|
||||
|
||||
|
||||
msgid "ShadowSocksR is running"
|
||||
msgstr "ShadowSocksR 客户端运行中"
|
||||
|
||||
msgid "ShadowSocksR is not running"
|
||||
msgstr "ShadowSocksR 客户端未运行"
|
||||
|
||||
msgid "Global Setting"
|
||||
msgstr "全局设置"
|
||||
|
||||
msgid "Global Server"
|
||||
msgstr "全局服务器"
|
||||
|
||||
msgid "ShadowSocksR SOCK5 Proxy is running"
|
||||
msgstr "ShadowSocksR SOCK5代理运行中"
|
||||
|
||||
msgid "UDP Relay Server"
|
||||
msgstr "UDP中继服务器"
|
||||
|
||||
msgid "Same as Global Server"
|
||||
msgstr "与全局服务器相同"
|
||||
|
||||
msgid "Servers Setting"
|
||||
msgstr "服务器配置"
|
||||
|
||||
|
||||
msgid "Use Config File"
|
||||
msgstr "使用配置文件"
|
||||
|
||||
|
||||
|
||||
msgid "Kcptun"
|
||||
msgstr "Kcptun开关"
|
||||
|
||||
msgid "Alias(optional)"
|
||||
msgstr "别名(可选)"
|
||||
|
||||
|
||||
msgid "Aliasd"
|
||||
msgstr "节点备注"
|
||||
|
||||
msgid "Onetime Authentication"
|
||||
msgstr "一次验证"
|
||||
|
||||
msgid "Server Address"
|
||||
msgstr "服务器地址"
|
||||
|
||||
msgid "Server Port"
|
||||
msgstr "服务器端口"
|
||||
|
||||
msgid "Local Port"
|
||||
msgstr "本地端口"
|
||||
|
||||
msgid "weight"
|
||||
msgstr "比重"
|
||||
|
||||
msgid "Ping Latency"
|
||||
msgstr "Ping 延迟"
|
||||
|
||||
|
||||
msgid "Connection Timeout"
|
||||
msgstr "连接超时"
|
||||
|
||||
msgid "Password"
|
||||
msgstr "密码"
|
||||
|
||||
msgid "Encrypt Method"
|
||||
msgstr "加密方式"
|
||||
|
||||
msgid "Protocol"
|
||||
msgstr "传输协议"
|
||||
|
||||
msgid "Protocol param(optional)"
|
||||
msgstr "传输协议参数(可选)"
|
||||
|
||||
msgid "Obfs"
|
||||
msgstr "混淆插件"
|
||||
|
||||
msgid "Obfs param(optional)"
|
||||
msgstr "混淆参数(可选)"
|
||||
|
||||
msgid "Enable Tunnel(DNS)"
|
||||
msgstr "启用隧道(DNS)转发"
|
||||
|
||||
msgid "Tunnel Port"
|
||||
msgstr "隧道(DNS)本地端口"
|
||||
|
||||
msgid "Forwarding Tunnel"
|
||||
msgstr "隧道(DNS)转发地址"
|
||||
|
||||
msgid "Access Control"
|
||||
msgstr "访问控制"
|
||||
|
||||
msgid "Interfaces - WAN"
|
||||
msgstr "接口 - WAN"
|
||||
|
||||
msgid "Bypassed IP List"
|
||||
msgstr "被忽略IP列表"
|
||||
|
||||
msgid "NULL - As Global Proxy"
|
||||
msgstr "留空 - 作为全局代理"
|
||||
|
||||
msgid "Bypassed IP"
|
||||
msgstr "额外被忽略IP"
|
||||
|
||||
msgid "Forwarded IP"
|
||||
msgstr "强制走代理IP"
|
||||
|
||||
msgid "Interfaces - LAN"
|
||||
msgstr "接口 - LAN"
|
||||
|
||||
msgid "LAN Access Control"
|
||||
msgstr "内网访问控制"
|
||||
|
||||
msgid "Allow listed only"
|
||||
msgstr "仅允许列表内"
|
||||
|
||||
msgid "Allow all except listed"
|
||||
msgstr "仅允许列表外"
|
||||
|
||||
msgid "LAN Host List"
|
||||
msgstr "内网主机列表"
|
||||
|
||||
msgid "SSR Client"
|
||||
msgstr "客户端"
|
||||
|
||||
msgid "SSR Server"
|
||||
msgstr "服务端"
|
||||
|
||||
msgid "ShadowSocksR Server"
|
||||
msgstr "SS/SSR/V2RAY 服务端"
|
||||
|
||||
msgid "ShadowSocksR Server is running"
|
||||
msgstr "ShadowSocksR 服务端运行中"
|
||||
|
||||
msgid "ShadowSocksR Server is not running"
|
||||
msgstr "ShadowSocksR 服务端未运行"
|
||||
|
||||
msgid "Enable Server"
|
||||
msgstr "启动服务端"
|
||||
|
||||
msgid "Server Setting"
|
||||
msgstr "服务端配置"
|
||||
|
||||
msgid "KcpTun Enable"
|
||||
msgstr "KcpTun 启用"
|
||||
|
||||
msgid "bin:/usr/bin/kcptun-client"
|
||||
msgstr "二进制文件:/usr/bin/kcptun-client"
|
||||
|
||||
msgid "KcpTun Port"
|
||||
msgstr "KcpTun 端口"
|
||||
|
||||
msgid "KcpTun Param"
|
||||
msgstr "KcpTun 参数"
|
||||
|
||||
msgid "KcpTun Password"
|
||||
msgstr "KcpTun 密码"
|
||||
|
||||
msgid "Haven't a Kcptun executable file"
|
||||
msgstr "不存在Kcptun可执行文件,请下载Kcptun可执行文件并改名放入/usr/bin/kcptun-client"
|
||||
|
||||
msgid "Not a Kcptun executable file"
|
||||
msgstr "Kcptun可执行文件格式不正确,请确认是否正确下载了路由器对应的可执行文件"
|
||||
|
||||
msgid "Enable Process Monitor"
|
||||
msgstr "启用进程监控"
|
||||
|
||||
msgid "Edit ShadowSocksR Server"
|
||||
msgstr "编辑服务器配置"
|
||||
|
||||
msgid "Alias"
|
||||
msgstr "别名"
|
||||
|
||||
msgid "SOCKS5 Proxy"
|
||||
msgstr "SOCKS5代理"
|
||||
|
||||
msgid "SSOCKS5 Proxy"
|
||||
msgstr "SS SOCKS5代理"
|
||||
|
||||
|
||||
msgid "Appointlist List"
|
||||
msgstr "指定列表"
|
||||
|
||||
msgid "V2 Edition"
|
||||
msgstr "V2版本"
|
||||
|
||||
msgid "Upgrade V2ray"
|
||||
msgstr "V2ray更新"
|
||||
|
||||
msgid "Server"
|
||||
msgstr "服务器"
|
||||
|
||||
msgid "V2SOCKS5 Proxy"
|
||||
msgstr "V2SOCKS5代理"
|
||||
|
||||
msgid "Global V2RAY Server"
|
||||
msgstr "V2RAY服务端"
|
||||
|
||||
msgid "Enable V2ray Update"
|
||||
msgstr "启用V2ray更新"
|
||||
|
||||
|
||||
|
||||
msgid "Update_V2ray"
|
||||
msgstr "更新V2ray"
|
||||
|
||||
msgid "Edition"
|
||||
msgstr "版本"
|
||||
|
||||
msgid "auto detected"
|
||||
msgstr "自动检测版本"
|
||||
|
||||
|
||||
msgid "Update"
|
||||
msgstr "更新"
|
||||
|
||||
msgid "haProxy settings"
|
||||
msgstr "HaProxy 设置"
|
||||
|
||||
|
||||
msgid "Enabling the Management Console"
|
||||
msgstr "启用管理控制台"
|
||||
|
||||
msgid "Service Port"
|
||||
msgstr "端口"
|
||||
|
||||
|
||||
msgid "TCP Fast Open"
|
||||
msgstr "TCP快速打开"
|
||||
|
||||
msgid "Status"
|
||||
msgstr "状态"
|
||||
|
||||
msgid "Unknown"
|
||||
msgstr "未知"
|
||||
|
||||
msgid "Running Status"
|
||||
msgstr "运行状态"
|
||||
|
||||
msgid "Global Client"
|
||||
msgstr "TCP透明代理"
|
||||
|
||||
msgid "Global SSR Server"
|
||||
msgstr "SSR服务端"
|
||||
|
||||
msgid "DNS Tunnel"
|
||||
msgstr "DNS 隧道"
|
||||
|
||||
msgid "IPK Version"
|
||||
msgstr "IPK 版本号"
|
||||
|
||||
msgid "KcpTun Version"
|
||||
msgstr "KcpTun 版本号"
|
||||
|
||||
msgid "udp2raw tunnel"
|
||||
msgstr "udp2raw 隧道"
|
||||
|
||||
msgid "Enable udp2raw"
|
||||
msgstr "启用 udp2raw"
|
||||
|
||||
msgid "Seq Mode"
|
||||
msgstr "Seq 模式"
|
||||
|
||||
msgid "udp2raw Version"
|
||||
msgstr "udp2raw 版本"
|
||||
|
||||
msgid "udp2raw tunnel Project"
|
||||
msgstr "udp2raw 项目"
|
||||
|
||||
|
||||
msgid "UDPspeeder Version"
|
||||
msgstr "UDPspeeder 版本"
|
||||
|
||||
|
||||
msgid "UDPspeeder Project"
|
||||
msgstr "UDPspeeder 项目"
|
||||
|
||||
|
||||
msgid "Enable UDPspeeder"
|
||||
msgstr "启用 UDPspeeder"
|
||||
|
||||
msgid "Speeder Mode"
|
||||
msgstr "Speeder 模式"
|
||||
|
||||
msgid "Mtu"
|
||||
msgstr "Mtu 参数"
|
||||
|
||||
|
||||
msgid "AlterId"
|
||||
msgstr "额外ID"
|
||||
|
||||
|
||||
msgid "VmessId (UUID)"
|
||||
msgstr "用户ID(UUID)"
|
||||
|
||||
|
||||
msgid "Subscription Managenent"
|
||||
msgstr "订阅管理"
|
||||
|
||||
msgid "Automatic Switching"
|
||||
msgstr "自动切换"
|
||||
|
||||
|
||||
msgid "Not exist"
|
||||
msgstr "未安装可执行文件"
|
||||
|
||||
msgid "IPK Installation Time"
|
||||
msgstr "IPK 安装时间"
|
||||
|
||||
msgid "Project"
|
||||
msgstr "项目地址"
|
||||
|
||||
msgid "Not Running"
|
||||
msgstr "未运行"
|
||||
|
||||
msgid "Running"
|
||||
msgstr "运行中"
|
||||
|
||||
msgid "Enable GFW mode"
|
||||
msgstr "启用 GFW 模式"
|
||||
|
||||
msgid "Running Mode"
|
||||
msgstr "运行模式"
|
||||
|
||||
msgid "IP Route Mode"
|
||||
msgstr "中国大陆白名单模式"
|
||||
|
||||
msgid "GFW List Mode"
|
||||
msgstr "GFW列表模式"
|
||||
|
||||
msgid "Global Mode"
|
||||
msgstr "全局代理模式"
|
||||
|
||||
msgid "Oversea Mode"
|
||||
msgstr "海外用户回国IP路由模式"
|
||||
|
||||
msgid "Router Proxy"
|
||||
msgstr "路由器访问控制"
|
||||
|
||||
msgid "Normal Proxy"
|
||||
msgstr "正常代理"
|
||||
|
||||
msgid "Bypassed Proxy"
|
||||
msgstr "不走代理"
|
||||
|
||||
msgid "Forwarded Proxy"
|
||||
msgstr "强制走代理"
|
||||
|
||||
msgid "UDP Relay"
|
||||
msgstr "UDP中继"
|
||||
|
||||
msgid "Google Connectivity"
|
||||
msgstr "【谷歌】连通性检查"
|
||||
|
||||
msgid "Baidu Connectivity"
|
||||
msgstr "【百度】连通性检查"
|
||||
|
||||
msgid "No Check"
|
||||
msgstr "未检查"
|
||||
|
||||
msgid "Check"
|
||||
msgstr "检查"
|
||||
|
||||
msgid "Connect OK"
|
||||
msgstr "连接正常"
|
||||
|
||||
msgid "Connect Error"
|
||||
msgstr "连接错误"
|
||||
|
||||
msgid "Check..."
|
||||
msgstr "正在检查.."
|
||||
|
||||
msgid "Proxy Check"
|
||||
msgstr "代理检查"
|
||||
|
||||
|
||||
msgid "GFW List Data"
|
||||
msgstr "【GFW列表】数据库"
|
||||
|
||||
msgid "China IP Data"
|
||||
msgstr "【国内IP段】数据库"
|
||||
|
||||
msgid "Records"
|
||||
msgstr "条记录"
|
||||
|
||||
msgid "Refresh Data"
|
||||
msgstr "更新数据库"
|
||||
|
||||
msgid "Refresh..."
|
||||
msgstr "正在更新,请稍候.."
|
||||
|
||||
msgid "Refresh OK!"
|
||||
msgstr "更新成功!"
|
||||
|
||||
msgid "Refresh Error!"
|
||||
msgstr "更新失败!"
|
||||
|
||||
msgid "No new data!"
|
||||
msgstr "你已经是最新数据,无需更新!"
|
||||
|
||||
msgid "Total Records:"
|
||||
msgstr "新的总纪录数:"
|
||||
|
||||
msgid "Check Server Port"
|
||||
msgstr "【服务器端口】检查"
|
||||
|
||||
msgid "Check Connect"
|
||||
msgstr "检查连通性"
|
||||
|
||||
msgid "Check Server"
|
||||
msgstr "检查服务器"
|
||||
|
||||
msgid "Auto Switch"
|
||||
msgstr "自动切换"
|
||||
|
||||
msgid "Enable Auto Switch"
|
||||
msgstr "启用自动切换"
|
||||
|
||||
msgid "Switch check cycly(second)"
|
||||
msgstr "自动切换检查周期(秒)"
|
||||
|
||||
msgid "Check timout(second)"
|
||||
msgstr "切换检查超时时间(秒)"
|
||||
|
||||
msgid "Enable Process Deamon"
|
||||
msgstr "启用进程自动守护"
|
||||
|
||||
msgid "Advertising Data"
|
||||
msgstr "【广告屏蔽】数据库"
|
||||
|
||||
msgid "DNS Server IP and Port"
|
||||
msgstr "DNS服务器地址和端口"
|
||||
|
||||
msgid "Resolve Dns Mode"
|
||||
msgstr "DNS解析方式"
|
||||
|
||||
msgid "Use SSR DNS Tunnel"
|
||||
msgstr "使用SSR-DNS隧道"
|
||||
|
||||
msgid "Use Pdnsd"
|
||||
msgstr "使用Pdnsd"
|
||||
|
||||
msgid "Use Other DNS Tunnel(Need to install)"
|
||||
msgstr "使用其他DNS转发(需要自己安装)"
|
||||
|
||||
msgid "Ping"
|
||||
msgstr "Ping延迟"
|
||||
|
||||
msgid "Import SSR"
|
||||
msgstr "导入ssr配置信息"
|
||||
|
||||
msgid "Export SSR"
|
||||
msgstr "导出ssr配置信息"
|
||||
|
||||
msgid "Import SSR successfully."
|
||||
msgstr "成功导入SSR。"
|
||||
|
||||
msgid "Invalid SSR format."
|
||||
msgstr "无效的SSR格式。"
|
||||
|
||||
msgid "User cancelled."
|
||||
msgstr "用户已取消。"
|
||||
|
||||
msgid "Paste ssr url here"
|
||||
msgstr "在此处粘贴ssr://网址"
|
||||
|
||||
msgid "Unable to copy SSR to clipboard."
|
||||
msgstr "无法复制SSR网址到剪贴板。"
|
||||
|
||||
msgid "Copy SSR to clipboard successfully."
|
||||
msgstr "成功复制SSR网址到剪贴板。"
|
||||
|
||||
msgid "Servers Manage"
|
||||
msgstr "服务器管理"
|
||||
|
||||
msgid "Auto Update"
|
||||
msgstr "自动更新"
|
||||
|
||||
msgid "Through proxy update"
|
||||
msgstr "通过代理更新"
|
||||
|
||||
msgid "GFW List"
|
||||
msgstr "GFW列表"
|
||||
|
||||
msgid "Servers List"
|
||||
msgstr "服务器列表"
|
||||
|
||||
msgid "Server settings"
|
||||
msgstr "服务器设置"
|
||||
|
||||
msgid "Link"
|
||||
msgstr "SS/SSR/Vmess链接"
|
||||
|
||||
|
||||
msgid "ShadowSocksR Plus+ Settings"
|
||||
msgstr "ShadowSocksR Plus+ (支持SS/SSR/V2RAY)"
|
||||
|
||||
msgid "Main Server"
|
||||
msgstr "主服务器"
|
||||
|
||||
msgid "Anti-pollution DNS Server"
|
||||
msgstr "访问国外域名DNS服务器"
|
||||
|
||||
msgid "Use Pdnsd udp query and cache"
|
||||
msgstr "使用PDNSD UDP查询并缓存"
|
||||
|
||||
msgid "Use Pdnsd tcp query and cache"
|
||||
msgstr "使用PDNSD TCP查询并缓存"
|
||||
|
||||
msgid "Use https_dns_proxy query and cache"
|
||||
msgstr "使用https_dns_proxy TCP查询并缓存"
|
||||
|
||||
msgid "Use smartdns query and cache"
|
||||
msgstr "使用SmartDNS TCP查询并缓存"
|
||||
|
||||
|
||||
msgid "Kill BT"
|
||||
msgstr "禁止 BT"
|
||||
|
||||
msgid "BT Port"
|
||||
msgstr "BT 端口"
|
||||
|
||||
|
||||
|
||||
msgid "Prohibit downloading tool ports through proxy"
|
||||
msgstr "禁止BT端口走代理"
|
||||
|
||||
|
||||
msgid "Domain White List"
|
||||
msgstr "域名白名单"
|
||||
|
||||
|
||||
msgid "Domain name (keyword only)"
|
||||
msgstr "域名(仅限关键字)"
|
||||
|
||||
|
||||
|
||||
|
||||
msgid "DNS Server IP:Port"
|
||||
msgstr "DNS服务器 IP:Port"
|
||||
|
||||
msgid "Update time (every day)"
|
||||
msgstr "更新时间 (每天)"
|
||||
|
||||
msgid "Auto Update Server subscription, GFW list and CHN route"
|
||||
msgstr "自动更新服务器订阅、GFW列表和 CHN路由表"
|
||||
|
||||
msgid "Subscribe URL"
|
||||
msgstr "SSR/V2RAY订阅URL地址"
|
||||
|
||||
|
||||
|
||||
msgid "Oversea IP Route Mode"
|
||||
msgstr "海外用户回国IP路由模式"
|
||||
|
||||
msgid "Use Local DNS Service"
|
||||
msgstr "使用设定DNS解析"
|
||||
|
||||
msgid "Using System Default DNS"
|
||||
msgstr "使用系统默认DNS"
|
||||
|
||||
|
||||
msgid "Global SS Server"
|
||||
msgstr "SS服务端"
|
||||
|
||||
msgid "Enabling IPv6 server"
|
||||
msgstr "启用ipv6服务"
|
||||
|
||||
msgid "HTTP Proxy"
|
||||
msgstr "HTTP代理"
|
||||
|
||||
msgid "Enable HTTP Proxy"
|
||||
msgstr "启用HTTP代理"
|
||||
|
||||
msgid "HTTP Port"
|
||||
msgstr "HTTP代理端口"
|
||||
|
||||
|
||||
msgid "Server Count"
|
||||
msgstr "服务器节点数量"
|
||||
|
||||
msgid "IP black-and-white list"
|
||||
msgstr "IP黑白名单"
|
||||
|
||||
msgid "WAN IP AC"
|
||||
msgstr "WAN IP访问控制"
|
||||
|
||||
msgid "WAN White List IP"
|
||||
msgstr "不走代理的WAN IP"
|
||||
|
||||
msgid "WAN Force Proxy IP"
|
||||
msgstr "强制走代理的WAN IP"
|
||||
|
||||
msgid "LAN Bypassed Host List"
|
||||
msgstr "不走代理的局域网LAN IP"
|
||||
|
||||
msgid "LAN Force Proxy Host List"
|
||||
msgstr "全局代理的LAN IP"
|
||||
|
||||
msgid "Router Self AC"
|
||||
msgstr "路由器自身代理设置"
|
||||
|
||||
msgid "Router Self Proxy"
|
||||
msgstr "路由器自身代理方式"
|
||||
|
||||
msgid "Normal Proxy"
|
||||
msgstr "跟随全局设置"
|
||||
|
||||
msgid "Bypassed Proxy"
|
||||
msgstr "不走代理"
|
||||
|
||||
msgid "Forwarded Proxy"
|
||||
msgstr "全局代理"
|
||||
|
||||
msgid "GFW Custom List"
|
||||
msgstr "GFW 用户自定义列表"
|
||||
|
||||
msgid "Please refer to the following writing"
|
||||
msgstr "每行一个域名,无需写前面的 HTTP(S):// ,提交后即时生效"
|
||||
|
||||
msgid "Servers subscription and manage"
|
||||
msgstr "服务器节点订阅与管理(支持订阅和手动导入SSR/Vmess链接)"
|
||||
|
||||
msgid "Through proxy update list, Not Recommended"
|
||||
msgstr "通过路由器自身代理更新订阅(不推荐)"
|
||||
|
||||
msgid "LAN IP AC"
|
||||
msgstr "LAN IP访问控制"
|
||||
|
||||
msgid "Game Mode UDP Server"
|
||||
msgstr "游戏模式UDP中继服务器"
|
||||
|
||||
msgid "Game Mode UDP Relay"
|
||||
msgstr "游戏模式UDP中继"
|
||||
|
||||
msgid "Server failsafe auto swith settings"
|
||||
msgstr "服务器节点故障自动切换设置"
|
||||
|
||||
msgid "Delete all severs"
|
||||
msgstr "删除所有服务器"
|
||||
|
||||
msgid "Severs Nodes"
|
||||
msgstr "服务器节点"
|
||||
|
||||
msgid "Use dnscrypt-proxy query and cache"
|
||||
msgstr "使用dnscrypt-proxy TCP查询并缓存"
|
||||
|
||||
msgid "Use dnsforwarder tcp query and cache"
|
||||
msgstr "使用dnsforwarder TCP查询并缓存"
|
||||
|
||||
msgid "Use dnsforwarder udp query and cache"
|
||||
msgstr "使用dnsforwarder UDP查询并缓存"
|
||||
|
||||
|
||||
msgid "Use chinadns query and cache"
|
||||
msgstr "使用ChinaDNS查询并缓存"
|
||||
|
||||
msgid "Chiadns Resolve Dns Mode"
|
||||
msgstr "ChinaDNS的上游服务器"
|
||||
|
||||
|
||||
msgid "Use Local DNS Service"
|
||||
msgstr "使用设定DNS解析"
|
||||
|
||||
|
||||
msgid "Use Local DNS Service listen port 5335"
|
||||
msgstr "使用本机端口为5335的DNS服务"
|
||||
|
||||
msgid "Server Node Type"
|
||||
msgstr "服务器节点类型"
|
||||
|
||||
msgid "Using incorrect encryption mothod may causes service fail to start"
|
||||
msgstr "输入不正确的参数组合可能会导致服务无法启动"
|
||||
|
||||
msgid "Game Mode Host List"
|
||||
msgstr "增强游戏模式客户端LAN IP"
|
||||
|
||||
msgid "Multi Threads Option"
|
||||
msgstr "多线程并发转发"
|
||||
|
||||
msgid "Auto Threads"
|
||||
msgstr "自动(CPU线程数)"
|
||||
|
||||
msgid "1 Thread"
|
||||
msgstr "单线程"
|
||||
|
||||
msgid "2 Threads"
|
||||
msgstr "2 线程"
|
||||
|
||||
msgid "4 Threads"
|
||||
msgstr "4 线程"
|
||||
|
||||
msgid "8 Threads"
|
||||
msgstr "8 线程"
|
||||
@ -3903,6 +3903,16 @@
|
||||
103.138.80.0/22
|
||||
103.138.134.0/23
|
||||
103.138.156.0/23
|
||||
103.138.208.0/23
|
||||
103.138.220.0/23
|
||||
103.138.246.0/23
|
||||
103.138.248.0/23
|
||||
103.139.0.0/23
|
||||
103.139.2.0/23
|
||||
103.139.22.0/23
|
||||
103.139.113.0/24
|
||||
103.139.134.0/23
|
||||
103.139.136.0/23
|
||||
103.192.0.0/22
|
||||
103.192.4.0/22
|
||||
103.192.8.0/22
|
||||
@ -5690,6 +5700,7 @@
|
||||
123.242.196.0/22
|
||||
123.244.0.0/14
|
||||
123.249.0.0/16
|
||||
123.253.108.0/22
|
||||
123.254.96.0/22
|
||||
123.254.100.0/22
|
||||
124.6.64.0/18
|
||||
@ -6241,6 +6252,7 @@
|
||||
202.8.12.0/24
|
||||
202.8.24.0/24
|
||||
202.8.77.0/24
|
||||
202.8.120.0/22
|
||||
202.8.128.0/19
|
||||
202.8.192.0/20
|
||||
202.9.32.0/24
|
||||
@ -1,17 +1,3 @@
|
||||
1.0.0.1
|
||||
1.1.1.1
|
||||
cloudflare-dns.com
|
||||
debian.org
|
||||
ip.sb
|
||||
openwrt.org
|
||||
apple.com
|
||||
icloud.com
|
||||
apple-dns.net
|
||||
cdn-apple.com
|
||||
akadns.net
|
||||
mzstatic.com
|
||||
docker.com
|
||||
cloudflare-dns.com
|
||||
91smartyun.pt
|
||||
adobe.com
|
||||
amazonaws.com
|
||||
@ -65,3 +51,4 @@ akamaiedge.net
|
||||
akamaihd.net
|
||||
edgesuite.net
|
||||
edgekey.net
|
||||
|
||||
@ -0,0 +1 @@
|
||||
0xDEADBEEF
|
||||
@ -0,0 +1,88 @@
|
||||
|
||||
|
||||
config global
|
||||
option tunnel_forward '8.8.4.4:53'
|
||||
option tunnel_address '0.0.0.0'
|
||||
option monitor_enable '1'
|
||||
option enable_switch '1'
|
||||
option switch_timeout '5'
|
||||
option switch_time '667'
|
||||
option threads '0'
|
||||
option run_mode 'router'
|
||||
option pdnsd_enable '6'
|
||||
option chinadns_enable '5'
|
||||
option global_server 'nil'
|
||||
|
||||
config socks5_proxy
|
||||
option local_port '1080'
|
||||
option local_address '0.0.0.0'
|
||||
option http_port '1081'
|
||||
option bt '0'
|
||||
option http_enable '1'
|
||||
option server 'nil'
|
||||
|
||||
config global_haproxy
|
||||
option admin_enable '1'
|
||||
option admin_port '1111'
|
||||
option admin_user 'admin'
|
||||
option admin_password 'root'
|
||||
|
||||
config access_control
|
||||
option wan_bp_list '/etc/china_ssr.txt'
|
||||
option lan_ac_mode 'b'
|
||||
option router_proxy '1'
|
||||
list wan_fw_ips '149.154.160.0/20'
|
||||
list wan_fw_ips '67.198.55.0/24'
|
||||
list wan_fw_ips '91.108.4.0/22'
|
||||
|
||||
|
||||
|
||||
config server_global
|
||||
option enable_server '0'
|
||||
|
||||
config server_subscribe
|
||||
option proxy '0'
|
||||
option auto_update_time '2'
|
||||
option auto_update '1'
|
||||
option edition '4.20.0'
|
||||
|
||||
config domain_white_list
|
||||
option domain_names 'youdao.com'
|
||||
|
||||
config domain_white_list
|
||||
option domain_names 'gov.cn'
|
||||
|
||||
config udp2raw
|
||||
option server '127.0.0.1'
|
||||
option local_port '400'
|
||||
option key 'passwd'
|
||||
option seq_mode '3'
|
||||
option auth_mode 'simple'
|
||||
option bt '0'
|
||||
option udp2raw_enable '1'
|
||||
option raw_mode 'udp'
|
||||
option cipher_mode 'aes128cbc'
|
||||
option server_port '600'
|
||||
|
||||
config udpspeeder
|
||||
option server '127.0.0.1'
|
||||
option server_port '400'
|
||||
option local_port '500'
|
||||
option key 'passwd'
|
||||
option speeder_mode '0'
|
||||
option fec '2:4'
|
||||
option mtu '1250'
|
||||
option queue_len '1'
|
||||
option timeout '8'
|
||||
option udpspeeder_enable '0'
|
||||
|
||||
config server_config
|
||||
option enable '0'
|
||||
option type 'ssr'
|
||||
option ipv4_ipv6 '0'
|
||||
option server_port '8388'
|
||||
option timeout '60'
|
||||
option password '222'
|
||||
option protocol 'origin'
|
||||
option obfs 'plain'
|
||||
option encrypt_method 'aes-192-cfb'
|
||||
5129
package/ctcgfw/luci-app-ssr-plus-jo/root/etc/dnsmasq.ssr/ad.conf
Normal file
5129
package/ctcgfw/luci-app-ssr-plus-jo/root/etc/dnsmasq.ssr/ad.conf
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,7 @@
|
||||
ipset=/.ipapi.co/gfwlist
|
||||
ipset=/.h12.io/gfwlist
|
||||
ipset=/.starlark.net/gfwlist
|
||||
ipset=/.golang.org/gfwlist
|
||||
ipset=/.honnef.co/gfwlist
|
||||
ipset=/.0rz.tw/gfwlist
|
||||
ipset=/.0to255.com/gfwlist
|
||||
ipset=/.10musume.com/gfwlist
|
||||
@ -2862,6 +2865,7 @@ ipset=/.ym.backchina.com/gfwlist
|
||||
ipset=/.yogichen.org/gfwlist
|
||||
ipset=/.yong.hu/gfwlist
|
||||
ipset=/.yorkbbs.ca/gfwlist
|
||||
ipset=/.youdao.com/gfwlist
|
||||
ipset=/.youjizz.com/gfwlist
|
||||
ipset=/.youmaker.com/gfwlist
|
||||
ipset=/.youpai.org/gfwlist
|
||||
@ -2937,7 +2941,10 @@ ipset=/.zuola.com/gfwlist
|
||||
ipset=/.zvereff.com/gfwlist
|
||||
ipset=/.zyzc9.com/gfwlist
|
||||
ipset=/.zyzg.us/gfwlist
|
||||
server=/.ipapi.co/127.0.0.1#5335
|
||||
server=/.h12.io/127.0.0.1#5335
|
||||
server=/.starlark.net/127.0.0.1#5335
|
||||
server=/.golang.org/127.0.0.1#5335
|
||||
server=/.honnef.co/127.0.0.1#5335
|
||||
server=/.0rz.tw/127.0.0.1#5335
|
||||
server=/.0to255.com/127.0.0.1#5335
|
||||
server=/.10musume.com/127.0.0.1#5335
|
||||
@ -5801,6 +5808,7 @@ server=/.ym.backchina.com/127.0.0.1#5335
|
||||
server=/.yogichen.org/127.0.0.1#5335
|
||||
server=/.yong.hu/127.0.0.1#5335
|
||||
server=/.yorkbbs.ca/127.0.0.1#5335
|
||||
server=/.youdao.com/127.0.0.1#5335
|
||||
server=/.youjizz.com/127.0.0.1#5335
|
||||
server=/.youmaker.com/127.0.0.1#5335
|
||||
server=/.youpai.org/127.0.0.1#5335
|
||||
@ -220,6 +220,8 @@ server=/.9bis.com/127.0.0.1#5335
|
||||
ipset=/.9bis.com/gfwlist
|
||||
server=/.9bis.net/127.0.0.1#5335
|
||||
ipset=/.9bis.net/gfwlist
|
||||
server=/.9gag.com/127.0.0.1#5335
|
||||
ipset=/.9gag.com/gfwlist
|
||||
server=/.a-normal-day.com/127.0.0.1#5335
|
||||
ipset=/.a-normal-day.com/gfwlist
|
||||
server=/.a248.e.akamai.net/127.0.0.1#5335
|
||||
@ -1578,6 +1580,8 @@ server=/.chinamule.com/127.0.0.1#5335
|
||||
ipset=/.chinamule.com/gfwlist
|
||||
server=/.chinamz.org/127.0.0.1#5335
|
||||
ipset=/.chinamz.org/gfwlist
|
||||
server=/.chinanewscenter.com/127.0.0.1#5335
|
||||
ipset=/.chinanewscenter.com/gfwlist
|
||||
server=/.chinapress.com.my/127.0.0.1#5335
|
||||
ipset=/.chinapress.com.my/gfwlist
|
||||
server=/.chinarightsia.org/127.0.0.1#5335
|
||||
@ -2954,6 +2958,8 @@ server=/.fgmtv.org/127.0.0.1#5335
|
||||
ipset=/.fgmtv.org/gfwlist
|
||||
server=/.fhreports.net/127.0.0.1#5335
|
||||
ipset=/.fhreports.net/gfwlist
|
||||
server=/.fiddle.jshell.net/127.0.0.1#5335
|
||||
ipset=/.fiddle.jshell.net/gfwlist
|
||||
server=/.figprayer.com/127.0.0.1#5335
|
||||
ipset=/.figprayer.com/gfwlist
|
||||
server=/.fileflyer.com/127.0.0.1#5335
|
||||
@ -5168,6 +5174,8 @@ server=/.lifemiles.com/127.0.0.1#5335
|
||||
ipset=/.lifemiles.com/gfwlist
|
||||
server=/.lighten.org.tw/127.0.0.1#5335
|
||||
ipset=/.lighten.org.tw/gfwlist
|
||||
server=/.lighti.me/127.0.0.1#5335
|
||||
ipset=/.lighti.me/gfwlist
|
||||
server=/.lightnovel.cn/127.0.0.1#5335
|
||||
ipset=/.lightnovel.cn/gfwlist
|
||||
server=/.lihkg.com/127.0.0.1#5335
|
||||
@ -6082,6 +6090,8 @@ server=/.nic.google/127.0.0.1#5335
|
||||
ipset=/.nic.google/gfwlist
|
||||
server=/.nic.gov/127.0.0.1#5335
|
||||
ipset=/.nic.gov/gfwlist
|
||||
server=/.nicovideo.jp/127.0.0.1#5335
|
||||
ipset=/.nicovideo.jp/gfwlist
|
||||
server=/.nighost.org/127.0.0.1#5335
|
||||
ipset=/.nighost.org/gfwlist
|
||||
server=/.nikkei.com/127.0.0.1#5335
|
||||
@ -6638,6 +6648,8 @@ server=/.pinoy-n.com/127.0.0.1#5335
|
||||
ipset=/.pinoy-n.com/gfwlist
|
||||
server=/.pinterest.at/127.0.0.1#5335
|
||||
ipset=/.pinterest.at/gfwlist
|
||||
server=/.pinterest.ca/127.0.0.1#5335
|
||||
ipset=/.pinterest.ca/gfwlist
|
||||
server=/.pinterest.co.kr/127.0.0.1#5335
|
||||
ipset=/.pinterest.co.kr/gfwlist
|
||||
server=/.pinterest.co.uk/127.0.0.1#5335
|
||||
@ -6696,6 +6708,8 @@ server=/.plunder.com/127.0.0.1#5335
|
||||
ipset=/.plunder.com/gfwlist
|
||||
server=/.plurk.com/127.0.0.1#5335
|
||||
ipset=/.plurk.com/gfwlist
|
||||
server=/.plus.codes/127.0.0.1#5335
|
||||
ipset=/.plus.codes/gfwlist
|
||||
server=/.plus28.com/127.0.0.1#5335
|
||||
ipset=/.plus28.com/gfwlist
|
||||
server=/.plusbb.com/127.0.0.1#5335
|
||||
@ -6788,6 +6802,8 @@ server=/.postadult.com/127.0.0.1#5335
|
||||
ipset=/.postadult.com/gfwlist
|
||||
server=/.postimg.org/127.0.0.1#5335
|
||||
ipset=/.postimg.org/gfwlist
|
||||
server=/.potato.im/127.0.0.1#5335
|
||||
ipset=/.potato.im/gfwlist
|
||||
server=/.potvpn.com/127.0.0.1#5335
|
||||
ipset=/.potvpn.com/gfwlist
|
||||
server=/.power.com/127.0.0.1#5335
|
||||
@ -7440,6 +7456,8 @@ server=/.shangfang.org/127.0.0.1#5335
|
||||
ipset=/.shangfang.org/gfwlist
|
||||
server=/.shapeservices.com/127.0.0.1#5335
|
||||
ipset=/.shapeservices.com/gfwlist
|
||||
server=/.share.america.gov/127.0.0.1#5335
|
||||
ipset=/.share.america.gov/gfwlist
|
||||
server=/.share.dmhy.org/127.0.0.1#5335
|
||||
ipset=/.share.dmhy.org/gfwlist
|
||||
server=/.share.youthwant.com.tw/127.0.0.1#5335
|
||||
@ -8660,8 +8678,6 @@ server=/.tsu.org.tw/127.0.0.1#5335
|
||||
ipset=/.tsu.org.tw/gfwlist
|
||||
server=/.tsunagarumon.com/127.0.0.1#5335
|
||||
ipset=/.tsunagarumon.com/gfwlist
|
||||
server=/.tt-rss.org/127.0.0.1#5335
|
||||
ipset=/.tt-rss.org/gfwlist
|
||||
server=/.tt1069.com/127.0.0.1#5335
|
||||
ipset=/.tt1069.com/gfwlist
|
||||
server=/.tttan.com/127.0.0.1#5335
|
||||
@ -264,7 +264,7 @@ start_pdnsd() {
|
||||
local usr_dns="$1"
|
||||
local usr_port="$2"
|
||||
local dns_port="5335"
|
||||
|
||||
|
||||
local tcp_dns_list="208.67.222.222,208.67.220.220"
|
||||
[ -z "$usr_dns" ] && usr_dns="8.8.8.8"
|
||||
[ -z "$usr_port" ] && usr_port="53"
|
||||
@ -688,12 +688,16 @@ start_redir() {
|
||||
local dnsstr="$(uci_get_by_type global tunnel_forward 8.8.4.4:53)"
|
||||
local dnsserver=`echo "$dnsstr"|awk -F ':' '{print $1}'`
|
||||
local dnsport=`echo "$dnsstr"|awk -F ':' '{print $2}'`
|
||||
if [ "$run_mode" = "gfw" ]; then
|
||||
ipset add gfwlist $dnsserver 2>/dev/null
|
||||
elif [ "$run_mode" = "oversea" ]; then
|
||||
ipset add oversea $dnsserver 2>/dev/null
|
||||
if [ "$dnsserver" = "0.0.0.0" ]; then
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") dns="$dnsserver"" >> /tmp/ssrplus.log
|
||||
else
|
||||
ipset add ss_spec_wan_ac $dnsserver nomatch 2>/dev/null
|
||||
if [ "$run_mode" = "gfw" ]; then
|
||||
ipset add gfwlist $dnsserver 2>/dev/null
|
||||
elif [ "$run_mode" = "oversea" ]; then
|
||||
ipset add oversea $dnsserver 2>/dev/null
|
||||
else
|
||||
ipset add ss_spec_wan_ac $dnsserver nomatch 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$(uci_get_by_type global pdnsd_enable)" = "1" ] || [ "$(uci_get_by_type global pdnsd_enable)" = "2" ] ;then
|
||||
@ -721,7 +725,7 @@ start_redir() {
|
||||
else
|
||||
dnsstrs="$(uci_get_by_type global tunnel_forward 8.8.4.4:53)"
|
||||
fi
|
||||
/usr/bin/chinadns -p 5335 -c /etc/china_ssr.txt -m -d -s $dnsstrs >/dev/null 2>&1 &
|
||||
nohup /usr/bin/chinadns -p 5335 -c /etc/china_ssr.txt -m -d -s $dnsstrs >/dev/null 2>&1 &
|
||||
chinadns_enable_flag=1
|
||||
fi
|
||||
|
||||
@ -741,6 +745,33 @@ start_redir() {
|
||||
|
||||
return $?
|
||||
}
|
||||
start_udp2raw() {
|
||||
cat > /var/etc/udp2raw.conf <<EOF
|
||||
# udp2raw config file
|
||||
-c
|
||||
-l0.0.0.0:$(uci_get_by_type udp2raw local_port)
|
||||
-r$(uci_get_by_type udp2raw server):$(uci_get_by_type udp2raw server_port)
|
||||
-a
|
||||
-k $(uci_get_by_type udp2raw key)
|
||||
--raw-mode $(uci_get_by_type udp2raw raw_mode)
|
||||
--seq-mode $(uci_get_by_type udp2raw seq_mode)
|
||||
--cipher-mode $(uci_get_by_type udp2raw cipher_mode)
|
||||
--auth-mode $(uci_get_by_type udp2raw auth_mode)
|
||||
EOF
|
||||
/usr/bin/udp2raw --conf-file /var/etc/udp2raw.conf >/dev/null 2>&1 &
|
||||
}
|
||||
|
||||
start_udpspeeeder() {
|
||||
/usr/bin/udpspeeder -c -l0.0.0.0:$(uci_get_by_type udpspeeder local_port) \
|
||||
-r$(uci_get_by_type udpspeeder server):$(uci_get_by_type udpspeeder server_port) \
|
||||
-k $(uci_get_by_type udpspeeder key) \
|
||||
--mode $(uci_get_by_type udpspeeder speeder_mode) \
|
||||
--mtu $(uci_get_by_type udpspeeder mtu) \
|
||||
-f$(uci_get_by_type udpspeeder fec) \
|
||||
-q$(uci_get_by_type udpspeeder queue_len) \
|
||||
--timeout $(uci_get_by_type udpspeeder timeout) \
|
||||
>/dev/null 2>&1 &
|
||||
}
|
||||
|
||||
gen_service_file() {
|
||||
if [ $(uci_get_by_name $1 fast_open) = "1" ] ;then
|
||||
@ -920,14 +951,27 @@ rules() {
|
||||
fi
|
||||
}
|
||||
|
||||
start() {
|
||||
start() {
|
||||
case "$(uci_get_by_type udp2raw udp2raw_enable)" in
|
||||
1|on|true|yes|enabled)
|
||||
start_udp2raw
|
||||
;;
|
||||
esac
|
||||
case "$(uci_get_by_type udpspeeder udpspeeder_enable)" in
|
||||
1|on|true|yes|enabled)
|
||||
start_udpspeeeder
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$switch_server" ] ;then
|
||||
GLOBAL_SERVER=$(uci_get_by_type global global_server)
|
||||
else
|
||||
GLOBAL_SERVER=$switch_server
|
||||
switch_enable=1
|
||||
|
||||
fi
|
||||
|
||||
|
||||
HAPROXY_MODE="0"
|
||||
if [ "$GLOBAL_SERVER" = "__haproxy__" ]; then
|
||||
GLOBAL_SERVER=$(uci -X show shadowsocksr | grep servers | awk -F'[.=]' '{print $2}' | head -n 1)
|
||||
@ -936,29 +980,40 @@ start() {
|
||||
|
||||
if rules ;then
|
||||
[ $HAPROXY_MODE = "1" ] && start_haproxy && haproxy_enable=1
|
||||
|
||||
start_redir
|
||||
|
||||
mkdir -p /tmp/dnsmasq.d
|
||||
if ! [ "$(uci_get_by_type global pdnsd_enable)" = "7" ] ;then
|
||||
if ! [ "$run_mode" = "oversea" ]; then
|
||||
for domain_names in $(uci -X show shadowsocksr | grep domain_white_list | awk -F'[.=]' '{print $2}'); do
|
||||
local DOMAIN_NANES=$(uci_get_by_name $domain_names domain_names)
|
||||
sed -i "/$DOMAIN_NANES/d" /etc/dnsmasq.ssr/custom_forward.conf
|
||||
sed -i "/$DOMAIN_NANES/d" /etc/dnsmasq.ssr/gfw_base.conf
|
||||
sed -i "/$DOMAIN_NANES/d" /etc/dnsmasq.ssr/gfw_list.conf
|
||||
done
|
||||
sleep 2
|
||||
cat > /tmp/dnsmasq.d/dnsmasq-ssr.conf <<EOF
|
||||
conf-dir=/var/dnsmasq.ssr
|
||||
|
||||
if ! [ "$run_mode" = "oversea" ]; then
|
||||
for domain_names in $(uci -X show shadowsocksr | grep domain_white_list | awk -F'[.=]' '{print $2}'); do
|
||||
local DOMAIN_NANES=$(uci_get_by_name $domain_names domain_names)
|
||||
|
||||
sed -i "/$DOMAIN_NANES/d" /etc/dnsmasq.ssr/custom_forward.conf
|
||||
sed -i "/$DOMAIN_NANES/d" /etc/dnsmasq.ssr/gfw_base.conf
|
||||
sed -i "/$DOMAIN_NANES/d" /etc/dnsmasq.ssr/gfw_list.conf
|
||||
done
|
||||
|
||||
sleep 2
|
||||
|
||||
cat > /tmp/dnsmasq.d/dnsmasq-ssr.conf <<EOF
|
||||
conf-dir=/var/etc/dnsmasq.ssr
|
||||
EOF
|
||||
cp -a /etc/dnsmasq.ssr /var
|
||||
else
|
||||
cat > /tmp/dnsmasq.d/dnsmasq-ssr.conf <<EOF
|
||||
conf-dir=/var/dnsmasq.oversea
|
||||
mkdir -p /var/etc/dnsmasq.ssr
|
||||
ln -s /etc/dnsmasq.ssr/* /var/etc/dnsmasq.ssr/
|
||||
|
||||
else
|
||||
cat > /tmp/dnsmasq.d/dnsmasq-ssr.conf <<EOF
|
||||
conf-dir=/var/etc/dnsmasq.oversea
|
||||
EOF
|
||||
cp -a /etc/dnsmasq.oversea /var
|
||||
fi
|
||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||
|
||||
mkdir -p /var/etc/dnsmasq.oversea
|
||||
ln -s /etc/dnsmasq.oversea/* /var/etc/dnsmasq.oversea/
|
||||
ln -s /etc/dnsmasq.ssr/appoint_list.conf /var/etc/dnsmasq.oversea/appoint_list.conf
|
||||
|
||||
fi
|
||||
|
||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
start_server
|
||||
@ -1019,7 +1074,9 @@ stop() {
|
||||
killall -q -9 obfs-local
|
||||
killall -q -9 obfs-server
|
||||
killall -q -9 chinadns
|
||||
|
||||
killall -q -9 udp2raw
|
||||
killall -q -9 udpspeeder
|
||||
/usr/bin/udp2raw --clear >/dev/null
|
||||
if [ -f /var/run/pdnsd.pid ] ;then
|
||||
kill $(cat /var/run/pdnsd.pid) >/dev/null 2>&1
|
||||
else
|
||||
@ -1034,11 +1091,11 @@ stop() {
|
||||
rm -f /tmp/dnsmasq.d/dnsmasq-ssr.conf
|
||||
|
||||
if [ -d "/var/dnsmasq.ssr" ]; then
|
||||
rm -rf /var/dnsmasq.ssr
|
||||
rm -rf /var/etc/dnsmasq.ssr
|
||||
fi
|
||||
|
||||
if [ -d "/var/dnsmasq.oversea" ]; then
|
||||
rm -rf /var/dnsmasq.oversea
|
||||
rm -rf /var/etc/dnsmasq.oversea
|
||||
fi
|
||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||
fi
|
||||
@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@shadowsocksr[-1]
|
||||
add ucitrack shadowsocksr
|
||||
@ -13,9 +12,6 @@ uci -q batch <<-EOF >/dev/null
|
||||
commit firewall
|
||||
EOF
|
||||
|
||||
/etc/init.d/dnscrypt-proxy stop
|
||||
/etc/init.d/dnscrypt-proxy disable
|
||||
|
||||
/usr/share/shadowsocksr/gfw2ipset.sh
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
@ -34,7 +34,7 @@ ssrserver_process=$11
|
||||
v2rayserver_process=$12
|
||||
haproxy_process=$13
|
||||
privoxy_process=$14
|
||||
chinadns_process=$14
|
||||
chinadns_process=$15
|
||||
if [ -z "$pdnsd_process" ] ;then
|
||||
pdnsd_process=0
|
||||
fi
|
||||
@ -63,7 +63,7 @@ else
|
||||
server=`cat /etc/ssr_ip`
|
||||
fi
|
||||
|
||||
while [ "1" = "1" ] #死循环
|
||||
while [ "1" = "1" ] #死循环
|
||||
do
|
||||
sleep 30
|
||||
#redir tcp
|
||||
@ -101,7 +101,7 @@ do
|
||||
if [ $server_process_count -gt 0 ] ;then
|
||||
if [ $ssrserver_process -gt 0 ] ;then
|
||||
icount=`ps -w | grep ssr-server |grep -v grep| wc -l`
|
||||
if [ $icount -lt $ssrserver_process ] #如果进程挂掉就重启它
|
||||
if [ $icount -lt $ssrserver_process ] #如果进程挂掉就重启它
|
||||
then
|
||||
logger -t "$NAME" "ssr server error.restart!"
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") ssr server error.restart!" >> ${logfile}
|
||||
@ -115,7 +115,7 @@ do
|
||||
#ss_server
|
||||
if [ $ssserver_process -gt 0 ] ;then
|
||||
icount=`ps -w | grep ss-server |grep -v grep| wc -l`
|
||||
if [ $icount -lt $ssserver_process ] #如果进程挂掉就重启它
|
||||
if [ $icount -lt $ssserver_process ] #如果进程挂掉就重启它
|
||||
then
|
||||
logger -t "$NAME" "ss server error.restart!"
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") ss server error.restart!" >> ${logfile}
|
||||
@ -129,7 +129,7 @@ do
|
||||
#v2ray_server
|
||||
if [ v2rayserver_process -gt 0 ] ;then
|
||||
icount=`ps -w | grep ss-server |grep -v grep| wc -l`
|
||||
if [ $icount -lt $v2rayserver_process ] #如果进程挂掉就重启它
|
||||
if [ $icount -lt $v2rayserver_process ] #如果进程挂掉就重启它
|
||||
then
|
||||
logger -t "$NAME" "v2ray server error.restart!"
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") v2ray server error.restart!" >> ${logfile}
|
||||
@ -144,7 +144,7 @@ do
|
||||
#kcptun
|
||||
if [ $kcp_process -gt 0 ] ;then
|
||||
icount=`ps -w | grep kcptun-client |grep -v grep| wc -l`
|
||||
if [ $icount -lt $kcp_process ] #如果进程挂掉就重启它
|
||||
if [ $icount -lt $kcp_process ] #如果进程挂掉就重启它
|
||||
then
|
||||
logger -t "$NAME" "ssr kcptun error.restart!"
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") ssr kcptun error.restart!" >> ${logfile}
|
||||
@ -156,7 +156,7 @@ do
|
||||
#local
|
||||
if [ $local_process -eq 1 ] ;then
|
||||
icount=`ps -w | grep ssr-local |grep -v grep| wc -l`
|
||||
if [ $icount -lt $local_process ] #如果进程挂掉就重启它
|
||||
if [ $icount -lt $local_process ] #如果进程挂掉就重启它
|
||||
then
|
||||
logger -t "$NAME" "ssr local error.restart!"
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") ssr local error.restart!" >> ${logfile}
|
||||
@ -169,7 +169,7 @@ do
|
||||
if [ $local_process -eq 2 ] ;then
|
||||
local_processs=1
|
||||
icount=`ps -w | grep ss-local |grep -v grep| wc -l`
|
||||
if [ $icount -lt $local_processs ] #如果进程挂掉就重启它
|
||||
if [ $icount -lt $local_processs ] #如果进程挂掉就重启它
|
||||
then
|
||||
logger -t "$NAME" "ss local error.restart!"
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") ss local error.restart!" >> ${logfile}
|
||||
@ -182,7 +182,7 @@ do
|
||||
if [ $local_process -eq 3 ] ;then
|
||||
local_processs=1
|
||||
icount=`ps -w | grep v2-ssr-local |grep -v grep| wc -l`
|
||||
if [ $icount -lt $local_processs ] #如果进程挂掉就重启它
|
||||
if [ $icount -lt $local_processs ] #如果进程挂掉就重启它
|
||||
then
|
||||
logger -t "$NAME" "v2ray local error.restart!"
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") v2ray local error.restart!" >> ${logfile}
|
||||
@ -216,7 +216,7 @@ do
|
||||
#pdnsd
|
||||
if [ $pdnsd_process -gt 0 ] ;then
|
||||
icount=`ps -w | grep pdnsd |grep -v grep| wc -l`
|
||||
if [ $icount -lt $pdnsd_process ] #如果进程挂掉就重启它
|
||||
if [ $icount -lt $pdnsd_process ] #如果进程挂掉就重启它
|
||||
then
|
||||
logger -t "$NAME" "pdnsd tunnel error.restart!"
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") pdnsd tunnel error.restart!" >> ${logfile}
|
||||
@ -243,11 +243,34 @@ do
|
||||
#haproxy
|
||||
if [ $haproxy_process -gt 0 ] ;then
|
||||
icount=`ps -w | grep haproxy |grep -v grep| wc -l`
|
||||
if [ $icount -lt $haproxy_process ] #如果进程挂掉就重启它
|
||||
if [ $icount -lt $haproxy_process ] #如果进程挂掉就重启它
|
||||
then
|
||||
logger -t "$NAME" "haproxy error.restart!"
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") haproxy error.restart!" >> ${logfile}
|
||||
/etc/init.d/shadowsocksr restart
|
||||
fi
|
||||
fi
|
||||
#udp2raw
|
||||
if [ $(uci_get_by_type udp2raw udp2raw_enable) = 1 ] ;then
|
||||
ucount=`ps -w | grep udp2raw |grep -v grep| wc -l`
|
||||
if [ $ucount = 0 ] ;then
|
||||
/usr/bin/udp2raw --clear >/dev/null
|
||||
/usr/bin/udp2raw --conf-file /var/etc/udp2raw.conf >/dev/null 2>&1 &
|
||||
fi
|
||||
fi
|
||||
#udpspeeder
|
||||
if [ $(uci_get_by_type udpspeeder udpspeeder_enable) = 1 ] ;then
|
||||
scount=`ps -w | grep udpspeeder |grep -v grep| wc -l`
|
||||
if [ $scount = 0 ] ;then
|
||||
/usr/bin/udpspeeder -c -l0.0.0.0:$(uci_get_by_type udpspeeder local_port) \
|
||||
-r$(uci_get_by_type udpspeeder server):$(uci_get_by_type udpspeeder server_port) \
|
||||
-k $(uci_get_by_type udpspeeder key) \
|
||||
--mode $(uci_get_by_type udpspeeder speeder_mode) \
|
||||
--mtu $(uci_get_by_type udpspeeder mtu) \
|
||||
-f$(uci_get_by_type udpspeeder fec) \
|
||||
-q$(uci_get_by_type udpspeeder queue_len) \
|
||||
--timeout $(uci_get_by_type udpspeeder timeout) \
|
||||
>/dev/null 2>&1 &
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@ -30,7 +30,7 @@ usage() {
|
||||
-w <wan_ips> wan ip of will be forwarded
|
||||
-p <fp_lan_ips> lan ip of will be global proxy
|
||||
-G <gm_lan_ips> lan ip of will be game mode proxy
|
||||
-k <wan_fk_ips> wan ip of will be forwarded
|
||||
-k <wan_fk_ips> wan ip of will be forwarded
|
||||
-e <extra_options> extra options for iptables
|
||||
-o apply the rules to the OUTPUT chain
|
||||
-O apply the global rules to the OUTPUT chain
|
||||
@ -83,7 +83,7 @@ ipset_r() {
|
||||
$(for ip in $WAN_FW_IP; do echo "add ss_spec_wan_ac $ip nomatch"; done)
|
||||
EOF
|
||||
ipset -N gfwlist hash:net 2>/dev/null
|
||||
$IPT -N SS_SPEC_WAN_AC
|
||||
$IPT -N SS_SPEC_WAN_AC
|
||||
$IPT -I SS_SPEC_WAN_AC -d $server -j RETURN
|
||||
$IPT -A SS_SPEC_WAN_AC -m set --match-set ss_spec_wan_ac dst -j RETURN
|
||||
$IPT -A SS_SPEC_WAN_AC -j SS_SPEC_WAN_FW
|
||||
@ -92,11 +92,12 @@ EOF
|
||||
ipset -N gfwlist hash:net 2>/dev/null
|
||||
for ip in $WAN_FW_IP; do ipset -! add gfwlist $ip ; done
|
||||
$IPT -N SS_SPEC_WAN_AC
|
||||
$IPT -A SS_SPEC_WAN_AC -m set --match-set gfwlist dst -j SS_SPEC_WAN_FW
|
||||
$IPT -A SS_SPEC_WAN_AC -m set --match-set gfwlist dst -j SS_SPEC_WAN_FW
|
||||
ipset -N gmlan hash:net 2>/dev/null
|
||||
|
||||
for ip in $LAN_GM_IP; do ipset -! add gmlan $ip ; done
|
||||
$IPT -A SS_SPEC_WAN_AC -m set --match-set gmlan src -m set ! --match-set china dst -j SS_SPEC_WAN_FW
|
||||
$IPT -A SS_SPEC_WAN_AC -m set --match-set gmlan src -m set ! --match-set china dst -j SS_SPEC_WAN_FW
|
||||
$IPT -A SS_SPEC_WAN_AC -m set --match-set china dst -j RETURN
|
||||
$IPT -I SS_SPEC_WAN_AC -d $server -j RETURN
|
||||
|
||||
elif [ "$RUNMODE" = "oversea" ] ;then
|
||||
@ -223,6 +224,7 @@ tp_rule() {
|
||||
-j TPROXY --on-port "$LOCAL_PORT" --tproxy-mark 0x01/0x01
|
||||
|
||||
elif [ "$RUNMODE" = "gfw" ] ;then
|
||||
$ipt -A SS_SPEC_TPROXY -p udp -m set --match-set china dst -j RETURN
|
||||
$ipt -A SS_SPEC_TPROXY -p udp -m set --match-set gmlan src -m set ! --match-set china dst \
|
||||
-j TPROXY --on-port "$LOCAL_PORT" --tproxy-mark 0x01/0x01
|
||||
$ipt -A SS_SPEC_TPROXY -p udp -m set --match-set gfwlist dst \
|
||||
175
package/ctcgfw/luci-app-ssr-plus-jo/root/usr/bin/ssr-switch
Executable file
175
package/ctcgfw/luci-app-ssr-plus-jo/root/usr/bin/ssr-switch
Executable file
@ -0,0 +1,175 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Copyright (C) 2017 openwrt-ssr
|
||||
# Copyright (C) 2017 yushi studio <ywb94@qq.com>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
cycle_time=60
|
||||
switch_time=3
|
||||
normal_flag=0
|
||||
server_locate=0
|
||||
server_count=0
|
||||
NAME=shadowsocksr
|
||||
ENABLE_SERVER=nil
|
||||
CONFIG_SWTICH_FILE=/var/etc/${NAME}_t.json
|
||||
|
||||
|
||||
[ -n "$1" ] && cycle_time=$1
|
||||
[ -n "$2" ] && switch_time=$2
|
||||
|
||||
uci_get_by_name() {
|
||||
local ret=$(uci get $NAME.$1.$2 2>/dev/null)
|
||||
echo ${ret:=$3}
|
||||
}
|
||||
|
||||
uci_get_by_type() {
|
||||
local ret=$(uci get $NAME.@$1[0].$2 2>/dev/null)
|
||||
echo ${ret:=$3}
|
||||
}
|
||||
|
||||
DEFAULT_SERVER=$(uci_get_by_type global global_server)
|
||||
CURRENT_SERVER=$DEFAULT_SERVER
|
||||
|
||||
#判断代理是否正常
|
||||
check_proxy() {
|
||||
/usr/bin/ssr-check www.google.com 80 $switch_time 1
|
||||
if [ "$?" == "0" ]; then
|
||||
return 0
|
||||
else
|
||||
/usr/bin/ssr-check www.baidu.com 80 $switch_time 1
|
||||
if [ "$?" == "0" ]; then
|
||||
#goole不通baidu通则不正常
|
||||
return 1
|
||||
else
|
||||
return 2
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
test_proxy() {
|
||||
local servername=$(uci_get_by_name $1 server)
|
||||
local serverport=$(uci_get_by_name $1 server_port)
|
||||
ret=$(ping -c 3 $servername | grep 'loss' | awk -F ',' '{ print $3 }' | awk -F "%" '{ print $1 }')
|
||||
[ -z "$ret" ] && return 1
|
||||
[ "$ret" -gt "50" ] && return 1
|
||||
ipset add ss_spec_wan_ac $servername 2>/dev/null
|
||||
ret=$?
|
||||
/usr/bin/ssr-check $servername $serverport $switch_time
|
||||
local ret2=$?
|
||||
if [ "$ret" = "0" ] ;then
|
||||
ipset del ss_spec_wan_ac $servername 2>/dev/null
|
||||
fi
|
||||
if [ "$ret2" = "0" ] ;then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
search_proxy() {
|
||||
let server_count=server_count+1
|
||||
[ "$normal_flag" = "1" -a "$server_count" -le "$server_locate" ] && return 0
|
||||
[ "$(uci_get_by_name $1 switch_enable)" != "1" ] && return 1
|
||||
[ $ENABLE_SERVER != nil ] && return 0
|
||||
[ "$1" = "$CURRENT_SERVER" ] && return 0
|
||||
local servername=$(uci_get_by_name $1 server)
|
||||
local serverport=$(uci_get_by_name $1 server_port)
|
||||
ipset add ss_spec_wan_ac $servername 2>/dev/null
|
||||
ret=$?
|
||||
/usr/bin/ssr-check $servername $serverport $switch_time
|
||||
local ret2=$?
|
||||
if [ "$ret" = "0" ] ;then
|
||||
ipset del ss_spec_wan_ac $servername 2>/dev/null
|
||||
fi
|
||||
if [ "$ret2" = "0" ] ;then
|
||||
server_locate=$server_count
|
||||
ENABLE_SERVER=$1
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
|
||||
}
|
||||
#选择可用的代理
|
||||
select_proxy() {
|
||||
|
||||
config_load $NAME
|
||||
ENABLE_SERVER=nil
|
||||
mkdir -p /var/run /var/etc
|
||||
server_count=0
|
||||
config_foreach search_proxy servers
|
||||
|
||||
}
|
||||
|
||||
#切换代理
|
||||
switch_proxy() {
|
||||
/etc/init.d/shadowsocksr restart $1
|
||||
return 0
|
||||
}
|
||||
|
||||
start() {
|
||||
#不支持kcptun启用时的切换
|
||||
[ $(uci_get_by_name $DEFAULT_SERVER kcp_enable) = "1" ] && return 1
|
||||
|
||||
while [ "1" = "1" ] #死循环
|
||||
do
|
||||
sleep $cycle_time
|
||||
|
||||
LOGTIME=$(date "+%Y-%m-%d %H:%M:%S")
|
||||
|
||||
|
||||
#判断当前代理是否为缺省服务器
|
||||
if [ "$CURRENT_SERVER" != "$DEFAULT_SERVER" ] ;then
|
||||
#echo "not default proxy"
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") Current server is not default Main server, try to switch back." >> /tmp/ssrplus.log
|
||||
|
||||
#检查缺省服务器是否正常
|
||||
if test_proxy $DEFAULT_SERVER ;then
|
||||
#echo "switch to default proxy"
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") Main server is avilable." >> /tmp/ssrplus.log
|
||||
#缺省服务器正常,切换回来
|
||||
CURRENT_SERVER=$DEFAULT_SERVER
|
||||
switch_proxy $CURRENT_SERVER
|
||||
echo "switch to default ["$(uci_get_by_name $CURRENT_SERVER server)"] proxy!" >> /tmp/ssrplus.log
|
||||
continue
|
||||
else
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") Main server is NOT avilable.Continue using current server." >> /tmp/ssrplus.log
|
||||
fi
|
||||
fi
|
||||
|
||||
#判断当前代理是否正常
|
||||
check_proxy
|
||||
current_ret=$?
|
||||
|
||||
if [ "$current_ret" = "1" ] ;then
|
||||
#当前代理错误,判断有无可用的服务器
|
||||
#echo "current error"
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") Current server error, try to switch another server." >> /tmp/ssrplus.log
|
||||
|
||||
select_proxy
|
||||
if [ "$ENABLE_SERVER" != nil ] ;then
|
||||
#有其他服务器可用,进行切换
|
||||
#echo $(uci_get_by_name $new_proxy server)
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") Another server is avilable, now switching server." >> /tmp/ssrplus.log
|
||||
CURRENT_SERVER=$ENABLE_SERVER
|
||||
switch_proxy $CURRENT_SERVER
|
||||
normal_flag=1
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") ShadowsocksR server switch OK" >> /tmp/ssrplus.log
|
||||
else
|
||||
switch_proxy $CURRENT_SERVER
|
||||
normal_flag=1
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") Try restart current server." >> /tmp/ssrplus.log
|
||||
fi
|
||||
else
|
||||
normal_flag=0
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") ShadowsocksR No Problem." >> /tmp/ssrplus.log
|
||||
fi
|
||||
|
||||
|
||||
done
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
echo "create china hash:net family inet hashsize 1024 maxelem 65536" > /tmp/china.ipset
|
||||
|
||||
awk '!/^$/&&!/^#/{printf("add china %s'" "'\n",$0)}' /etc/china_ssr.txt >> /tmp/china.ipset
|
||||
ipset -! flush china
|
||||
ipset -! restore < /tmp/china.ipset 2>/dev/null
|
||||
@ -2,6 +2,7 @@ local ucursor = require "luci.model.uci".cursor()
|
||||
local json = require "luci.jsonc"
|
||||
local server_section = arg[1]
|
||||
local proto = arg[2]
|
||||
|
||||
local local_port = arg[3]
|
||||
|
||||
local server = ucursor:get_all("shadowsocksr", server_section)
|
||||
@ -1,5 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
awk '!/^$/&&!/^#/{printf("ipset=/.%s/'"gfwlist"'\n",$0)}' /etc/config/gfw.list > /etc/dnsmasq.ssr/custom_forward.conf
|
||||
awk '!/^$/&&!/^#/{printf("server=/.%s/'"127.0.0.1#5335"'\n",$0)}' /etc/config/gfw.list >> /etc/dnsmasq.ssr/custom_forward.conf
|
||||
|
||||
@ -1,82 +1,66 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2017 XiaoShan https://www.mivm.cn
|
||||
# Copyright (C) 2019 Jerryk jerrykuku@qq.com
|
||||
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
urlsafe_b64decode() {
|
||||
local d="====" data=$(echo $1 | sed 's/_/\//g; s/-/+/g')
|
||||
local mod4=$((${#data}%4))
|
||||
[ $mod4 -gt 0 ] && data=$data${d:mod4}
|
||||
echo $data | base64 -d
|
||||
local d="====" data=$(echo $1 | sed 's/_/\//g; s/-/+/g')
|
||||
local mod4=$((${#data}%4))
|
||||
[ $mod4 -gt 0 ] && data=${data}${d:mod4}
|
||||
echo $data | base64 -d
|
||||
}
|
||||
|
||||
echo_date(){
|
||||
echo 【$(TZ=UTC-8 date -R +%Y年%m月%d日\ %X)】:$1
|
||||
}
|
||||
|
||||
CheckIPAddr() {
|
||||
echo $1 | grep "^[0-9]\{1,3\}\.\([0-9]\{1,3\}\.\)\{2\}[0-9]\{1,3\}$" >/dev/null 2>&1
|
||||
[ $? -ne 0 ] && return 1
|
||||
local ipaddr=($(echo $1 | sed 's/\./ /g'))
|
||||
[ ${#ipaddr[@]} -ne 4 ] && return 1
|
||||
for ((i=0;i<${#ipaddr[@]};i++))
|
||||
do
|
||||
[ ${ipaddr[i]} -gt 255 -a ${ipaddr[i]} -lt 0 ] && return 1
|
||||
done
|
||||
return 0
|
||||
echo $(TZ=UTC-8 date -R +%Y-%m-%d\ %X):$1
|
||||
}
|
||||
|
||||
Server_Update() {
|
||||
local uci_set="uci -q set $name.$1."
|
||||
${uci_set}grouphashkey="$ssr_grouphashkey"
|
||||
${uci_set}hashkey="$ssr_hashkey"
|
||||
${uci_set}alias="[$ssr_group] $ssr_remarks"
|
||||
${uci_set}auth_enable="0"
|
||||
${uci_set}switch_enable="1"
|
||||
${uci_set}type="$ssr_type"
|
||||
${uci_set}server="$ssr_host"
|
||||
${uci_set}server_port="$ssr_port"
|
||||
${uci_set}local_port="1234"
|
||||
uci -q get $name.@servers[$1].timeout >/dev/null || ${uci_set}timeout="60"
|
||||
${uci_set}password="$ssr_passwd"
|
||||
${uci_set}encrypt_method="$ssr_method"
|
||||
${uci_set}protocol="$ssr_protocol"
|
||||
${uci_set}protocol_param="$ssr_protoparam"
|
||||
${uci_set}obfs="$ssr_obfs"
|
||||
${uci_set}obfs_param="$ssr_obfsparam"
|
||||
${uci_set}fast_open="0"
|
||||
${uci_set}weight="10"
|
||||
${uci_set}kcp_enable="0"
|
||||
${uci_set}kcp_port="0"
|
||||
${uci_set}kcp_param="--nocomp"
|
||||
|
||||
local uci_set="uci -q set $name.$1."
|
||||
${uci_set}grouphashkey="$ssr_grouphashkey"
|
||||
${uci_set}hashkey="$ssr_hashkey"
|
||||
${uci_set}alias="[$ssr_group] $ssr_remarks"
|
||||
${uci_set}auth_enable="0"
|
||||
${uci_set}switch_enable="1"
|
||||
${uci_set}type="$ssr_type"
|
||||
${uci_set}server="$ssr_host"
|
||||
${uci_set}server_port="$ssr_port"
|
||||
${uci_set}local_port="1234"
|
||||
uci -q get $name.@servers[$1].timeout >/dev/null || ${uci_set}timeout="60"
|
||||
${uci_set}password="$ssr_passwd"
|
||||
${uci_set}encrypt_method="$ssr_method"
|
||||
${uci_set}protocol="$ssr_protocol"
|
||||
${uci_set}protocol_param="$ssr_protoparam"
|
||||
${uci_set}obfs="$ssr_obfs"
|
||||
${uci_set}obfs_param="$ssr_obfsparam"
|
||||
${uci_set}fast_open="0"
|
||||
${uci_set}kcp_enable="0"
|
||||
${uci_set}kcp_port="0"
|
||||
${uci_set}kcp_param="--nocomp"
|
||||
|
||||
if [ "$ssr_type" = "v2ray" ]; then
|
||||
#v2ray
|
||||
${uci_set}alter_id="$ssr_alter_id"
|
||||
${uci_set}vmess_id="$ssr_vmess_id"
|
||||
${uci_set}security="$ssr_security"
|
||||
${uci_set}transport="$ssr_transport"
|
||||
${uci_set}ws_host="$ssr_ws_host"
|
||||
${uci_set}ws_path="$ssr_ws_path"
|
||||
if [ "$ssr_tls" = "tls" -o "$ssr_tls" == "1" ];then
|
||||
${uci_set}tls="1"
|
||||
fi
|
||||
${uci_set}tcp_guise="$ssr_tcp_guise"
|
||||
#v2ray
|
||||
${uci_set}alter_id="$ssr_alter_id"
|
||||
${uci_set}vmess_id="$ssr_vmess_id"
|
||||
${uci_set}security="$ssr_security"
|
||||
${uci_set}transport="$ssr_transport"
|
||||
${uci_set}tcp_guise="$ssr_tcp_guise"
|
||||
${uci_set}ws_host="$ssr_ws_host"
|
||||
${uci_set}ws_path="$ssr_ws_path"
|
||||
${uci_set}tls="$ssr_tls"
|
||||
fi
|
||||
}
|
||||
|
||||
#设置订阅开始
|
||||
|
||||
echo "1" >/www/lock.htm
|
||||
|
||||
name=shadowsocksr
|
||||
subscribe_url=($(uci get $name.@server_subscribe[0].subscribe_url))
|
||||
subscribe_url=($(uci get $name.@server_subscribe[0].subscribe_url)) #订阅服务器地址
|
||||
[ ${#subscribe_url[@]} -eq 0 ] && exit 1
|
||||
[ $(uci -q get $name.@server_subscribe[0].proxy || echo 0) -eq 0 ] && /etc/init.d/$name stop >/dev/null 2>&1
|
||||
log_name=${name}_subscribe
|
||||
echo_date "开始订阅"
|
||||
echo_date "==================================================="
|
||||
echo_date " 服务器订阅程序"
|
||||
echo_date "==================================================="
|
||||
for ((o=0;o<${#subscribe_url[@]};o++))
|
||||
do
|
||||
|
||||
echo_date "从 ${subscribe_url[o]} 获取订阅"
|
||||
echo_date "开始更新在线订阅列表..."
|
||||
echo_date "开始下载订阅链接到本地临时文件,请稍等..."
|
||||
@ -128,6 +112,7 @@ do
|
||||
temp_alias=$(uci -q get $name.@servers[$x].grouphashkey | grep "$ssr_grouphashkey")
|
||||
[ -n "$temp_alias" ] && temp_host_o[${#temp_host_o[@]}]=$(uci get $name.@servers[$x].hashkey)
|
||||
done
|
||||
|
||||
for ((x=0;x<$subscribe_max;x++)) # 循环链接
|
||||
do
|
||||
[ ${#subscribe_max_x[@]} -eq 0 ] && temp_x=$x || temp_x=${subscribe_max_x[x]}
|
||||
@ -138,6 +123,7 @@ do
|
||||
# 计算hashkey
|
||||
ssr_hashkey=$(echo "$temp_info" | md5sum | cut -d ' ' -f1)
|
||||
|
||||
|
||||
info=${temp_info///?*/}
|
||||
temp_info_array=(${info//:/ })
|
||||
ssr_type="ssr"
|
||||
@ -174,17 +160,22 @@ do
|
||||
|
||||
ssr_type="v2ray"
|
||||
json_load "$temp_info"
|
||||
json_get_var ssr_remarks ps
|
||||
json_get_var ssr_host add
|
||||
json_get_var ssr_port port
|
||||
json_get_var ssr_alter_id aid
|
||||
json_get_var ssr_vmess_id id
|
||||
json_get_var ssr_security type
|
||||
json_get_var ssr_security auto
|
||||
json_get_var ssr_transport net
|
||||
json_get_var ssr_remarks ps
|
||||
ssr_tcp_guise="none"
|
||||
json_get_var ssr_ws_host host
|
||||
json_get_var ssr_ws_path path
|
||||
json_get_var ssr_tls tls
|
||||
ssr_tcp_guise="none"
|
||||
if [ "$ssr_tls" == "tls" -o "$ssr_tls" == "1" ]; then
|
||||
ssr_tls="1"
|
||||
else
|
||||
ssr_tls="0"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "ssr_remarks" ]; then # 没有备注的话则生成一个
|
||||
@ -200,7 +191,8 @@ do
|
||||
subscribe_x=$subscribe_x$ssr_hashkey" "
|
||||
ssrtype=$(echo $ssr_type | tr '[a-z]' '[A-Z]')
|
||||
echo_date "$ssrtype节点:【$ssr_remarks】"
|
||||
|
||||
|
||||
# SSR
|
||||
# echo "服务器地址: $ssr_host"
|
||||
# echo "服务器端口 $ssr_port"
|
||||
# echo "密码: $ssr_passwd"
|
||||
@ -210,6 +202,7 @@ do
|
||||
# echo "混淆: $ssr_obfs"
|
||||
# echo "混淆参数: $ssr_obfsparam"
|
||||
# echo "备注: $ssr_remarks"
|
||||
|
||||
done
|
||||
for ((x=0;x<${#temp_host_o[@]};x++)) # 新旧服务器信息匹配,如果旧服务器信息不存在于新服务器信息则删除
|
||||
do
|
||||
@ -233,4 +226,5 @@ else
|
||||
logger -st $log_name[$$] -p3 "${subscribe_url[$o]} 订阅数据获取失败 错误代码: $curl_code"
|
||||
fi
|
||||
done
|
||||
echo "0" >/www/lock.htm
|
||||
/etc/init.d/$name restart >/dev/null 2>&1
|
||||
@ -1,14 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
chnroute_data=$(wget -O- -t 3 -T 3 http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest)
|
||||
[ $? -eq 0 ] && {
|
||||
echo "$chnroute_data" | grep ipv4 | grep CN | awk -F\| '{ printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > /tmp/china_ssr.txt
|
||||
}
|
||||
|
||||
if [ -s "/tmp/china_ssr.txt" ];then
|
||||
if ( ! cmp -s /tmp/china_ssr.txt /etc/china_ssr.txt );then
|
||||
mv /tmp/china_ssr.txt /etc/china_ssr.txt
|
||||
fi
|
||||
if ( ! cmp -s /tmp/china_ssr.txt /etc/china_ssr.txt );then
|
||||
mv /tmp/china_ssr.txt /etc/china_ssr.txt
|
||||
fi
|
||||
fi
|
||||
|
||||
/usr/share/shadowsocksr/chinaipset.sh
|
||||
@ -17,10 +16,10 @@ wget-ssl --no-check-certificate https://raw.githubusercontent.com/gfwlist/gfwlis
|
||||
/usr/bin/ssr-gfw
|
||||
|
||||
if [ -s "/tmp/gfwnew.txt" ];then
|
||||
if ( ! cmp -s /tmp/gfwnew.txt /etc/dnsmasq.ssr/gfw_list.conf );then
|
||||
mv /tmp/gfwnew.txt /etc/dnsmasq.ssr/gfw_list.conf
|
||||
echo "copy"
|
||||
fi
|
||||
if ( ! cmp -s /tmp/gfwnew.txt /etc/dnsmasq.ssr/gfw_list.conf );then
|
||||
mv /tmp/gfwnew.txt /etc/dnsmasq.ssr/gfw_list.conf
|
||||
echo "copy"
|
||||
fi
|
||||
fi
|
||||
|
||||
/etc/init.d/shadowsocksr restart
|
||||
/etc/init.d/shadowsocksr restart
|
||||
@ -4,11 +4,16 @@ dir="/usr/share/v2ray/"
|
||||
v2ray_new_version=$(wget -qO- "https://github.com/v2ray/v2ray-core/tags"| grep "/v2ray/v2ray-core/releases/tag/"| head -n 1| awk -F "/tag/v" '{print $2}'| sed 's/\">//')
|
||||
echo "$v2ray_new_version" > ${dir}v2ray_new_version
|
||||
if [ $? -eq 0 ];then
|
||||
v2ray_new_version=$(cat ${dir}v2ray_new_version|sed -n '1p')
|
||||
edition=$(uci get shadowsocksr.@server_subscribe[0].edition 2>/dev/null)
|
||||
if [ "$edition" = "auto_detected" ];then
|
||||
v2ray_new_version=$(cat ${dir}v2ray_new_version|sed -n '1p')
|
||||
else
|
||||
v2ray_new_version=$edition
|
||||
fi
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") v2ray自动更新启动,验证版本..." >> ${logfile}
|
||||
|
||||
if ( ! cmp -s ${dir}v2ray_version ${dir}v2ray_new_version );then
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") 检测到v2ray最新版本为$v2ray_new_version..." >> ${logfile}
|
||||
mem_mode=$(uci get shadowsocksr.@server_subscribe[0].mem_mode 2>/dev/null)
|
||||
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") 检测到v2ray版本为$v2ray_new_version..." >> ${logfile}
|
||||
|
||||
UpdateApp() {
|
||||
for a in $(opkg print-architecture | awk '{print $2}'); do
|
||||
@ -39,6 +44,7 @@ if [ $? -eq 0 ];then
|
||||
|
||||
download_binary(){
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") 开始下载v2ray二进制文件..." >> ${logfile}
|
||||
rm -rf $bin_dir/v2ray*.zip
|
||||
bin_dir="/tmp"
|
||||
UpdateApp
|
||||
cd $bin_dir
|
||||
@ -55,14 +61,33 @@ if [ $? -eq 0 ];then
|
||||
if [ -f $bin_dir/v2ray-linux-"$ARCH"*.zip ]; then
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") 成功下载v2ray二进制文件" >> ${logfile}
|
||||
killall -q -9 v2ray
|
||||
|
||||
|
||||
if [ ! -d "/usr/bin/v2ray/" ]; then
|
||||
mkdir -p /usr/bin/v2ray
|
||||
fi
|
||||
unzip -o v2ray-linux-"$ARCH"*.zip -d $bin_dir/v2ray-v"$v2ray_new_version"-linux-"$ARCH"/
|
||||
mv $bin_dir/v2ray-v"$v2ray_new_version"-linux-"$ARCH"/v2ray /usr/bin/v2ray/v2ray
|
||||
mv $bin_dir/v2ray-v"$v2ray_new_version"-linux-"$ARCH"/v2ctl /usr/bin/v2ray/v2ctl
|
||||
mv $bin_dir/v2ray-v"$v2ray_new_version"-linux-"$ARCH"/geoip.dat /usr/bin/v2ray/geoip.dat
|
||||
mv $bin_dir/v2ray-v"$v2ray_new_version"-linux-"$ARCH"/geosite.dat /usr/bin/v2ray/geosite.dat
|
||||
mem_mode=$(uci get shadowsocksr.@server_subscribe[0].mem_mode 2>/dev/null)
|
||||
if [ $mem_mode -eq 1 ]; then
|
||||
if [ -f /usr/bin/v2ray/v2ray ]; then
|
||||
rm -rf /usr/bin/v2ray/*
|
||||
rm -rf $bin_dir/v2ray-v"$v2ray_new_version"-linux-"$ARCH"
|
||||
fi
|
||||
chmod +x $bin_dir/v2ray-v"$v2ray_new_version"-linux-"$ARCH"/v2*
|
||||
ln -s $bin_dir/v2ray-v"$v2ray_new_version"-linux-"$ARCH"/v2ray /usr/bin/v2ray/
|
||||
ln -s $bin_dir/v2ray-v"$v2ray_new_version"-linux-"$ARCH"/v2ctl /usr/bin/v2ray/
|
||||
ln -s $bin_dir/v2ray-v"$v2ray_new_version"-linux-"$ARCH"/geoip.dat /usr/bin/v2ray/
|
||||
ln -s $bin_dir/v2ray-v"$v2ray_new_version"-linux-"$ARCH"/geosite.dat /usr/bin/v2ray/
|
||||
else
|
||||
if [ -f /usr/bin/v2ray/v2ray ]; then
|
||||
rm -rf /usr/bin/v2ray/*
|
||||
fi
|
||||
mv $bin_dir/v2ray-v"$v2ray_new_version"-linux-"$ARCH"/v2ray /usr/bin/v2ray/
|
||||
mv $bin_dir/v2ray-v"$v2ray_new_version"-linux-"$ARCH"/v2ctl /usr/bin/v2ray/
|
||||
mv $bin_dir/v2ray-v"$v2ray_new_version"-linux-"$ARCH"/geoip.dat /usr/bin/v2ray/
|
||||
mv $bin_dir/v2ray-v"$v2ray_new_version"-linux-"$ARCH"/geosite.dat /usr/bin/v2ray/
|
||||
rm -rf $bin_dir/v2ray-v"$v2ray_new_version"-linux-"$ARCH"
|
||||
fi
|
||||
rm -rf $bin_dir/v2ray*.zip
|
||||
rm -rf $bin_dir/v2ray-v"$v2ray_new_version"-linux-"$ARCH"
|
||||
if [ -f "/usr/bin/v2ray/v2ray" ]; then
|
||||
chmod +x /usr/bin/v2ray/v2*
|
||||
/etc/init.d/shadowsocksr restart
|
||||
@ -78,8 +103,4 @@ if [ $? -eq 0 ];then
|
||||
echo "" > ${dir}v2ray_version
|
||||
echo "$v2ray_new_version" > ${dir}v2ray_version
|
||||
rm -rf ${dir}v2ray_new_version
|
||||
else
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") v2ray已经是最新的了..." >> ${logfile}
|
||||
rm -rf ${dir}v2ray_new_version
|
||||
fi
|
||||
fi
|
||||
@ -0,0 +1 @@
|
||||
4.20.0
|
||||
File diff suppressed because one or more lines are too long
@ -1,91 +0,0 @@
|
||||
local shadowsocksr = "shadowsocksr"
|
||||
local uci = luci.model.uci.cursor()
|
||||
local server_table = {}
|
||||
|
||||
uci:foreach(shadowsocksr, "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}
|
||||
end
|
||||
end)
|
||||
|
||||
local key_table = {}
|
||||
for key,_ in pairs(server_table) do
|
||||
table.insert(key_table,key)
|
||||
end
|
||||
|
||||
table.sort(key_table)
|
||||
|
||||
m = Map(shadowsocksr)
|
||||
|
||||
s = m:section(TypedSection, "global", translate("Server failsafe auto swith settings"))
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Flag, "monitor_enable", translate("Enable Process Deamon"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Flag, "enable_switch", translate("Enable Auto Switch"))
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Value, "switch_time", translate("Switch check cycly(second)"))
|
||||
o.datatype = "uinteger"
|
||||
o:depends("enable_switch", "1")
|
||||
o.default = 3600
|
||||
|
||||
o = s:option(Value, "switch_timeout", translate("Check timout(second)"))
|
||||
o.datatype = "uinteger"
|
||||
o:depends("enable_switch", "1")
|
||||
o.default = 5
|
||||
|
||||
-- [[ haProxy ]]--
|
||||
|
||||
s = m:section(TypedSection, "global_haproxy", translate("haProxy settings"))
|
||||
s.anonymous = true
|
||||
|
||||
o = s:option(Flag, "admin_enable", translate("Enabling the Management Console"))
|
||||
o.rmempty = false
|
||||
o.default = 1
|
||||
|
||||
o = s:option(Value, "admin_port", translate("Service Port"))
|
||||
o.datatype = "uinteger"
|
||||
o.default = 1111
|
||||
|
||||
o = s:option(Value, "admin_user", translate("User name"))
|
||||
o.default = "admin"
|
||||
|
||||
o = s:option(Value, "admin_password", translate("Password"))
|
||||
o.default = "root"
|
||||
|
||||
-- [[ 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
|
||||
|
||||
|
||||
|
||||
return m
|
||||
@ -1,23 +0,0 @@
|
||||
local fs = require "nixio.fs"
|
||||
local conffile = "/etc/dnsmasq.oversea/base_list.conf"
|
||||
|
||||
f = SimpleForm("custom", translate("Oversea Custom List"))
|
||||
|
||||
t = f:field(TextValue, "conf")
|
||||
t.rmempty = true
|
||||
t.rows = 13
|
||||
function t.cfgvalue()
|
||||
return fs.readfile(conffile) or ""
|
||||
end
|
||||
|
||||
function f.handle(self, state, data)
|
||||
if state == FORM_VALID then
|
||||
if data.conf then
|
||||
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
|
||||
luci.sys.call("/etc/init.d/shadowsocksr restart")
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
return f
|
||||
@ -1,8 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<span style="color: red">
|
||||
<%
|
||||
local val = self:cfgvalue(section) or self.default or ""
|
||||
write(pcdata(val))
|
||||
%>
|
||||
</span>
|
||||
<%+cbi/valuefooter%>
|
||||
@ -1,5 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
<label class="cbi-value" style="display:inline-block; width: 130px" for="ulfile"><%:Choose local file:%></label>
|
||||
<input class="cbi-input-file" style="width: 400px" type="file" id="ulfile" name="ulfile" />
|
||||
<input type="submit" class="cbi-button cbi-input-apply" name="upload" value="<%:Upload%>" />
|
||||
<%+cbi/valuefooter%>
|
||||
@ -1,6 +0,0 @@
|
||||
<%+cbi/valueheader%>
|
||||
|
||||
<label class="cbi-value-title" style="display:inline-block; width: 180px" for="ulfile"><%:Choose local file:%></label>
|
||||
<input class="cbi-input-file" style="width: 400px" type="file" id="ulfile" name="ulfile" />
|
||||
|
||||
<%+cbi/valuefooter%>
|
||||
@ -1,289 +0,0 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-dns-prefetch-control" content="on">
|
||||
<link rel="dns-prefetch" href="//cdn.jsdelivr.net">
|
||||
<link rel="dns-prefetch" href="//api.ipify.org">
|
||||
<link rel="dns-prefetch" href="//myip.ipip.net">
|
||||
<link rel="dns-prefetch" href="//api.ipify.org">
|
||||
<link rel="dns-prefetch" href="//api.ttt.sh">
|
||||
<link rel="dns-prefetch" href="//api.skk.moe">
|
||||
<link rel="dns-prefetch" href="//dt.skk.moe">
|
||||
<link rel="preconnect" href="https://api.ipify.org">
|
||||
<link rel="preconnect" href="https://myip.ipip.net">
|
||||
<script src="https://pv.sohu.com/cityjson?ie=utf-8"></script>
|
||||
<link rel="preconnect" href="https://api.ipify.org">
|
||||
<link rel="preconnect" href="https://api.ttt.sh">
|
||||
<link rel="preconnect" href="https://api.skk.moe">
|
||||
<link rel="preconnect" href="https://dt.skk.moe">
|
||||
<link rel="shortcut icon" type="image/ico" href="https://cdn.jsdelivr.net/npm/skx@0.0.1">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,minimal-ui">
|
||||
<style>
|
||||
.ip-title {
|
||||
font-weight: bold;
|
||||
color: #444;
|
||||
font-size:15px;
|
||||
display: inline-block;
|
||||
width: 25%;
|
||||
vertical-align:bottom;
|
||||
}
|
||||
|
||||
.ip-state_title {
|
||||
font-weight: bold;
|
||||
color: #444;
|
||||
font-size:15px;
|
||||
display: inline-block;
|
||||
width: 52%;
|
||||
vertical-align:bottom;
|
||||
transform:translateY(10%);
|
||||
}
|
||||
|
||||
.ip-result {
|
||||
color: #444;
|
||||
font-size:16px;
|
||||
white-space: nowrap; /*强制span不换行*/
|
||||
display: inline-block; /*将span当做块级元素对待*/
|
||||
width: 29%; /*限制宽度*/
|
||||
overflow: hidden; /*超出宽度部分隐藏*/
|
||||
text-overflow: ellipsis; /*超出部分以点号代替*/
|
||||
vertical-align:bottom;
|
||||
transform:translateY(8%);
|
||||
}
|
||||
|
||||
.ip-geo {
|
||||
color: #444;
|
||||
font-size:15px;
|
||||
white-space: nowrap; /*强制span不换行*/
|
||||
display: inline-block; /*将span当做块级元素对待*/
|
||||
width: 40%; /*限制宽度*/
|
||||
overflow: hidden; /*超出宽度部分隐藏*/
|
||||
text-overflow: ellipsis; /*超出部分以点号代替*/
|
||||
vertical-align:bottom;
|
||||
transform:translateY(2%);
|
||||
}
|
||||
|
||||
.ip-checking {
|
||||
color: #444;
|
||||
font-size:15px;
|
||||
display: inline-block;
|
||||
vertical-align:bottom;
|
||||
width: 29%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
transform:translateY(10%);
|
||||
}
|
||||
|
||||
.sk-text-success {
|
||||
color: #32b643;
|
||||
font-size:15px;
|
||||
display: inline-block;
|
||||
vertical-align:bottom;
|
||||
width: 48%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-align: left;
|
||||
transform:translateY(10%);
|
||||
}
|
||||
|
||||
.sk-text-error {
|
||||
color: #e85600;
|
||||
font-size:15px;
|
||||
display: inline-block;
|
||||
vertical-align:bottom;
|
||||
width: 48%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-align: left;
|
||||
transform:translateY(10%);
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin: 5px 0 6px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<fieldset class="cbi-section">
|
||||
<table>
|
||||
<tr><td width="100%">
|
||||
<body onLoad="myip_Load()">
|
||||
<div style="display: flex;">
|
||||
<div style="width: 51%">
|
||||
<h3>IP 地址</h3>
|
||||
<p>
|
||||
<span class="ip-title">IPIP 国内:</span><span class="ip-result" id="ip-ipipnet"></span> <span class="ip-geo" id="ip-ipipnet-geo"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-title">搜狐 国内:</span><span class="ip-result" id="ip-sohu"></span> <span class="ip-geo" id="ip-sohu-ipip"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-title">Ipify 海外:</span><span class="ip-result" id="ip-ipify"></span> <span class="ip-geo" id="ip-ipify-geo"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-title">IPAPI 海外:</span><span class="ip-result" id="ip-ipapi"></span> <span class="ip-geo" id="ip-ipapi-geo"></span>
|
||||
</p>
|
||||
</div>
|
||||
<div style="width: 49%">
|
||||
<h3>网站访问检查</h3>
|
||||
<p>
|
||||
<span class="ip-state_title">百度搜索:</span><span id="http-baidu"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-state_title">网易云音乐:</span><span id="http-163"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-state_title">GitHub:</span><span id="http-github"></span>
|
||||
</p>
|
||||
<p>
|
||||
<span class="ip-state_title">YouTube:</span><span id="http-youtube"></span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<p style="float: right; margin-top: 3px; font-size:15px; padding-right: 10px">Powered by <a onclick="return ip_skk()" href="javascript:void(0);">ip.skk.moe</a></p>
|
||||
</div>
|
||||
</td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<script>
|
||||
function ip_skk()
|
||||
{
|
||||
url2='https://ip.skk.moe';
|
||||
window.open(url2);
|
||||
}
|
||||
const $$ = document;
|
||||
$$.getElementById('ip-sohu').innerHTML = '查询中...';
|
||||
$$.getElementById('ip-ipapi').innerHTML = '查询中...';
|
||||
$$.getElementById('ip-ipipnet').innerHTML = '查询中...';
|
||||
$$.getElementById('ip-ipify').innerHTML = '查询中...';
|
||||
let random = parseInt(Math.random() * 100000000);
|
||||
let IP = {
|
||||
get: (url, type) =>
|
||||
fetch(url, { method: 'GET' }).then((resp) => {
|
||||
if (type === 'text')
|
||||
return Promise.all([resp.ok, resp.status, resp.text(), resp.headers]);
|
||||
else {
|
||||
return Promise.all([resp.ok, resp.status, resp.json(), resp.headers]);
|
||||
}
|
||||
}).then(([ok, status, data, headers]) => {
|
||||
if (ok) {
|
||||
let json = {
|
||||
ok,
|
||||
status,
|
||||
data,
|
||||
headers
|
||||
}
|
||||
return json;
|
||||
} else {
|
||||
throw new Error(JSON.stringify(json.error));
|
||||
}
|
||||
}).catch(error => {
|
||||
throw error;
|
||||
}),
|
||||
parseIPIpip: (ip, elID) => {
|
||||
IP.get(`https://api.skk.moe/network/parseIp/ipip/${ip}`, 'json')
|
||||
.then(resp => {
|
||||
let x = '';
|
||||
for (let i of resp.data) {
|
||||
x += (i !== '') ? `${i} ` : '';
|
||||
}
|
||||
$$.getElementById(elID).innerHTML = x;
|
||||
//$$.getElementById(elID).innerHTML = `${resp.data.country} ${resp.data.regionName} ${resp.data.city} ${resp.data.isp}`;
|
||||
})
|
||||
},
|
||||
getIpipnetIP: () => {
|
||||
IP.get(`https://myip.ipip.net/?z=${random}`, 'text')
|
||||
.then((resp) => {
|
||||
let data = resp.data.replace('当前 IP:', '').split(' 来自于:');
|
||||
$$.getElementById('ip-ipipnet').innerHTML = `${data[0]}`;
|
||||
$$.getElementById('ip-ipipnet-geo').innerHTML = `${data[1]}`;
|
||||
});
|
||||
},
|
||||
getSohuIP: (data) => {
|
||||
$$.getElementById('ip-sohu').innerHTML = returnCitySN.cip;
|
||||
IP.parseIPIpip(returnCitySN.cip, 'ip-sohu-ipip');
|
||||
},
|
||||
getIpifyIP: () => {
|
||||
IP.get(`https://api.ipify.org/?format=json&z=${random}`, 'json')
|
||||
.then((resp) => {
|
||||
$$.getElementById('ip-ipify').innerHTML = resp.data.ip;
|
||||
return resp.data.ip
|
||||
}).then((ip) => {
|
||||
IP.parseIPIpip(ip, 'ip-ipify-geo');
|
||||
})
|
||||
},
|
||||
getIPApiIP: () => {
|
||||
IP.get(`https://ipapi.co/json?z=${random}`, 'json')
|
||||
.then(resp => {
|
||||
$$.getElementById('ip-ipapi').innerHTML = resp.data.ip;
|
||||
IP.parseIPIpip(resp.data.ip, 'ip-ipapi-geo');
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
window.ipCallback = (data) => IP.getTaobaoIP(data);
|
||||
$$.getElementById('http-baidu').innerHTML = '<span class="ip-checking">检测中...</span>';
|
||||
$$.getElementById('http-163').innerHTML = '<span class="ip-checking">检测中...</span>';
|
||||
$$.getElementById('http-github').innerHTML = '<span class="ip-checking">检测中...</span>';
|
||||
$$.getElementById('http-youtube').innerHTML = '<span class="ip-checking">检测中...</span>';
|
||||
let HTTP = {
|
||||
checker: (domain, cbElID) => {
|
||||
let img = new Image;
|
||||
let timeout = setTimeout(() => {
|
||||
img.onerror = img.onload = null;
|
||||
$$.getElementById(cbElID).innerHTML = '<span class="sk-text-error">连接超时</span>'
|
||||
}, 5000);
|
||||
|
||||
img.onerror = () => {
|
||||
clearTimeout(timeout);
|
||||
$$.getElementById(cbElID).innerHTML = '<span class="sk-text-error">无法访问</span>'
|
||||
}
|
||||
|
||||
img.onload = () => {
|
||||
clearTimeout(timeout);
|
||||
$$.getElementById(cbElID).innerHTML = '<span class="sk-text-success">连接正常</span>'
|
||||
}
|
||||
|
||||
img.src = `https://${domain}/favicon.ico?${+(new Date)}`
|
||||
},
|
||||
runcheck: () => {
|
||||
HTTP.checker('www.baidu.com', 'http-baidu');
|
||||
HTTP.checker('s1.music.126.net/style', 'http-163');
|
||||
HTTP.checker('github.com', 'http-github');
|
||||
HTTP.checker('www.youtube.com', 'http-youtube');
|
||||
}
|
||||
};
|
||||
|
||||
function myip_Load()
|
||||
{
|
||||
|
||||
var sbip = document.getElementsByTagName('HEAD').item(0);
|
||||
var sbipScript= document.createElement("script");
|
||||
sbipScript.defer = "defer";
|
||||
sbipScript.src='https://ipv4.ip.sb/addrinfo?callback=IP.getIpsbIP';
|
||||
sbip.appendChild( sbipScript);
|
||||
|
||||
const $$ = document;
|
||||
random = parseInt(Math.random() * 100000000);
|
||||
window.ipCallback = (data) => IP.getIpipnetIP(data);;
|
||||
IP.getIpipnetIP();
|
||||
IP.getSohuIP();
|
||||
IP.getIPApiIP();
|
||||
IP.getIpifyIP();
|
||||
HTTP.runcheck();
|
||||
setTimeout("myip_Load()",1000*8);
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -1,42 +0,0 @@
|
||||
|
||||
config global
|
||||
option tunnel_address '0.0.0.0'
|
||||
option monitor_enable '1'
|
||||
option enable_switch '1'
|
||||
option switch_timeout '5'
|
||||
option switch_time '667'
|
||||
option threads '0'
|
||||
option run_mode 'router'
|
||||
option filter_aaaa '0'
|
||||
option bt '0'
|
||||
option pdnsd_enable '5'
|
||||
option global_server 'cfg0b4a8f'
|
||||
|
||||
config socks5_proxy
|
||||
option server 'nil'
|
||||
option local_port '1080'
|
||||
option local_address '0.0.0.0'
|
||||
|
||||
config access_control
|
||||
option wan_bp_list '/etc/china_ssr.txt'
|
||||
option lan_ac_mode 'b'
|
||||
option router_proxy '1'
|
||||
list wan_bp_ips '114.114.114.114'
|
||||
list wan_bp_ips '119.29.29.29'
|
||||
list wan_fw_ips '1.0.0.1'
|
||||
list wan_fw_ips '1.1.1.1'
|
||||
list wan_fw_ips '109.239.140.0/24'
|
||||
list wan_fw_ips '149.154.160.0/20'
|
||||
list wan_fw_ips '67.198.55.0/24'
|
||||
list wan_fw_ips '91.108.4.0/22'
|
||||
list wan_fw_ips '91.108.56.0/22'
|
||||
list wan_fw_ips '192.168.10.0/24'
|
||||
|
||||
config server_global
|
||||
option enable_server '0'
|
||||
|
||||
config server_subscribe
|
||||
option proxy '0'
|
||||
option auto_update_time '2'
|
||||
option auto_update '0'
|
||||
option v2ray_update '0'
|
||||
@ -1,3 +0,0 @@
|
||||
server=/.3g.music.qq.com/127.0.0.1#5335
|
||||
ipset=/3g.music.qq.com/oversea
|
||||
|
||||
@ -1,21 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2007 OpenWrt.org
|
||||
|
||||
/etc/init.d/shadowsocksr enabled && {
|
||||
|
||||
[ "$ACTION" = "ifup" ] && {
|
||||
local_server=`uci get shadowsocksr.@global[0].global_server 2>/dev/null`
|
||||
|
||||
if [ "$local_server" = "nil" ] ;then
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") Shadowsocks/ShadowsocksR/v2ray not running!" >> /tmp/ssrplus.log
|
||||
else
|
||||
icount=`ps -w | grep ssr-retcp |grep -v grep| wc -l`
|
||||
if [ $icount = 0 ] ;then
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") Shadowsocks/ShadowsocksR/v2ray error.restart!" >> /tmp/ssrplus.log
|
||||
/etc/init.d/shadowsocksr restart
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,183 +0,0 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Copyright (C) 2017 openwrt-ssr
|
||||
# Copyright (C) 2017 yushi studio <ywb94@qq.com>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
cycle_time=60
|
||||
switch_time=3
|
||||
normal_flag=0
|
||||
server_locate=0
|
||||
server_count=0
|
||||
NAME=shadowsocksr
|
||||
ENABLE_SERVER=nil
|
||||
CONFIG_SWTICH_FILE=/var/etc/${NAME}_t.json
|
||||
logfile="/tmp/ssrplus.log"
|
||||
|
||||
clean_log(){
|
||||
logrow=$(grep -c "" ${logfile})
|
||||
if [ $logrow -ge 500 ];then
|
||||
cat /dev/null > ${logfile}
|
||||
echo "$LOGTIME Log条数超限,清空处理!" >> ${logfile}
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
[ -n "$1" ] && cycle_time=$1
|
||||
[ -n "$2" ] && switch_time=$2
|
||||
|
||||
uci_get_by_name() {
|
||||
local ret=$(uci get $NAME.$1.$2 2>/dev/null)
|
||||
echo ${ret:=$3}
|
||||
}
|
||||
|
||||
uci_get_by_type() {
|
||||
local ret=$(uci get $NAME.@$1[0].$2 2>/dev/null)
|
||||
echo ${ret:=$3}
|
||||
}
|
||||
|
||||
DEFAULT_SERVER=$(uci_get_by_type global global_server)
|
||||
CURRENT_SERVER=$DEFAULT_SERVER
|
||||
|
||||
#判断代理是否正常
|
||||
check_proxy() {
|
||||
/usr/bin/ssr-check www.google.com 80 $switch_time 1 || /usr/bin/ssr-check www.youtube.com 80 $switch_time 1
|
||||
if [ "$?" == "0" ]; then
|
||||
return 0
|
||||
else
|
||||
/usr/bin/ssr-check www.baidu.com 80 $switch_time 1 && /usr/bin/ssr-check www.17173.com 80 $switch_time 1
|
||||
if [ "$?" == "0" ]; then
|
||||
#goole不通baidu通则不正常
|
||||
return 1
|
||||
else
|
||||
return 2
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
test_proxy() {
|
||||
local servername=$(uci_get_by_name $1 server)
|
||||
local serverport=$(uci_get_by_name $1 server_port)
|
||||
ret=$(ping -c 3 $servername | grep 'loss' | awk -F ',' '{ print $3 }' | awk -F "%" '{ print $1 }')
|
||||
[ -z "$ret" ] && return 1
|
||||
[ "$ret" -gt "50" ] && return 1
|
||||
ipset add ss_spec_wan_ac $servername 2>/dev/null
|
||||
ret=$?
|
||||
#/usr/bin/ssr-check $servername $serverport $switch_time
|
||||
/usr/bin/ssr-check $servername 80 $switch_time 1
|
||||
local ret2=$?
|
||||
if [ "$ret" = "0" ] ;then
|
||||
ipset del ss_spec_wan_ac $servername 2>/dev/null
|
||||
fi
|
||||
|
||||
if [ "$ret2" = "0" ] ;then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
search_proxy() {
|
||||
let server_count=server_count+1
|
||||
[ "$normal_flag" = "1" -a "$server_count" -le "$server_locate" ] && return 0
|
||||
[ "$(uci_get_by_name $1 switch_enable)" != "1" ] && return 1
|
||||
[ $ENABLE_SERVER != nil ] && return 0
|
||||
[ "$1" = "$CURRENT_SERVER" ] && return 0
|
||||
local servername=$(uci_get_by_name $1 server)
|
||||
local serverport=$(uci_get_by_name $1 server_port)
|
||||
ipset add ss_spec_wan_ac $servername 2>/dev/null
|
||||
ret=$?
|
||||
#/usr/bin/ssr-check $servername $serverport $switch_time
|
||||
/usr/bin/ssr-check $servername 80 $switch_time 1
|
||||
local ret2=$?
|
||||
if [ "$ret" = "0" ] ;then
|
||||
ipset del ss_spec_wan_ac $servername 2>/dev/null
|
||||
fi
|
||||
|
||||
if [ "$ret2" = "0" ] ;then
|
||||
server_locate=$server_count
|
||||
ENABLE_SERVER=$1
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
#选择可用的代理
|
||||
select_proxy() {
|
||||
config_load $NAME
|
||||
ENABLE_SERVER=nil
|
||||
mkdir -p /var/run /var/etc
|
||||
server_count=0
|
||||
config_foreach search_proxy servers
|
||||
}
|
||||
|
||||
#切换代理
|
||||
switch_proxy() {
|
||||
/etc/init.d/shadowsocksr restart $1
|
||||
return 0
|
||||
}
|
||||
|
||||
start() {
|
||||
#不支持kcptun启用时的切换
|
||||
[ $(uci_get_by_name $DEFAULT_SERVER kcp_enable) = "1" ] && return 1
|
||||
|
||||
while [ "1" = "1" ] #死循环
|
||||
do
|
||||
sleep $cycle_time
|
||||
|
||||
clean_log
|
||||
|
||||
#判断当前代理是否为缺省服务器
|
||||
if [ "$CURRENT_SERVER" != "$DEFAULT_SERVER" ] ;then
|
||||
#echo "not default proxy"
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") Current server is not default Main server, try to switch back." >> ${logfile}
|
||||
|
||||
#检查缺省服务器是否正常
|
||||
if test_proxy $DEFAULT_SERVER ;then
|
||||
#echo "switch to default proxy"
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") Main server is avilable." >> /tmp/ssrplus.log
|
||||
|
||||
#缺省服务器正常,切换回来
|
||||
CURRENT_SERVER=$DEFAULT_SERVER
|
||||
switch_proxy $CURRENT_SERVER
|
||||
echo "switch to default ["$(uci_get_by_name $CURRENT_SERVER server)"] proxy!" >> ${logfile}
|
||||
continue
|
||||
else
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") Main server is NOT avilable.Continue using current server." >> ${logfile}
|
||||
fi
|
||||
fi
|
||||
|
||||
#判断当前代理是否正常
|
||||
check_proxy
|
||||
current_ret=$?
|
||||
|
||||
if [ "$current_ret" = "1" ] ;then
|
||||
#当前代理错误,判断有无可用的服务器
|
||||
#echo "current error"
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") Current server error, try to switch another server." >> ${logfile}
|
||||
|
||||
select_proxy
|
||||
if [ "$ENABLE_SERVER" != nil ] ;then
|
||||
#有其他服务器可用,进行切换
|
||||
#echo $(uci_get_by_name $new_proxy server)
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") Another server is avilable, now switching server." >> ${logfile}
|
||||
CURRENT_SERVER=$ENABLE_SERVER
|
||||
switch_proxy $CURRENT_SERVER
|
||||
normal_flag=1
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") ShadowsocksR server switch OK" >> ${logfile}
|
||||
else
|
||||
normal_flag=0
|
||||
fi
|
||||
|
||||
else
|
||||
normal_flag=0
|
||||
echo "$(date "+%Y-%m-%d %H:%M:%S") ShadowsocksR No Problem." >> ${logfile}
|
||||
fi
|
||||
|
||||
done
|
||||
}
|
||||
@ -1,95 +0,0 @@
|
||||
local ucursor = require "luci.model.uci".cursor()
|
||||
local json = require "luci.jsonc"
|
||||
local server_section = arg[1]
|
||||
local proto = arg[2]
|
||||
local local_port = arg[3]
|
||||
|
||||
local server = ucursor:get_all("shadowsocksr", server_section)
|
||||
|
||||
local v2ray = {
|
||||
log = {
|
||||
-- error = "/var/ssrplus.log",
|
||||
loglevel = "warning"
|
||||
},
|
||||
-- 传入连接
|
||||
inbound = {
|
||||
port = local_port,
|
||||
protocol = "dokodemo-door",
|
||||
settings = {
|
||||
network = proto,
|
||||
followRedirect = true
|
||||
},
|
||||
sniffing = {
|
||||
enabled = true,
|
||||
destOverride = { "http", "tls" }
|
||||
}
|
||||
},
|
||||
-- 传出连接
|
||||
outbound = {
|
||||
protocol = "vmess",
|
||||
settings = {
|
||||
vnext = {
|
||||
{
|
||||
address = "0.0.0.0",
|
||||
port = '4433',
|
||||
users = {
|
||||
{
|
||||
id = server.vmess_id,
|
||||
alterId = tonumber(server.alter_id),
|
||||
security = server.security
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
-- 底层传输配置
|
||||
streamSettings = {
|
||||
network = server.transport,
|
||||
security = (server.tls == '1') and "tls" or "none",
|
||||
tlsSettings = {allowInsecure = (server.insecure == "1") and true or false,},
|
||||
kcpSettings = (server.transport == "kcp") and {
|
||||
mtu = tonumber(server.mtu),
|
||||
tti = tonumber(server.tti),
|
||||
uplinkCapacity = tonumber(server.uplink_capacity),
|
||||
downlinkCapacity = tonumber(server.downlink_capacity),
|
||||
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
|
||||
}
|
||||
} or nil,
|
||||
wsSettings = (server.transport == "ws") and {
|
||||
path = server.ws_path,
|
||||
headers = (server.ws_host ~= nil) and {
|
||||
Host = server.ws_host
|
||||
} or nil,
|
||||
} or nil,
|
||||
httpSettings = (server.transport == "h2") and {
|
||||
path = server.h2_path,
|
||||
host = server.h2_host,
|
||||
} or nil,
|
||||
quicSettings = (server.transport == "quic") and {
|
||||
security = server.quic_security,
|
||||
key = server.quic_key,
|
||||
header = {
|
||||
type = server.quic_guise
|
||||
}
|
||||
} or nil
|
||||
},
|
||||
mux = {
|
||||
enabled = (server.mux == "1") and true or false,
|
||||
concurrency = tonumber(server.concurrency)
|
||||
}
|
||||
},
|
||||
|
||||
-- 额外传出连接
|
||||
outboundDetour = {
|
||||
{
|
||||
protocol = "freedom",
|
||||
tag = "direct",
|
||||
settings = { keep = "" }
|
||||
}
|
||||
}
|
||||
}
|
||||
print(json.stringify(v2ray, 1))
|
||||
Loading…
Reference in New Issue
Block a user