From 7a8e30dabacc351812047b048604f2f0bd863ed9 Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Tue, 21 Jul 2026 18:17:44 +0800 Subject: [PATCH] docs: add control panel deployment guide --- docs/deployment.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 docs/deployment.md diff --git a/docs/deployment.md b/docs/deployment.md new file mode 100644 index 0000000..c2eed51 --- /dev/null +++ b/docs/deployment.md @@ -0,0 +1,76 @@ +# SafeSight Control 部署指南 + +## 打包 + +在开发机上: + +```bash +cd safesight-control +bash scripts/package.sh +``` + +生成 `safesight-control-*.tar.gz`,包含 ARM64 和 AMD64 两个二进制。 + +--- + +## 部署 + +### 部署到 Edge 设备(ARM64) + +```bash +# 传到设备 +scp safesight-control-*.tar.gz orangepi@10.0.0.81:/tmp/ + +# 在设备上 +cd /tmp && tar -xzf safesight-control-*.tar.gz +cd safesight-control-* +sudo cp safesightd-linux-arm64 /usr/local/bin/safesightd +sudo chmod +x /usr/local/bin/safesightd + +# 创建配置 +sudo mkdir -p /opt/safesightd/config +sudo cp safesightd.json.example /opt/safesightd/config/safesightd.json +sudo vi /opt/safesightd/config/safesightd.json # 修改 agent_token + +# 安装服务 +sudo cp safesightd.service /etc/systemd/system/ +sudo systemctl daemon-reload +sudo systemctl enable --now safesightd +``` + +### 部署到独立 Linux 服务器(AMD64) + +```bash +# 同上,使用 safesightd-linux-amd64 +sudo cp safesightd-linux-amd64 /usr/local/bin/safesightd +``` + +其余步骤相同。 + +--- + +## 配置 + +编辑 `/opt/safesightd/config/safesightd.json`: + +```json +{ + "listen": "0.0.0.0:18080", + "discovery_port": 35688, + "agent_token": "<与 edge agent 相同的 token>", + "concurrency": 5, + "data_dir": "/opt/safesightd/data", + "offline_after_ms": 10000 +} +``` + +--- + +## 验证 + +```bash +systemctl status safesightd +curl http://localhost:18080/health +``` + +浏览器打开 `http://:18080`