HORNET-Storage/HORNETS-Nostr-Relay

GitHub: HORNET-Storage/HORNETS-Nostr-Relay

一个功能丰富的自托管 Nostr Relay 实现,集成社交互动、文件存储与 Web 管理面板,支持付费、公开和邀请制三种运营模式。

Stars: 39 | Forks: 7

![nostr 徽章](https://img.shields.io/badge/nostr-8e30eb?style=flat) ![Go 徽章](https://img.shields.io/badge/Go-00ADD8&logo=go&logoColor=white) # H.O.R.N.E.T 存储 Nostr Relay 🐝 释放 Nostr 的强大功能,通过一个***可配置的一体化 relay***,支持将未分块文件作为 Blossom Blobs、分块文件作为 Scionic Merkle Trees,以及各种作为 Nostr kind 编号的社交媒体功能。 ### 选择 Kind 编号和文件扩展名 Relay 运维人员可以在 [H.O.R.N.E.T Storage Relay 面板](https://github.com/HORNET-Storage/hornet-storage-panel)中通过优雅的 GUI 开关选择要启用的文件类型和 nostr 功能,旁边还配有图表和图形来直观展示随时间推移托管的数据量。 ### 17 个受支持的 Nostr 功能 **✅ - 已实现:** 当前可用且完全运行的功能。 **⚠️ - 开发中:** 目前正在开发中尚未发布的功能。 | NIP 编号 | NIP 描述 | Kind 编号描述 | |------------|------------------------------------|-------------------------------------------------------------------| | NIP-01 | 基础 Nostr 协议 | [***kind0***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind0) → 用户元数据 ✅

[***kind1***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind1) → 短文本帖子 [不可变] ✅ | | NIP-02 | 关注列表 | [***kind3***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind3) → 你关注的用户列表 ✅ | | NIP-05 | 将 Nostr 地址映射到 DNS | 未列出特定 Kinds ✅ | | NIP-09 | 删除笔记 | [***kind5***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind5) → 删除请求 ✅ | | NIP-11 | Relay 信息文档 | 未列出特定 Kinds ✅ | | NIP-18 | 转发 | [***kind6***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind6) → 转发 Kind1 笔记 ✅

[***kind16***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind16) → 转发所有其他 Kind 笔记 ✅ | | NIP-23 | 格式化文章 | [***kind30023***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind30023) → Markdown 帖子 [可更新] ✅ | | NIP-25 | 反应 | [***kind7***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind7) → 点赞、爱心或自定义反应 ✅ | | NIP-45 | 统计关注者及更多... | 未列出特定 Kinds ✅ | | NIP-50 | 搜索能力 | 未列出特定 Kinds ✅ | | NIP-51 | 自定义列表 | [***kind10000***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind10000) → 屏蔽列表 ✅

[***kind10001***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind10001) → 置顶笔记 ✅

*kindxxxx* → 私密关注列表 [已加密] ⚠️

*kindxxxx* → 私密书签 [已加密] ⚠️

[***kind30000***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind30000) → 公开关注列表 [未加密] ✅ | | NIP-56 | 举报 | [***kind1984***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind1984) → 举报用户、帖子或 Relay ✅ | | NIP-57 | Lightning Zaps | [***kind9735***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind9735) → Lightning Zap 收据 ✅ | | NIP-58 | 徽章 | [***kind8***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind8) → 徽章奖励 ✅

[***kind30008***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind30008) → 个人资料徽章 ✅

[***kind30009***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind30009) → 徽章定义 ✅ | | NIP-65 | 传播微型 Relay 列表 | [***kind10002***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind10002) → 微型 Relay 列表 [Outbox 模型] ✅ | | NIP-84 | 高亮 | [***kind9802***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind9802) → 帖子或文章的片段 ✅ | | NIP-116 | 事件路径 | [***kind30079***](https://github.com/HORNET-Storage/hornet-storage/tree/main/lib/handlers/nostr/kind30079) → 使用路径替代 Kind 编号 ✅ | ## 运行完整的 Relay Stack GitHub 发布归档是常规的部署路径。每个平台归档包含: - `hornets-relay`、Airlock 以及与平台匹配的 hyperswarm sidecar。 - 原生 sidecar 预构建版本。 - 版本匹配的 Relay Web 面板。 - Relay 和 Airlock 的示例配置。 - 适用于 Windows 的 `start.bat` 和适用于 Linux/macOS 的 `start.sh`。 - Docker 运行时资产以及包含所有源版本修订的构建清单。 解压其中一个归档文件,保持其目录结构完整,然后运行: ``` .\start.bat ``` 或者: ``` chmod +x start.sh ./start.sh ``` 启动器会首先启动 relay。在全新安装时,它会等待首次运行设置创建 Relay 和 Airlock 配置,然后再启动 Airlock。它仅监督自己启动的进程,并在退出时对其进行清理。 打开 `http://127.0.0.1:11012` 进行首次运行设置。在提供的启动器和 Compose 文件中,设置端口仅限本地回环访问。默认的 Relay endpoint 为 `11000` 和 `11002`;Airlock 的可选 HTTP endpoint 配置为在 `11006` 上进行本地回环访问,且不会由 Docker 配置对外发布。 ### 配置约定 标准的发布版目录结构如下: ``` hornets-relay-/ ├── bin/ │ ├── hornets-relay │ ├── airlock │ ├── hornets-hyperswarm │ └── prebuilds/ ├── relay/ │ ├── config.example.yaml │ └── web/ ├── airlock/ │ └── config.example.yaml ├── start.bat ├── start.sh └── README.md ``` 进程之间不会复制任何私钥或可执行文件路径: - Relay 拥有 Relay 的 Nostr 身份。 - 配置后,Airlock 使用其显式的 `private_key`;否则,它会通过 `relay_config_path` 读取 Relay 密钥,并派生出特定于 Airlock 的、域名隔离的 DHT 种子。原始 Relay 密钥不会被直接复制或重用为 Ed25519 种子。 - 共享的 Go 客户端会在调用者旁边、工作目录、`PATH` 或标准的 Hornet Storage 安装位置发现 sidecar。 - 显式的配置和环境变量始终具有最高优先级,从而保障独立部署和服务部署的兼容性。 生成的配置包含机密信息。请将其权限限制为服务账户,并且不要提交到版本库中。 ## Docker 从 `linux-amd64` 发布归档中运行: ``` docker compose up -d ``` 从同级的源码检出目录运行(`hornets-suite/hornets-nostr-relay`、`airlock`、`nosis-cli`、`hornets-hyperswarm` 和 `hornets-relay-panel`): ``` ./docker/build.sh docker compose up -d ``` 在 Windows 上使用 `docker\build.bat`,然后运行 `docker compose up -d`。持久化的 Relay 和 Airlock 数据存储在命名卷中。设置 UI 仅映射到 `127.0.0.1:11012`。如果运维人员需要超越 Docker 桥接网络的入站 DHT/UDP 行为,应有目的地配置主机网络或特定的部署网络。 ## 从源码构建完整 Stack 要求:Go 1.25+、Git、Node.js 22+、npm 11.10+、Corepack、Yarn Classic,以及用于 Relay 和 Airlock 的 CGO 构建的 C 编译器。Relay 保持启用 CGO,因为它现有的统计存储使用 SQLite;Bleve 保持嵌入式,不会增加另一个原生运行时服务。请将 Airlock、Nosis CLI、hyperswarm 和 Relay 面板保留为同级仓库,因为开发版本构建使用的是本地检出的源码。 Badger 仍然是权威的事件数据库。NIP-50 在配置的 Badger 路径旁边使用嵌入式的、派生的 Bleve 索引;它不增加任何服务、端口或单独管理的进程,并且如果丢失、不兼容或损坏,会自动重建。 Linux/macOS: ``` ./build-stack.sh ``` Windows: ``` .\build-stack.bat ``` 开发构建包被写入 `dist/hornets-relay-dev`,其目录结构与发布归档相同。针对独立开发的各个 Relay 专用构建脚本仍然可用,并且现有的服务安装程序将继续使用其显式的配置路径。 ## 发布工作流 推送 `v*` 标签会触发 `.github/workflows/release.yml`。它会检出相应的组件仓库,在 Linux x64、Windows x64、macOS Intel 和 macOS Apple Silicon 上原生构建每个二进制文件和 Relay 面板,验证完整的运行时目录结构,并发布带有 SHA-256 校验和文件、可供解压的归档。如果同级仓库是私有的,请配置具有读取权限的 `HORNETS_REPO_TOKEN`;公开仓库可以直接使用工作流 token。 手动运行工作流会构建并保留归档,但不会发布 GitHub Release。组件引用是显式输入的,因此发布版本可以固定经过审查的 Airlock、hyperswarm、Nosis CLI 和 Relay 面板修订版本。 ## 附加服务 Relay 还可以集成以下服务: - [Super Neutrino Wallet](https://github.com/HORNET-Storage/Super-Neutrino-Wallet),用于付费 Relay 功能。 - [NestShield](https://github.com/HORNET-Storage/NestShield),用于内容审核。 - [Ollama](https://ollama.com/download),用于高级的本地审核。 ## 安全与验证 打包仅改变了进程发现和部署的易用性。Airlock 仍然是仓库推送和拉取的验证边界;身份验证、签名、权限、DAG 验证以及 Relay/Airlock 的信任规则保持不变。Relay 和 Airlock 仍然可以独立运行,可以使用独立的身份,并且可以连接到外部管理的持久化 sidecar。
标签:EVTX分析, Go, MITM代理, Nostr, Ruby工具, 中继服务器, 去中心化, 文件存储, 日志审计, 社交网络, 自托管, 请求拦截