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

56 lines
2.0 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/proxycast/config.yaml`,Linux: `~/.config/proxycast/config.yaml`,Windows: `%APPDATA%\\proxycast\\config.yaml`)
- 凭证池副本目录(导入的凭证文件):macOS `~/Library/Application Support/proxycast/credentials/`,Linux `~/.local/share/proxycast/credentials/`,Windows `%APPDATA%\\proxycast\\credentials\\`
- OAuth 凭证目录:`~/.proxycast/auth/`
- 数据库文件:`~/.proxycast/proxycast.db`
- 日志目录:`~/.proxycast/logs/`、`~/.proxycast/request_logs/`
恢复步骤(顺序建议):
1. 停止应用
2. 恢复 `config.yaml`
3. 恢复 `credentials` 目录、`auth` 目录与数据库 `proxycast.db`
4. 如需保留历史日志,恢复 `logs/` 与 `request_logs/`
5. 启动应用并验证 `/health` 与关键功能
## 回滚策略
- 如果升级失败,恢复备份的 `config.yaml` 与 `proxycast.db`
- 使用上一版本安装包覆盖安装
- 完成健康检查与冒烟测试
## 发布质量门槛(最小)
- `cd src-tauri && cargo test`
- `cd src-tauri && cargo clippy`
- `npm test`
- `npm run lint`
- `npm run build`