Files
qiniu-feishu-bot/start.sh
饭团 b00567762f Initial commit: 七牛云上传飞书机器人
功能:
- 飞书交互卡片支持
- 七牛云文件上传
- 自动 CDN 刷新
- 多存储桶配置
- 跨平台部署(Linux/macOS/Windows)
- Docker 支持
2026-03-05 14:22:26 +08:00

70 lines
1.7 KiB
Bash
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.
#!/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