Files
openclaw-skill-qiniu/scripts/setup.sh
daoqi 1aeae9cc51 initial: 七牛云上传 OpenClaw Skill
功能特性:
- 支持 /upload, /u 命令上传文件到七牛云
- 支持 /qiniu-config 配置管理
- 支持飞书卡片交互
- 支持指定上传路径和存储桶
- 自动刷新 CDN 缓存
- 支持文件覆盖上传

包含组件:
- OpenClaw 处理器 (openclaw-processor.js)
- 独立监听器 (scripts/feishu-listener.js)
- 核心上传脚本 (scripts/upload-to-qiniu.js)
- 部署脚本 (deploy.sh)
- 完整文档

部署方式:
1. 复制 skill 到 ~/.openclaw/workspace/skills/
2. 配置 ~/.openclaw/credentials/qiniu-config.json
3. 重启 OpenClaw Gateway
2026-03-07 16:02:18 +08:00

85 lines
2.2 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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.
#!/bin/bash
# 🍙 七牛云上传技能 - 快速配置脚本
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "🍙 七牛云上传技能 - 快速配置"
echo "================================"
echo ""
# 1. 检查七牛云配置
QINIU_CONFIG="$HOME/.openclaw/credentials/qiniu-config.json"
if [ ! -f "$QINIU_CONFIG" ]; then
echo "📝 配置七牛云凭证..."
echo ""
echo "请复制配置模板并编辑:"
echo " cp qiniu-config.example.json ~/.openclaw/credentials/qiniu-config.json"
echo ""
read -p "按回车继续..."
if [ ! -f "$QINIU_CONFIG" ]; then
cp qiniu-config.example.json "$QINIU_CONFIG"
echo "✅ 已复制配置模板到:$QINIU_CONFIG"
echo ""
echo "请编辑文件并填写你的七牛云信息:"
echo " - AccessKey"
echo " - SecretKey"
echo " - Bucket 名称"
echo " - 区域代码"
echo " - CDN 域名"
echo ""
read -p "编辑完成后按回车继续..."
fi
else
echo "✅ 七牛云配置已存在"
fi
# 2. 配置飞书环境变量
if [ ! -f ".env" ]; then
echo ""
echo "📝 配置飞书环境变量..."
cp .env.example .env
echo "✅ 已创建 .env 文件"
echo ""
echo "请编辑 .env 文件并填写:"
echo " - FEISHU_VERIFY_TOKEN自定义"
echo " - FEISHU_ENCRYPT_KEY从飞书开放平台获取"
echo ""
read -p "按回车继续..."
else
echo "✅ 飞书环境变量已配置"
fi
# 3. 检查 Node.js
if ! command -v node &> /dev/null; then
echo "❌ 未找到 Node.js请先安装 Node.js"
exit 1
fi
echo ""
echo "✅ 配置完成!"
echo ""
echo "================================"
echo "📋 下一步:"
echo ""
echo "1⃣ 配置飞书开放平台事件订阅"
echo " 查看详细说明cat FEISHU_SETUP.md"
echo ""
echo "2⃣ 启动 URL 验证服务(首次配置)"
echo " ./scripts/verify-url.js"
echo ""
echo "3⃣ 验证通过后,启动正式监听器"
echo " ./scripts/start-listener.sh"
echo ""
echo "4⃣ 在飞书中测试"
echo " 发送:/upload 文件名.pdf"
echo " 附上文件"
echo ""
echo "================================"
echo ""