sipcapture/homer

GitHub: sipcapture/homer

一款开源的 SIP/VoIP/RTC 信令抓包与监控平台,基于 DuckDB 数据湖架构实现海量通话数据的高效采集、存储与检索。

Stars: 1949 | Forks: 253

# homer eleven `homer` 是为 Homer 11.x 数据湖提供支持的*多合一* HEP 捕获和 API 服务器单体应用 homer11 ## 特性 - 多合一应用 *(写入器、读取器、协调器、压缩器、API)* - 适用于 Linux/MacOS 上 X64/ARM64 架构的现代化 Golang 代码库 - 由 DuckDB 1.5 和 Apache Arrow/IPC/Parquet 驱动 - 基于 DuckLake Catalog 和 本地/对象存储的数据湖设计 - 端到端列式 OTLP 设计,支持按需查询执行 - 线性扩展以查询共享的对象存储 catalog/池 - 灵活的 Schema 支持,应对不断增长的问题和协议 - 向后兼容所有 HEPv3 代理 (Agent) - 易于维护、操作和扩展 *(可缩减至零!)* - 面向 K8s 和标准部署的云原生设计 - 为人类打造的内置用户界面 - 支持 MCP 且对 LLM/Agent 友好的设计 *(抢走我们枯燥的工作)* ## 架构 Homer 采用模块化架构,具有四个主要组件: ``` ┌─────────────────────────────────────────────────────────────────────────────┐ │ Homer Core │ │ │ │ ┌─────────────┐ ┌─────────────┐ ┌──────────┐ ┌─────────────────┐ │ │ │ Ingest │ │ Storage │ │ Node │ │ Coordinator │ │ │ │ (HEP recv) │──▶│ (DuckLake) │──▶│ gRPC/HTTP│──▶│ (REST API) │ │ │ └─────────────┘ └─────────────┘ └──────────┘ └─────────────────┘ │ │ UDP/TCP/HTTP Parquet+S3 Airport :50051 HTTP :8080 │ │ FlightSQL :50055 (opt. proxy :32010) │ └─────────────────────────────────────────────────────────────────────────────┘ ``` ### 模块 | 模块 | 描述 | |--------|-------------| | **Ingest** | 通过 UDP/TCP/TLS/HTTP/HTTPS 接收 HEP 数据包 | | **Storage** | 将数据写入 DuckLake (Parquet + catalog) | | **Node** | Airport gRPC + HTTP `/query`;可选的用于 Grafana 的 Arrow FlightSQL ([docs/FLIGHTSQL.md](docs/FLIGHTSQL.md)) | | **Coordinator** | 用于 UI 和外部应用程序的 REST API 网关 | ## 快速入门 ### 安装选项 - 下载 [release 版本](https://github.com/sipcapture/homer/releases)并在您的操作系统/架构上安装 `homer` 包 - 使用官方的 [docker 构建](ghcr.io/sipcapture/homer:latest)和 [compose 示例](examples/docker) - 在本地构建您自己的发布版本 _(继续阅读)_ ### 多合一部署 ``` { "ingest": { "enable": true, "udp": { "enable": true, "port": 9060 }, "tcp": { "enable": true, "port": 9061 }, "http": { "enable": true, "port": 9080 } }, "storage": { "enable": true, "ducklake": { "catalog_path": "/data/homer/homer_catalog.sqlite", "data_path": "/data/homer/parquet" } }, "node": { "enable": true, "flight_server": { "port": 50051 } }, "coordinator": { "enable": true, "http_server": { "port": 8080 } } } ``` ### 构建与运行 ``` # 构建 make # 作为服务器运行(默认模式) ./homer --config-path /etc/homer/homer.json # 带 debug 日志 ./homer --config-path /etc/homer/homer.json --log-level debug ``` ## 子命令 Homer 使用基于子命令的 CLI。不带参数运行 `homer` 将启动服务器。 ``` homer Run the server (default) homer search [flags] Search Homer data via coordinator API homer cli [flags] Interactive DuckLake SQL shell homer system [flags] System operations (compaction, extensions, reload) homer wizard [flags] Interactive config generator wizard homer mcp [flags] Start MCP stdio server homer version Show version homer help Show full help with all flags ``` ### 服务器模式(默认) ``` homer --config-path /etc/homer/homer.json homer --config-path /etc/homer/homer.json --log-level debug --syslog-disable ``` | 标志 | 描述 | |------|-------------| | `--config-path ` | 配置文件或目录的路径 | | `--log-level ` | 日志级别:debug、info、warn、error、trace | | `--syslog-disable` | 禁用 syslog,仅使用 stdout | | `--pid-file ` | PID 文件路径 (默认: /var/run/homer-core.pid) | ### 搜索(通过 coordinator API) 使用表格、垂直、CSV、JSON、图表、呼叫流程或 **PCAP** 输出(仅限 SIP;使用 `-o` / `--output` 附加 `--format pcap`)从命令行搜索 Homer 数据。 ``` # 基础 SIP 搜索(过去一小时) homer search --host 10.0.0.1:8081 --user admin --pass secret # 搜索 INVITE 消息并查看呼叫流程图 homer search --host 10.0.0.1:8081 --method INVITE --format callflow # 导出 SIP 消息到 pcap 文件(与 API /transactions/export/pcap 相同的 framing) homer search --host 10.0.0.1:8081 --call-id "abc123@host" --format pcap -o /tmp/call.pcap # 按 Call-ID 搜索 homer search --host 10.0.0.1:8081 --call-id "abc123@host" --format vertical # 后置过滤器:仅 INVITE 和 BYE,排除临时响应 homer search --host 10.0.0.1:8081 --grep "INVITE,BYE" --exclude "100,183" # 交互式 TUI 模式 homer search --host 10.0.0.1:8081 --interactive ``` 完整文档和示例请参见 [docs/SEARCH.md](docs/SEARCH.md)。 ### CLI(DuckLake SQL Shell) 用于直接进行 DuckLake 查询的交互式 SQL shell: ``` # 启动交互式 CLI homer cli --config-path /etc/homer/homer.json # 执行单次查询并退出 homer cli --config-path /etc/homer/homer.json --query "SELECT COUNT(*) FROM homer_lake.main.hep_proto_1_call" ``` | 命令 | 描述 | |---------|-------------| | `help`, `\h`, `\?` | 显示帮助 | | `tables`, `\dt` | 列出可用的表 | | `clear`, `\c` | 清屏 | | `exit`, `quit`, `\q` | 退出 CLI | ### 系统操作 ``` # 运行完全 compaction homer system --config-path /etc/homer/homer.json --compaction-force # 安装 DuckDB 扩展 homer system --config-path /etc/homer/homer.json --install-extensions # 显示 DuckDB 版本 homer system --config-path /etc/homer/homer.json --duckdb-version # 生成示例 config homer system --generate-example-config > homer.json # 重新加载运行中的进程 homer system --reload ``` ### 向导(配置生成器) 交互式向导,用于生成完整的 `homer.json` 配置: ``` # 交互式 TUI 向导 homer wizard # 非交互式:为特定 deployment profile 生成 config homer wizard --profile all-in-one --output homer.json homer wizard --profile writer --output homer-writer.json homer wizard --profile coordinator --output homer-coordinator.json homer wizard --profile edge --output homer-edge.json homer wizard --profile node --output homer-node.json ``` | 配置文件 | 启用的模块 | |---------|----------------| | `all-in-one` | ingest + storage + node + coordinator | | `writer` | ingest + storage | | `edge` | ingest + storage + node | | `coordinator` | 仅 coordinator | | `node` | 仅 node | ## 配置示例 参见 `examples/` 目录: | 文件 | 描述 | |------|-------------| | `homer.json` | 多合一部署 | | `homer-writer.json` | Ingest + Storage + Node | | `homer-node.json` | 仅 Node (只读) | | `homer-coordinator.json` | 仅 Coordinator | | `homer-edge.json` | Edge 部署 | ## 文档 - [搜索 CLI](docs/SEARCH.md) - 从命令行进行搜索(示例、格式、呼叫流程) - [配置向导](docs/WIZARD.md) - 交互式配置生成器 (TUI + 预设) - [Coordinator 模块](docs/COORDINATOR.md) - REST API 网关 - [MCP UI 指南](docs/MCP_UI_GUIDE.md) - 自然语言查询助手(配置 + UI 用法) - [Node 模块](docs/NODE.md) - FlightSQL 数据服务器 - [存储架构](docs/STORAGE_ARCHITECTURE.md) - DuckLake 存储 - [存储策略](docs/STORAGE_POLICIES.md) - 分层存储(冷/热) - [压缩设置](docs/COMPACTION_SETUP.md) - 文件压缩 ## 许可证 基于 [AGPL-3.0 许可证](LICENSE.md) 发布
标签:Apache Arrow, DEF CON 演示, DuckDB, EVTX分析, Google搜索, Go语言, Gradle集成, HEP协议, LLM, MCP支持, Python工具, RTC, SIP协议, Unmanaged PE, VoIP, 分布式架构, 列式存储, 子域名突变, 实时通信, 开源, 故障排查, 数据湖, 日志审计, 程序破解, 端到端监控, 网络性能监控, 网络流量捕获, 网络测绘, 请求拦截, 防御绕过