Skip to content

Commit 79ae16c

Browse files
authored
Merge pull request #723 from Colin-XKL/dev
merge dev into main
2 parents 4d46aff + 590f283 commit 79ae16c

83 files changed

Lines changed: 2100 additions & 605 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ FC_DB_SQLITE_PATH=./db
1515
# Cache Configuration
1616
FC_REDIS_URI=redis://localhost:6379/
1717

18+
# Outbound HTTP User-Agent defaults
19+
FC_HTTP_USER_AGENT_FEED="FeedCraft/2.0"
20+
FC_HTTP_USER_AGENT_HTML="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36"
21+
1822
# LLM Configuration
1923
FC_LLM_API_BASE=https://api.openai.com/v1
2024
FC_LLM_API_KEY=sk-your-api-key-here
@@ -28,4 +32,4 @@ FC_PUPPETEER_HTTP_ENDPOINT=http://localhost:3000
2832
# Frontend Configuration
2933
FRONTEND_PORT=5173
3034
FRONTEND_HOST=localhost
31-
VITE_API_BASE_URL=http://localhost:8080
35+
VITE_API_BASE_URL=http://localhost:8080

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
# https://github.com/docker/build-push-action
100100
- name: Build and push Docker image
101101
id: build-and-push
102-
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
102+
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
103103
with:
104104
file: build/Dockerfile
105105
context: .

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
with:
2727
version: latest
2828

