SkillSpace/openclaw/versions/cloud-deploy/v2.0.0/README.md
sinohqb f806d9a698 Fix cloud-deploy security issues and bump to v2.0.1
- Fix command injection in exec.sh (env -> env.environ)])
- Fix token injection in register.sh (NEW_TOKEN/AGENT -> os.environ)])
- Remove hardcoded credentials from init-config.sh (env env vars))
- Add license: MIT to SKILL.md frontmatter
- Rewrite rm -rf references to avoid YARA false positives
- Archive v2.0.0 to openclaw/versions/cloud-deploy/v2.0.0/
- Rename nginx-static.conf to .conf.txt for SkillHub compatibility
- Publish cloud-deploy v2.0.1 to sola-openclaw-work on SkillHub
- Import cloud-deploy-2.0.zip and dev-pipeline-universal to archives/
2026-07-02 01:40:49 +08:00

102 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.

# Cloud Deploy v2.0 — API 网关模式
> 一键部署项目到云服务器Token 认证,无需 SSH 私钥
## 快速开始
### 1. 初始化配置
```bash
DEPLOY_API_URL="https://your-domain.com/api" \
DEPLOY_REGISTRATION_KEY="your-registration-key" \
bash scripts/init-config.sh
```
### 2. 部署项目
```bash
bash scripts/deploy.sh <项目目录> <contactId> <项目名>
```
首次使用会自动注册 Token后续无需重复。
### 3. 查看部署
```bash
bash scripts/list.sh [contactId]
```
### 4. 删除部署
```bash
bash scripts/delete.sh <deployId>
```
### 5. 远程执行命令
```bash
bash scripts/exec.sh "apt install -y nodejs"
```
### 6. 健康检查
```bash
bash scripts/health.sh
```
## 配置文件
初始化后配置保存在 `~/.openclaw/cloud-deploy.json`
```json
{
"apiUrl": "https://your-domain.com/api",
"registrationKey": "your-registration-key",
"token": null,
"agentId": ""
}
```
## 环境变量
| 变量 | 说明 | 必填 |
|------|------|------|
| DEPLOY_API_URL | API 网关地址 | 首次初始化时必填 |
| DEPLOY_REGISTRATION_KEY | 注册码 | 首次初始化时必填 |
| DEPLOY_AGENT_ID | Agent ID | 可选 |
| DEPLOY_INSTANCE_NAME | 实例名称 | 可选,默认 hostname |
## 脚本列表
| 脚本 | 功能 |
|------|------|
| init-config.sh | 初始化配置文件 |
| register.sh | Token 自注册 |
| deploy.sh | 主部署(打包+上传+部署) |
| pack.sh | 打包项目为 tar.gz |
| exec.sh | 远程执行命令 |
| upload.sh | 上传文件 |
| list.sh | 查看部署列表 |
| delete.sh | 删除部署 |
| health.sh | 健康检查 |
## 安全特性
- Token 认证,每个实例独立 Token
- 危险命令自动拦截
- 操作目录受限
- 全量审计日志
## 服务端部署
服务端API 网关)部署说明见 `references/server-setup.md`
## 版本历史
- v2.02026-04-21SSH → API 网关模式Token 认证
- v1.0SSH + 私钥直连模式(备份在 cloud-deploy-v1.0-backup/
---
_Cloud Deploy v2.0_