Update README and project cleanup
This commit is contained in:
42
start-tunnel.command
Executable file
42
start-tunnel.command
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
# macOS Cloudflare Tunnel 启动脚本
|
||||
|
||||
# 打开终端并显示在最前面
|
||||
osascript -e 'tell application "Terminal" to activate'
|
||||
|
||||
# 进入项目目录
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
echo "================================================"
|
||||
echo " 🚀 DMP Cloudflare Tunnel 启动工具"
|
||||
echo "================================================"
|
||||
echo ""
|
||||
|
||||
# 启动 Node.js 服务器(后台运行)
|
||||
echo "📦 正在启动 DMP 服务器..."
|
||||
node server.js &
|
||||
SERVER_PID=$!
|
||||
|
||||
echo "✅ DMP 服务已启动 (PID: $SERVER_PID)"
|
||||
echo "🌐 本地访问: http://localhost:3456"
|
||||
echo ""
|
||||
echo "⏳ 等待服务器启动..."
|
||||
sleep 3
|
||||
|
||||
# 启动 Cloudflare Tunnel
|
||||
echo ""
|
||||
echo "================================================"
|
||||
echo " 🔗 正在启动 Cloudflare Tunnel..."
|
||||
echo "================================================"
|
||||
echo ""
|
||||
echo "📌 公网访问地址: https://dmp.ink1ing.tech"
|
||||
echo ""
|
||||
|
||||
cloudflared tunnel --config cloudflare-tunnel.yml run dmp-tunnel
|
||||
|
||||
# 清理:当 tunnel 停止时,也停止 Node.js 服务器
|
||||
echo ""
|
||||
echo "🛑 正在停止服务..."
|
||||
kill $SERVER_PID 2>/dev/null
|
||||
echo "✅ 已停止"
|
||||
Reference in New Issue
Block a user