diff --git a/README.md b/README.md index 503fb9026c..2e6b38419a 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,8 @@ Package zxlhhyccc: [zxlhhyccc/MY-lede](https://github.com/zxlhhyccc/MY-lede). luci-theme-darkmatter source: [apollo-ng/luci-theme-darkmatter](https://github.com/apollo-ng/luci-theme-darkmatter). luci-app-koolproxyR source: [Ameykyl/luci-app-koolproxyR](https://github.com/Ameykyl/luci-app-koolproxyR). -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). +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). diff --git a/package/jsda/luci-app-ssr-plus-jsda/Makefile b/package/ctcgfw/luci-app-ssr-plus-jo/Makefile similarity index 68% rename from package/jsda/luci-app-ssr-plus-jsda/Makefile rename to package/ctcgfw/luci-app-ssr-plus-jo/Makefile index 0a0f4766e5..890d88b75e 100644 --- a/package/jsda/luci-app-ssr-plus-jsda/Makefile +++ b/package/ctcgfw/luci-app-ssr-plus-jo/Makefile @@ -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)) diff --git a/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/controller/shadowsocksr.lua b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/controller/shadowsocksr.lua new file mode 100644 index 0000000000..48a357706d --- /dev/null +++ b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/controller/shadowsocksr.lua @@ -0,0 +1,253 @@ +-- Copyright (C) 2017 yushi studio +-- 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="" + 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 .. "[" .. server_name .. "] OK." + else + retstring =retstring .. "[" .. server_name .. "] Error." + 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 diff --git a/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/advanced.lua b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/advanced.lua new file mode 100644 index 0000000000..79bc3fcf7c --- /dev/null +++ b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/advanced.lua @@ -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 diff --git a/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/automatic.lua b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/automatic.lua new file mode 100644 index 0000000000..75575d83c7 --- /dev/null +++ b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/automatic.lua @@ -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 diff --git a/package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/client-config.lua b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/client-config.lua similarity index 81% rename from package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/client-config.lua rename to package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/client-config.lua index aead0253ee..5e6e707866 100644 --- a/package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/client-config.lua +++ b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/client-config.lua @@ -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 diff --git a/package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/client.lua b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/client.lua similarity index 76% rename from package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/client.lua rename to package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/client.lua index 853e7be54a..ce86e72560 100644 --- a/package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/client.lua +++ b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/client.lua @@ -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 diff --git a/package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/control.lua b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/control.lua similarity index 94% rename from package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/control.lua rename to package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/control.lua index c922dbaae3..c4685389d0 100644 --- a/package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/control.lua +++ b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/control.lua @@ -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 \ No newline at end of file +return m diff --git a/package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/list.lua b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/list.lua similarity index 93% rename from package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/list.lua rename to package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/list.lua index 5fdfdb7755..e920889247 100644 --- a/package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/list.lua +++ b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/list.lua @@ -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 \ No newline at end of file + +return f diff --git a/package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/log.lua b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/log.lua similarity index 97% rename from package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/log.lua rename to package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/log.lua index 05b4162fc4..ad60e95829 100644 --- a/package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/log.lua +++ b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/log.lua @@ -12,4 +12,5 @@ function t.cfgvalue() end t.readonly="readonly" -return f \ No newline at end of file + +return f diff --git a/package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/server-config.lua b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/server-config.lua similarity index 77% rename from package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/server-config.lua rename to package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/server-config.lua index b403dd683f..c233e3eb44 100644 --- a/package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/server-config.lua +++ b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/server-config.lua @@ -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") diff --git a/package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/server.lua b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/server.lua similarity index 100% rename from package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/server.lua rename to package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/server.lua diff --git a/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/servers.lua b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/servers.lua new file mode 100644 index 0000000000..70be2ee0cf --- /dev/null +++ b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/servers.lua @@ -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 diff --git a/package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/status.lua b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/status.lua similarity index 74% rename from package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/status.lua rename to package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/status.lua index 38981463f9..a4931e4561 100644 --- a/package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/status.lua +++ b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/status.lua @@ -1,7 +1,7 @@ -- Copyright (C) 2017 yushi studio -- 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 .. [[]] + .. "https://github.com/wangyu-/udp2raw-tunnel" .. [[]] .. 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 .. [[]] + .. "https://github.com/wangyu-/UDPspeeder" .. [[]] .. 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 diff --git a/package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/servers.lua b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/subscription.lua similarity index 87% rename from package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/servers.lua rename to package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/subscription.lua index ee87ee2aa5..d6896fb177 100644 --- a/package/jsda/luci-app-ssr-plus-jsda/luasrc/model/cbi/shadowsocksr/servers.lua +++ b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/model/cbi/shadowsocksr/subscription.lua @@ -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 diff --git a/package/jsda/luci-app-ssr-plus-jsda/luasrc/view/shadowsocksr/check.htm b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/view/shadowsocksr/check.htm similarity index 97% rename from package/jsda/luci-app-ssr-plus-jsda/luasrc/view/shadowsocksr/check.htm rename to package/ctcgfw/luci-app-ssr-plus-jo/luasrc/view/shadowsocksr/check.htm index bd78926118..7ff8a5e84e 100644 --- a/package/jsda/luci-app-ssr-plus-jsda/luasrc/view/shadowsocksr/check.htm +++ b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/view/shadowsocksr/check.htm @@ -35,4 +35,4 @@ <%=self.value%> -<%+cbi/valuefooter%> \ No newline at end of file +<%+cbi/valuefooter%> diff --git a/package/jsda/luci-app-ssr-plus-jsda/luasrc/view/shadowsocksr/checkport.htm b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/view/shadowsocksr/checkport.htm similarity index 92% rename from package/jsda/luci-app-ssr-plus-jsda/luasrc/view/shadowsocksr/checkport.htm rename to package/ctcgfw/luci-app-ssr-plus-jo/luasrc/view/shadowsocksr/checkport.htm index ed91a2f22c..285e5a3fb2 100644 --- a/package/jsda/luci-app-ssr-plus-jsda/luasrc/view/shadowsocksr/checkport.htm +++ b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/view/shadowsocksr/checkport.htm @@ -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%> \ No newline at end of file +<%+cbi/valuefooter%> diff --git a/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/view/shadowsocksr/myip.htm b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/view/shadowsocksr/myip.htm new file mode 100644 index 0000000000..c3f946c37f --- /dev/null +++ b/package/ctcgfw/luci-app-ssr-plus-jo/luasrc/view/shadowsocksr/myip.htm @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IP 地址查询 + + IP 登录设备: + + + IPIP 国内: + + + 太平洋 国内: + + + IP.SB 海外: + + + IPIFY 海外: + + + + 网站访问检查 + + 百度搜索: + + + 网易云音乐: + + + GitHub: + + + Facebook: + + + YouTube: + + + + + 由 ip.skk.moe 提供支持 + + + + + + + + + +
+ IP 登录设备: +
+ IPIP 国内: +
+ 太平洋 国内: +
+ IP.SB 海外: +
+ IPIFY 海外: +
+ 百度搜索: +
+ 网易云音乐: +
+ GitHub: +
+ Facebook: +
+ YouTube: +
由 ip.skk.moe 提供支持