Initial commit: 七牛云上传飞书机器人

功能:
- 飞书交互卡片支持
- 七牛云文件上传
- 自动 CDN 刷新
- 多存储桶配置
- 跨平台部署(Linux/macOS/Windows)
- Docker 支持
This commit is contained in:
饭团
2026-03-05 14:22:26 +08:00
commit b00567762f
15 changed files with 2286 additions and 0 deletions

69
start.sh Normal file
View File

@@ -0,0 +1,69 @@
#!/bin/bash
# 七牛云上传机器人 - Linux/macOS 启动脚本
echo "========================================"
echo " 🍙 七牛云上传机器人"
echo "========================================"
echo ""
# 检查 Node.js
if ! command -v node &> /dev/null; then
echo "❌ 未检测到 Node.js请先安装 Node.js 18+"
echo "访问https://nodejs.org/"
exit 1
fi
echo "✅ Node.js 已安装:$(node --version)"
# 检查配置文件
if [ ! -f ".env" ]; then
echo "⚠️ 未找到 .env 文件,正在创建..."
cp .env.example .env
echo ""
echo "⚠️ 请先编辑 .env 文件,填入飞书和七牛云配置"
echo "按任意键打开 .env 文件..."
read -p ""
${EDITOR:-nano} .env
echo ""
echo "配置完成后按任意键继续..."
read -p ""
fi
# 检查七牛云配置
if [ ! -f "config/qiniu-config.json" ]; then
echo "⚠️ 未找到七牛云配置文件,正在创建..."
mkdir -p config
cp config/qiniu-config.json.example config/qiniu-config.json
echo ""
echo "⚠️ 请先编辑 config/qiniu-config.json 文件,填入七牛云配置"
echo "按任意键打开配置文件..."
read -p ""
${EDITOR:-nano} config/qiniu-config.json
echo ""
echo "配置完成后按任意键继续..."
read -p ""
fi
# 检查依赖
if [ ! -d "node_modules" ]; then
echo "📦 正在安装依赖..."
npm install
if [ $? -ne 0 ]; then
echo "❌ 依赖安装失败"
exit 1
fi
echo "✅ 依赖安装完成"
echo ""
fi
# 启动服务
echo ""
echo "🚀 正在启动服务..."
echo "📍 监听端口3000"
echo "📍 事件地址https://your-domain.com/feishu/event"
echo ""
echo "按 Ctrl+C 停止服务"
echo ""
node src/index.js