Files
proxycast/docs/content/06.development/4.operations.md
T

64 lines
2.6 KiB
Markdown
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.
---
title: 上线运维
description: 生产就绪的最小运维清单
navigation:
icon: i-heroicons-wrench-screwdriver
---
# 上线运行与运维(生产就绪最小版)
本页面用于“马上上线且长期稳定运行”的最小运维闭环,避免上线后因配置、备份或回滚缺失导致不可恢复的问题。
## 上线前检查
- 确认服务仅本地监听:`server.host = 127.0.0.1`(当前版本仅支持本地监听)
- 设置强 API Key:不要使用默认值 `proxy_cast`
- 确认日志保留策略:`logging.retention_days` 合理(建议 >= 7 天)
- 确认凭证与配置已正确导入,并完成一次启动 + 健康检查
## 运行健康检查
- HTTP 健康检查:`GET /health`
- 关键字段应包含 `status=healthy` 与 `version`
- 建议在上线后做一次 API 冒烟请求(如 `/v1/models`)
## 备份与恢复(必须)
当前版本需要手动备份以下路径:
- 配置文件(macOS: `~/Library/Application Support/lime/config.yaml`,Linux: `~/.config/lime/config.yaml`,Windows: `%APPDATA%\\lime\\config.yaml`)
- 凭证池副本目录(导入的凭证文件):macOS `~/Library/Application Support/lime/credentials/`,Linux `~/.local/share/lime/credentials/`,Windows `%APPDATA%\\lime\\credentials\\`
- OAuth 凭证目录:`~/.lime/auth/`
- 数据库文件:`~/.lime/lime.db`
- 日志目录:`~/.lime/logs/`、`~/.lime/request_logs/`
恢复步骤(顺序建议):
1. 停止应用
2. 恢复 `config.yaml`
3. 恢复 `credentials` 目录、`auth` 目录与数据库 `lime.db`
4. 如需保留历史日志,恢复 `logs/` 与 `request_logs/`
5. 启动应用并验证 `/health` 与关键功能
## Windows 启动失败排查
- 优先确认用户安装的是 `Lime_*_x64-online-setup.exe`;离线、内网或受限网络环境再提供 `Lime_*_x64-offline-setup.exe`
- 首次启动若提示缺少运行时,优先重新运行 Windows setup 安装包;如果在线安装失败,再切换到 offline 安装包
- 检查 `%APPDATA%\lime\` 与 `%USERPROFILE%\.lime\` 是否可写;数据库、日志与部分运行时状态依赖这两个目录
- 收集 `%USERPROFILE%\.lime\logs\` 与 `%USERPROFILE%\.lime\request_logs\` 作为一线排障材料
- 若前端出现 Windows 启动自检提示,按提示项优先检查目录权限、数据库可访问性、WebView2 与 Shell 可用性
## 回滚策略
- 如果升级失败,恢复备份的 `config.yaml` 与 `lime.db`
- 使用上一版本安装包覆盖安装
- 完成健康检查与冒烟测试
## 发布质量门槛(最小)
- `cd src-tauri && cargo test`
- `cd src-tauri && cargo clippy`
- `npm test`
- `npm run lint`
- `npm run build`