Files
onion-dmp/README_DEPLOYMENT.md
2026-04-08 14:52:09 +08:00

158 lines
3.8 KiB
Markdown
Raw Permalink 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.
# 🎉 DMP Cloudflare Tunnel 部署完成指南
## 📊 当前状态
### ✅ 已完成
- ✅ Cloudflare 账号认证
- ✅ Cloudflare Tunnel 创建 (dmp-tunnel)
- ✅ Node.js 服务器运行中 (localhost:3456)
- ✅ Tunnel 连接已建立
- ✅ 部署脚本已创建
### ⚠️ 待完成(只需 2 分钟)
- ⚠️ 修复 DNS 记录指向新的 Tunnel
---
## 🚀 最后一步:修复 DNS二选一
### 方法 1Cloudflare Dashboard推荐
1. **打开浏览器**访问https://dash.cloudflare.com/
2. **登录账号**huinkling@gmail.com
3. **选择域名**ink1ing.tech
4. **进入 DNS 设置**:左侧菜单 → DNS → 记录
5. **找到记录**:名称为 `dmp` 的 CNAME 记录
6. **编辑记录**
- 点击 **编辑** 按钮
-**内容** 改为:`d8a6a4cd-4ddf-4122-92f1-b3d961aca422.cfargotunnel.com`
- 确保 **代理状态** 为已代理(橙色云朵 ☁️)
- 点击 **保存**
### 方法 2命令行
如果你在 Dashboard 中删除了旧的 `dmp` 记录,在终端运行:
```bash
cd /Users/inkling/Desktop/dmp
cloudflared tunnel route dns d8a6a4cd-4ddf-4122-92f1-b3d961aca422 dmp.ink1ing.tech
```
---
## 🌐 访问你的应用
完成 DNS 配置后,等待 1-2 分钟,然后访问:
- **公网地址**https://dmp.ink1ing.tech
- **本地地址**http://localhost:3456
---
## 📂 项目文件说明
```
dmp/
├── 快速修复指南.txt # 快速参考(推荐先看这个)
├── DEPLOYMENT_STATUS.md # 详细部署状态
├── CLOUDFLARE_DEPLOYMENT.md # 完整部署文档
├── cloudflare-tunnel.yml # Tunnel 配置文件
├── start-tunnel.command # macOS 一键启动(推荐)
├── start-tunnel.sh # 终端启动脚本
├── setup-tunnel.sh # 初始设置脚本(已运行完成)
├── fix-dns.sh # DNS 修复辅助脚本
└── server.js # DMP 应用主程序
```
---
## 🔄 日常使用
### 启动服务
**macOS 用户(推荐)**
```
双击运行start-tunnel.command
```
**终端用户**
```bash
cd /Users/inkling/Desktop/dmp
./start-tunnel.sh
```
这会自动启动:
1. Node.js 服务器(端口 3456
2. Cloudflare Tunnel
### 停止服务
在运行 Tunnel 的终端窗口按 `Ctrl+C`
### 查看状态
```bash
# 查看所有 tunnels
cloudflared tunnel list
# 查看 dmp-tunnel 详情
cloudflared tunnel info dmp-tunnel
# 测试本地服务
curl http://localhost:3456
# 测试公网访问
curl https://dmp.ink1ing.tech
```
---
## 🛠 技术信息
- **Tunnel ID**: d8a6a4cd-4ddf-4122-92f1-b3d961aca422
- **Tunnel 名称**: dmp-tunnel
- **域名**: dmp.ink1ing.tech
- **本地端口**: 3456
- **协议**: QUIC
- **凭证文件**: ~/.cloudflared/d8a6a4cd-4ddf-4122-92f1-b3d961aca422.json
---
## ❓ 常见问题
### Q: 公网访问返回 530 错误?
**A**: 确保本地服务器和 Tunnel 都在运行。运行 `./start-tunnel.sh`
### Q: 公网访问返回 1033 错误?
**A**: DNS 配置问题,按照上面的步骤修复 DNS 记录。
### Q: 如何让服务开机自启?
**A**: 运行 `sudo cloudflared service install`
### Q: 如何查看 Tunnel 日志?
**A**: 在运行 `start-tunnel.sh` 的终端窗口中查看实时日志。
---
## 📞 需要帮助?
查看详细文档:
- `快速修复指南.txt` - 快速参考
- `DEPLOYMENT_STATUS.md` - 当前状态
- `CLOUDFLARE_DEPLOYMENT.md` - 完整指南
---
## ✨ 下一步
1.**现在**: 修复 DNS 记录(见上方说明)
2.**等待**: 1-2 分钟 DNS 传播
3. 🎯 **测试**: 访问 https://dmp.ink1ing.tech
4. 🎉 **成功**: 你的应用已部署到全球互联网!
---
**生成时间**: 2026-04-06
**部署账号**: huinkling@gmail.com
**域名**: ink1ing.tech