08. 日常速查:核心配置文件与故障自愈清单
本章为日常运维、版本迁移与紧急排错的速查备忘手册。
一、核心配置文件物理路径清单
| 组件 | 所在机器 | 物理路径 | 主要作用 |
|---|---|---|---|
| WSL 宿主设置 | 家里 Windows | C:\Users\<username>\.wslconfig | 内存上限 (10G)、自动收缩、永不休眠 |
| WSL 内部设置 | 家里 Ubuntu | /etc/wsl.conf | Systemd 支持、磁盘权限与互通 |
| OpenCode 配置 | 家里 Ubuntu | ~/.config/opencode/opencode.jsonc | 模型 Provider、CLIProxyAPI 聚合参数 |
| OpenCode 服务 | 家里 Ubuntu | /etc/systemd/system/opencode.service | 7×24 小时开机自启守护与访问密码 |
| FRP 客户端 | 家里 Ubuntu | /etc/frp/frpc.toml | 跨网隧道映射 (4096 / 2222 / 33890) |
| FRP 客户端服务 | 家里 Ubuntu | /etc/systemd/system/frpc.service | 客户端后台自启与自愈 |
| FRP 服务端 | 香港轻量云 | /etc/frp/frps.toml | FRP 服务端监听与 Token |
| Nginx 反代配置 | 香港轻量云 | /etc/nginx/sites-available/opencode | 8443 SSL 回落反代至 OpenCode |
| CLIProxyAPI | 东京轻量云 | ~/cliproxyapi/config.yaml | 大模型聚合代理与 WARP SOCKS5 出口 |
| WARP 客户端 | 东京轻量云 | warp-cli (Proxy 模式 127.0.0.1:40000) | 破除 Google 机房 IP 风控 |
二、日常巡检常用命令
1. 家里 Ubuntu 侧
bash
# 查看 OpenCode 状态与端口
sudo systemctl status opencode
sudo ss -tulpn | grep 4096
# 查看 FRP 客户端连接状态
sudo systemctl status frpc
sudo journalctl -u frpc -n 20 --no-pager2. 香港中继服务器侧
bash
# 查看 FRP 服务端与 Nginx
sudo systemctl status frps
sudo nginx -t && sudo systemctl reload nginx
sudo ss -tulpn | grep -E "7000|8443|443"3. 东京算力网关侧
bash
# 查看模型聚合服务与出站代理
systemctl --user status cliproxyapi.service
warp-cli status
curl -x socks5h://127.0.0.1:40000 ifconfig.me三、三类最常见故障的一句话自愈指南
- 调用模型报
User location is not supported:- ➔ 原因:东京机器上的 WARP 代理断开,回落到了机房原生 IP。
- ➔ 解决:在东京服务器执行
warp-cli connect,并确认模式为proxy。
- 手机/Mac 访问网页显示
401 Unauthorized或密码错误:- ➔ 原因:请求成功到达 OpenCode,但凭据未通过。
- ➔ 解决:核对密码;若使用免密通道,重新访问一次
https://code.your-domain.com/login?key=你的密钥重新种下 Cookie。
- 网页无法打开(连接超时):
- ➔ 原因:家里宽带断网、或香港 FRP 客户端未连上。
- ➔ 解决:在家里 Ubuntu 执行
sudo systemctl restart frpc,看 journalctl 日志提示。