Files
ykxmz/_build/diag_1033.sh
T
xmz7891 b62ac865ea ykxmz 1.5.0:修复手表端 TLS 证书校验 + MTU 修复网络稳定性
被控端
- 修复 MTU 问题:夹 MSS + 路径 MTU 探测(公网可用率 48% -> 100%)
- 复用 HTTP 连接(免掉每次新建 TLS 的 30% 握手失败)
- 每分钟回头找局域网,自动切回快 400 倍的路径
- 画面心跳帧:静止时省流量,客户端仍知道流是活的
- 锁屏时给出可操作的提示

手表端
- 内置 GTS Root R4 / GlobalSign Root CA,修 SSLHandshakeException
- 连接错误翻译成人话(证书/时间/解析/超时分别提示)
- 经中转连上后用服务器报的地址刷新已配对记录
- 新增局域网连接页面、服务器延迟检测

服务器端
- 支持 chunked 请求体(修每 16 秒一次的连接错乱与大面积 502)
- 网络调优脚本 net-tune.sh(开机自动应用)
- 管理页:批量删除、网络体检、下载区
- 隧道改 HTTP/2 + 双连接

文档
- 许可协议 / 安装前必读 / 安装后须知(作者:小麦子)
2026-10-06 19:01:05 +08:00

60 lines
2.5 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 深挖:"被控端一提交配对码,隧道就掉(1033)"
#
# 1033 = cloudflared 没连上 Cloudflare(不是 502 那种源站问题)
# 所以要看:cloudflared 是不是被杀 / OOM / 崩了
set -u
RELAY_DIR=/root/lanremote-relay
URL=https://relay.xxmxxs.top
echo "===== 1. 内存(460MB 的小机器,OOM 是头号嫌疑)====="
free -m | sed 's/^/ /'
echo -n " swap: "
swapon --show 2>/dev/null | tail -1 || echo "(没有 swap)"
echo
echo "===== 2. 内核有没有杀进程(OOM killer)====="
dmesg 2>/dev/null | grep -iE 'killed process|out of memory|oom' | tail -8 | sed 's/^/ /' || echo " 读不到 dmesg"
echo " journal 里的 OOM:"
journalctl -k --no-pager 2>/dev/null | grep -iE 'killed process|oom' | tail -6 | sed 's/^/ /' || echo " 没有"
echo
echo "===== 3. 服务重启过几次 ====="
for s in lanremote-relay lanremote-tunnel; do
printf " %-22s NRestarts=%s 状态=%s\n" "$s" \
"$(systemctl show $s -p NRestarts --value 2>/dev/null)" \
"$(systemctl is-active $s 2>/dev/null)"
echo " 最近 3 条日志:"
journalctl -u "$s" --no-pager -n 3 2>/dev/null | sed 's/^/ /'
done
echo
echo "===== 4. 现在各进程吃多少内存 ====="
ps -eo rss,comm --sort=-rss 2>/dev/null | head -10 | sed 's/^/ /'
echo
echo "===== 5. 隧道连接数 + 公网 ====="
echo -n " ha_connections = "
curl -s --max-time 5 http://127.0.0.1:20241/metrics 2>/dev/null \
| grep '^cloudflared_tunnel_ha_connections' | awk '{print $2}'
echo " 公网: HTTP $(timeout 15 curl -4 -s -o /dev/null -w '%{http_code}' \
-H 'User-Agent: LanRemote/1.4.0' $URL/v1/health 2>/dev/null)"
echo
echo "===== 6. 看门狗最近动作 ====="
tail -10 "$RELAY_DIR/watchdog.log" 2>/dev/null | sed 's/^/ /'
echo
echo "===== 7. 中转自身的内存上限 ====="
echo " relay 的 MemoryMax: $(systemctl show lanremote-relay -p MemoryMax --value 2>/dev/null)"
echo " tunnel 的 MemoryMax: $(systemctl show lanremote-tunnel -p MemoryMax --value 2>/dev/null)"
echo " relay 的 MemoryCurrent: $(systemctl show lanremote-relay -p MemoryCurrent --value 2>/dev/null)"
echo " tunnel 的 MemoryCurrent: $(systemctl show lanremote-tunnel -p MemoryCurrent --value 2>/dev/null)"
echo
echo "===== 8. 系统整体 OOM 配额 ====="
cat /proc/sys/vm/panic_on_oom 2>/dev/null | sed 's/^/ panic_on_oom=/'
cat /proc/sys/vm/oom_kill_allocating_task 2>/dev/null | sed 's/^/ oom_kill_allocating_task=/'
echo " 设备内存: $(grep MemTotal /proc/meminfo | awk '{print int($2/1024)}') MB"