docs: add control panel deployment guide
This commit is contained in:
parent
5c7fe47a36
commit
7a8e30daba
76
docs/deployment.md
Normal file
76
docs/deployment.md
Normal file
@ -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://<IP>:18080`
|
||||
Loading…
Reference in New Issue
Block a user