sh2/d2ypp2/readme2.txt
eric 3bc2cf6a1e Harden WG+Neko install defaults, Neko proxy egress probe, and YouTube multi-Pro UI.
WireGuard overlay persists remote NAT1TO1 at install, opens WebRTC via ShellCrash trusted CIDRs, and reconfigures Neko after wg-quick restarts. Neko proxy probes Google before proxycheap. Console defaults to multi-channel Pro; docs updated.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-26 06:54:14 -05:00

60 lines
3.7 KiB
Plaintext
Raw Permalink 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.

项目修复记录(2026-05-17)
1. 本次实际修复的 bug
- 单频道 YouTube / 抖音转 YouTube:
旧逻辑只要检测到任意一个托管配置文件存在,就会把 `youtube.ini` 和 `URL_config.ini` 整对切到托管路径;当只生成了一半托管文件时,会把另一半旧配置绕掉,导致推流 key 或房间 URL 丢失。现已改为“按文件粒度回退”。
- 多频道 Pro:
前端从服务端拉取频道列表时,空列表会被误判成“拉取失败”,随后回退到浏览器本地缓存,导致页面继续显示旧频道。现已把“成功拉到空列表”和“请求失败”区分开。
- 进程重启:
`web.py` 的重启接口原先在 `restart()` 之后再 `force_kill_ffmpeg()`,会把刚拉起的新 ffmpeg 一并杀掉。现已改为先清理旧 ffmpeg,再执行重启。
- PM2 状态污染:
PM2 `start/stop/restart/resurrect` 失败时,旧代码仍会把进程标记成期望运行并保存状态,控制台会显示假在线。现已改为只有返回码为 0 才更新 desired 状态。
- PM2 自恢复卡死:
`src/web_process_backend.py` 把一些很小的本地文件读写放进 `asyncio.to_thread()`;在当前环境里这条路径会卡住,导致 PM2 进程表恢复逻辑不返回。现已改为直接同步执行这些轻量操作。
- Neko 浏览器:
`DeveloperToolsAvailability` 原来是 `2`,会直接禁用开发者工具;同时启动参数带 `--bwsi`,会破坏扩展持久化和 Tampermonkey 行为。现已改为允许 DevTools,并移除 `--bwsi`。
2. 本次改动的关键文件
- 后端:
`src/youtube_config_paths.py`
`youtube.py`
`src/web_process_backend.py`
`web.py`
- 前端:
`web-console/lib/youtubeProChannels.ts`
`web-console/components/live-product/LiveYoutubeUnmannedView.tsx`
`web-console/out/*`(已重新构建静态产物)
- Neko:
`services/neko/policies/policies.json`
`services/neko/google-chrome.conf`
`services/neko/chromium.conf`
`services/neko/browser-launch.sh`
3. 验证结果
- 已通过:
`python -m compileall -q src web.py youtube.py douyin_youtube_ffplay.py tests`
`python -m unittest -q tests.test_web_process_backend tests.test_web_dynamic_processes tests.test_youtube_config_paths tests.test_neko_config tests.test_youtube_push_config tests.test_youtube_pro_runtime`
- 前端已使用 Node 20 重新执行 `web-console` 构建,新的 `web-console/out` 已生成。
4. 部署注意
- `live.local` 实际运行目录不是当前仓库 `/home/eric/sh/d2ypp2`,而是 `/home/eric/d2ypp`。
- 如果只改当前目录而不把修复同步到 `/home/eric/d2ypp`,`live.local` 不会生效。
---
项目修复记录(2026-08-26)
1. 一键安装 / Neko / WireGuard
- WireGuard overlay 上线后,`install_neko_browser` 与 `service_ctl neko` 通过 `sync_neko_wireguard_remote_access` 自动写入 `NEKO_ACCESS_MODE=remote`、`NEKO_WIREGUARD_HOST`、`NEKO_WEBRTC_NAT1TO1`,避免 WebRTC 仍广播物理网 IP 导致黑屏/重连。
- `ensure_neko_webrtc_ports_for_trusted_cidrs` 在 ShellCrash WAN 防火墙下为 overlay 网段放行 Neko HTTP/WebRTC;`wireguard_watch` 在 WG 重启后自动 reconfigure Neko。
- Neko 浏览器代理:`shellcrash_proxy_egress_ready` 实测 Google 204 后再选端口;proxycheap `:7894` 不可用时保持 `ENABLE_NEKO_BROWSER_PROXY=0`,走 mixed `:7890`。
2. YouTube 无人直播控制台
- 默认多频道 Pro,隐藏「单频道 / 多频道」切换条(`HIDE_YOUTUBE_MODE_TOGGLE`)。
3. 关键文件
- `scripts/linux/lib/common.sh`、`scripts/linux/service_ctl.sh`、`scripts/linux/wireguard_watch.sh`
- `src/network_preflight.py`、`src/wireguard_config.py`
- `web-console/components/live-product/LiveYoutubeUnmannedView.tsx`
- `docs/deploy-hardening.md`、`README.md`