|
|
@@ -4,7 +4,7 @@
|
|
|
<img src="/_image/banner.webp" alt="TrendRadar Banner" width="80%">
|
|
|
</a>
|
|
|
|
|
|
-🚀 Deploy in <strong>30 seconds</strong> — Your Smart Trending News Assistant
|
|
|
+🚀 Deploy in <strong>30 seconds</strong> — Say goodbye to endless scrolling, only see the news you truly care about
|
|
|
|
|
|
<a href="https://trendshift.io/repositories/14726" target="_blank"><img src="https://trendshift.io/api/badge/repositories/14726" alt="sansan0%2FTrendRadar | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
|
|
|
|
|
@@ -14,7 +14,7 @@
|
|
|
[](https://github.com/sansan0/TrendRadar/stargazers)
|
|
|
[](https://github.com/sansan0/TrendRadar/network/members)
|
|
|
[](LICENSE)
|
|
|
-[](https://github.com/sansan0/TrendRadar)
|
|
|
+[](https://github.com/sansan0/TrendRadar)
|
|
|
[](https://github.com/sansan0/TrendRadar)
|
|
|
|
|
|
[](https://work.weixin.qq.com/)
|
|
|
@@ -44,6 +44,34 @@
|
|
|
|
|
|
> This project is designed to be lightweight and easy to deploy
|
|
|
|
|
|
+<details>
|
|
|
+<summary>⚠️ Click to expand: <strong>Fork Guide: Docs, Resource Limits & Deployment Options</strong></summary>
|
|
|
+<br>
|
|
|
+
|
|
|
+**📄 Documentation Version:**
|
|
|
+
|
|
|
+If you use this project via **Fork**, you might be viewing outdated documentation. Fork copies the documentation version at that time, but the original project may have been updated.
|
|
|
+
|
|
|
+**👉 [Click to View Latest Official Documentation](https://github.com/sansan0/TrendRadar?tab=readme-ov-file)**
|
|
|
+
|
|
|
+**How to Tell?** Check the repository address at the top of the page:
|
|
|
+- `github.com/your-username/TrendRadar` ← Your forked version
|
|
|
+- `github.com/sansan0/TrendRadar` ← Latest official version
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+**🛡️ Resource Limits & Safety Tips:**
|
|
|
+
|
|
|
+GitHub provides limited Actions resources per account. To avoid being flagged for abuse and risking account suspension:
|
|
|
+
|
|
|
+- **Platform Count**: Keep it around **10 platforms** — more platforms consume more resources
|
|
|
+- **Run Frequency**: Minimum interval of **30 minutes** — more frequent runs are unnecessary
|
|
|
+- **Fair Use**: GitHub Actions is designed for lightweight scheduled tasks, not high-frequency crawlers
|
|
|
+
|
|
|
+💡 **Want more freedom?** Try [🐳 Docker Deployment](#6-docker-deployment) on your own server with no restrictions.
|
|
|
+
|
|
|
+</details>
|
|
|
+
|
|
|
<br>
|
|
|
|
|
|
## 📑 Quick Navigation
|
|
|
@@ -156,23 +184,25 @@ Default monitoring of 11 mainstream platforms, with support for adding custom pl
|
|
|
>
|
|
|
> For detailed comparison and configuration, see [Configuration Guide - Push Mode Details](#3-push-mode-details)
|
|
|
|
|
|
-**Additional Feature - Push Time Window Control** (Optional):
|
|
|
+**Additional Features** (Optional):
|
|
|
|
|
|
-- Set push time range (e.g., 09:00-18:00), push only within specified time
|
|
|
-- Configure multiple pushes within window or once per day
|
|
|
-- Avoid notifications during non-work hours
|
|
|
+| Feature | Description | Default |
|
|
|
+|---------|-------------|---------|
|
|
|
+| **Push Time Window Control** | Set push time range (e.g., 09:00-18:00) to avoid non-work hours notifications | Disabled |
|
|
|
+| **Content Order Configuration** | Adjust display order of "Trending Keywords Stats" and "New Trending News" (v3.5.0 new) | Stats first |
|
|
|
|
|
|
-> 💡 This feature is disabled by default, see [Quick Start](#-quick-start) for configuration
|
|
|
+> 💡 For detailed configuration, see [Configuration Guide - Report Configuration](#7-report-configuration) and [Configuration Guide - Push Window](#8-push-window-configuration)
|
|
|
|
|
|
### **Precise Content Filtering**
|
|
|
|
|
|
Set personal keywords (e.g., AI, BYD, Education Policy) to receive only relevant trending news, filtering out noise.
|
|
|
|
|
|
-**Basic Syntax** (4 types):
|
|
|
+**Basic Syntax** (5 types):
|
|
|
- Normal words: Basic matching
|
|
|
- Required words `+`: Narrow scope
|
|
|
- Filter words `!`: Exclude noise
|
|
|
- Count limit `@`: Control display count (v3.2.0 new)
|
|
|
+- Global filter `[GLOBAL_FILTER]`: Globally exclude specified content (v3.5.0 new)
|
|
|
|
|
|
**Advanced Features** (v3.2.0 new):
|
|
|
- 🔢 **Keyword Sorting Control**: Sort by popularity or config order
|
|
|
@@ -214,6 +244,14 @@ No longer controlled by platform algorithms, TrendRadar reorganizes all trending
|
|
|
|
|
|
Supports **WeWork** (+ WeChat push solution), **Feishu**, **DingTalk**, **Telegram**, **Email**, **ntfy**, **Bark**, **Slack** — messages delivered directly to phone and email.
|
|
|
|
|
|
+**📌 Multi-Account Push Notes (v3.5.0 New Feature):**
|
|
|
+
|
|
|
+- ✅ **Multi-Account Configuration Support**: All push channels (Feishu, DingTalk, WeWork, Telegram, ntfy, Bark, Slack) support configuring multiple accounts
|
|
|
+- ✅ **Configuration Method**: Use English semicolon `;` to separate multiple account values
|
|
|
+- ✅ **Example**: Set `FEISHU_WEBHOOK_URL` Secret value to `https://webhook1;https://webhook2`
|
|
|
+- ⚠️ **Paired Configuration**: Telegram and ntfy require paired parameter quantities to match (e.g., token and chat_id both have 2 values)
|
|
|
+- ⚠️ **Quantity Limit**: Default maximum 3 accounts per channel, exceeded values will be truncated
|
|
|
+
|
|
|
### **Multi-Platform Support**
|
|
|
- **GitHub Pages**: Auto-generate beautiful web reports, PC/mobile adapted
|
|
|
- **Docker Deployment**: Supports multi-architecture containerized operation
|
|
|
@@ -272,6 +310,62 @@ 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
|
|
|
|
|
|
|
|
|
+### 2025/12/03 - v3.5.0
|
|
|
+
|
|
|
+**🎉 Core Feature Enhancements**
|
|
|
+
|
|
|
+1. **Multi-Account Push Support**
|
|
|
+ - All push channels (Feishu, DingTalk, WeWork, Telegram, ntfy, Bark, Slack) support multiple account configuration
|
|
|
+ - Use semicolon `;` to separate multiple accounts, e.g., `FEISHU_WEBHOOK_URL=url1;url2`
|
|
|
+ - Automatic validation for paired configurations (e.g., Telegram's token and chat_id)
|
|
|
+
|
|
|
+2. **Configurable Push Content Order**
|
|
|
+ - Added `reverse_content_order` configuration option
|
|
|
+ - Customize display order of trending keywords stats and new trending news
|
|
|
+
|
|
|
+3. **Global Filter Keywords**
|
|
|
+ - Added `[GLOBAL_FILTER]` region marker for filtering unwanted content globally
|
|
|
+ - Use cases: Filter ads, marketing, low-quality content, etc.
|
|
|
+
|
|
|
+**🐳 Docker Dual-Path HTML Generation Optimization**
|
|
|
+
|
|
|
+- **Bug Fix**: Resolved issue where `index.html` could not sync to host in Docker environment
|
|
|
+- **Dual-Path Generation**: Daily summary HTML is generated to two locations simultaneously
|
|
|
+ - `index.html` (project root): For GitHub Pages access
|
|
|
+ - `output/index.html`: Accessible on host via Docker Volume mount
|
|
|
+- **Compatibility**: Ensures web reports are accessible in Docker, GitHub Actions, and local environments
|
|
|
+
|
|
|
+**🐳 Docker MCP Image Support**
|
|
|
+
|
|
|
+- Added independent MCP service image `wantcat/trendradar-mcp`
|
|
|
+- Supports Docker deployment of AI analysis features via HTTP interface (port 3333)
|
|
|
+- Dual-container architecture: News push service and MCP service run independently, can be scaled and restarted separately
|
|
|
+- See [Docker Deployment - MCP Service](#6-docker-deployment) for details
|
|
|
+
|
|
|
+**🌐 Web Server Support**
|
|
|
+
|
|
|
+- Added built-in web server for browser access to generated reports
|
|
|
+- Control via `manage.py` commands: `docker exec -it trend-radar python manage.py start_webserver`
|
|
|
+- Access URL: `http://localhost:8080` (port configurable)
|
|
|
+- Security features: Static file service, directory restriction, localhost binding
|
|
|
+- Supports both auto-start and manual control modes
|
|
|
+
|
|
|
+**📖 Documentation Optimization**
|
|
|
+
|
|
|
+- Added [Report Configuration](#7-report-configuration) section: report-related parameter details
|
|
|
+- Added [Push Window Configuration](#8-push-window-configuration) section: push_window configuration tutorial
|
|
|
+- Added [Execution Frequency Configuration](#9-execution-frequency-configuration) section: Cron expression explanation and common examples
|
|
|
+- Added [Multi-Account Push Configuration](#10-multiple-account-push-configuration) section: multi-account push configuration details
|
|
|
+- Optimized all configuration sections: Unified "Configuration Location" instructions
|
|
|
+- Simplified Quick Start configuration: Three core files at a glance
|
|
|
+- Optimized [Docker Deployment](#6-docker-deployment) section: Added image description, recommended git clone deployment, reorganized deployment methods
|
|
|
+
|
|
|
+**🔧 Upgrade Instructions**:
|
|
|
+- **GitHub Fork Users**: Update `main.py`, `config/config.yaml` (Added multi-account push support, existing single-account configuration unaffected)
|
|
|
+- **Docker Users**: Update `.env`, `docker-compose.yml` or set environment variables `REVERSE_CONTENT_ORDER`, `MAX_ACCOUNTS_PER_CHANNEL`
|
|
|
+- **Multi-Account Push**: New feature, disabled by default, existing single-account configuration unaffected
|
|
|
+
|
|
|
+
|
|
|
### 2025/11/28 - v3.4.1
|
|
|
|
|
|
**🔧 Format Optimization**
|
|
|
@@ -705,6 +799,24 @@ frequency_words.txt file added **required word** feature, using + sign
|
|
|
- ⚠️ **DO NOT Create Custom Names**: The Secret Name must **strictly use** the names listed below (e.g., `WEWORK_WEBHOOK_URL`, `FEISHU_WEBHOOK_URL`, etc.). Do not modify or create new names arbitrarily, or the system will not recognize them
|
|
|
- 💡 **Can Configure Multiple Platforms**: The system will send notifications to all configured platforms
|
|
|
|
|
|
+ **📌 Multi-Account Push Notes (v3.5.0 New Feature):**
|
|
|
+
|
|
|
+ - ✅ **Multi-Account Configuration Support**: All push channels (Feishu, DingTalk, WeWork, Telegram, ntfy, Bark, Slack) support configuring multiple accounts
|
|
|
+ - ✅ **Configuration Method**: Use English semicolon `;` to separate multiple account values
|
|
|
+ - ✅ **Example**: Set `FEISHU_WEBHOOK_URL` Secret value to `https://webhook1;https://webhook2`
|
|
|
+ - ⚠️ **Paired Configuration**: Telegram and ntfy require paired parameter quantities to match (e.g., token and chat_id both have 2 values)
|
|
|
+ - ⚠️ **Quantity Limit**: Default maximum 3 accounts per channel, exceeded values will be truncated
|
|
|
+
|
|
|
+ **Multi-Account Configuration Examples**:
|
|
|
+
|
|
|
+ | Name | Secret (Value) Example |
|
|
|
+ |------|------------------------|
|
|
|
+ | `FEISHU_WEBHOOK_URL` | `https://webhook1;https://webhook2;https://webhook3` |
|
|
|
+ | `TELEGRAM_BOT_TOKEN` | `token1;token2` |
|
|
|
+ | `TELEGRAM_CHAT_ID` | `chatid1;chatid2` |
|
|
|
+ | `NTFY_TOPIC` | `topic1;topic2` |
|
|
|
+ | `NTFY_TOKEN` | `;token2` (1st has no token, use empty string as placeholder) |
|
|
|
+
|
|
|
**Configuration Example:**
|
|
|
|
|
|
<img src="_image/secrets.png" alt="GitHub Secrets Configuration Example"/>
|
|
|
@@ -1316,15 +1428,21 @@ frequency_words.txt file added **required word** feature, using + sign
|
|
|
3. Click **"Run workflow"** button on the right to run
|
|
|
4. Wait about 1 minute, messages will be pushed to your configured platform
|
|
|
|
|
|
+ > ⏱️ **Testing Tips**:
|
|
|
+ > - Don't test too frequently to avoid triggering GitHub Actions limits
|
|
|
+ > - After clicking Run workflow, you need to **refresh the browser page** to see the new run record
|
|
|
+
|
|
|
4. **Configuration Notes (Optional)**:
|
|
|
|
|
|
- > 💡 Default configuration works normally, only adjust if you need personalization
|
|
|
+ > 💡 **Default configuration works normally**, only adjust if you need personalization, understand these three files:
|
|
|
|
|
|
- - **Push Settings**: Configure push mode and notification options in [config/config.yaml](config/config.yaml) → [Push Mode Details](#3-push-mode-details)
|
|
|
- - **Keyword Settings**: Add your interested keywords in [config/frequency_words.txt](config/frequency_words.txt) → [Keyword Configuration Tutorial](#2-keyword-configuration)
|
|
|
- - **Push Frequency Adjustment**: In [.github/workflows/crawler.yml](.github/workflows/crawler.yml) adjust carefully, don't be greedy
|
|
|
+ | File | Purpose |
|
|
|
+ |------|---------|
|
|
|
+ | `config/config.yaml` | Main config file: push mode, time window, platform list, hotspot weights, etc. |
|
|
|
+ | `config/frequency_words.txt` | Keyword file: set your interested keywords, filter push content |
|
|
|
+ | `.github/workflows/crawler.yml` | Execution frequency: control how often to run (⚠️ modify carefully) |
|
|
|
|
|
|
- **Note**: Suggest only adjusting explicitly documented config items, other options mainly for author's development testing
|
|
|
+ 👉 **Detailed Configuration Tutorial**: [Configuration Guide](#configuration-guide)
|
|
|
|
|
|
5. **🎉 Deployment Success! Share Your Experience**
|
|
|
|
|
|
@@ -1365,6 +1483,8 @@ frequency_words.txt file added **required word** feature, using + sign
|
|
|
<summary>👉 Click to expand: <strong>Custom Monitoring Platforms</strong></summary>
|
|
|
<br>
|
|
|
|
|
|
+**Configuration Location:** `platforms` section in `config/config.yaml`
|
|
|
+
|
|
|
This project's news data comes from [newsnow](https://github.com/ourongxing/newsnow). You can click the [website](https://newsnow.busiyi.world/), click [More], to see if there are platforms you want.
|
|
|
|
|
|
For specific additions, visit [project source code](https://github.com/ourongxing/newsnow/tree/main/server/sources), based on the file names there, modify the `platforms` configuration in `config/config.yaml` file:
|
|
|
@@ -1379,13 +1499,18 @@ platforms:
|
|
|
name: "Wallstreetcn"
|
|
|
# Add more platforms...
|
|
|
```
|
|
|
-If you don't know how to look, you can directly copy the partially organized [Platform Configuration](https://github.com/sansan0/TrendRadar/issues/95)
|
|
|
+
|
|
|
+> 💡 **Shortcut**: If you don't know how to read source code, you can copy from others' organized [Platform Configuration Summary](https://github.com/sansan0/TrendRadar/issues/95)
|
|
|
+
|
|
|
+> ⚠️ **Note**: More platforms is not always better, suggest choosing 10-15 core platforms. Too many platforms will cause information overload and actually reduce user experience.
|
|
|
|
|
|
</details>
|
|
|
|
|
|
### 2. Keyword Configuration
|
|
|
|
|
|
-Configure monitoring keywords in `frequency_words.txt` with four syntax types and grouping features.
|
|
|
+**Configuration Location:** `config/frequency_words.txt`
|
|
|
+
|
|
|
+Configure monitoring keywords in `frequency_words.txt` with five syntax types, region markers, and grouping features.
|
|
|
|
|
|
| Syntax Type | Symbol | Purpose | Example | Matching Logic |
|
|
|
|------------|--------|---------|---------|----------------|
|
|
|
@@ -1393,6 +1518,7 @@ Configure monitoring keywords in `frequency_words.txt` with four syntax types an
|
|
|
| **Required** | `+` | Scope limiting | `+phone` | Must include both |
|
|
|
| **Filter** | `!` | Noise exclusion | `!ad` | Exclude if included |
|
|
|
| **Count Limit** | `@` | Control display count | `@10` | Max 10 news (v3.2.0 new) |
|
|
|
+| **Global Filter** | `[GLOBAL_FILTER]` | Globally exclude content | See example below | Filter under any circumstances (v3.5.0 new) |
|
|
|
|
|
|
#### 2.1 Basic Syntax
|
|
|
|
|
|
@@ -1437,6 +1563,55 @@ Musk
|
|
|
|
|
|
**Priority:** `@number` > Global config > Unlimited
|
|
|
|
|
|
+##### 5. **Global Filter** `[GLOBAL_FILTER]` - Globally Exclude Content (v3.5.0 new)
|
|
|
+```txt
|
|
|
+[GLOBAL_FILTER]
|
|
|
+advertisement
|
|
|
+promotion
|
|
|
+marketing
|
|
|
+shocking
|
|
|
+clickbait
|
|
|
+
|
|
|
+[WORD_GROUPS]
|
|
|
+technology
|
|
|
+AI
|
|
|
+
|
|
|
+Huawei
|
|
|
+HarmonyOS
|
|
|
+!car
|
|
|
+```
|
|
|
+**Effect:** Filters news containing specified words under **any circumstances**, with **highest priority**
|
|
|
+
|
|
|
+**Use Cases:**
|
|
|
+- Filter low-quality content: shocking, clickbait, breaking news, etc.
|
|
|
+- Filter marketing content: advertisement, promotion, sponsorship, etc.
|
|
|
+- Filter specific topics: entertainment, gossip (based on needs)
|
|
|
+
|
|
|
+**Filter Priority:** Global Filter > Group Filter(`!`) > Group Matching
|
|
|
+
|
|
|
+**Region Markers:**
|
|
|
+- `[GLOBAL_FILTER]`: Global filter region, words are filtered under any circumstances
|
|
|
+- `[WORD_GROUPS]`: Keyword groups region, maintains existing syntax (`!`, `+`, `@`)
|
|
|
+- If no region markers are used, all content is treated as keyword groups (backward compatible)
|
|
|
+
|
|
|
+**Matching Examples:**
|
|
|
+```txt
|
|
|
+[GLOBAL_FILTER]
|
|
|
+advertisement
|
|
|
+
|
|
|
+[WORD_GROUPS]
|
|
|
+technology
|
|
|
+AI
|
|
|
+```
|
|
|
+- ❌ "Advertisement: Latest tech product launch" ← Contains global filter word "advertisement", rejected
|
|
|
+- ✅ "Tech company launches new AI product" ← No global filter words, matches "technology" group
|
|
|
+- ✅ "AI technology breakthrough draws attention" ← No global filter words, matches "AI" in "technology" group
|
|
|
+
|
|
|
+**Important Notes:**
|
|
|
+- Use global filter words carefully to avoid over-filtering and missing valuable content
|
|
|
+- Recommended to keep global filter words under 5-15
|
|
|
+- For group-specific filtering, prioritize using group filter words (`!` prefix)
|
|
|
+
|
|
|
---
|
|
|
|
|
|
#### 🔗 Group Feature - Importance of Empty Lines
|
|
|
@@ -1625,6 +1800,15 @@ BYD
|
|
|
<summary>👉 Click to expand: <strong>Three Push Modes Detailed Comparison</strong></summary>
|
|
|
<br>
|
|
|
|
|
|
+**Configuration Location:** `report.mode` in `config/config.yaml`
|
|
|
+
|
|
|
+```yaml
|
|
|
+report:
|
|
|
+ mode: "daily" # Options: "daily" | "incremental" | "current"
|
|
|
+```
|
|
|
+
|
|
|
+**Docker Environment Variable:** `REPORT_MODE=incremental`
|
|
|
+
|
|
|
#### Detailed Comparison Table
|
|
|
|
|
|
| Mode | Target Users | Push Timing | Display Content | Typical Use Case |
|
|
|
@@ -1678,6 +1862,15 @@ Assume you monitor "Apple" keyword, execute once per hour:
|
|
|
<summary>👉 Click to expand: <strong>Hotspot Weight Adjustment</strong></summary>
|
|
|
<br>
|
|
|
|
|
|
+**Configuration Location:** `weight` section in `config/config.yaml`
|
|
|
+
|
|
|
+```yaml
|
|
|
+weight:
|
|
|
+ rank_weight: 0.6 # Ranking weight
|
|
|
+ frequency_weight: 0.3 # Frequency weight
|
|
|
+ hotness_weight: 0.1 # Hotness weight
|
|
|
+```
|
|
|
+
|
|
|
Current default configuration is balanced.
|
|
|
|
|
|
#### Two Core Scenarios
|
|
|
@@ -1775,50 +1968,33 @@ Updated: 2025-01-15 12:30:15
|
|
|
<summary>👉 Click to expand: <strong>Complete Docker Deployment Guide</strong></summary>
|
|
|
<br>
|
|
|
|
|
|
-#### Method 1: Quick Experience (One-Line Command)
|
|
|
+**Image Description:**
|
|
|
|
|
|
-**Linux/macOS System:**
|
|
|
-```bash
|
|
|
-# Create config directory and download config files
|
|
|
-mkdir -p config output
|
|
|
-wget https://raw.githubusercontent.com/sansan0/TrendRadar/master/config/config.yaml -P config/
|
|
|
-wget https://raw.githubusercontent.com/sansan0/TrendRadar/master/config/frequency_words.txt -P config/
|
|
|
-```
|
|
|
-Or **Manual Creation**:
|
|
|
-1. Create `config` folder in current directory
|
|
|
-2. Download config files:
|
|
|
- - Visit https://raw.githubusercontent.com/sansan0/TrendRadar/master/config/config.yaml → Right-click "Save As" → Save to `config\config.yaml`
|
|
|
- - Visit https://raw.githubusercontent.com/sansan0/TrendRadar/master/config/frequency_words.txt → Right-click "Save As" → Save to `config\frequency_words.txt`
|
|
|
+TrendRadar provides two independent Docker images, deploy according to your needs:
|
|
|
|
|
|
-Final directory structure should be:
|
|
|
-```
|
|
|
-current directory/
|
|
|
-└── config/
|
|
|
- ├── config.yaml
|
|
|
- └── frequency_words.txt
|
|
|
-```
|
|
|
+| Image Name | Purpose | Description |
|
|
|
+|---------|------|------|
|
|
|
+| `wantcat/trendradar` | News Push Service | Scheduled news crawling, push notifications (Required) |
|
|
|
+| `wantcat/trendradar-mcp` | AI Analysis Service | MCP protocol support, AI dialogue analysis (Optional) |
|
|
|
|
|
|
-```bash
|
|
|
-docker run -d --name trend-radar \
|
|
|
- -v ./config:/app/config:ro \
|
|
|
- -v ./output:/app/output \
|
|
|
- -e FEISHU_WEBHOOK_URL="your feishu webhook" \
|
|
|
- -e DINGTALK_WEBHOOK_URL="your dingtalk webhook" \
|
|
|
- -e WEWORK_WEBHOOK_URL="your wework webhook" \
|
|
|
- -e TELEGRAM_BOT_TOKEN="your telegram_bot_token" \
|
|
|
- -e TELEGRAM_CHAT_ID="your telegram_chat_id" \
|
|
|
- -e EMAIL_FROM="your sender email" \
|
|
|
- -e EMAIL_PASSWORD="your email password or auth code" \
|
|
|
- -e EMAIL_TO="recipient email" \
|
|
|
- -e CRON_SCHEDULE="*/30 * * * *" \
|
|
|
- -e RUN_MODE="cron" \
|
|
|
- -e IMMEDIATE_RUN="true" \
|
|
|
- wantcat/trendradar:latest
|
|
|
-```
|
|
|
-
|
|
|
-#### Method 2: Using docker-compose (Recommended)
|
|
|
+> 💡 **Recommendations**:
|
|
|
+> - Only need push functionality: Deploy `wantcat/trendradar` image only
|
|
|
+> - Need AI analysis: Deploy both images
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### Method 1: Using docker-compose (Recommended)
|
|
|
|
|
|
1. **Create Project Directory and Config**:
|
|
|
+
|
|
|
+ **Method 1-A: Using git clone (Recommended, Simplest)**
|
|
|
+ ```bash
|
|
|
+ # Clone project to local
|
|
|
+ git clone https://github.com/sansan0/TrendRadar.git
|
|
|
+ cd TrendRadar
|
|
|
+ ```
|
|
|
+
|
|
|
+ **Method 1-B: Using wget to download config files**
|
|
|
```bash
|
|
|
# Create directory structure
|
|
|
mkdir -p trendradar/{config,docker}
|
|
|
@@ -1829,11 +2005,11 @@ docker run -d --name trend-radar \
|
|
|
wget https://raw.githubusercontent.com/sansan0/TrendRadar/master/config/frequency_words.txt -P config/
|
|
|
|
|
|
# Download docker-compose config
|
|
|
- wget https://raw.githubusercontent.com/sansan0/TrendRadar/master/docker/.env
|
|
|
- wget https://raw.githubusercontent.com/sansan0/TrendRadar/master/docker/docker-compose.yml
|
|
|
+ wget https://raw.githubusercontent.com/sansan0/TrendRadar/master/docker/.env -P docker/
|
|
|
+ wget https://raw.githubusercontent.com/sansan0/TrendRadar/master/docker/docker-compose.yml -P docker/
|
|
|
```
|
|
|
|
|
|
-Final directory structure should be:
|
|
|
+ > 💡 **Note**: Key directory structure required for Docker deployment:
|
|
|
```
|
|
|
current directory/
|
|
|
├── config/
|
|
|
@@ -1858,10 +2034,13 @@ current directory/
|
|
|
| `ENABLE_CRAWLER` | `crawler.enable_crawler` | `true` / `false` | Enable crawler |
|
|
|
| `ENABLE_NOTIFICATION` | `notification.enable_notification` | `true` / `false` | Enable notification |
|
|
|
| `REPORT_MODE` | `report.mode` | `daily` / `incremental` / `current`| Report mode |
|
|
|
+ | `MAX_ACCOUNTS_PER_CHANNEL` | `notification.max_accounts_per_channel` | `3` | Maximum accounts per channel |
|
|
|
| `PUSH_WINDOW_ENABLED` | `notification.push_window.enabled` | `true` / `false` | Push time window switch |
|
|
|
| `PUSH_WINDOW_START` | `notification.push_window.time_range.start` | `08:00` | Push start time |
|
|
|
| `PUSH_WINDOW_END` | `notification.push_window.time_range.end` | `22:00` | Push end time |
|
|
|
- | `FEISHU_WEBHOOK_URL` | `notification.webhooks.feishu_url` | `https://...` | Feishu Webhook |
|
|
|
+ | `ENABLE_WEBSERVER` | - | `true` / `false` | Auto-start web server |
|
|
|
+ | `WEBSERVER_PORT` | - | `8080` | Web server port (default 8080) |
|
|
|
+ | `FEISHU_WEBHOOK_URL` | `notification.webhooks.feishu_url` | `https://...` | Feishu Webhook (supports multi-account, use `;` separator) |
|
|
|
|
|
|
**Config Priority**: Environment Variables > config.yaml
|
|
|
|
|
|
@@ -1872,22 +2051,52 @@ current directory/
|
|
|
|
|
|
|
|
|
3. **Start Service**:
|
|
|
+
|
|
|
+ **Option A: Start All Services (Push + AI Analysis)**
|
|
|
```bash
|
|
|
- # Pull latest image and start
|
|
|
+ # Pull latest images
|
|
|
docker-compose pull
|
|
|
+
|
|
|
+ # Start all services (trend-radar + trend-radar-mcp)
|
|
|
docker-compose up -d
|
|
|
```
|
|
|
|
|
|
+ **Option B: Start News Push Service Only**
|
|
|
+ ```bash
|
|
|
+ # Start trend-radar only (scheduled crawling and push)
|
|
|
+ docker-compose pull trend-radar
|
|
|
+ docker-compose up -d trend-radar
|
|
|
+ ```
|
|
|
+
|
|
|
+ **Option C: Start MCP AI Analysis Service Only**
|
|
|
+ ```bash
|
|
|
+ # Start trend-radar-mcp only (AI analysis interface)
|
|
|
+ docker-compose pull trend-radar-mcp
|
|
|
+ docker-compose up -d trend-radar-mcp
|
|
|
+ ```
|
|
|
+
|
|
|
+ > 💡 **Tips**:
|
|
|
+ > - Most users only need to start `trend-radar` for news push functionality
|
|
|
+ > - Only start `trend-radar-mcp` when using Claude/ChatGPT for AI dialogue analysis
|
|
|
+ > - Both services are independent and can be flexibly combined
|
|
|
+
|
|
|
4. **Check Running Status**:
|
|
|
```bash
|
|
|
- # View logs
|
|
|
+ # View news push service logs
|
|
|
docker logs -f trend-radar
|
|
|
|
|
|
- # View container status
|
|
|
+ # View MCP AI analysis service logs
|
|
|
+ docker logs -f trend-radar-mcp
|
|
|
+
|
|
|
+ # View all container status
|
|
|
docker ps | grep trend-radar
|
|
|
+
|
|
|
+ # Stop specific service
|
|
|
+ docker-compose stop trend-radar # Stop push service
|
|
|
+ docker-compose stop trend-radar-mcp # Stop MCP service
|
|
|
```
|
|
|
|
|
|
-#### Method 3: Local Build (Developer Option)
|
|
|
+#### Method 2: Local Build (Developer Option)
|
|
|
|
|
|
If you need custom code modifications or build your own image:
|
|
|
|
|
|
@@ -1903,17 +2112,38 @@ vim config/frequency_words.txt
|
|
|
# Use build version docker-compose
|
|
|
cd docker
|
|
|
cp docker-compose-build.yml docker-compose.yml
|
|
|
+```
|
|
|
+
|
|
|
+**Build and Start Services**:
|
|
|
|
|
|
-# Build and start
|
|
|
+```bash
|
|
|
+# Option A: Build and start all services
|
|
|
docker-compose build
|
|
|
docker-compose up -d
|
|
|
+
|
|
|
+# Option B: Build and start news push service only
|
|
|
+docker-compose build trend-radar
|
|
|
+docker-compose up -d trend-radar
|
|
|
+
|
|
|
+# Option C: Build and start MCP AI analysis service only
|
|
|
+docker-compose build trend-radar-mcp
|
|
|
+docker-compose up -d trend-radar-mcp
|
|
|
```
|
|
|
|
|
|
+> 💡 **Architecture Parameter Notes**:
|
|
|
+> - Default builds `amd64` architecture images (suitable for most x86_64 servers)
|
|
|
+> - To build `arm64` architecture (Apple Silicon, Raspberry Pi, etc.), set environment variable:
|
|
|
+> ```bash
|
|
|
+> export DOCKER_ARCH=arm64
|
|
|
+> docker-compose build
|
|
|
+> ```
|
|
|
+
|
|
|
#### Image Update
|
|
|
|
|
|
```bash
|
|
|
-# Method 1: Manual update
|
|
|
+# Method 1: Manual update (Crawler + MCP images)
|
|
|
docker pull wantcat/trendradar:latest
|
|
|
+docker pull wantcat/trendradar-mcp:latest
|
|
|
docker-compose down
|
|
|
docker-compose up -d
|
|
|
|
|
|
@@ -1922,6 +2152,13 @@ docker-compose pull
|
|
|
docker-compose up -d
|
|
|
```
|
|
|
|
|
|
+**Available Images**:
|
|
|
+
|
|
|
+| Image Name | Purpose | Description |
|
|
|
+|---------|------|---------|
|
|
|
+| `wantcat/trendradar` | News Push Service | Scheduled news crawling, push notifications |
|
|
|
+| `wantcat/trendradar-mcp` | MCP Service | AI analysis features (optional) |
|
|
|
+
|
|
|
#### Service Management Commands
|
|
|
|
|
|
```bash
|
|
|
@@ -1940,6 +2177,11 @@ docker exec -it trend-radar python manage.py config
|
|
|
# Display output files
|
|
|
docker exec -it trend-radar python manage.py files
|
|
|
|
|
|
+# Web server management (for browser access to generated reports)
|
|
|
+docker exec -it trend-radar python manage.py start_webserver # Start web server
|
|
|
+docker exec -it trend-radar python manage.py stop_webserver # Stop web server
|
|
|
+docker exec -it trend-radar python manage.py webserver_status # Check web server status
|
|
|
+
|
|
|
# View help info
|
|
|
docker exec -it trend-radar python manage.py help
|
|
|
|
|
|
@@ -1953,10 +2195,52 @@ docker stop trend-radar
|
|
|
docker rm trend-radar
|
|
|
```
|
|
|
|
|
|
+> 💡 **Web Server Notes**:
|
|
|
+> - After starting, access latest report at `http://localhost:8080`
|
|
|
+> - Access historical reports via directory navigation (e.g., `http://localhost:8080/2025年xx月xx日/`)
|
|
|
+> - Port can be configured in `.env` file with `WEBSERVER_PORT` parameter
|
|
|
+> - Auto-start: Set `ENABLE_WEBSERVER=true` in `.env`
|
|
|
+> - Security: Static files only, limited to output directory, localhost binding only
|
|
|
+
|
|
|
#### Data Persistence
|
|
|
|
|
|
Generated reports and data are saved in `./output` directory by default. Data persists even if container is restarted or removed.
|
|
|
|
|
|
+**📊 Web Report Access Paths**:
|
|
|
+
|
|
|
+TrendRadar generates daily summary HTML reports to two locations simultaneously:
|
|
|
+
|
|
|
+| File Location | Access Method | Use Case |
|
|
|
+|--------------|---------------|----------|
|
|
|
+| `output/index.html` | Direct host access | **Docker Deployment** (via Volume mount, visible on host) |
|
|
|
+| `index.html` | Root directory access | **GitHub Pages** (repository root, auto-detected by Pages) |
|
|
|
+| `output/YYYY年MM月DD日/html/当日汇总.html` | Historical reports | All environments (archived by date) |
|
|
|
+
|
|
|
+**Local Access Examples**:
|
|
|
+```bash
|
|
|
+# Method 1: Via Web Server (recommended, Docker environment)
|
|
|
+# 1. Start web server
|
|
|
+docker exec -it trend-radar python manage.py start_webserver
|
|
|
+# 2. Access in browser
|
|
|
+http://localhost:8080 # Access latest report (default index.html)
|
|
|
+http://localhost:8080/2025年xx月xx日/ # Access reports for specific date
|
|
|
+http://localhost:8080/2025年xx月xx日/html/ # Browse all HTML files for that date
|
|
|
+
|
|
|
+# Method 2: Direct file access (local environment)
|
|
|
+open ./output/index.html # macOS
|
|
|
+start ./output/index.html # Windows
|
|
|
+xdg-open ./output/index.html # Linux
|
|
|
+
|
|
|
+# Method 3: Access historical archives
|
|
|
+open ./output/2025年xx月xx日/html/当日汇总.html
|
|
|
+```
|
|
|
+
|
|
|
+**Why two index.html files?**
|
|
|
+- `output/index.html`: Docker Volume mounted to host, can be opened locally
|
|
|
+- `index.html`: Pushed to repository by GitHub Actions, auto-deployed by GitHub Pages
|
|
|
+
|
|
|
+> 💡 **Tip**: Both files have identical content, choose either one to access.
|
|
|
+
|
|
|
#### Troubleshooting
|
|
|
|
|
|
```bash
|
|
|
@@ -1973,6 +2257,521 @@ docker exec -it trend-radar /bin/bash
|
|
|
docker exec -it trend-radar ls -la /app/config/
|
|
|
```
|
|
|
|
|
|
+#### MCP Service Deployment (AI Analysis Feature)
|
|
|
+
|
|
|
+If you need to use AI analysis features, you can deploy the standalone MCP service container.
|
|
|
+
|
|
|
+**Architecture Description**:
|
|
|
+
|
|
|
+```mermaid
|
|
|
+flowchart TB
|
|
|
+ subgraph trend-radar["trend-radar"]
|
|
|
+ A1[Scheduled News Fetching]
|
|
|
+ A2[Push Notifications]
|
|
|
+ end
|
|
|
+
|
|
|
+ subgraph trend-radar-mcp["trend-radar-mcp"]
|
|
|
+ B1[127.0.0.1:3333]
|
|
|
+ B2[AI Analysis API]
|
|
|
+ end
|
|
|
+
|
|
|
+ subgraph shared["Shared Volume"]
|
|
|
+ C1["config/ (ro)"]
|
|
|
+ C2["output/ (ro)"]
|
|
|
+ end
|
|
|
+
|
|
|
+ trend-radar --> shared
|
|
|
+ trend-radar-mcp --> shared
|
|
|
+```
|
|
|
+
|
|
|
+**Quick Start**:
|
|
|
+
|
|
|
+Use docker-compose to start both news push and MCP services:
|
|
|
+
|
|
|
+```bash
|
|
|
+# Download latest docker-compose.yml (includes MCP service config)
|
|
|
+wget https://raw.githubusercontent.com/sansan0/TrendRadar/master/docker/docker-compose.yml
|
|
|
+
|
|
|
+# Start all services
|
|
|
+docker-compose up -d
|
|
|
+
|
|
|
+# Check running status
|
|
|
+docker ps | grep trend-radar
|
|
|
+```
|
|
|
+
|
|
|
+**Start MCP Service Separately**:
|
|
|
+
|
|
|
+```bash
|
|
|
+docker run -d --name trend-radar-mcp \
|
|
|
+ -p 127.0.0.1:3333:3333 \
|
|
|
+ -v ./config:/app/config:ro \
|
|
|
+ -v ./output:/app/output:ro \
|
|
|
+ -e TZ=Asia/Shanghai \
|
|
|
+ wantcat/trendradar-mcp:latest
|
|
|
+```
|
|
|
+
|
|
|
+**Verify Service**:
|
|
|
+
|
|
|
+```bash
|
|
|
+# Check if MCP service is running properly
|
|
|
+curl http://127.0.0.1:3333/mcp
|
|
|
+
|
|
|
+# View MCP service logs
|
|
|
+docker logs -f trend-radar-mcp
|
|
|
+```
|
|
|
+
|
|
|
+**Configure in AI Clients**:
|
|
|
+
|
|
|
+After MCP service starts, configure in Claude Desktop, Cherry Studio, Cursor, etc.:
|
|
|
+
|
|
|
+```json
|
|
|
+{
|
|
|
+ "mcpServers": {
|
|
|
+ "trendradar": {
|
|
|
+ "url": "http://127.0.0.1:3333/mcp",
|
|
|
+ "description": "TrendRadar News Trending Analysis"
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+> 💡 **Tip**: MCP service only listens on local port (127.0.0.1) for security. For remote access, configure reverse proxy and authentication yourself.
|
|
|
+
|
|
|
+</details>
|
|
|
+
|
|
|
+### 7. Report Configuration
|
|
|
+
|
|
|
+<details>
|
|
|
+<summary>👉 Click to expand: <strong>Report-Related Parameter Configuration</strong></summary>
|
|
|
+<br>
|
|
|
+
|
|
|
+**Configuration Location:** `report` section in `config/config.yaml`
|
|
|
+
|
|
|
+```yaml
|
|
|
+report:
|
|
|
+ mode: "daily" # Push mode
|
|
|
+ rank_threshold: 5 # Ranking highlight threshold
|
|
|
+ sort_by_position_first: false # Sorting priority
|
|
|
+ max_news_per_keyword: 0 # Maximum display count per keyword
|
|
|
+ reverse_content_order: false # Content order configuration
|
|
|
+```
|
|
|
+
|
|
|
+#### Configuration Details
|
|
|
+
|
|
|
+| Config Item | Type | Default | Description |
|
|
|
+|------------|------|---------|-------------|
|
|
|
+| `mode` | string | `daily` | Push mode, options: `daily`/`incremental`/`current`, see [Push Mode Details](#3-push-mode-details) |
|
|
|
+| `rank_threshold` | int | `5` | Ranking highlight threshold, news with rank ≤ this value will be displayed in bold |
|
|
|
+| `sort_by_position_first` | bool | `false` | Sorting priority: `false`=sort by news count, `true`=sort by config position |
|
|
|
+| `max_news_per_keyword` | int | `0` | Maximum display count per keyword, `0`=unlimited |
|
|
|
+| `reverse_content_order` | bool | `false` | Content order: `false`=trending keywords stats first, `true`=new trending news first |
|
|
|
+
|
|
|
+#### Content Order Configuration (v3.5.0 New)
|
|
|
+
|
|
|
+Controls display order of two content sections in push messages and HTML reports:
|
|
|
+
|
|
|
+| Config Value | Display Order |
|
|
|
+|-------------|--------------|
|
|
|
+| `false` (default) | ① Trending Keywords Stats → ② New Trending News |
|
|
|
+| `true` | ① New Trending News → ② Trending Keywords Stats |
|
|
|
+
|
|
|
+**Use Cases:**
|
|
|
+- `false` (default): Suitable for users focusing on keyword match results, view categorized stats first
|
|
|
+- `true`: Suitable for users focusing on latest updates, prioritize viewing new trending topics
|
|
|
+
|
|
|
+**Docker Environment Variable:**
|
|
|
+```bash
|
|
|
+REVERSE_CONTENT_ORDER=true
|
|
|
+```
|
|
|
+
|
|
|
+#### Sorting Priority Configuration
|
|
|
+
|
|
|
+**Example Scenario:** Config order A, B, C, news count A(3), B(10), C(5)
|
|
|
+
|
|
|
+| Config Value | Display Order | Use Case |
|
|
|
+|-------------|--------------|----------|
|
|
|
+| `false` (default) | B(10) → C(5) → A(3) | Focus on popularity trends |
|
|
|
+| `true` | A(3) → B(10) → C(5) | Focus on personal priority |
|
|
|
+
|
|
|
+**Docker Environment Variables:**
|
|
|
+```bash
|
|
|
+SORT_BY_POSITION_FIRST=true
|
|
|
+MAX_NEWS_PER_KEYWORD=10
|
|
|
+```
|
|
|
+
|
|
|
+</details>
|
|
|
+
|
|
|
+### 8. Push Window Configuration
|
|
|
+
|
|
|
+<details>
|
|
|
+<summary>👉 Click to expand: <strong>Push Time Window Control Details</strong></summary>
|
|
|
+<br>
|
|
|
+
|
|
|
+**Configuration Location:** `notification.push_window` section in `config/config.yaml`
|
|
|
+
|
|
|
+```yaml
|
|
|
+notification:
|
|
|
+ push_window:
|
|
|
+ enabled: false # Whether to enable
|
|
|
+ time_range:
|
|
|
+ start: "20:00" # Start time (Beijing time)
|
|
|
+ end: "22:00" # End time (Beijing time)
|
|
|
+ once_per_day: true # Push only once per day
|
|
|
+ push_record_retention_days: 7 # Push record retention days
|
|
|
+```
|
|
|
+
|
|
|
+#### Configuration Details
|
|
|
+
|
|
|
+| Config Item | Type | Default | Description |
|
|
|
+|------------|------|---------|-------------|
|
|
|
+| `enabled` | bool | `false` | Whether to enable push time window control |
|
|
|
+| `time_range.start` | string | `"20:00"` | Push window start time (Beijing time, HH:MM format) |
|
|
|
+| `time_range.end` | string | `"22:00"` | Push window end time (Beijing time, HH:MM format) |
|
|
|
+| `once_per_day` | bool | `true` | `true`=push only once per day within window, `false`=push every execution within window |
|
|
|
+| `push_record_retention_days` | int | `7` | Push record retention days (used to determine if already pushed) |
|
|
|
+
|
|
|
+#### Use Cases
|
|
|
+
|
|
|
+| Scenario | Configuration Example |
|
|
|
+|----------|---------------------|
|
|
|
+| **Working Hours Push** | `start: "09:00"`, `end: "18:00"`, `once_per_day: false` |
|
|
|
+| **Evening Summary Push** | `start: "20:00"`, `end: "22:00"`, `once_per_day: true` |
|
|
|
+| **Lunch Break Push** | `start: "12:00"`, `end: "13:00"`, `once_per_day: true` |
|
|
|
+
|
|
|
+#### Important Notice
|
|
|
+
|
|
|
+> ⚠️ **GitHub Actions Users Note:**
|
|
|
+> - GitHub Actions execution time is unstable, may have ±15 minutes deviation
|
|
|
+> - Time range should be at least **2 hours** wide
|
|
|
+> - For precise timed push, recommend **Docker deployment** on personal server
|
|
|
+
|
|
|
+#### Docker Environment Variables
|
|
|
+
|
|
|
+```bash
|
|
|
+PUSH_WINDOW_ENABLED=true
|
|
|
+PUSH_WINDOW_START=09:00
|
|
|
+PUSH_WINDOW_END=18:00
|
|
|
+PUSH_WINDOW_ONCE_PER_DAY=false
|
|
|
+PUSH_WINDOW_RETENTION_DAYS=7
|
|
|
+```
|
|
|
+
|
|
|
+#### Complete Configuration Examples
|
|
|
+
|
|
|
+**Scenario: Push once between 8-10 PM daily**
|
|
|
+
|
|
|
+```yaml
|
|
|
+notification:
|
|
|
+ push_window:
|
|
|
+ enabled: true
|
|
|
+ time_range:
|
|
|
+ start: "20:00"
|
|
|
+ end: "22:00"
|
|
|
+ once_per_day: true
|
|
|
+ push_record_retention_days: 7
|
|
|
+```
|
|
|
+
|
|
|
+**Scenario: Push every hour during working hours**
|
|
|
+
|
|
|
+```yaml
|
|
|
+notification:
|
|
|
+ push_window:
|
|
|
+ enabled: true
|
|
|
+ time_range:
|
|
|
+ start: "09:00"
|
|
|
+ end: "18:00"
|
|
|
+ once_per_day: false
|
|
|
+ push_record_retention_days: 7
|
|
|
+```
|
|
|
+
|
|
|
+</details>
|
|
|
+
|
|
|
+### 9. Execution Frequency Configuration
|
|
|
+
|
|
|
+<details>
|
|
|
+<summary>👉 Click to expand: <strong>Automatic Execution Frequency Settings</strong></summary>
|
|
|
+<br>
|
|
|
+
|
|
|
+**Configuration Location:** `schedule` section in `.github/workflows/crawler.yml`
|
|
|
+
|
|
|
+```yaml
|
|
|
+on:
|
|
|
+ schedule:
|
|
|
+ - cron: "0 * * * *" # Run every hour
|
|
|
+```
|
|
|
+
|
|
|
+#### What is a Cron Expression?
|
|
|
+
|
|
|
+Cron is a time-based job scheduler format, consisting of 5 parts: `minute hour day month weekday`
|
|
|
+
|
|
|
+```
|
|
|
+┌───────────── minute (0-59)
|
|
|
+│ ┌───────────── hour (0-23)
|
|
|
+│ │ ┌───────────── day (1-31)
|
|
|
+│ │ │ ┌───────────── month (1-12)
|
|
|
+│ │ │ │ ┌───────────── weekday (0-6, 0=Sunday)
|
|
|
+│ │ │ │ │
|
|
|
+* * * * *
|
|
|
+```
|
|
|
+
|
|
|
+#### Common Configuration Examples
|
|
|
+
|
|
|
+| Desired Effect | Cron Expression | Description |
|
|
|
+|---------------|----------------|-------------|
|
|
|
+| Every hour | `0 * * * *` | Run at minute 0 of every hour (default) |
|
|
|
+| Every 30 minutes | `*/30 * * * *` | Run every 30 minutes |
|
|
|
+| Daily at 8 AM | `0 0 * * *` | UTC 0:00 = Beijing 8:00 AM |
|
|
|
+| Working hours | `*/30 0-14 * * *` | Beijing 8:00-22:00, every 30 minutes |
|
|
|
+| 3 times daily | `0 0,6,12 * * *` | Beijing 8:00, 14:00, 20:00 |
|
|
|
+
|
|
|
+#### Important Notes
|
|
|
+
|
|
|
+> ⚠️ **Time Zone Note**: GitHub Actions uses **UTC time**, Beijing time needs to **subtract 8 hours**
|
|
|
+> - Want Beijing 8:00 AM run → Set UTC 0:00
|
|
|
+> - Want Beijing 8:00 PM run → Set UTC 12:00
|
|
|
+
|
|
|
+> ⚠️ **Frequency Limit**: GitHub has a limit on Actions execution count per account
|
|
|
+> - **Recommendation**: Don't set intervals shorter than 30 minutes
|
|
|
+> - **Reason**: Too frequent may be considered abuse, facing account ban risk
|
|
|
+> - **Reality**: GitHub Actions execution time has inherent deviation, setting too precise is meaningless
|
|
|
+
|
|
|
+#### Modification Method
|
|
|
+
|
|
|
+1. Open your forked repository
|
|
|
+2. Find `.github/workflows/crawler.yml` file
|
|
|
+3. Click edit (pencil icon)
|
|
|
+4. Modify the expression in `cron: "0 * * * *"`
|
|
|
+5. Click "Commit changes" to save
|
|
|
+
|
|
|
+</details>
|
|
|
+
|
|
|
+### 10. Multiple Account Push Configuration
|
|
|
+
|
|
|
+<details>
|
|
|
+<summary>👉 Click to expand: <strong>Multiple Account Push Configuration Guide</strong></summary>
|
|
|
+<br>
|
|
|
+
|
|
|
+**Configuration Location:** `notification` section in `config/config.yaml`
|
|
|
+
|
|
|
+> ### ⚠️ **Security Warning**
|
|
|
+> **GitHub Fork Users: DO NOT configure push information in `config.yaml`!**
|
|
|
+>
|
|
|
+> - **Risk**: `config.yaml` will be committed to public Git repositories. Configuring push information (Webhook URLs, Tokens, etc.) will expose sensitive data
|
|
|
+> - **Recommended Methods**:
|
|
|
+> - **GitHub Actions Users** → Use GitHub Secrets environment variables
|
|
|
+> - **Docker Users** → Use [`.env` file configuration](#6-docker-deployment) (`.env` is in `.gitignore` and won't be committed)
|
|
|
+> - **Local Development Users**: Can configure in `config.yaml` (ensure it won't be pushed to public repositories)
|
|
|
+
|
|
|
+#### Supported Channels
|
|
|
+
|
|
|
+| Channel | Configuration Item | Pairing Required | Description |
|
|
|
+|---------|-------------------|-----------------|-------------|
|
|
|
+| **Feishu** | `feishu_url` | No | Multiple webhook URLs |
|
|
|
+| **DingTalk** | `dingtalk_url` | No | Multiple webhook URLs |
|
|
|
+| **WeWork** | `wework_url` | No | Multiple webhook URLs |
|
|
|
+| **Telegram** | `telegram_bot_token` + `telegram_chat_id` | ✅ Yes | Token and chat_id quantities must match |
|
|
|
+| **ntfy** | `ntfy_topic` + `ntfy_token` | ✅ Yes | Topic and token quantities must match (token optional) |
|
|
|
+| **Bark** | `bark_url` | No | Multiple push URLs |
|
|
|
+| **Slack** | `slack_webhook_url` | No | Multiple webhook URLs |
|
|
|
+| **Email** | `email_to` | - | Already supports multiple recipients (comma-separated), no modification needed |
|
|
|
+
|
|
|
+#### Recommended Method 1: GitHub Actions Environment Variables
|
|
|
+
|
|
|
+**Configuration Location**: GitHub Repo → Settings → Secrets and variables → Actions → Repository secrets
|
|
|
+
|
|
|
+**Basic Configuration Example**:
|
|
|
+```bash
|
|
|
+# Multi-account quantity limit
|
|
|
+MAX_ACCOUNTS_PER_CHANNEL=3
|
|
|
+
|
|
|
+# Feishu multi-account (3 groups)
|
|
|
+FEISHU_WEBHOOK_URL=https://hook1.feishu.cn/xxx;https://hook2.feishu.cn/yyy;https://hook3.feishu.cn/zzz
|
|
|
+
|
|
|
+# DingTalk multi-account (2 groups)
|
|
|
+DINGTALK_WEBHOOK_URL=https://oapi.dingtalk.com/xxx;https://oapi.dingtalk.com/yyy
|
|
|
+
|
|
|
+# WeWork multi-account (2 groups)
|
|
|
+WEWORK_WEBHOOK_URL=https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx;https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=yyy
|
|
|
+
|
|
|
+# Bark multi-account (2 devices)
|
|
|
+BARK_URL=https://api.day.app/key1;https://api.day.app/key2
|
|
|
+
|
|
|
+# Slack multi-account (2 channels)
|
|
|
+SLACK_WEBHOOK_URL=https://hooks.slack.com/xxx;https://hooks.slack.com/yyy
|
|
|
+```
|
|
|
+
|
|
|
+**Paired Configuration Examples (Telegram and ntfy)**:
|
|
|
+
|
|
|
+<details>
|
|
|
+<summary><strong>Telegram Paired Configuration</strong></summary>
|
|
|
+
|
|
|
+```bash
|
|
|
+# ✅ Correct: 2 tokens correspond to 2 chat_ids
|
|
|
+TELEGRAM_BOT_TOKEN=123456:AAA-BBB;789012:CCC-DDD
|
|
|
+TELEGRAM_CHAT_ID=-100111;-100222
|
|
|
+
|
|
|
+# ❌ Incorrect: quantities don't match, push will be skipped
|
|
|
+TELEGRAM_BOT_TOKEN=token1;token2;token3
|
|
|
+TELEGRAM_CHAT_ID=id1;id2
|
|
|
+```
|
|
|
+
|
|
|
+**Note**: The quantities of `token` and `chat_id` must match exactly, otherwise the channel push will be skipped.
|
|
|
+
|
|
|
+</details>
|
|
|
+
|
|
|
+<details>
|
|
|
+<summary><strong>ntfy Paired Configuration</strong></summary>
|
|
|
+
|
|
|
+```bash
|
|
|
+# ✅ Correct: 3 topics, only the 2nd needs a token
|
|
|
+NTFY_TOPIC=topic1;topic2;topic3
|
|
|
+NTFY_TOKEN=;token_for_topic2;
|
|
|
+
|
|
|
+# ✅ Correct: 2 topics both need tokens
|
|
|
+NTFY_TOPIC=topic1;topic2
|
|
|
+NTFY_TOKEN=token1;token2
|
|
|
+
|
|
|
+# ❌ Incorrect: topic and token quantities don't match
|
|
|
+NTFY_TOPIC=topic1;topic2
|
|
|
+NTFY_TOKEN=token1;token2;token3
|
|
|
+```
|
|
|
+
|
|
|
+**Notes**:
|
|
|
+- If a topic doesn't need a token, leave it empty at the corresponding position (between two semicolons)
|
|
|
+- The quantities of `topic` and `token` must match
|
|
|
+
|
|
|
+</details>
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### Recommended Method 2: Docker Environment Variables (.env)
|
|
|
+
|
|
|
+**Configuration Location**: `docker/.env` file in project root directory
|
|
|
+
|
|
|
+**Basic Configuration Example**:
|
|
|
+```bash
|
|
|
+# Multi-account quantity limit
|
|
|
+MAX_ACCOUNTS_PER_CHANNEL=3
|
|
|
+
|
|
|
+# Feishu multi-account (3 groups)
|
|
|
+FEISHU_WEBHOOK_URL=https://hook1.feishu.cn/xxx;https://hook2.feishu.cn/yyy;https://hook3.feishu.cn/zzz
|
|
|
+
|
|
|
+# DingTalk multi-account (2 groups)
|
|
|
+DINGTALK_WEBHOOK_URL=https://oapi.dingtalk.com/xxx;https://oapi.dingtalk.com/yyy
|
|
|
+
|
|
|
+# WeWork multi-account (2 groups)
|
|
|
+WEWORK_WEBHOOK_URL=https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx;https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=yyy
|
|
|
+
|
|
|
+# Bark multi-account (2 devices)
|
|
|
+BARK_URL=https://api.day.app/key1;https://api.day.app/key2
|
|
|
+
|
|
|
+# Slack multi-account (2 channels)
|
|
|
+SLACK_WEBHOOK_URL=https://hooks.slack.com/xxx;https://hooks.slack.com/yyy
|
|
|
+```
|
|
|
+
|
|
|
+**Paired Configuration Examples (Telegram and ntfy)**:
|
|
|
+
|
|
|
+<details>
|
|
|
+<summary><strong>Telegram Paired Configuration</strong></summary>
|
|
|
+
|
|
|
+```bash
|
|
|
+# ✅ Correct: 2 tokens correspond to 2 chat_ids
|
|
|
+TELEGRAM_BOT_TOKEN=123456:AAA-BBB;789012:CCC-DDD
|
|
|
+TELEGRAM_CHAT_ID=-100111;-100222
|
|
|
+
|
|
|
+# ❌ Incorrect: quantities don't match, push will be skipped
|
|
|
+TELEGRAM_BOT_TOKEN=token1;token2;token3
|
|
|
+TELEGRAM_CHAT_ID=id1;id2
|
|
|
+```
|
|
|
+
|
|
|
+**Note**: The quantities of `token` and `chat_id` must match exactly, otherwise the channel push will be skipped.
|
|
|
+
|
|
|
+</details>
|
|
|
+
|
|
|
+<details>
|
|
|
+<summary><strong>ntfy Paired Configuration</strong></summary>
|
|
|
+
|
|
|
+```bash
|
|
|
+# ✅ Correct: 3 topics, only the 2nd needs a token
|
|
|
+NTFY_TOPIC=topic1;topic2;topic3
|
|
|
+NTFY_TOKEN=;token_for_topic2;
|
|
|
+
|
|
|
+# ✅ Correct: 2 topics both need tokens
|
|
|
+NTFY_TOPIC=topic1;topic2
|
|
|
+NTFY_TOKEN=token1;token2
|
|
|
+
|
|
|
+# ❌ Incorrect: topic and token quantities don't match
|
|
|
+NTFY_TOPIC=topic1;topic2
|
|
|
+NTFY_TOKEN=token1;token2;token3
|
|
|
+```
|
|
|
+
|
|
|
+**Notes**:
|
|
|
+- If a topic doesn't need a token, leave it empty at the corresponding position (between two semicolons)
|
|
|
+- The quantities of `topic` and `token` must match
|
|
|
+
|
|
|
+</details>
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### Push Behavior Description
|
|
|
+
|
|
|
+1. **Independent Push**: Each account sends independently, one failure doesn't affect other accounts
|
|
|
+2. **Partial Success**: As long as one account sends successfully, the overall result is considered successful
|
|
|
+3. **Log Differentiation**: Multi-account logs show "Account 1", "Account 2", etc.
|
|
|
+4. **Batch Interval**: Multi-account increases total send time (each account independently calculates batch interval)
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+#### FAQ
|
|
|
+
|
|
|
+<details>
|
|
|
+<summary><strong>Q1: What happens if more than 3 accounts are configured?</strong></summary>
|
|
|
+<br>
|
|
|
+
|
|
|
+The system will automatically truncate to the configured maximum quantity and output warning logs. You can adjust the limit via `max_accounts_per_channel`.
|
|
|
+
|
|
|
+**⚠️ Special Note for GitHub Actions Users**:
|
|
|
+- **Not recommended to configure too many accounts** (suggest no more than 3), which may cause:
|
|
|
+ - **Trigger GitHub Actions rate limits**: Frequent network requests may be identified as abnormal behavior
|
|
|
+ - **Affect Workflow execution time**: Multi-account pushing will extend runtime and may exceed free quotas
|
|
|
+ - **Potential account risks**: Excessive use of GitHub Actions resources may affect account status
|
|
|
+- **Recommended Practices**:
|
|
|
+ - Use `max_accounts_per_channel: 3` or lower values
|
|
|
+ - Adjust Cron execution frequency (e.g., change from hourly to every 2-3 hours)
|
|
|
+ - Prioritize the most important push channels and avoid configuring too many accounts
|
|
|
+
|
|
|
+</details>
|
|
|
+
|
|
|
+<details>
|
|
|
+<summary><strong>Q2: Will multi-accounts affect push speed?</strong></summary>
|
|
|
+<br>
|
|
|
+
|
|
|
+Yes. Each account sends independently, total time = number of accounts × single account send time. Recommend controlling the number of accounts.
|
|
|
+
|
|
|
+</details>
|
|
|
+
|
|
|
+<details>
|
|
|
+<summary><strong>Q3: How can local development users configure in config.yaml?</strong></summary>
|
|
|
+<br>
|
|
|
+
|
|
|
+If you are doing local development and **will not push code to public repositories**, you can configure directly in `config/config.yaml`:
|
|
|
+
|
|
|
+```yaml
|
|
|
+notification:
|
|
|
+ enable_notification: true
|
|
|
+ max_accounts_per_channel: 3
|
|
|
+
|
|
|
+ webhooks:
|
|
|
+ feishu_url: "https://hook1.feishu.cn/xxx;https://hook2.feishu.cn/yyy"
|
|
|
+ telegram_bot_token: "token1;token2"
|
|
|
+ telegram_chat_id: "id1;id2"
|
|
|
+```
|
|
|
+
|
|
|
+**⚠️ Important Reminder**:
|
|
|
+- Ensure `config/config.yaml` is in `.gitignore` (if you will commit code)
|
|
|
+- Or only use in local development environment, **never commit to public repositories**
|
|
|
+
|
|
|
+</details>
|
|
|
+
|
|
|
</details>
|
|
|
|
|
|
<br>
|