mirror of
https://gitee.com/houhuan/TrendRadar.git
synced 2025-12-21 13:07:17 +08:00
v3.4.0: 新增 slack 推送,优化 setup-windows.bat 一键安装 MCP
This commit is contained in:
parent
c3e182941a
commit
39738cc821
1
.github/workflows/crawler.yml
vendored
1
.github/workflows/crawler.yml
vendored
@ -63,6 +63,7 @@ jobs:
|
|||||||
NTFY_SERVER_URL: ${{ secrets.NTFY_SERVER_URL }}
|
NTFY_SERVER_URL: ${{ secrets.NTFY_SERVER_URL }}
|
||||||
NTFY_TOKEN: ${{ secrets.NTFY_TOKEN }}
|
NTFY_TOKEN: ${{ secrets.NTFY_TOKEN }}
|
||||||
BARK_URL: ${{ secrets.BARK_URL }}
|
BARK_URL: ${{ secrets.BARK_URL }}
|
||||||
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||||
GITHUB_ACTIONS: true
|
GITHUB_ACTIONS: true
|
||||||
run: python main.py
|
run: python main.py
|
||||||
|
|
||||||
|
|||||||
@ -65,7 +65,7 @@ cd 你的项目名
|
|||||||
|
|
||||||
### Windows 用户
|
### Windows 用户
|
||||||
|
|
||||||
1. **双击运行**项目文件夹中的 `setup-windows.bat`
|
1. **双击运行**项目文件夹中的 `setup-windows.bat`,如果有问题,就运行 `setup-windows-en.bat`
|
||||||
2. **等待安装完成**
|
2. **等待安装完成**
|
||||||
3. **记录显示的配置信息**(命令路径和参数)
|
3. **记录显示的配置信息**(命令路径和参数)
|
||||||
|
|
||||||
|
|||||||
200
README-EN.md
200
README-EN.md
@ -14,7 +14,7 @@
|
|||||||
[](https://github.com/sansan0/TrendRadar/stargazers)
|
[](https://github.com/sansan0/TrendRadar/stargazers)
|
||||||
[](https://github.com/sansan0/TrendRadar/network/members)
|
[](https://github.com/sansan0/TrendRadar/network/members)
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
[](https://github.com/sansan0/TrendRadar)
|
[](https://github.com/sansan0/TrendRadar)
|
||||||
[](https://github.com/sansan0/TrendRadar)
|
[](https://github.com/sansan0/TrendRadar)
|
||||||
|
|
||||||
[](https://work.weixin.qq.com/)
|
[](https://work.weixin.qq.com/)
|
||||||
@ -25,6 +25,7 @@
|
|||||||
[](#)
|
[](#)
|
||||||
[](https://github.com/binwiederhier/ntfy)
|
[](https://github.com/binwiederhier/ntfy)
|
||||||
[](https://github.com/Finb/Bark)
|
[](https://github.com/Finb/Bark)
|
||||||
|
[](https://slack.com/)
|
||||||
|
|
||||||
|
|
||||||
[](https://github.com/sansan0/TrendRadar)
|
[](https://github.com/sansan0/TrendRadar)
|
||||||
@ -60,7 +61,7 @@
|
|||||||
- Thanks to **followers**, your interactions make the content more meaningful 😎
|
- Thanks to **followers**, your interactions make the content more meaningful 😎
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>👉 Click to view <strong>Acknowledgments</strong> (Current <strong>🔥72🔥</strong> supporters)</summary>
|
<summary>👉 Click to view <strong>Acknowledgments</strong> (Current <strong>🔥73🔥</strong> supporters)</summary>
|
||||||
|
|
||||||
### Infrastructure Support
|
### Infrastructure Support
|
||||||
|
|
||||||
@ -90,6 +91,7 @@ After communication, the author indicated no concerns about server pressure, but
|
|||||||
|
|
||||||
| Supporter | Amount (CNY) | Date | Note |
|
| Supporter | Amount (CNY) | Date | Note |
|
||||||
| :-------: | :----------: | :--: | :--: |
|
| :-------: | :----------: | :--: | :--: |
|
||||||
|
| D*5 | 1.8 * 3 | 2025.11.24 | |
|
||||||
| *鬼 | 1 | 2025.11.17 | |
|
| *鬼 | 1 | 2025.11.17 | |
|
||||||
| *超 | 10 | 2025.11.17 | |
|
| *超 | 10 | 2025.11.17 | |
|
||||||
| R*w | 10 | 2025.11.17 | Great agent work! |
|
| R*w | 10 | 2025.11.17 | Great agent work! |
|
||||||
@ -270,6 +272,33 @@ Transform from "algorithm recommendation captivity" to "actively getting the inf
|
|||||||
- **Major Version Upgrade**: Upgrading from v1.x to v2.y, recommend deleting existing fork and re-forking to save effort and avoid config conflicts
|
- **Major Version Upgrade**: Upgrading from v1.x to v2.y, recommend deleting existing fork and re-forking to save effort and avoid config conflicts
|
||||||
|
|
||||||
|
|
||||||
|
### 2025/11/25 - v3.4.0
|
||||||
|
|
||||||
|
**🎉 Added Slack Push Support**
|
||||||
|
|
||||||
|
1. **Team Collaboration Push Channel**
|
||||||
|
- Supports Slack Incoming Webhooks (globally popular team collaboration tool)
|
||||||
|
- Centralized message management, suitable for team-shared trending news
|
||||||
|
- Supports mrkdwn format (bold, links, etc.)
|
||||||
|
|
||||||
|
2. **Multiple Deployment Methods**
|
||||||
|
- GitHub Actions: Configure `SLACK_WEBHOOK_URL` Secret
|
||||||
|
- Docker: Environment variable `SLACK_WEBHOOK_URL`
|
||||||
|
- Local: `config/config.yaml` configuration file
|
||||||
|
|
||||||
|
|
||||||
|
> 📖 **Detailed Configuration Tutorial**: [Quick Start - Slack Push](#-quick-start)
|
||||||
|
|
||||||
|
- Optimized the one-click installation experience for setup-windows.bat and setup-windows-en.bat
|
||||||
|
|
||||||
|
**🔧 Upgrade Instructions**:
|
||||||
|
- **GitHub Fork Users**: Update `main.py`, `config/config.yaml`, `.github/workflows/crawler.yml`
|
||||||
|
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>👉 Click to expand: <strong>Historical Updates</strong></summary>
|
||||||
|
|
||||||
|
|
||||||
### 2025/11/24 - v3.3.0
|
### 2025/11/24 - v3.3.0
|
||||||
|
|
||||||
**🎉 Added Bark Push Support**
|
**🎉 Added Bark Push Support**
|
||||||
@ -334,9 +363,6 @@ Transform from "algorithm recommendation captivity" to "actively getting the inf
|
|||||||
- Fix issue where today's news query may return articles from past dates
|
- Fix issue where today's news query may return articles from past dates
|
||||||
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary><strong>👉 Click to expand: Historical Updates</strong></summary>
|
|
||||||
|
|
||||||
### 2025/11/20 - v3.1.0
|
### 2025/11/20 - v3.1.0
|
||||||
|
|
||||||
- **Added Personal WeChat Push Support**: WeWork application can push to personal WeChat without installing WeWork APP
|
- **Added Personal WeChat Push Support**: WeWork application can push to personal WeChat without installing WeWork APP
|
||||||
@ -918,6 +944,7 @@ frequency_words.txt file added **required word** feature, using + sign
|
|||||||
| **Sina Mail** | sina.com | smtp.sina.com | 465 | SSL |
|
| **Sina Mail** | sina.com | smtp.sina.com | 465 | SSL |
|
||||||
| **Sohu Mail** | sohu.com | smtp.sohu.com | 465 | SSL |
|
| **Sohu Mail** | sohu.com | smtp.sohu.com | 465 | SSL |
|
||||||
| **189 Mail** | 189.cn | smtp.189.cn | 465 | SSL |
|
| **189 Mail** | 189.cn | smtp.189.cn | 465 | SSL |
|
||||||
|
| **Aliyun Mail** | aliyun.com | smtp.aliyun.com | 465 | TLS |
|
||||||
|
|
||||||
> **Auto-detect**: When using above emails, no need to manually configure `EMAIL_SMTP_SERVER` and `EMAIL_SMTP_PORT`, system auto-detects.
|
> **Auto-detect**: When using above emails, no need to manually configure `EMAIL_SMTP_SERVER` and `EMAIL_SMTP_PORT`, system auto-detects.
|
||||||
>
|
>
|
||||||
@ -927,6 +954,7 @@ frequency_words.txt file added **required word** feature, using + sign
|
|||||||
>
|
>
|
||||||
> **Special Thanks**:
|
> **Special Thanks**:
|
||||||
> - Thanks to [@DYZYD](https://github.com/DYZYD) for contributing 189 Mail (189.cn) configuration and completing self-send-receive testing ([#291](https://github.com/sansan0/TrendRadar/issues/291))
|
> - Thanks to [@DYZYD](https://github.com/DYZYD) for contributing 189 Mail (189.cn) configuration and completing self-send-receive testing ([#291](https://github.com/sansan0/TrendRadar/issues/291))
|
||||||
|
> - Thanks to [@longzhenren](https://github.com/longzhenren) for contributing Aliyun Mail (aliyun.com) configuration and completing testing ([#344](https://github.com/sansan0/TrendRadar/issues/344))
|
||||||
|
|
||||||
**Common Email Settings:**
|
**Common Email Settings:**
|
||||||
|
|
||||||
@ -1078,6 +1106,162 @@ frequency_words.txt file added **required word** feature, using + sign
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>👉 Click to expand: <strong>Bark Push</strong> (iOS exclusive, clean & efficient)</summary>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
**GitHub Secret Configuration (⚠️ Name must be exact):**
|
||||||
|
- **Name**: `BARK_URL` (copy and paste this name, don't type manually)
|
||||||
|
- **Secret**: Your Bark push URL
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
**Bark Introduction:**
|
||||||
|
|
||||||
|
Bark is a free open-source push tool for iOS platform, featuring simplicity, speed, and no ads.
|
||||||
|
|
||||||
|
**Usage Methods:**
|
||||||
|
|
||||||
|
### Method 1: Use Official Server (Recommended for beginners) 🆓
|
||||||
|
|
||||||
|
1. **Download Bark App**:
|
||||||
|
- iOS: [App Store](https://apps.apple.com/us/app/bark-customed-notifications/id1403753865)
|
||||||
|
|
||||||
|
2. **Get Push URL**:
|
||||||
|
- Open Bark App
|
||||||
|
- Copy the push URL displayed on the home page (format: `https://api.day.app/your_device_key`)
|
||||||
|
- Configure the URL to GitHub Secrets as `BARK_URL`
|
||||||
|
|
||||||
|
### Method 2: Self-Hosted Server (Complete Privacy Control) 🔒
|
||||||
|
|
||||||
|
**Suitable for**: Users with servers, pursuing complete privacy, strong technical skills
|
||||||
|
|
||||||
|
**Docker One-Click Deployment**:
|
||||||
|
```bash
|
||||||
|
docker run -d \
|
||||||
|
--name bark-server \
|
||||||
|
-p 8080:8080 \
|
||||||
|
finab/bark-server
|
||||||
|
```
|
||||||
|
|
||||||
|
**Configure TrendRadar**:
|
||||||
|
```yaml
|
||||||
|
BARK_URL: http://your-server-ip:8080/your_device_key
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Notes:**
|
||||||
|
- ✅ Bark uses APNs push, max 4KB per message
|
||||||
|
- ✅ Supports automatic batch sending, no worry about long messages
|
||||||
|
- ✅ Push format is plain text (automatically removes Markdown syntax)
|
||||||
|
- ⚠️ Only supports iOS platform
|
||||||
|
|
||||||
|
**Related Links:**
|
||||||
|
- [Bark Official Website](https://bark.day.app/)
|
||||||
|
- [Bark GitHub Repository](https://github.com/Finb/Bark)
|
||||||
|
- [Bark Server Self-Hosting Tutorial](https://github.com/Finb/bark-server)
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>👉 Click to expand: <strong>Slack Push</strong></summary>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
**GitHub Secret Configuration (⚠️ Name must be exact):**
|
||||||
|
- **Name**: `SLACK_WEBHOOK_URL` (copy and paste this name, don't type manually)
|
||||||
|
- **Secret**: Your Slack Incoming Webhook URL
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
**Slack Introduction:**
|
||||||
|
|
||||||
|
Slack is a team collaboration tool, Incoming Webhooks can push messages to Slack channels.
|
||||||
|
|
||||||
|
**Setup Steps:**
|
||||||
|
|
||||||
|
### Step 1: Create Slack App
|
||||||
|
|
||||||
|
1. **Visit Slack API Page**:
|
||||||
|
- Open https://api.slack.com/apps?new_app=1
|
||||||
|
- Login to your Slack workspace if not logged in
|
||||||
|
|
||||||
|
2. **Choose Creation Method**:
|
||||||
|
- Click **"From scratch"**
|
||||||
|
|
||||||
|
3. **Fill in App Information**:
|
||||||
|
- **App Name**: Enter app name (e.g., `TrendRadar` or `Hot News Monitor`)
|
||||||
|
- **Workspace**: Select your workspace from dropdown
|
||||||
|
- Click **"Create App"** button
|
||||||
|
|
||||||
|
### Step 2: Enable Incoming Webhooks
|
||||||
|
|
||||||
|
1. **Navigate to Incoming Webhooks**:
|
||||||
|
- Find and click **"Incoming Webhooks"** in left menu
|
||||||
|
|
||||||
|
2. **Enable Feature**:
|
||||||
|
- Find **"Activate Incoming Webhooks"** toggle
|
||||||
|
- Switch from `OFF` to `ON`
|
||||||
|
- Page will auto-refresh showing new configuration options
|
||||||
|
|
||||||
|
### Step 3: Generate Webhook URL
|
||||||
|
|
||||||
|
1. **Add New Webhook**:
|
||||||
|
- Scroll to page bottom
|
||||||
|
- Click **"Add New Webhook to Workspace"** button
|
||||||
|
|
||||||
|
2. **Select Target Channel**:
|
||||||
|
- System will show authorization page
|
||||||
|
- Select channel to receive messages from dropdown (e.g., `#hot-news`)
|
||||||
|
- ⚠️ For private channels, must join the channel first
|
||||||
|
|
||||||
|
3. **Authorize App**:
|
||||||
|
- Click **"Allow"** button to complete authorization
|
||||||
|
- System will auto-redirect back to config page
|
||||||
|
|
||||||
|
### Step 4: Copy and Save Webhook URL
|
||||||
|
|
||||||
|
1. **View Generated URL**:
|
||||||
|
- In "Webhook URLs for Your Workspace" section
|
||||||
|
- You'll see the newly generated Webhook URL
|
||||||
|
- Format: `https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX`
|
||||||
|
|
||||||
|
2. **Copy URL**:
|
||||||
|
- Click **"Copy"** button on the right of URL
|
||||||
|
- Or manually select and copy URL
|
||||||
|
|
||||||
|
3. **Configure to TrendRadar**:
|
||||||
|
- **GitHub Actions**: Add URL to GitHub Secrets as `SLACK_WEBHOOK_URL`
|
||||||
|
- **Local Testing**: Fill URL in `config/config.yaml` `slack_webhook_url` field
|
||||||
|
- **Docker Deployment**: Add URL to `docker/.env` file as `SLACK_WEBHOOK_URL` variable
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Notes:**
|
||||||
|
- ✅ Supports Markdown format (auto-converts to Slack mrkdwn)
|
||||||
|
- ✅ Supports automatic batch sending (4KB per batch)
|
||||||
|
- ✅ Suitable for team collaboration, centralized message management
|
||||||
|
- ⚠️ Webhook URL contains secret key, never make it public
|
||||||
|
|
||||||
|
**Message Format Preview:**
|
||||||
|
```
|
||||||
|
*[Batch 1/2]*
|
||||||
|
|
||||||
|
📊 *Trending Topics Statistics*
|
||||||
|
|
||||||
|
🔥 *[1/3] AI ChatGPT* : 2 articles
|
||||||
|
|
||||||
|
1. [Baidu Hot] 🆕 ChatGPT-5 Official Release *[1]* - 09:15 (1 time)
|
||||||
|
|
||||||
|
2. [Toutiao] AI Chip Stocks Surge *[3]* - [08:30 ~ 10:45] (3 times)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Related Links:**
|
||||||
|
- [Slack Incoming Webhooks Official Docs](https://api.slack.com/messaging/webhooks)
|
||||||
|
- [Slack API App Management](https://api.slack.com/apps)
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
> **💡 Beginner Quick Start Tip**:
|
> **💡 Beginner Quick Start Tip**:
|
||||||
>
|
>
|
||||||
> For first deployment, suggest completing **GitHub Secrets** configuration first (choose one push platform), then jump to [Step 3] to test push success.
|
> For first deployment, suggest completing **GitHub Secrets** configuration first (choose one push platform), then jump to [Step 3] to test push success.
|
||||||
@ -1330,7 +1514,7 @@ Meizu
|
|||||||
!second-hand
|
!second-hand
|
||||||
```
|
```
|
||||||
|
|
||||||
<EFBFBD><EFBFBD><EFBFBD> **Recommended:** Split into precise groups
|
**Recommended:** Split into precise groups
|
||||||
```txt
|
```txt
|
||||||
Huawei
|
Huawei
|
||||||
OPPO
|
OPPO
|
||||||
@ -1804,6 +1988,10 @@ Cherry Studio provides GUI config interface, 5-minute quick deployment, complex
|
|||||||
|
|
||||||
**Detailed Deployment Tutorial**: [README-Cherry-Studio.md](README-Cherry-Studio.md)
|
**Detailed Deployment Tutorial**: [README-Cherry-Studio.md](README-Cherry-Studio.md)
|
||||||
|
|
||||||
|
**Deployment Mode Description**:
|
||||||
|
- **STDIO Mode (Recommended)**: One-time configuration, no need to reconfigure later. The **illustrated deployment tutorial** only demonstrates this mode's configuration.
|
||||||
|
- **HTTP Mode (Alternative)**: If STDIO mode configuration encounters issues, you can use HTTP mode. This mode's configuration is basically the same as STDIO, but only requires copy-pasting one line, less error-prone. The only thing to note is that you need to manually start the service before each use. For details, refer to the HTTP mode section at the bottom of [README-Cherry-Studio.md](README-Cherry-Studio.md).
|
||||||
|
|
||||||
### 2. Learning to Talk with AI
|
### 2. Learning to Talk with AI
|
||||||
|
|
||||||
**Detailed Conversation Tutorial**: [README-MCP-FAQ.md](README-MCP-FAQ.md)
|
**Detailed Conversation Tutorial**: [README-MCP-FAQ.md](README-MCP-FAQ.md)
|
||||||
|
|||||||
143
README.md
143
README.md
@ -14,7 +14,7 @@
|
|||||||
[](https://github.com/sansan0/TrendRadar/stargazers)
|
[](https://github.com/sansan0/TrendRadar/stargazers)
|
||||||
[](https://github.com/sansan0/TrendRadar/network/members)
|
[](https://github.com/sansan0/TrendRadar/network/members)
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
[](https://github.com/sansan0/TrendRadar)
|
[](https://github.com/sansan0/TrendRadar)
|
||||||
[](https://github.com/sansan0/TrendRadar)
|
[](https://github.com/sansan0/TrendRadar)
|
||||||
|
|
||||||
[](https://work.weixin.qq.com/)
|
[](https://work.weixin.qq.com/)
|
||||||
@ -25,6 +25,7 @@
|
|||||||
[](#)
|
[](#)
|
||||||
[](https://github.com/binwiederhier/ntfy)
|
[](https://github.com/binwiederhier/ntfy)
|
||||||
[](https://github.com/Finb/Bark)
|
[](https://github.com/Finb/Bark)
|
||||||
|
[](https://slack.com/)
|
||||||
|
|
||||||
|
|
||||||
[](https://github.com/sansan0/TrendRadar)
|
[](https://github.com/sansan0/TrendRadar)
|
||||||
@ -336,6 +337,33 @@ GitHub 一键 Fork 即可使用,无需编程基础。
|
|||||||
- **大版本升级**:从 v1.x 升级到 v2.y,建议删除现有 fork 后重新 fork,这样更省力且避免配置冲突
|
- **大版本升级**:从 v1.x 升级到 v2.y,建议删除现有 fork 后重新 fork,这样更省力且避免配置冲突
|
||||||
|
|
||||||
|
|
||||||
|
### 2025/11/25 - v3.4.0
|
||||||
|
|
||||||
|
**🎉 新增 Slack 推送支持**
|
||||||
|
|
||||||
|
1. **团队协作推送渠道**
|
||||||
|
- 支持 Slack Incoming Webhooks(全球流行的团队协作工具)
|
||||||
|
- 消息集中管理,适合团队共享热点资讯
|
||||||
|
- 支持 mrkdwn 格式(粗体、链接等)
|
||||||
|
|
||||||
|
2. **多种部署方式**
|
||||||
|
- GitHub Actions:配置 `SLACK_WEBHOOK_URL` Secret
|
||||||
|
- Docker:环境变量 `SLACK_WEBHOOK_URL`
|
||||||
|
- 本地运行:`config/config.yaml` 配置文件
|
||||||
|
|
||||||
|
|
||||||
|
> 📖 **详细配置教程**:[快速开始 - Slack 推送](#-快速开始)
|
||||||
|
|
||||||
|
- 优化 setup-windows.bat 和 setup-windows-en.bat 一键安装 MCP 的体验
|
||||||
|
|
||||||
|
**🔧 升级说明**:
|
||||||
|
- **GitHub Fork 用户**:更新 `main.py`、`config/config.yaml`、`.github/workflows/crawler.yml`
|
||||||
|
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>👉 点击展开:<strong>历史更新</strong></summary>
|
||||||
|
|
||||||
|
|
||||||
### 2025/11/24 - v3.3.0
|
### 2025/11/24 - v3.3.0
|
||||||
|
|
||||||
**🎉 新增 Bark 推送支持**
|
**🎉 新增 Bark 推送支持**
|
||||||
@ -358,11 +386,6 @@ GitHub 一键 Fork 即可使用,无需编程基础。
|
|||||||
**🔧 升级说明**:
|
**🔧 升级说明**:
|
||||||
- **GitHub Fork 用户**:更新 `main.py`、`config/config.yaml`、`.github/workflows/crawler.yml`
|
- **GitHub Fork 用户**:更新 `main.py`、`config/config.yaml`、`.github/workflows/crawler.yml`
|
||||||
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>👉 点击展开:<strong>历史更新</strong></summary>
|
|
||||||
|
|
||||||
|
|
||||||
### 2025/11/23 - v3.2.0
|
### 2025/11/23 - v3.2.0
|
||||||
|
|
||||||
**🎯 新增高级定制功能**
|
**🎯 新增高级定制功能**
|
||||||
@ -1191,6 +1214,104 @@ frequency_words.txt 文件增加了一个【必须词】功能,使用 + 号
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>👉 点击展开:<strong>Slack 推送</strong></summary>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
**GitHub Secret 配置(⚠️ Name 名称必须严格一致):**
|
||||||
|
- **Name(名称)**:`SLACK_WEBHOOK_URL`(请复制粘贴此名称,不要手打)
|
||||||
|
- **Secret(值)**:你的 Slack Incoming Webhook URL
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
**Slack 简介:**
|
||||||
|
|
||||||
|
Slack 是团队协作工具,Incoming Webhooks 可以将消息推送到 Slack 频道。
|
||||||
|
|
||||||
|
**设置步骤:**
|
||||||
|
|
||||||
|
### 步骤 1:创建 Slack App
|
||||||
|
|
||||||
|
1. **访问 Slack API 页面**:
|
||||||
|
- 打开 https://api.slack.com/apps?new_app=1
|
||||||
|
- 如果未登录,先登录你的 Slack 工作空间
|
||||||
|
|
||||||
|
2. **选择创建方式**:
|
||||||
|
- 点击 **"From scratch"**(从头开始创建)
|
||||||
|
|
||||||
|
3. **填写 App 信息**:
|
||||||
|
- **App Name**:填写应用名称(如 `TrendRadar` 或 `热点新闻监控`)
|
||||||
|
- **Workspace**:从下拉列表选择你的工作空间
|
||||||
|
- 点击 **"Create App"** 按钮
|
||||||
|
|
||||||
|
### 步骤 2:启用 Incoming Webhooks
|
||||||
|
|
||||||
|
1. **导航到 Incoming Webhooks**:
|
||||||
|
- 在左侧菜单中找到并点击 **"Incoming Webhooks"**
|
||||||
|
|
||||||
|
2. **启用功能**:
|
||||||
|
- 找到 **"Activate Incoming Webhooks"** 开关
|
||||||
|
- 将开关从 `OFF` 切换到 `ON`
|
||||||
|
- 页面会自动刷新显示新的配置选项
|
||||||
|
|
||||||
|
### 步骤 3:生成 Webhook URL
|
||||||
|
|
||||||
|
1. **添加新的 Webhook**:
|
||||||
|
- 滚动到页面底部
|
||||||
|
- 点击 **"Add New Webhook to Workspace"** 按钮
|
||||||
|
|
||||||
|
2. **选择目标频道**:
|
||||||
|
- 系统会弹出授权页面
|
||||||
|
- 从下拉列表中选择要接收消息的频道(如 `#热点新闻`)
|
||||||
|
- ⚠️ 如果要选择私有频道,必须先加入该频道
|
||||||
|
|
||||||
|
3. **授权应用**:
|
||||||
|
- 点击 **"Allow"** 按钮完成授权
|
||||||
|
- 系统会自动跳转回配置页面
|
||||||
|
|
||||||
|
### 步骤 4:复制并保存 Webhook URL
|
||||||
|
|
||||||
|
1. **查看生成的 URL**:
|
||||||
|
- 在 "Webhook URLs for Your Workspace" 区域
|
||||||
|
- 会看到刚刚生成的 Webhook URL
|
||||||
|
- 格式如:`https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX`
|
||||||
|
|
||||||
|
2. **复制 URL**:
|
||||||
|
- 点击 URL 右侧的 **"Copy"** 按钮
|
||||||
|
- 或手动选中 URL 并复制
|
||||||
|
|
||||||
|
3. **配置到 TrendRadar**:
|
||||||
|
- **GitHub Actions**:将 URL 添加到 GitHub Secrets 中的 `SLACK_WEBHOOK_URL`
|
||||||
|
- **本地测试**:将 URL 填入 `config/config.yaml` 的 `slack_webhook_url` 字段
|
||||||
|
- **Docker 部署**:将 URL 添加到 `docker/.env` 文件的 `SLACK_WEBHOOK_URL` 变量
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**注意事项:**
|
||||||
|
- ✅ 支持 Markdown 格式(自动转换为 Slack mrkdwn)
|
||||||
|
- ✅ 支持自动分批推送(每批 4KB)
|
||||||
|
- ✅ 适合团队协作,消息集中管理
|
||||||
|
- ⚠️ Webhook URL 包含密钥,切勿公开
|
||||||
|
|
||||||
|
**消息格式预览:**
|
||||||
|
```
|
||||||
|
*[第 1/2 批次]*
|
||||||
|
|
||||||
|
📊 *热点词汇统计*
|
||||||
|
|
||||||
|
🔥 *[1/3] AI ChatGPT* : 2 条
|
||||||
|
|
||||||
|
1. [百度热搜] 🆕 ChatGPT-5正式发布 *[1]* - 09时15分 (1次)
|
||||||
|
|
||||||
|
2. [今日头条] AI芯片概念股暴涨 *[3]* - [08时30分 ~ 10时45分] (3次)
|
||||||
|
```
|
||||||
|
|
||||||
|
**相关链接:**
|
||||||
|
- [Slack Incoming Webhooks 官方文档](https://api.slack.com/messaging/webhooks)
|
||||||
|
- [Slack API 应用管理](https://api.slack.com/apps)
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
3. **手动测试新闻推送**:
|
3. **手动测试新闻推送**:
|
||||||
|
|
||||||
> 💡 **完成第1-2步后,请立即测试!** 测试成功后再根据需要调整配置(第4步)。
|
> 💡 **完成第1-2步后,请立即测试!** 测试成功后再根据需要调整配置(第4步)。
|
||||||
@ -1276,7 +1397,9 @@ platforms:
|
|||||||
name: "华尔街见闻"
|
name: "华尔街见闻"
|
||||||
# 添加更多平台...
|
# 添加更多平台...
|
||||||
```
|
```
|
||||||
如果不会看的话,就直接复制他人整理好的部分[平台配置](https://github.com/sansan0/TrendRadar/issues/95)
|
如果不会看的话,可以有选择的复制他人整理好的部分[平台配置](https://github.com/sansan0/TrendRadar/issues/95)
|
||||||
|
|
||||||
|
> 💡 平台不是越多越好,别贪心大量信息,你要进行筛选,否则依然只会被大量信息淹没。
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
@ -1906,12 +2029,14 @@ Cherry Studio 提供 GUI 配置界面, 5 分钟快速部署, 复杂的部分
|
|||||||
|
|
||||||
**详细部署教程**:[README-Cherry-Studio.md](README-Cherry-Studio.md)
|
**详细部署教程**:[README-Cherry-Studio.md](README-Cherry-Studio.md)
|
||||||
|
|
||||||
|
**部署模式说明**:
|
||||||
|
- **STDIO 模式(推荐)**:一次配置后续无需重复配置,**图文部署教程**中仅以此模式的配置为例。
|
||||||
|
- **HTTP 模式(备选)**:如果 STDIO 模式配置遇到问题,可使用 HTTP 模式。此模式的配置方式与 STDIO 基本一致,但复制粘贴的内容就一行,不易出错。唯一需要注意的是每次使用前都需要手动启动一下服务。详细请参考 [README-Cherry-Studio.md](README-Cherry-Studio.md) 底部的 HTTP 模式说明。
|
||||||
|
|
||||||
### 2. 学习与 AI 对话的姿势
|
### 2. 学习与 AI 对话的姿势
|
||||||
|
|
||||||
**详细对话教程**:[README-MCP-FAQ.md](README-MCP-FAQ.md)
|
**详细对话教程**:[README-MCP-FAQ.md](README-MCP-FAQ.md)
|
||||||
|
|
||||||
**提问效果**:
|
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>👉 点击展开:<strong>查看 AI 对话示例图</strong></summary>
|
<summary>👉 点击展开:<strong>查看 AI 对话示例图</strong></summary>
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
@ -36,6 +36,7 @@ notification:
|
|||||||
dingtalk_batch_size: 20000 # 钉钉消息分批大小(字节)(这个配置也别动)
|
dingtalk_batch_size: 20000 # 钉钉消息分批大小(字节)(这个配置也别动)
|
||||||
feishu_batch_size: 29000 # 飞书消息分批大小(字节)
|
feishu_batch_size: 29000 # 飞书消息分批大小(字节)
|
||||||
bark_batch_size: 3600 # Bark消息分批大小(字节)
|
bark_batch_size: 3600 # Bark消息分批大小(字节)
|
||||||
|
slack_batch_size: 4000 # Slack消息分批大小(字节)
|
||||||
batch_send_interval: 3 # 批次发送间隔(秒)
|
batch_send_interval: 3 # 批次发送间隔(秒)
|
||||||
feishu_message_separator: "━━━━━━━━━━━━━━━━━━━" # feishu 消息分割线
|
feishu_message_separator: "━━━━━━━━━━━━━━━━━━━" # feishu 消息分割线
|
||||||
|
|
||||||
@ -86,6 +87,7 @@ notification:
|
|||||||
ntfy_topic: "" # ntfy主题名称
|
ntfy_topic: "" # ntfy主题名称
|
||||||
ntfy_token: "" # ntfy访问令牌(可选,用于私有主题)
|
ntfy_token: "" # ntfy访问令牌(可选,用于私有主题)
|
||||||
bark_url: "" # Bark推送URL(格式:https://api.day.app/your_device_key 或自建服务器地址)
|
bark_url: "" # Bark推送URL(格式:https://api.day.app/your_device_key 或自建服务器地址)
|
||||||
|
slack_webhook_url: "" # Slack Incoming Webhook URL(格式:https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX)
|
||||||
|
|
||||||
# 用于让关注度更高的新闻在更前面显示,即用算法重新组合不同平台的热搜排序形成你侧重的热搜,合起来是 1 就行
|
# 用于让关注度更高的新闻在更前面显示,即用算法重新组合不同平台的热搜排序形成你侧重的热搜,合起来是 1 就行
|
||||||
weight:
|
weight:
|
||||||
|
|||||||
@ -53,6 +53,14 @@ NTFY_TOPIC=
|
|||||||
# 可选:访问令牌(用于私有主题)
|
# 可选:访问令牌(用于私有主题)
|
||||||
NTFY_TOKEN=
|
NTFY_TOKEN=
|
||||||
|
|
||||||
|
# Bark 推送配置
|
||||||
|
# Bark推送URL(格式:https://api.day.app/your_device_key 或自建服务器地址)
|
||||||
|
BARK_URL=
|
||||||
|
|
||||||
|
# Slack 推送配置
|
||||||
|
# Slack Incoming Webhook URL(格式:https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX)
|
||||||
|
SLACK_WEBHOOK_URL=
|
||||||
|
|
||||||
# ============================================
|
# ============================================
|
||||||
# 运行配置
|
# 运行配置
|
||||||
# ============================================
|
# ============================================
|
||||||
|
|||||||
@ -43,6 +43,8 @@ services:
|
|||||||
- NTFY_TOKEN=${NTFY_TOKEN:-}
|
- NTFY_TOKEN=${NTFY_TOKEN:-}
|
||||||
# Bark配置
|
# Bark配置
|
||||||
- BARK_URL=${BARK_URL:-}
|
- BARK_URL=${BARK_URL:-}
|
||||||
|
# Slack配置
|
||||||
|
- SLACK_WEBHOOK_URL=${SLACK_WEBHOOK_URL:-}
|
||||||
# 运行模式
|
# 运行模式
|
||||||
- CRON_SCHEDULE=${CRON_SCHEDULE:-*/5 * * * *}
|
- CRON_SCHEDULE=${CRON_SCHEDULE:-*/5 * * * *}
|
||||||
- RUN_MODE=${RUN_MODE:-cron}
|
- RUN_MODE=${RUN_MODE:-cron}
|
||||||
|
|||||||
@ -41,6 +41,8 @@ services:
|
|||||||
- NTFY_TOKEN=${NTFY_TOKEN:-}
|
- NTFY_TOKEN=${NTFY_TOKEN:-}
|
||||||
# Bark配置
|
# Bark配置
|
||||||
- BARK_URL=${BARK_URL:-}
|
- BARK_URL=${BARK_URL:-}
|
||||||
|
# Slack配置
|
||||||
|
- SLACK_WEBHOOK_URL=${SLACK_WEBHOOK_URL:-}
|
||||||
# 运行模式
|
# 运行模式
|
||||||
- CRON_SCHEDULE=${CRON_SCHEDULE:-*/5 * * * *}
|
- CRON_SCHEDULE=${CRON_SCHEDULE:-*/5 * * * *}
|
||||||
- RUN_MODE=${RUN_MODE:-cron}
|
- RUN_MODE=${RUN_MODE:-cron}
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
@echo off
|
@echo off
|
||||||
:: 使用系统默认编码而不是强制 UTF-8
|
|
||||||
setlocal enabledelayedexpansion
|
setlocal enabledelayedexpansion
|
||||||
|
|
||||||
echo ==========================================
|
echo ==========================================
|
||||||
@ -7,13 +6,42 @@ echo TrendRadar MCP Setup (Windows)
|
|||||||
echo ==========================================
|
echo ==========================================
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
REM Get current directory
|
REM Fix: Use script location instead of current working directory
|
||||||
set "PROJECT_ROOT=%CD%"
|
set "PROJECT_ROOT=%~dp0"
|
||||||
|
REM Remove trailing backslash
|
||||||
|
if "%PROJECT_ROOT:~-1%"=="\" set "PROJECT_ROOT=%PROJECT_ROOT:~0,-1%"
|
||||||
|
|
||||||
echo Project Directory: %PROJECT_ROOT%
|
echo Project Directory: %PROJECT_ROOT%
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
|
REM Change to project directory
|
||||||
|
cd /d "%PROJECT_ROOT%"
|
||||||
|
if %errorlevel% neq 0 (
|
||||||
|
echo [ERROR] Cannot access project directory
|
||||||
|
pause
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Validate project structure
|
||||||
|
echo [0/4] Validating project structure...
|
||||||
|
if not exist "pyproject.toml" (
|
||||||
|
echo [ERROR] pyproject.toml not found in: %PROJECT_ROOT%
|
||||||
|
echo:
|
||||||
|
echo This should not happen! Please check:
|
||||||
|
echo 1. Is setup-windows.bat in the project root?
|
||||||
|
echo 2. Was the project properly cloned/downloaded?
|
||||||
|
echo:
|
||||||
|
echo Files in current directory:
|
||||||
|
dir /b
|
||||||
|
echo:
|
||||||
|
pause
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
echo [OK] pyproject.toml found
|
||||||
|
echo:
|
||||||
|
|
||||||
REM Check Python
|
REM Check Python
|
||||||
echo Checking Python...
|
echo [1/4] Checking Python...
|
||||||
python --version >nul 2>&1
|
python --version >nul 2>&1
|
||||||
if %errorlevel% neq 0 (
|
if %errorlevel% neq 0 (
|
||||||
echo [ERROR] Python not detected. Please install Python 3.10+
|
echo [ERROR] Python not detected. Please install Python 3.10+
|
||||||
@ -21,76 +49,106 @@ if %errorlevel% neq 0 (
|
|||||||
pause
|
pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
echo Python OK
|
for /f "tokens=*" %%i in ('python --version') do echo [OK] %%i
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
REM Check UV
|
REM Check UV
|
||||||
echo Checking UV...
|
echo [2/4] Checking UV...
|
||||||
where uv >nul 2>&1
|
where uv >nul 2>&1
|
||||||
if %errorlevel% neq 0 (
|
if %errorlevel% neq 0 (
|
||||||
echo [1/3] UV not installed, installing automatically...
|
echo UV not installed, installing automatically...
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
REM Use Bypass execution policy
|
echo Trying installation method 1: PowerShell...
|
||||||
powershell -ExecutionPolicy Bypass -Command "irm https://astral.sh/uv/install.ps1 | iex"
|
powershell -ExecutionPolicy Bypass -Command "try { irm https://astral.sh/uv/install.ps1 | iex; exit 0 } catch { Write-Host 'PowerShell method failed'; exit 1 }"
|
||||||
|
|
||||||
if %errorlevel% neq 0 (
|
if %errorlevel% neq 0 (
|
||||||
echo [ERROR] UV installation failed
|
|
||||||
echo:
|
echo:
|
||||||
echo Please install UV manually:
|
echo Method 1 failed. Trying method 2: pip...
|
||||||
echo Method 1: Visit https://docs.astral.sh/uv/getting-started/installation/
|
python -m pip install --upgrade uv
|
||||||
echo Method 2: Use pip install uv
|
|
||||||
|
if %errorlevel% neq 0 (
|
||||||
|
echo:
|
||||||
|
echo [ERROR] Automatic installation failed
|
||||||
|
echo:
|
||||||
|
echo Please install UV manually using one of these methods:
|
||||||
|
echo:
|
||||||
|
echo Method 1 - pip:
|
||||||
|
echo python -m pip install uv
|
||||||
|
echo:
|
||||||
|
echo Method 2 - pipx:
|
||||||
|
echo pip install pipx
|
||||||
|
echo pipx install uv
|
||||||
|
echo:
|
||||||
|
echo Method 3 - Manual download:
|
||||||
|
echo Visit: https://docs.astral.sh/uv/getting-started/installation/
|
||||||
|
echo:
|
||||||
pause
|
pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
echo:
|
echo:
|
||||||
echo [SUCCESS] UV installed successfully
|
echo [SUCCESS] UV installed successfully!
|
||||||
echo [IMPORTANT] Please follow these steps:
|
echo:
|
||||||
|
echo [IMPORTANT] Please restart your terminal:
|
||||||
echo 1. Close this window
|
echo 1. Close this window
|
||||||
echo 2. Reopen Command Prompt or PowerShell
|
echo 2. Open a new Command Prompt
|
||||||
echo 3. Navigate to project directory: cd "%PROJECT_ROOT%"
|
echo 3. Navigate to: %PROJECT_ROOT%
|
||||||
echo 4. Run this script again: setup-windows.bat
|
echo 4. Run: setup-windows.bat
|
||||||
echo:
|
echo:
|
||||||
pause
|
pause
|
||||||
exit /b 0
|
exit /b 0
|
||||||
) else (
|
) else (
|
||||||
echo [1/3] UV already installed
|
for /f "tokens=*" %%i in ('uv --version') do echo [OK] %%i
|
||||||
uv --version
|
|
||||||
)
|
)
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
echo [2/3] Installing project dependencies...
|
echo [3/4] Installing dependencies...
|
||||||
|
echo Working directory: %PROJECT_ROOT%
|
||||||
echo:
|
echo:
|
||||||
|
|
||||||
REM Install dependencies with UV
|
REM Ensure we're in the project directory
|
||||||
|
cd /d "%PROJECT_ROOT%"
|
||||||
uv sync
|
uv sync
|
||||||
if %errorlevel% neq 0 (
|
if %errorlevel% neq 0 (
|
||||||
|
echo:
|
||||||
echo [ERROR] Dependency installation failed
|
echo [ERROR] Dependency installation failed
|
||||||
echo:
|
echo:
|
||||||
echo Possible causes:
|
echo Troubleshooting steps:
|
||||||
echo - Missing pyproject.toml file
|
echo 1. Check your internet connection
|
||||||
echo - Network connection issues
|
echo 2. Verify Python version ^>= 3.10: python --version
|
||||||
echo - Incompatible Python version
|
echo 3. Try with verbose output: uv sync --verbose
|
||||||
|
echo 4. Check if pyproject.toml is valid
|
||||||
|
echo:
|
||||||
|
echo Project directory: %PROJECT_ROOT%
|
||||||
|
echo:
|
||||||
pause
|
pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
echo:
|
echo:
|
||||||
|
echo [OK] Dependencies installed successfully
|
||||||
|
echo:
|
||||||
|
|
||||||
echo [3/3] Checking configuration file...
|
echo [4/4] Checking configuration file...
|
||||||
if not exist "config\config.yaml" (
|
if not exist "config\config.yaml" (
|
||||||
echo [WARNING] Configuration file not found: config\config.yaml
|
echo [WARNING] config\config.yaml not found
|
||||||
if exist "config\config.example.yaml" (
|
if exist "config\config.example.yaml" (
|
||||||
echo Tip: Example config found, please copy and modify:
|
echo:
|
||||||
echo copy config\config.example.yaml config\config.yaml
|
echo To create your configuration:
|
||||||
|
echo 1. Copy: copy config\config.example.yaml config\config.yaml
|
||||||
|
echo 2. Edit: notepad config\config.yaml
|
||||||
|
echo 3. Add your API keys
|
||||||
)
|
)
|
||||||
echo:
|
echo:
|
||||||
|
) else (
|
||||||
|
echo [OK] config\config.yaml exists
|
||||||
)
|
)
|
||||||
|
echo:
|
||||||
|
|
||||||
REM Get UV path
|
REM Get UV path
|
||||||
for /f "tokens=*" %%i in ('where uv 2^>nul') do set "UV_PATH=%%i"
|
for /f "tokens=*" %%i in ('where uv 2^>nul') do set "UV_PATH=%%i"
|
||||||
if not defined UV_PATH (
|
if not defined UV_PATH (
|
||||||
echo [WARNING] Unable to get UV path, please find it manually
|
|
||||||
set "UV_PATH=uv"
|
set "UV_PATH=uv"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -99,7 +157,7 @@ echo ==========================================
|
|||||||
echo Setup Complete!
|
echo Setup Complete!
|
||||||
echo ==========================================
|
echo ==========================================
|
||||||
echo:
|
echo:
|
||||||
echo MCP Server Configuration:
|
echo MCP Server Configuration for Claude Desktop:
|
||||||
echo:
|
echo:
|
||||||
echo Command: %UV_PATH%
|
echo Command: %UV_PATH%
|
||||||
echo Working Directory: %PROJECT_ROOT%
|
echo Working Directory: %PROJECT_ROOT%
|
||||||
@ -112,6 +170,7 @@ echo python
|
|||||||
echo -m
|
echo -m
|
||||||
echo mcp_server.server
|
echo mcp_server.server
|
||||||
echo:
|
echo:
|
||||||
echo Documentation: README-Cherry-Studio.md
|
echo Configuration guide: README-Cherry-Studio.md
|
||||||
|
echo:
|
||||||
echo:
|
echo:
|
||||||
pause
|
pause
|
||||||
@ -1,17 +1,48 @@
|
|||||||
@echo off
|
@echo off
|
||||||
chcp 65001 >nul
|
chcp 65001 >nul
|
||||||
setlocal enabledelayedexpansion
|
setlocal enabledelayedexpansion
|
||||||
echo ╔════════════════════════════════════════╗
|
|
||||||
echo ║ TrendRadar MCP 一键部署 (Windows) ║
|
echo ==========================================
|
||||||
echo ╚════════════════════════════════════════╝
|
echo TrendRadar MCP 一键部署 (Windows)
|
||||||
|
echo ==========================================
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
REM 获取当前目录
|
REM 修复:使用脚本所在目录,而不是当前工作目录
|
||||||
set "PROJECT_ROOT=%CD%"
|
set "PROJECT_ROOT=%~dp0"
|
||||||
|
REM 移除末尾的反斜杠
|
||||||
|
if "%PROJECT_ROOT:~-1%"=="\" set "PROJECT_ROOT=%PROJECT_ROOT:~0,-1%"
|
||||||
|
|
||||||
echo 📍 项目目录: %PROJECT_ROOT%
|
echo 📍 项目目录: %PROJECT_ROOT%
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
|
REM 切换到项目目录
|
||||||
|
cd /d "%PROJECT_ROOT%"
|
||||||
|
if %errorlevel% neq 0 (
|
||||||
|
echo ❌ 无法访问项目目录
|
||||||
|
pause
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
REM 验证项目结构
|
||||||
|
echo [0/4] 🔍 验证项目结构...
|
||||||
|
if not exist "pyproject.toml" (
|
||||||
|
echo ❌ 未找到 pyproject.toml 文件: %PROJECT_ROOT%
|
||||||
|
echo.
|
||||||
|
echo 请检查:
|
||||||
|
echo 1. setup-windows.bat 是否在项目根目录?
|
||||||
|
echo 2. 项目文件是否完整?
|
||||||
|
echo.
|
||||||
|
echo 当前目录内容:
|
||||||
|
dir /b
|
||||||
|
echo.
|
||||||
|
pause
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
echo ✅ pyproject.toml 已找到
|
||||||
|
echo.
|
||||||
|
|
||||||
REM 检查 Python
|
REM 检查 Python
|
||||||
|
echo [1/4] 🐍 检查 Python...
|
||||||
python --version >nul 2>&1
|
python --version >nul 2>&1
|
||||||
if %errorlevel% neq 0 (
|
if %errorlevel% neq 0 (
|
||||||
echo ❌ 未检测到 Python,请先安装 Python 3.10+
|
echo ❌ 未检测到 Python,请先安装 Python 3.10+
|
||||||
@ -19,84 +50,119 @@ if %errorlevel% neq 0 (
|
|||||||
pause
|
pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
for /f "tokens=*" %%i in ('python --version') do echo ✅ %%i
|
||||||
|
echo.
|
||||||
|
|
||||||
REM 检查 UV
|
REM 检查 UV
|
||||||
|
echo [2/4] 🔧 检查 UV...
|
||||||
where uv >nul 2>&1
|
where uv >nul 2>&1
|
||||||
if %errorlevel% neq 0 (
|
if %errorlevel% neq 0 (
|
||||||
echo [1/3] 🔧 UV 未安装,正在自动安装...
|
echo UV 未安装,正在自动安装...
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
REM 使用 Bypass 执行策略
|
echo 尝试方法1: PowerShell 安装...
|
||||||
powershell -ExecutionPolicy Bypass -Command "irm https://astral.sh/uv/install.ps1 | iex"
|
powershell -ExecutionPolicy Bypass -Command "try { irm https://astral.sh/uv/install.ps1 | iex; exit 0 } catch { Write-Host 'PowerShell 安装失败'; exit 1 }"
|
||||||
|
|
||||||
if %errorlevel% neq 0 (
|
if %errorlevel% neq 0 (
|
||||||
echo ❌ UV 安装失败
|
|
||||||
echo.
|
echo.
|
||||||
echo 请手动安装 UV:
|
echo 方法1失败,尝试方法2: pip 安装...
|
||||||
echo 方法1: 访问 https://docs.astral.sh/uv/getting-started/installation/
|
python -m pip install --upgrade uv
|
||||||
echo 方法2: 使用 pip install uv
|
|
||||||
|
if %errorlevel% neq 0 (
|
||||||
|
echo.
|
||||||
|
echo ❌ 自动安装失败
|
||||||
|
echo.
|
||||||
|
echo 请手动安装 UV,可选方法:
|
||||||
|
echo.
|
||||||
|
echo 方法1 - pip:
|
||||||
|
echo python -m pip install uv
|
||||||
|
echo.
|
||||||
|
echo 方法2 - pipx:
|
||||||
|
echo pip install pipx
|
||||||
|
echo pipx install uv
|
||||||
|
echo.
|
||||||
|
echo 方法3 - 手动下载:
|
||||||
|
echo 访问: https://docs.astral.sh/uv/getting-started/installation/
|
||||||
|
echo.
|
||||||
pause
|
pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ✅ UV 安装完成
|
echo ✅ UV 安装完成!
|
||||||
|
echo.
|
||||||
echo ⚠️ 重要: 请按照以下步骤操作:
|
echo ⚠️ 重要: 请按照以下步骤操作:
|
||||||
echo 1. 关闭此窗口
|
echo 1. 关闭此窗口
|
||||||
echo 2. 重新打开命令提示符(或 PowerShell)
|
echo 2. 重新打开命令提示符(或 PowerShell)
|
||||||
echo 3. 回到项目目录: cd "%PROJECT_ROOT%"
|
echo 3. 回到项目目录: %PROJECT_ROOT%
|
||||||
echo 4. 重新运行此脚本: setup-windows.bat
|
echo 4. 重新运行此脚本: setup-windows.bat
|
||||||
echo.
|
echo.
|
||||||
pause
|
pause
|
||||||
exit /b 0
|
exit /b 0
|
||||||
) else (
|
) else (
|
||||||
echo [1/3] ✅ UV 已安装
|
for /f "tokens=*" %%i in ('uv --version') do echo ✅ %%i
|
||||||
uv --version
|
|
||||||
)
|
)
|
||||||
|
|
||||||
echo.
|
|
||||||
echo [2/3] 📦 安装项目依赖...
|
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
REM 使用 UV 安装依赖
|
echo [3/4] 📦 安装项目依赖...
|
||||||
|
echo 工作目录: %PROJECT_ROOT%
|
||||||
|
echo.
|
||||||
|
|
||||||
|
REM 确保在项目目录下执行
|
||||||
|
cd /d "%PROJECT_ROOT%"
|
||||||
uv sync
|
uv sync
|
||||||
if %errorlevel% neq 0 (
|
if %errorlevel% neq 0 (
|
||||||
|
echo.
|
||||||
echo ❌ 依赖安装失败
|
echo ❌ 依赖安装失败
|
||||||
echo.
|
echo.
|
||||||
echo 可能的原因:
|
echo 可能的原因:
|
||||||
echo - 缺少 pyproject.toml 文件
|
echo 1. 网络连接问题
|
||||||
echo - 网络连接问题
|
echo 2. Python 版本不兼容(需要 ^>= 3.10)
|
||||||
echo - Python 版本不兼容
|
echo 3. pyproject.toml 文件格式错误
|
||||||
|
echo.
|
||||||
|
echo 故障排查:
|
||||||
|
echo - 检查网络连接
|
||||||
|
echo - 验证 Python 版本: python --version
|
||||||
|
echo - 尝试详细输出: uv sync --verbose
|
||||||
|
echo.
|
||||||
|
echo 项目目录: %PROJECT_ROOT%
|
||||||
|
echo.
|
||||||
pause
|
pause
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo [3/3] ✅ 检查配置文件...
|
echo ✅ 依赖安装成功
|
||||||
|
echo.
|
||||||
|
|
||||||
|
echo [4/4] ⚙️ 检查配置文件...
|
||||||
if not exist "config\config.yaml" (
|
if not exist "config\config.yaml" (
|
||||||
echo ⚠️ 配置文件不存在: config\config.yaml
|
echo ⚠️ 配置文件不存在: config\config.yaml
|
||||||
if exist "config\config.example.yaml" (
|
if exist "config\config.example.yaml" (
|
||||||
echo 提示: 发现示例配置文件,请复制并修改:
|
echo.
|
||||||
echo copy config\config.example.yaml config\config.yaml
|
echo 创建配置文件:
|
||||||
|
echo 1. 复制: copy config\config.example.yaml config\config.yaml
|
||||||
|
echo 2. 编辑: notepad config\config.yaml
|
||||||
|
echo 3. 填入 API 密钥
|
||||||
)
|
)
|
||||||
echo.
|
echo.
|
||||||
|
) else (
|
||||||
|
echo ✅ config\config.yaml 已存在
|
||||||
)
|
)
|
||||||
|
echo.
|
||||||
|
|
||||||
REM 获取 UV 路径
|
REM 获取 UV 路径
|
||||||
for /f "tokens=*" %%i in ('where uv 2^>nul') do set "UV_PATH=%%i"
|
for /f "tokens=*" %%i in ('where uv 2^>nul') do set "UV_PATH=%%i"
|
||||||
|
|
||||||
if not defined UV_PATH (
|
if not defined UV_PATH (
|
||||||
echo ⚠️ 无法获取 UV 路径,请手动查找
|
|
||||||
set "UV_PATH=uv"
|
set "UV_PATH=uv"
|
||||||
)
|
)
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ╔════════════════════════════════════════╗
|
echo ==========================================
|
||||||
echo ║ 部署完成! ║
|
echo 部署完成!
|
||||||
echo ╚════════════════════════════════════════╝
|
echo ==========================================
|
||||||
echo.
|
echo.
|
||||||
echo 📋 MCP 服务器配置信息:
|
echo 📋 MCP 服务器配置信息(用于 Claude Desktop):
|
||||||
echo.
|
echo.
|
||||||
echo 命令: %UV_PATH%
|
echo 命令: %UV_PATH%
|
||||||
echo 工作目录: %PROJECT_ROOT%
|
echo 工作目录: %PROJECT_ROOT%
|
||||||
@ -111,4 +177,5 @@ echo mcp_server.server
|
|||||||
echo.
|
echo.
|
||||||
echo 📖 详细教程: README-Cherry-Studio.md
|
echo 📖 详细教程: README-Cherry-Studio.md
|
||||||
echo.
|
echo.
|
||||||
|
echo.
|
||||||
pause
|
pause
|
||||||
Loading…
Reference in New Issue
Block a user