--- a/luci-app-ssr-plus/Makefile +++ b/luci-app-ssr-plus/Makefile @@ -33,6 +33,7 @@ LUCI_DEPENDS:= \ +libuci-lua +lua +luci-compat +coreutils +coreutils-base64 +dns2tcp +dnsmasq-full \ +jq +ip-full +lua-neturl +libuci-lua +microsocks +ipt2socks +lyaml \ +resolveip +curl +nping +unzip +xz-utils \ + +PACKAGE_$(PKG_NAME)_INCLUDE_Xray:xray-core \ +PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS_NG:chinadns-ng \ +PACKAGE_$(PKG_NAME)_INCLUDE_MosDNS:mosdns \ +PACKAGE_$(PKG_NAME)_INCLUDE_Shadow_TLS:shadow-tls \ @@ -99,7 +100,7 @@ endchoice choice prompt "V2ray-core Selection" - default PACKAGE_$(PKG_NAME)_INCLUDE_Xray if aarch64||arm||i386||x86_64 + default PACKAGE_$(PKG_NAME)_INCLUDE_Xray default PACKAGE_$(PKG_NAME)_INCLUDE_NONE_V2RAY config PACKAGE_$(PKG_NAME)_INCLUDE_NONE_V2RAY @@ -107,7 +108,6 @@ choice config PACKAGE_$(PKG_NAME)_INCLUDE_Xray bool "Xray-core" - select PACKAGE_xray-core endchoice config PACKAGE_$(PKG_NAME)_INCLUDE_ChinaDNS_NG --- a/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua +++ b/luci-app-ssr-plus/luasrc/controller/shadowsocksr.lua @@ -663,6 +663,62 @@ function index() entry({"admin", "services", "shadowsocksr", "clash_client_rule_clear"}, call("clash_client_rule_clear")).leaf = true --[[Backup]] entry({"admin", "services", "shadowsocksr", "backup"}, call("create_backup")).leaf = true + entry({'admin', 'services', "shadowsocksr", 'ip'}, call('check_ip')) -- 获取ip情况 +end + +function check_site(host, port) + local nixio = require "nixio" + local socket = nixio.socket("inet", "stream") + socket:setopt("socket", "rcvtimeo", 2) + socket:setopt("socket", "sndtimeo", 2) + local ret = socket:connect(host, port) + socket:close() + return ret +end + +function get_ip_geo_info() + local result = luci.sys.exec('curl --retry 3 -m 10 -LfsA "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36" http://ip-api.com/json/') + local json = require "luci.jsonc" + local info = json.parse(result) + + return { + flag = string.lower(info.countryCode) or "un", + country = get_country_name(info.countryCode) or "Unknown", + ip = info.query, + isp = info.isp + } +end + +function get_country_name(countryCode) + local country_names = { + US = "美国", CN = "中国", JP = "日本", GB = "英国", DE = "德国", + FR = "法国", BR = "巴西", IT = "意大利", RU = "俄罗斯", CA = "加拿大", + KR = "韩国", ES = "西班牙", AU = "澳大利亚", MX = "墨西哥", ID = "印度尼西亚", + NL = "荷兰", TR = "土耳其", CH = "瑞士", SA = "沙特阿拉伯", SE = "瑞典", + PL = "波兰", BE = "比利时", AR = "阿根廷", NO = "挪威", AT = "奥地利", + TW = "台湾", ZA = "南非", TH = "泰国", DK = "丹麦", MY = "马来西亚", + PH = "菲律宾", SG = "新加坡", IE = "爱尔兰", HK = "香港", FI = "芬兰", + CL = "智利", PT = "葡萄牙", GR = "希腊", IL = "以色列", NZ = "新西兰", + CZ = "捷克", RO = "罗马尼亚", VN = "越南", UA = "乌克兰", HU = "匈牙利", + AE = "阿联酋", CO = "哥伦比亚", IN = "印度", EG = "埃及", PE = "秘鲁", TW = "台湾" + } + return country_names[countryCode] +end + +function check_ip() + local e = {} + local port = 80 + local geo_info = get_ip_geo_info(ip) + e.ip = geo_info.ip + e.flag = geo_info.flag + e.country = geo_info.country + e.isp = geo_info.isp + e.baidu = check_site('www.baidu.com', port) + e.taobao = check_site('www.taobao.com', port) + e.google = check_site('www.google.com', port) + e.youtube = check_site('www.youtube.com', port) + luci.http.prepare_content('application/json') + luci.http.write_json(e) end function subscribe() --- a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client.lua +++ b/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client.lua @@ -227,7 +227,7 @@ if is_finded("chinadns-ng") then end end -local dns_defaults_section = m:section(SimpleSection) -dns_defaults_section.template = "shadowsocksr/client_dns_defaults" +m:append(Template("shadowsocksr/client_dns_defaults")) +m:append(Template("shadowsocksr/status_bottom")) return m new file mode 100644 index 000000000000..a00fff9c79b3 --- /dev/null +++ b/luci-app-ssr-plus/luasrc/view/shadowsocksr/status_bottom.htm @@ -0,0 +1,128 @@ + +
+ + --- a/luci-app-ssr-plus/root/etc/uci-defaults/luci-ssr-plus +++ b/luci-app-ssr-plus/root/etc/uci-defaults/luci-ssr-plus @@ -43,5 +43,8 @@ if [ -s "/etc/uwsgi/vassals/luci-webui.ini" ];then /etc/init.d/uwsgi restart fi +grep -q ip-api.com /etc/ssrplus/black.list || + sed -i '$a ip-api.com' /etc/ssrplus/black.list + rm -f /tmp/luci-indexcache /tmp/luci-indexcache.* rm -rf /tmp/luci-modulecache/ --- a/luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua +++ b/luci-app-ssr-plus/root/usr/share/shadowsocksr/gen_config.lua @@ -389,10 +389,7 @@ Xray.outbounds = { fingerprint = server.fingerprint, allowInsecure = (function() if server.tls_CertSha and server.tls_CertSha ~= "" then return nil end - if os.date("%Y.%m.%d") < "2026.06.01" then - return server.insecure == "1" - end - return nil + return server.insecure == "1" end)(), serverName = server.tls_host, certificates = server.certificate and { --- a/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua +++ b/luci-app-ssr-plus/luasrc/model/cbi/shadowsocksr/client-config.lua @@ -1456,11 +1456,9 @@ o:depends("type", "tuic") o.description = translate("If true, allowss insecure connection at TLS client, e.g., TLS server uses unverifiable certificates.") -- Xray 支持时间判断 -- if os.time() < os.time({year=2026,month=6,day=1}) then -if os.date("%Y.%m.%d") < "2026.06.01" then -- Xray 支持到 26.06.01 o:depends("tls", true) o:depends({ type = "v2ray", v2ray_protocol = "vless", reality = true }) -end if xray_version_val >= 260131 then -- Xray 版本大于等于 26.1.31 --- a/luci-app-ssr-plus/root/usr/share/shadowsocksr/shadowsocksr.config +++ b/luci-app-ssr-plus/root/usr/share/shadowsocksr/shadowsocksr.config @@ -65,3 +65,7 @@ config clash_client_group option ip_addr '' option client_mac '' option policy_group '' + +config server_subscribe_item + option enabled '1' + option alias 'Subscribe default'