ma111e/downlink

GitHub: ma111e/downlink

Downlink 是一个安全新闻聚合平台,通过 LLM 对 RSS 文章进行评分和摘要,自动生成排名摘要并发布到 GitHub Pages 和 Discord。

Stars: 2 | Forks: 0

# 下行链路 [![CI](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/4ccca4bcff092201.svg)](https://github.com/ma111e/downlink/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Go Version](https://img.shields.io/badge/go-1.25-00ADD8.svg)](go.mod) [![Docker Image](https://img.shields.io/github/v/tag/ma111e/downlink?logo=docker&logoColor=white&label=ghcr.io%2Fma111e%2Fdownlink&color=2496ED)](https://github.com/ma111e/downlink/pkgs/container/downlink) 一个用于安全新闻的 feed 聚合器和内容分析平台。Downlink 收集 RSS/Atom feed,抓取完整的文章内容,通过 LLM 对每篇文章进行基于评分标准的打分和总结, 并组装出可以发布到 GitHub Pages 和 Discord 的排名摘要。 ## 功能 - **多提供商 LLM** Claude、ChatGPT Codex、Mistral、vLLM、Ollama 和 llama.cpp (任何兼容 OpenAI 的 endpoint) - **打分** 文章由 LLM 进行直觉打分,或者跨越六个维度 (具体性、严重性、广度、新颖性、可操作性、可信度)进行打分,而不是单一的 不透明数字。参见 [`pkg/scoring`](pkg/scoring)。 - **灵活的抓取** 纯 RSS、动态抓取 (Lightpanda) 以及完整浏览器 抓取([Solimen](https://github.com/ma111e/solimen)),支持针对特定 feed 的 CSS 选择器、触发器、黑名单和 headers。 - **摘要生成** 分类、按重要性排名且经过去重的摘要。 - **初学者模式** 为每篇文章提供可选的通俗语言解释和术语表, 可在摘要页面进行切换。 - **发布** 将静态摘要推送到 GitHub Pages 并通知 Discord webhook。 - **接口** gRPC API(默认 `:50051`)、Atom feed 导出(`:65261`)以及 `dlk` 命令行客户端。 ## 架构 | 组件 | 路径 | 描述 | | ----------------- | ------------- | ------------------------------------------------------------------- | | Server | `cmd/server` | gRPC 服务 + feed 管理器 + Atom feed 导出。 | | CLI (`dlk`) | `cmd/dlk` | 用于文章、feed、分析、摘要、配置、queue 管理的 gRPC 客户端。 | | 共享包 | `pkg/` | 打分、LLM 网关/提供商、codex 认证、模型、protobufs。 | Server 暴露用于文章、分析、feed、摘要、queue 管理、配置和认证的 gRPC 服务。Atom feed 服务器在 `http://localhost:65261` 发布分析后的文章。 ## 安装 使用 Go 1.25+: ``` go install github.com/ma111e/downlink/cmd/dlk@latest # CLI go install github.com/ma111e/downlink/cmd/server@latest # server ``` 或者从源码构建: ``` make all # builds server + cli make server # build just the server make cli # build just dlk ``` 或者使用 Docker: ``` docker build -t downlink . docker run --rm -p 50051:50051 -p 65261:65261 \ -v "$PWD/config.json:/app/config.json" \ -v "$PWD/feeds.yml:/app/feeds.yml" \ downlink ``` 提供了一个 `docker-compose.yml`,它还配置了可选的 Solimen 完整浏览器抓取器。 ## 快速开始 **1. 构建二进制文件**(参见[安装](#install)): ``` make all # produces ./server and ./dlk ``` **2. 创建您的配置** 并至少启用一个 LLM 提供商(分析需要一个; 获取 feed 则不需要): ``` cp config.example.json config.json $EDITOR config.json # enable a provider + fill in its api_key ``` **3. 编写一个包含几个公开安全 feed 的演示 `feeds.yml`**: ``` feeds: - url: https://cert.gov.ua/api/articles/rss title: Cert-UA type: rss enabled: true scraping: dynamic # "dynamic" (Lightpanda) or "full_browser" (Solimen); omit for static RSS scraper: article: div.article-item__content # CSS selector for the article body - url: https://www.bleepingcomputer.com/feed/ title: Bleeping Computer type: rss enabled: true scraper: triggers: loaded: - article .article_section scraping: full_browser selectors: article: div.articleBody - url: https://feeds.feedburner.com/TheHackersNews title: The Hacker News type: rss enabled: true scraper: triggers: loaded: - div.main-box scraping: full_browser selectors: article: '#articlebody' cutoff: .stophere ``` **4. 启动服务器**(在一个终端中)。快速开始的 feed 同时使用了两种抓取器,因此也要 启动它们(需要 Docker): ``` ./server --auto-start-lightpanda --auto-start-solimen ``` **5. 应用 feed。** `dlk feed apply` 将数据库与文件进行协调。文件中的 feed 将被创建或更新,不再列出的 feed 将被禁用 (其文章将被保留)。首先使用 `--dry-run` 进行预览: ``` ./dlk feed apply -f feeds.yml --dry-run # show what would change ./dlk feed apply -f feeds.yml # apply it ``` **6. 获取并生成摘要。** `digest generate` 会使用您的 LLM 提供商分析任何尚未打分的 文章,然后组装出排名摘要: ``` ./dlk feed refresh all # pull the latest articles ./dlk digest generate # analyze + assemble the ranked digest ``` **7. 查看结果:** ``` ./dlk digest list # list generated digests ./dlk digest get # pick one and view it (add --markdown for prose) ``` `./dlk feed export -f feeds.yml` 执行与第 5 步相反的操作:它将当前数据库中的 feed 回写到 YAML 文件中。 ## 文档 完整指南位于 [docs/](docs/README.md):包含入门、配置和 CLI 参考、feed 和抓取、分析和打分、LLM 提供商、摘要、发布 以及部署。 ## 配置 Downlink 从三个来源读取配置。复制内置的示例并 填入您的值: ``` cp config.example.json config.json # LLM providers, analysis, notifications cp feeds.example.yml feeds.yml # feed sources and per-feed scraping rules cp .env.example .env # runtime/env overrides ``` - **`config.json`** LLM 提供商定义(名称、类型、模型、base URL、API key), 当前启用的分析提供商及其 persona/写作风格,以及通知设置 (Discord webhook、GitHub Pages 仓库/token/分支)。参见 [config.example.json](config.example.json)。 - **`feeds.yml`** feed 列表,包含每个 feed 的抓取策略、CSS 选择器、 触发器、黑名单和自定义 HTTP headers。参见 [feeds.example.yml](feeds.example.yml)。 - **`.env`** 每个服务器 flag 都有一个等效的 `DOWNLINK_*` 环境变量 (通过 Viper 自动加载)。参见 [.env.example](.env.example)。优先级:CLI flag -> 环境变量/`.env` -> `config.json` -> 默认值。 ## 发布摘要 Downlink 可以将生成的摘要发布到 GitHub Pages 并在 Discord 上公告。 有关完整的设置,包括 `--init-gh-pages` 和所需的 token scope,请参见 [docs/github-pages.md](docs/github-pages.md)。 ## 部署 在 [etc/downlink.service](etc/downlink.service) 提供了一个示例 systemd unit, 用于在 `/opt/downlink` 下运行服务器。 ## 许可证 [MIT](LICENSE) © 2026 ma111e 目前不接受贡献。
标签:C2, DLL 劫持, EVTX分析, Go, Python工具, RSS聚合, Ruby工具, URL抓取, 内容分析, 大语言模型, 安全资讯, 数据抓取, 日志审计, 网络调试, 自动化, 请求拦截