{"repo": "aneiangsoft/aneiang.yarp", "files": {"README.md": {"0b6ab4b8194091061ad932030fcaffa89e827917": {"t": 1785746399.1603527, "n": 24573, "h": "3171a48f49147a44", "c": "
\n\"LOGO\"\n\n**Aneiang.Yarp — Full-featured API Gateway powered by YARP**\n\nDashboard · Dynamic Routing · WAF · AI Assistant · 2FA · Notifications · IP Isolation · Auto-Registration\n\n[![NuGet](https://img.shields.io/nuget/v/Aneiang.Yarp.svg)](https://www.nuget.org/packages/Aneiang.Yarp)\n[![NuGet](https://img.shields.io/nuget/v/Aneiang.Yarp.Dashboard.svg)](https://www.nuget.org/packages/Aneiang.Yarp.Dashboard)\n[![NuGet](https://img.shields.io/nuget/v/Aneiang.Yarp.Client.svg)](https://www.nuget.org/packages/Aneiang.Yarp.Client)\n[![YARP](https://img.shields.io/badge/YARP-2.3.0-blue.svg)](https://github.com/microsoft/reverse-proxy)\n[![.NET](https://img.shields.io/badge/.NET-8.0%20%7C%209.0-purple.svg)](https://dotnet.microsoft.com/)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n\n[English](README.md) | [中文](README.zh-CN.md)\n\n
\n\n---\n\n**Aneiang.Yarp** is an enhanced, production-ready API gateway built on [Microsoft YARP](https://microsoft.github.io/reverse-proxy/) 2.3.0. It adds everything YARP leaves for you to build: a visual management dashboard, WAF firewall, AI assistant, notification alerts, health monitoring, circuit breaker views, client auto-registration, IP-based load balancing — all through three NuGet packages.\n\n> **Docs**:https://yarp.aneiang.com\n\n> **Live Demo**: https://yarp-test.aneiang.com/aneiang  ·  `admin` / `demo123`\n\n> **Online proxy address (site and proxy port are isolated)**: https://yarp-proxy.aneiang.com\n\n---\n\n## Packages\n\n| Package | Purpose | Depends on YARP |\n|:--------|:--------|:---:|\n| **Aneiang.Yarp** | Gateway core: dynamic routing, config persistence, API auth, IP-based LB | ✅ |\n| **Aneiang.Yarp.Dashboard** | Web admin UI: full CRUD, WAF, AI assistant (Function Calling), 2FA, notifications, health check, circuit breakers, audit log | via core |\n| **Aneiang.Yarp.Client** | Client SDK: one-liner auto-register / unregister on startup and shutdown | ❌ |\n| **Aneiang.Yarp.Storage.Abstractions** | Storage interfaces & entities (8 repository interfaces) | ❌ |\n| **Aneiang.Yarp.Storage.Sqlite** | SQLite implementation with SQLCipher AES-256 encryption | via abstractions |\n| **Aneiang.Yarp.Grpc** | gRPC registration protocol (GatewayRegistry.proto) | ❌ |\n\n```\nAneiang.Yarp.Dashboard\n └── Aneiang.Yarp\n ├── Aneiang.Yarp.Client\n ├── Aneiang.Yarp.Grpc\n └── Aneiang.Yarp.Storage.Abstractions\n └── Aneiang.Yarp.Storage.Sqlite\n\nClient microservice → reference Aneiang.Yarp.Client only (zero YARP SDK)\nGateway project → reference Aneiang.Yarp + Aneiang.Yarp.Dashboard\n```\n\n---\n\n## Dashboard\n\nA full-featured web admin panel — **two lines of code** to enable:\n\n```csharp\nbuilder.Services.AddAneiangYarpDashboard();\n// ...\napp.UseAneiangYarpDashboard();\n```\n\n

\n \"Dashboard\n

\n\n### All 15 Dashboard Pages\n\n| Group | Page | Description |\n|:------|:-----|:------------|\n| **Overview** | Overview | Active routes & clusters count, traffic QPS summary, cluster health quick preview, recent change timeline |\n| **Gateway** | Clusters | Create, edit, delete clusters with destinations, configure active/passive health checks, `HttpRequest` & `HttpClient` settings |\n| | Routes | Manage routes with transforms, metadata (`Waf:Enabled` per-route), drag-and-drop priority ordering, `CorsPolicy` config |\n| **Monitoring** | Statistics | Request volume trends, P50/P90/P99 latency percentiles, HTTP status distribution pie chart, top routes ranking |\n| | Logs | Real-time log stream (WebSocket) + history (TraceID-paired request/response merged view), filter by route/status/TraceID, sensitive data sanitization, sampling & errors-only mode |\n| | Circuits | Per-cluster/destination circuit breaker status: Closed (green) / Open (red) / HalfOpen (yellow), consecutive failures vs threshold, recovery countdown, one-click reset |\n| | Notifications | Manage webhook channels (DingTalk bot / generic HTTP), configure event rules (per-type toggle + cooldown), view notification history |\n| | Health Check | Cluster-level health overview table, drill-down per destination showing real-time health status, last check time & result |\n| **Security** | WAF Firewall | IP whitelist/blacklist (exact IP / CIDR / wildcard), SQL injection, XSS, path traversal detection, request size limits, security response headers |\n| | Policies | Traffic policies: create, edit, enable, disable, reorder — supports retry, timeout, rate limit, request transform |\n| | Plugins | View all registered `IGatewayPlugin` plugins, plugin metadata & load order |\n| **System** | Config History | Auto-snapshot before every change, view full content of any snapshot, one-click rollback to any version |\n| | Audit Log | Full audit trail: operation type, target, operator, before/after JSON diff, precise timestamp |\n| | Deployment | Current deployment mode (AllInOne/Split/ProxyOnly/DashboardOnly), listening endpoints (name/address/port/role/public status), health check endpoints & security warnings |\n| | Settings | Auth mode switching, JWT key config, AI config, log settings (sampling rate/sanitize list/body length limit), one-click database download, language switch |\n\n---\n\n## Core Features\n\n### Dynamic Routing\n\nYARP requires `appsettings.json` + restart for route changes. Aneiang.Yarp adds full runtime management:\n\n- **Dual-source config**: static (`appsettings.json`) + dynamic (API / Dashboard), merged in YARP's `InMemoryConfigProvider`\n- **Auto-persistence**: dynamic changes auto-save to `gateway-dynamic.json`, survive restarts\n- **Source tracking**: every route & cluster records `CreatedAt`, `CreatedBy`, `Source` metadata\n- **Thread-safe**: all operations protected by `SemaphoreSlim(1,1)` — async-friendly concurrency\n\n### WAF Firewall\n\nProduction-grade web application firewall built into the gateway — no external service needed.\n\n| Protection | Details |\n|:-----------|:--------|\n| **IP Blacklist / Whitelist** | Exact IP, CIDR (`192.168.1.0/24`), wildcard. Whitelist takes priority. Regex-cached for performance. |\n| **SQL Injection** | Two precompiled regex patterns (keywords + injection values) with 5ms ReDoS timeout |\n| **XSS** | Detects `