Files
congsh c59dd304f7 fix: 端口更换 & 代码审核修复
端口:
- 服务端口 8000 → 7329
- 前端开发端口 5173 → 7330

安全:
- CORS 收紧为白名单,关闭 credentials
- SPA 路由白名单完善
- 前端 XSS 转义

可靠性:
- 时区统一为 datetime.now(timezone.utc)
- 文章入库改为内存去重 + 增量计数
- OPML 导入改为 body 参数接收
- OPML 导出 URL XML 转义
- 首次抓取改为 BackgroundTasks 异步
- articles.py HTTPException 移到顶部 import
- FTS5 异常显式日志
- FTS5 查询加引号包裹防布尔注入
- 中文摘要支持中文标点
- 去掉未使用的 hashlib import

部署:
- Dockerfile 锁 python:3.12.7-slim
- requirements 锁定具体版本
- healthcheck 不用 curl(镜像里没有)
- docker-compose 使用 .env 文件
- 新增 .env 配置文件
2026-06-11 14:31:29 +08:00

82 lines
1.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# rssKeeper
RSS 抓取、管理与检索系统。支持 Docker 部署,包含 Web UI 和 REST API。
## 功能特性
- 📡 **RSS 源管理** — 添加、编辑、删除 RSS 源,支持自动发现 feed URL
- 📄 **文章管理** — 自动抓取、去重、分类,全文搜索
- 🩺 **健康度监控** — 实时展示每个 RSS 源的成功率、最后更新、文章数量
- 🔍 **全文检索** — 基于 SQLite FTS5 的全文搜索
- 🐳 **Docker 部署** — 单容器部署,数据持久化
- 🔌 **对外 API** — RESTful API 供 AI 或外部系统调用
## 快速开始
### Docker 部署(推荐)
```bash
# 克隆项目
git clone <repo-url>
cd rssKeeper
# 启动(服务运行在 7329 端口)
docker-compose up -d --build
# 访问 http://localhost:7329
```
### 开发模式
```bash
# 后端
cd backend
pip install -r requirements.txt
uvicorn main:app --reload --port 7329
# 前端(另开终端,运行在 7330 端口)
cd frontend
npm install
npm run dev
```
## 对外 API
### 获取最近文章(供 AI 分析)
```bash
# 获取最近 24 小时的文章
curl "http://localhost:7329/api/v1/external/recent?hours=24&limit=50"
# 指定 RSS 源
curl "http://localhost:7329/api/v1/external/recent?feed_id=1&hours=48"
# 指定分类
curl "http://localhost:7329/api/v1/external/recent?category=科技&hours=24"
```
### 获取源列表
```bash
curl "http://localhost:7329/api/v1/external/feeds"
```
### 按源获取文章
```bash
curl "http://localhost:7329/api/v1/external/feeds/1/articles?limit=100"
```
### 获取每日摘要
```bash
curl "http://localhost:7329/api/v1/external/summary?date=2024-06-01"
```
## 技术栈
- **后端**: Python 3.12 + FastAPI + SQLAlchemy + APScheduler
- **数据库**: SQLiteFTS5 全文搜索)
- **前端**: Vue 3 + Element Plus + Vite
- **部署**: Docker + docker-compose