Files
MemRelay/projects/4f53c06a-c6c3-40ec-b2fc-5f019ea45fc0/curated/development/项目 CPE 运行与维护手册.md
T

89 lines
3.2 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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: 项目 CPE 运行与维护手册
type: curated
permalink: main/projects/4f53c06a-c6c3-40ec-b2fc-5f019ea45fc0/curated/development/项目-cpe-运行与维护手册
stable_id: 9d1ffd0c-9758-495f-ab5f-20e2ebff3034
scope: project
project_id: 4f53c06a-c6c3-40ec-b2fc-5f019ea45fc0
workspace_type: development
usage_profile_id: null
preference_context: development
document_type: maintenance
revision: 1
source_memory_ids: []
source_checkpoint_ids: []
source_file_ids: []
source_git_commit: de28dc8246094e2bc17cab7c764fb4d4a2da71e0
source_git_commits:
- de28dc8246094e2bc17cab7c764fb4d4a2da71e0
source_agent_sync_ids: []
model_connection: Sub2API
model_name: git-restore
source_count: 188
source_revisions: {}
source_dispositions:
processed: 188
unchanged: 0
unsupported: 0
skipped: 0
cited_source_ids:
- git:backend/src/config.rs
- git:backend/src/usb_switch.rs
- git:backend/src/handlers.rs
- git:frontend/src/pages/ATConsole.tsx
- git:frontend/src/pages/Configuration.tsx
- global_guidance_memory:bf88c265-4749-4c50-85bc-4bae25298cd5
- global_guidance_document:6973450e-6ecc-48e3-8cdd-4d7d7707d843
job_cited_source_ids:
- git:backend/src/config.rs
- git:backend/src/usb_switch.rs
- git:backend/src/handlers.rs
- git:frontend/src/pages/ATConsole.tsx
- git:frontend/src/pages/Configuration.tsx
- global_guidance_memory:bf88c265-4749-4c50-85bc-4bae25298cd5
- global_guidance_document:6973450e-6ecc-48e3-8cdd-4d7d7707d843
conflicts: []
supersedes: []
preferences: []
source_cursor: 87
source_hash: 96f0e4026558c8a03161f53b392fcec7359d4d701c4f33576b44e2f308b0ec5a
prompt_version: 2026-08-12.3
schema_version: '3'
curation_job_id: null
created_at: '2026-08-19T18:49:47.691587+00:00'
updated_at: '2026-09-23T14:55:04.315845+00:00'
tags:
- 运行
- 维护
- 故障排查
- 安全
- 配置
restored_from_commit: 6a6a895eafcca6052e81a14fca103a42635dd1c2
---
# 项目 CPE 运行与维护手册
## 组件概览
- 后端服务 (Rust + Axum) 监听 `0.0.0.0:3000`
- 前端 (React + Vite) 位于 `/home/root/www/`
- 可选 FRPC 客户端 `frpc`,配置文件 `frpc.toml`
- USB Gadget 切换实现于 `backend/src/usb_switch.rs`
- OTA 更新通过 `scripts/pack-ota.sh` 生成的包,由后端 `ota.rs` 校验并原子替换。
## 配置管理
- 主配置 `config.json` 支持热重载,涉及 `WebhookConfig`、`SmsPushConfig`、`RefreshConfig`、`FrpcConfig`、`AppConfig`(见 `backend/src/config.rs`)。
- 敏感信息应通过 Vaultwarden 或加密文件注入,前端 UI 仅显示占位。
## 常规运维任务
- **日志**: 后端通过 `tracing` 输出,容器可 `docker logs`;FRPC 日志轮转 512 KB。
- **系统资源**: Dashboard 实时展示 CPU、内存、磁盘、网络、温度、运行时间。
- **OTA 更新流程**: 上传 `.tar.gz` → 后端 `validate_ota_package()` 检查版本、架构、校验和 → 原子 `rename` 完成更新。
- **USB 切换**: UI 调用 `switch_usb_mode_advanced`,在 `/mnt/data/mode.cfg` 写入模式并重新启用 UDC。
## 未决事项
1. OTA 包签名校验与回滚机制(A/B 分区)。
2. HTTP API token/白名单安全。
3. 敏感凭证统一 Vaultwarden 管理。
4. Docker 基础镜像升级至 `ubuntu:24.04`。
**标签**: ["运行","维护","故障排查","安全","配置"]