29-
- uses: pnpm/action-setup@v3
29+
- uses: pnpm/action-setup@v6
3030
with:
3131
version: 9
3232

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ Doc: [English](https://feed-craft-doc.vercel.app/en) | [简体中文](https://fe
1919

2020
**FeedCraft** is a simple, powerful RSS feed processing tool.
2121
It can serve as middleware to handle your RSS feeds; you can use it to extract the main text, perform intelligent translation, generate article summaries through AI, filter articles using natural language, and more.
22-
It includes a built-in visual RSS generator (HTML/Curl/Search to RSS) that can turn web pages, API responses, or search results into RSS feeds.
22+
It includes a built-in visual RSS generator (HTML/JSON/Search to RSS) that can turn web pages, JSON API responses, or search results into RSS feeds.
2323

2424
**FeedCraft** 是一个简单、强大的 RSS 源处理工具.
2525
他可以作为一个中间件处理你的 RSS 源, 你可以用它来提取正文、智能翻译、通过 AI 生成文章摘要、通过自然语言筛选文章等.
26-
它内置了可视化 RSS 生成器 (HTML/Curl/Search to RSS),支持将网页、API (Curl) 或搜索结果转换为 RSS 订阅源。
26+
它内置了可视化 RSS 生成器 (HTML/JSON/Search to RSS),支持将网页、JSON API (Curl) 或搜索结果转换为 RSS 订阅源。
2727

2828
## 核心特性
2929

3030
- 开源可自部署. 可以作为中间件与现有的任何 RSS 阅读器协同使用
3131
- AI Power, 可以接入 Open AI 接口兼容的 LLM 对 RSS 进行处理, 可自定义 prompt
32-
- **HTML/Curl/Search to RSS**: 内置可视化 RSS 生成器,支持将网页、API (Curl) 或搜索结果转换为 RSS 订阅源
32+
- **HTML/JSON/Search to RSS**: 内置可视化 RSS 生成器,支持将网页、JSON API (支持 Curl 语句导入) 或搜索结果转换为 RSS 订阅源
3333
- 支持**便携模式**(portable mode, 即用即走, 只需要在原 RSS 地址前面加个前缀即可), 和**高级模式**(dock mode,
3434
在后台页面自定义 RSS 地址和各类深度加工参数)
3535

@@ -87,7 +87,6 @@ https://feed-craft.colinx.one
8787
控制台默认账号`admin`, 密码 `adminadmin`, 登陆后请尽快修改默认密码
8888

8989
```yaml
90-
version: "3"
9190
services:
9291
app.feed-craft:
9392
image: ghcr.io/colin-xkl/feed-craft
@@ -129,6 +128,7 @@ services:
129128
FC_LLM_API_MODEL: gemini-pro/chatgpt-3.5/... # 默认使用的模型
130129
FC_LLM_API_TYPE: openai # openai 或 ollama
131130
FC_DEFAULT_TARGET_LANG: zh-CN # (Optional) LLM 处理任务的默认目标语言
131+
LOG_LEVEL: info # (Optional) 日志级别,如 info, debug, trace
132132
service.redis:
133133
image: redis:6-alpine
134134
container_name: feedcraft_redis

doc-site/src/content/docs/en/guides/advanced/customization.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,15 @@ You can configure FeedCraft using environment variables in `docker-compose.yml`.
6565

6666
- **FC_PUPPETEER_HTTP_ENDPOINT**: Address of the Browserless/Chrome instance. Required for `fulltext-plus`.
6767
- **FC_REDIS_URI**: Redis connection address. Used for caching to speed up processing and reduce AI token consumption.
68+
- **FC_HTTP_USER_AGENT_FEED**: (Optional) Default `User-Agent` for feed-style outbound requests, such as fetching RSS/XML resources. Search provider requests are temporarily grouped into this same rule.
69+
- **FC_HTTP_USER_AGENT_HTML**: (Optional) Default `User-Agent` for HTML page fetches, such as fulltext extraction and the HTML-to-RSS tooling. **Note:** If the value contains spaces or parentheses, it must be enclosed in quotes.
6870
- **FC_LLM_API_KEY**: API Key for OpenAI or compatible services (like DeepSeek, Gemini, etc.).
6971
- **FC_LLM_API_MODEL**: Default model to use (e.g., `gemini-pro`, `gpt-3.5-turbo`). **Multiple Models Support:** You can provide a comma-separated list of models (e.g., `gpt-3.5-turbo,gpt-4`). FeedCraft will randomly select a model for each request and automatically retry with others if a call fails.
7072
- **FC_LLM_API_BASE**: API endpoint address. For OpenAI-compatible APIs, usually ends with `/v1`.
7173
- **FC_LLM_API_TYPE**: (Optional) `openai` (default) or `ollama`.
7274
- **FC_LLM_MAX_CONCURRENCY**: (Optional) Global maximum concurrency for LLM requests (default: `3`). Limits concurrent API calls to prevent rate limits.
7375
- **FC_DOMAIN_MAX_CONCURRENCY**: (Optional) Maximum concurrent requests per target domain during web scraping like fulltext extraction (default: `3`). Prevents overwhelming target servers.
76+
- **LOG_LEVEL**: (Optional) Log level for the backend application (e.g., `info`, `debug`, `trace`). Overrides the default level set by `ENV`.
7477

7578
### External Services
7679

doc-site/src/content/docs/en/guides/advanced/html-to-rss.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sidebar:
1111
FeedCraft includes a visual **HTML to RSS** tool that allows you to generate selectors for creating RSS feeds from websites that don't provide them natively.
1212

1313
:::note
14-
This tool is designed for HTML pages. If you need to process a JSON API, use the [CURL to RSS](/en/guides/advanced/curl-to-rss/) instead.
14+
This tool is designed for HTML pages. If you need to process a JSON API, use the [JSON to RSS](/en/guides/advanced/json-to-rss/) instead.
1515
:::
1616

1717
## Overview

doc-site/src/content/docs/en/guides/advanced/curl-to-rss.md renamed to doc-site/src/content/docs/en/guides/advanced/json-to-rss.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: CURL to RSS
2+
title: JSON to RSS
33
description: Convert any JSON API response into an RSS feed with jq selectors and optional templates.
44
sidebar:
55
order: 3
@@ -8,11 +8,11 @@ sidebar:
88
variant: success
99
---
1010

11-
FeedCraft includes a **CURL to RSS** tool that allows you to fetch data from JSON APIs, extract fields with `jq`, and optionally post-process them with templates before generating an RSS feed.
11+
FeedCraft includes a **JSON to RSS** tool that allows you to fetch data from JSON APIs, extract fields with `jq`, and optionally post-process them with templates before generating an RSS feed.
1212

1313
## Overview
1414

15-
The CURL to RSS tool helps you:
15+
The JSON to RSS tool helps you:
1616

1717
1. **Fetch** JSON data from an API endpoint (supporting custom headers and methods).
1818
2. **Parse** the JSON structure using `jq` syntax, then optionally use templates to build the final RSS fields.
@@ -21,13 +21,13 @@ The CURL to RSS tool helps you:
2121

2222
## How to use
2323

24-
Navigate to **Worktable > Curl to RSS** in the admin dashboard.
24+
Navigate to **Worktable > JSON to RSS** in the admin dashboard.
2525

2626
### Step 1: Request Configuration
2727

2828
You need to define how to fetch the JSON data.
2929

30-
- **Import from Curl**: You can paste a `curl` command to automatically populate the URL, method, headers, and body. This is useful if you copy the request from your browser's Developer Tools.
30+
- **Import from cURL**: You can paste a `curl` command to automatically populate the URL, method, headers, and body. This is useful if you copy the request from your browser's Developer Tools.
3131
- **Method**: Select `GET` or `POST`.
3232
- **URL**: The API endpoint URL.
3333
- **Headers**: Add any necessary headers (e.g., `Authorization`, `Content-Type`).
@@ -50,6 +50,28 @@ The tool uses **[jq](https://jqlang.github.io/jq/)** syntax for querying JSON, a
5050
- **Date Selector**: (Optional) Path to the publication date.
5151
- **Content Selector**: (Optional) Path to the full content or summary.
5252

53+
#### Using Templates (Optional)
54+
55+
You can use [Go Templates](https://pkg.go.dev/text/template) to further process extracted values.
56+
57+
**Available Variables:**
58+
59+
- `.Fields`: The parsed field values (e.g., `.Fields.Title`, `.Fields.Link`, `.Fields.Date`, `.Fields.Description`).
60+
- `.Item`: The raw JSON item object (e.g., `.Item.id`, `.Item.author.name`).
61+
62+
**Built-in Functions:**
63+
64+
- `trimSpace`: Removes leading and trailing whitespace.
65+
- `trim`: Removes specified leading and trailing characters.
66+
- `default`: Provides a fallback value if the field is empty.
67+
68+
**Examples:**
69+
70+
- **Clean up whitespace in title**: `{{ .Fields.Title | trimSpace }}`
71+
- **Build absolute URLs**: `https://example.com/article/{{ .Item.id }}`
72+
- **Remove specific prefixes**: `{{ .Fields.Description | trim "Prefix: " }}`
73+
- **Fallback values**: `{{ default .Fields.Description "No summary available" }}`
74+
5375
Click **Run Preview** to verify your selectors, then click **Next Step**.
5476

5577
### Step 3: Feed Metadata

doc-site/src/content/docs/en/guides/advanced/tools.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,21 @@ The **Craft Dependencies** (System Health) tool visualizes the internal relation
4848
If you encounter errors like "Craft not found", use this tool to trace the broken link in your configuration.
4949
:::
5050

51+
## System Runtime
52+
53+
The **System Runtime** (Observability) tool provides a comprehensive dashboard for monitoring the health and execution status of your resources.
54+
55+
- **Usage**:
56+
1. Navigate to **Tools > System Runtime**.
57+
- **Features**:
58+
- **Resource Health**: View the current status (Healthy, Degraded, Paused) of Recipes and other components, including consecutive failures.
59+
- **Execution Logs**: Track detailed execution history, success rates, and specific error types (e.g., Timeout, Network, Parse) across all runs.
60+
- **System Notifications**: Review automated alerts regarding resource state transitions (e.g., when a Recipe becomes degraded). You can also subscribe to these alerts via the built-in RSS feed at `/system/notifications/rss`.
61+
62+
:::tip
63+
If a Recipe fails repeatedly and becomes "Paused", you can use the System Runtime dashboard to manually "Resume" it after fixing the underlying issue.
64+
:::
65+
5166
## Debug Tools
5267

5368
### LLM Debug

doc-site/src/content/docs/en/guides/start/concepts.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ You can configure processors for a Topic Feed to automatically handle the combin
5757
- **Limit**: Keeps only the most recent items.
5858

5959
**Managing Topic Feeds:**
60+
61+
:::caution
62+
The Topic Feed feature is currently under active development. Its UI entry point in the admin dashboard has been temporarily hidden until the feature is stable and ready for general use.
63+
:::
64+
6065
Navigate to **Worktable > Topic Feed** to create and manage topics.
6166

6267
- **Create**: Define a title, add multiple input URIs (e.g. `feedcraft://recipe/my-recipe` or external RSS URLs), and set your aggregator config.

doc-site/src/content/docs/zh-tw/guides/advanced/customization.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,15 @@ sidebar:
6565

6666
- **FC_PUPPETEER_HTTP_ENDPOINT**: Browserless/Chrome 實例的地址。`fulltext-plus` 功能必須。
6767
- **FC_REDIS_URI**: Redis 連線地址。用於快取,加快處理速度並減少 AI Token 消耗。
68+
- **FC_HTTP_USER_AGENT_FEED**: (可選)feed 類外部請求的預設 `User-Agent`,例如抓取 RSS/XML 資源時使用。搜尋提供方請求目前也暫時歸入這一規則。
69+
- **FC_HTTP_USER_AGENT_HTML**: (可選)HTML 頁面抓取的預設 `User-Agent`,例如全文提取和 HTML 轉 RSS 工具使用。**注意:** 如果該值包含空格或括號,必須使用引號括起來。
6870
- **FC_LLM_API_KEY**: OpenAI 或相容服務(如 DeepSeek, Gemini 等)的 API Key。
6971
- **FC_LLM_API_MODEL**: 預設使用的模型(如 `gemini-pro`, `gpt-3.5-turbo`)。**支援多個模型:** 你可以提供一個逗號分隔的模型列表(例如 `gpt-3.5-turbo,gpt-4`)。FeedCraft 會為每個請求隨機選擇一個模型,如果調用失敗,會自動重試列表中的其他模型。
7072
- **FC_LLM_API_BASE**: API 介面地址。如果是相容 OpenAI 的 API,通常以 `/v1` 結尾。
7173
- **FC_LLM_API_TYPE**: (可選) `openai` (預設) 或 `ollama`.
7274
- **FC_LLM_MAX_CONCURRENCY**: (可選) 全局最大 LLM 併發請求數(預設: `3`)。用於限制併發請求數量以防止觸發 API 速率限制。
7375
- **FC_DOMAIN_MAX_CONCURRENCY**: (可選) 網頁抓取(如全文提取)時每個目標域名的最大併發數(預設: `3`)。防止抓取目標伺服器負載過高。
76+
- **LOG_LEVEL**: (可選) 後端應用的日誌級別 (例如 `info`, `debug`, `trace`)。覆蓋 `ENV` 設定的預設級別。
7477

7578
### 外部服務
7679

0 commit comments

Comments
 (0)