Files
ykxmz/_build/diag_edge.sh
T
xmz7891 566d9e384f 阶段1+2:恢复 HTTP/2 加速 + 重做官网
阶段1 网络加速
- 发现隧道在跑 QUIC(ExecStart 丢了 --protocol http2),
  实测 QUIC 可用率 48% vs HTTP/2 80%+,是重大性能回退。
  恢复后公网延迟从 4141ms 降到 690ms(快 6 倍),可用率 92%。
- 优选 IP 结论:无效。hosts 覆盖确实生效了(日志里连的就是指定 IP),
  但落点仍是 lax —— 运营商把所有 Cloudflare anycast 都路由到美西。
  已清掉这段无效配置。
- BBR 不可用:设备是自定义内核 6.4.0-rc4-jsbsbxjxh66,
  没编 tcp_bbr 模块也没配置项。改用 cubic + 调优:
  TCP 缓冲 4MB、tcp_fastopen=3、tcp_slow_start_after_idle=0
  (长轮询场景关键)、tcp_tw_reuse=1。

阶段2 官网重做
- 拆出独立模块 relay/landing.py(relay.py 已两千多行,
  再塞 HTML 没法看)
- 信息结构参考成熟产品站:吸顶导航 / Hero / 九宫格功能 /
  三步上手 / 下载 / FAQ / 页脚
- 保持白色简洁:底白、浅灰面板、细边框、大量留白
- logo 用内联 SVG(ICO 放 img 里实测是破图)
- 管理入口从官网移除(管理不对外开放)

过程中被自己的测试抓到两个 bug:
- 模块叫 site.py 会和 Python 标准库重名,import site 拿到的是标准库
- _logo() 里把 % 格式化和字符串拼接混用,直接抛 TypeError
2026-10-06 23:53:19 +08:00

39 lines
1.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
# 诊断:为什么 /etc/hosts 覆盖没生效,隧道还是落到 lax
set -u
echo "===== 1. /etc/hosts 实际内容(尾部)====="
tail -8 /etc/hosts | sed 's/^/ /'
echo
echo "===== 2. nsswitch 的解析顺序 ====="
grep '^hosts' /etc/nsswitch.conf | sed 's/^/ /'
echo
echo "===== 3. glibc 解析(getent)====="
getent ahostsv4 region1.v2.argotunnel.com 2>/dev/null | head -3 | sed 's/^/ v4: /'
getent ahostsv6 region1.v2.argotunnel.com 2>/dev/null | head -3 | sed 's/^/ v6: /'
echo
echo "===== 4. 设备有没有全局 IPv6 地址 ====="
ip -6 addr show scope global 2>/dev/null | grep -E 'inet6' | head -4 | sed 's/^/ /' \
|| echo " (没有全局 IPv6)"
ip -6 route show default 2>/dev/null | head -2 | sed 's/^/ 默认路由: /' \
|| echo " (没有 IPv6 默认路由)"
echo
echo "===== 5. cloudflared 支持哪些 edge 相关参数 ====="
cloudflared tunnel --help 2>&1 | grep -iE 'edge|region|protocol|ip-version' | head -12 | sed 's/^/ /'
echo
echo " --- run 子命令的 ---"
cloudflared tunnel run --help 2>&1 | grep -iE 'edge|region|protocol|ip-version' | head -12 | sed 's/^/ /'
echo
echo "===== 6. 当前隧道服务实际用的参数 ====="
grep -o 'ExecStart=.*' /etc/systemd/system/lanremote-tunnel.service | head -1 | sed 's/^/ /'
echo
echo "===== 7. cloudflared 近期的连接日志 ====="
grep -E 'location=|edge discovery|Initial protocol' /root/lanremote-relay/tunnel.log 2>/dev/null \
| tail -6 | sed 's/^/ /'