- Intercepts POST /sentinel/alerton your Sentinel FastAPI app
- Lets your existing handler run first (Telegram etc.)
- If the response is 200, forwards the same alert to Connector Hub /bridge/ingest
- HMAC and Idempotency-Key are added automatically
- Drop hub_patch.pynext to your FastAPI app code (PYTHONPATH-visible).
- Add two lines near where you create your FastAPI()app:
from hub_patch import register_hub_forwarder
register_hub_forwarder(app)- Set environment variables:
HUB_URL=https://<HUB_DOMAIN>.up.railway.app/bridge/ingest
CONNECTOR_SECRET=sentinel_20250818_abcd1234
- Deploy and test:
- Trigger a normal alert (Telegram should still work)
- Check your Hub logs for POST /bridge/ingest 200
- curl -sS https://<HUB_DOMAIN>.up.railway.app/jobs | jq .
- Remove the two lines; delete hub_patch.py(no other changes needed).