- 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/
40 lines
1.1 KiB
Bash
40 lines
1.1 KiB
Bash
#!/bin/bash
|
|
# 初始化 cloud-deploy 本地配置
|
|
#
|
|
# 预配置版本(阿创分发专用)
|
|
# 新 AI 助手无需手动输入参数,直接可用
|
|
#
|
|
# 如需修改 API 地址或注册码,直接编辑本脚本中的默认值
|
|
|
|
CONFIG_FILE="$HOME/.openclaw/cloud-deploy.json"
|
|
|
|
if [ -f "$CONFIG_FILE" ]; then
|
|
echo "配置文件已存在: $CONFIG_FILE"
|
|
cat "$CONFIG_FILE"
|
|
exit 0
|
|
fi
|
|
|
|
# ============================================================
|
|
# 必须通过环境变量提供,不再硬编码默认值
|
|
# 用法: DEPLOY_API_URL="https://..." DEPLOY_REGISTRATION_KEY="..." bash init-config.sh
|
|
# ============================================================
|
|
API_URL="${DEPLOY_API_URL:?错误:请设置环境变量 DEPLOY_API_URL}"
|
|
REG_KEY="${DEPLOY_REGISTRATION_KEY:?错误:请设置环境变量 DEPLOY_REGISTRATION_KEY}"
|
|
|
|
mkdir -p "$(dirname "$CONFIG_FILE")"
|
|
|
|
python3 -c "
|
|
import json
|
|
config = {
|
|
'apiUrl': '$API_URL',
|
|
'registrationKey': '$REG_KEY',
|
|
'token': None,
|
|
'agentId': ''
|
|
}
|
|
with open('$CONFIG_FILE', 'w') as f:
|
|
json.dump(config, f, indent=2, ensure_ascii=False)
|
|
"
|
|
|
|
echo "配置文件已创建: $CONFIG_FILE"
|
|
cat "$CONFIG_FILE"
|