Skip to content

AstrBot Resource MonitorDistribution Route Probe Plugin

Scheduled resource-distribution monitor for AstrBot that verifies remote config endpoints, manifests, HTTP Range chunks, MD5 checksums, hot-update packages, and TLS expiry with debounced alerting and QQ official acknowledgment.

Capabilities & Explicit Limits ​

What AstrBot Resource Monitor Delivers

  • 10 Content & Protocol Probes: Validates config sanity, version non-regression, majority manifest consensus, HTTP 206 Range slicing, 32-hex MD5 chunk rotation (7-day coverage), hot-package streaming checksums, and TLS <14d/<3d expiry.
  • Public-Only SSRF & Chat Safety: PublicResolver pins public IPs (blocking loopback/private ranges and trust_env proxies), enforces a 64 MiB fetch cap, sanitizes output via render.safe(), and drives M-of-N alerts + QQ Official /线路 ack.
  • Dual-Lock Isolation & Pluggable SPIs: Independent 300s fast and 3600s slow async locks plus offline-testable Source and HttpClient interfaces.

Explicit Non-Goals & Hard Boundaries

  • Strictly Read-Only Observation: Never collects host CPU/RAM/disk metrics, never switches live CDN routing or edits upstream configs, and never acts as a long-term SLA database.
  • Public Targets & Heavy-Check Gating: Blocks LAN/private targets and env proxies; manual chat probes enforce allow_heavy=False and shared cooldowns; bundles zero built-in default endpoints (entry_url or mirrors is mandatory).

Interactive Topology Overview ​

Host, Plugin, SSRF Guard & Alert Delivery Topology (Pan / Zoom)
Open Fullscreen ↗

Implementation alignment note: The embedded diagram depicts high-level topology between AstrBot, the plugin core, SSRF/output guards, and delivery channels. Actual probes implemented in watch/ inspect external distribution configs, manifests, HTTP Range chunks, MD5 hashes, hot-update archives, and TLS expiry — never host CPU or memory telemetry.

Quick Local Verification ​

sh
# 1. Run offline unit tests (252 total; 5 aiohttp boundary tests skip if aiohttp is absent)
python3 -m unittest discover -s tests -t . -v

# 2. Verify no real endpoints or credentials are committed
python3 tools/check-no-endpoints.py --verbose

Documentation Guide ​

Quick Navigation by Role & Goal