Files
tobiichiGPT/QUICKSTART.md
ChenKaiLiuG 506836f22e Update
2025-12-20 01:09:27 +08:00

123 lines
3.0 KiB
Markdown
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.
# TobiichiGPT - 快速設定指南
## 📦 一鍵啟動
```powershell
# 進入 docker-stack 目錄
cd docker-stack
# 啟動所有服務
docker-compose up -d
```
## 🌐 服務清單
| 服務 | 網址 | 用途 |
|------|------|------|
| Open WebUI | http://localhost:3000 | 用戶對話介面 |
| 管理員後台 | http://localhost:8000/admin | 真人回覆訊息 |
| NPM 管理面板 | http://localhost:82 | 反向代理設定 |
| Cloudflare Tunnel | 自動連線 | 公開訪問(需設定) |
## ⚙️ Open WebUI 設定步驟
1. 開啟 http://localhost:3000
2. 進入 **Settings****Connections**
3. 點擊 **+ Add OpenAI Connection**
4. 填入:
- **API Base URL**: `http://human-reply-server:8000/v1`
- **API Key**: `sk-human` (隨便填)
5. 模型列表會出現 **human-admin**
## 💬 使用流程
### 用戶端
1. 在 Open WebUI 選擇 `human-admin` 模型
2. 輸入訊息後送出
3. 等待管理員回覆(畫面會轉圈)
### 管理員端
1. 訪問 http://localhost:8000/admin
2. 看到新訊息通知
3. 在文字框輸入回覆
4. 點擊「送出回覆」
## 🔒 設定 HTTPS
### 方法 1: 使用 NPM本機 NPM
1. 訪問 http://localhost:82
2. 登入預設帳密admin@example.com / changeme
3. 首次登入會要求更改密碼
4. 新增 Proxy Host
- **Domain Names**: 你的網域 (例如: chat.example.com)
- **Forward Hostname**: `open-webui`
- **Forward Port**: `8080`
- 勾選 **SSL** → 申請 Let's Encrypt 憑證
### 方法 2: 使用 Cloudflare Tunnel推薦
1. 前往 https://one.dash.cloudflare.com/
2. 建立 Tunnel 並複製 Token
3. 編輯 `docker-stack/.env`,填入 Token
4. 在 Cloudflare 設定 Public Hostname
- `chat.yourdomain.com``open-webui:8080`
- `admin.yourdomain.com``human-reply-server:8000`
5. 自動獲得 HTTPS + DDoS 保護
## 🛠️ 常用指令
```powershell
# 查看服務狀態
docker-compose ps
# 查看日誌
docker-compose logs -f
# 重啟服務
docker-compose restart
# 停止服務
docker-compose down
# 完全移除(包含資料)
docker-compose down -v
```
## 🐛 疑難排解
### Open WebUI 連不到人工回覆伺服器
- 確認 API URL 使用 `http://human-reply-server:8000/v1`(容器名稱)
- 不要使用 `localhost:8000`
### 管理員後台打不開
- 確認容器是否正常運行:`docker ps`
- 查看錯誤日誌:`docker logs tobiichi-gpt`
### NPM 無法訪問
- 確認 port 81 沒有被佔用
- Windows 防火牆可能需要開放 port
## 📝 Port 對應
### 本機訪問
| 容器內 Port | 本機 Port | 服務 |
|------------|----------|------|
| 8080 | 3000 | Open WebUI |
| 8000 | 8000 | 人工回覆 API |
| 80 | 8080 | 本專案 NPM HTTP |
| 443 | 8443 | 本專案 NPM HTTPS |
| 81 | 82 | 本專案 NPM 管理 |
### 與現有 NPM 共存
| 服務 | Port | 說明 |
|------|------|------|
| 現有 NPM | 80/443/81 | 原有的 NPM 實例 |
| 本專案 NPM | 8080/8443/82 | TobiichiGPT 專用 NPM |
### 透過 Cloudflare Tunnel
無需開放 Port直接使用網域訪問需設定 `.env` 檔案)