safesight-control/docs/deployment.md
2026-07-21 18:19:54 +08:00

77 lines
1.4 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.

# 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": "4fe2d69fda23d0d5d04a1486d4920e68",
"concurrency": 5,
"data_dir": "/opt/safesightd/data",
"offline_after_ms": 10000
}
```
---
## 验证
```bash
systemctl status safesightd
curl http://localhost:18080/health
```
浏览器打开 `http://<IP>:18080`