-
Notifications
You must be signed in to change notification settings - Fork 0
Docker Webhook Server Specification
Language / שפה: English | עברית
This document formalizes the design principles, architecture, API contracts, and deployment model for RightSub's native Webhook Server and official Docker container.
The objective is to enable turnkey, zero-kludge integration into home media environments (Unraid, TrueNAS SCALE, Synology DSM, Docker Compose) and downloader stacks (*arr and Bazarr) without requiring host-level Python installations or brittle custom scripts.
-
Container Isolation on Homelab & NAS Hardware:
- Modern homelabs and NAS appliances run Sonarr, Radarr, and Bazarr in isolated Docker containers.
- Operating systems like Unraid, TrueNAS SCALE, and Synology DSM discourage direct package/library installations onto the host OS.
-
The Failure of In-Container Custom Scripts:
- Attempting to configure custom post-processing scripts inside Bazarr or Sonarr that call
rightsub autofails immediately withcommand not found, because RightSub is not installed inside the third-party container.
- Attempting to configure custom post-processing scripts inside Bazarr or Sonarr that call
-
Current Community Workarounds ("Kludgy Scripts"):
- Users currently build ad-hoc Flask servers or fragile cron jobs to intercept events and trigger custom subtitle commands.
-
The Architectural Opportunity in Native
*arr/ Bazarr Webhooks:- Sonarr, Radarr, and Bazarr feature robust built-in Webhook notification engines that emit structured HTTP POST JSON payloads the moment an episode or subtitle file lands on disk.
-
Zero Heavy Server Dependencies:
- The Webhook server is embedded directly into the RightSub codebase, invokable via
rightsub serve --port 8775. - Built on lightweight Python standard libraries (
http.server/asyncio) consuming under 15 MB RAM idle.
- The Webhook server is embedded directly into the RightSub codebase, invokable via
-
Native Parsing for Sonarr, Radarr, and Bazarr Payloads:
- Automatic schema matching without complex user parameter tuning.
-
Autonomous Container Path Mapping (
PATH_MAP):- Bridges path disparities when Sonarr sees
/data/media/tvwhile RightSub mounts/tv.
- Bridges path disparities when Sonarr sees
-
Seed-Safe Guarantee for Active Torrents:
- Never alters original torrent subtitle files in-place; always generates mastered sidecar files (
<stem>.he.srt).
- Never alters original torrent subtitle files in-place; always generates mastered sidecar files (
-
Accelerated Metadata Sync for Plex & Infuse:
- Automatic
os.utime()flushing ensuring instantaneous player index recognition.
- Automatic
Default listening port: 8775 (configurable via RIGHTSUB_PORT or --port flag).
-
Supported Events:
Download,Upgrade,Rename. -
Payload Schema:
{ "eventType": "Download", "series": { "title": "Boston Legal", "path": "/data/media/tv/Boston Legal" }, "episodeFile": { "relativePath": "Season 01/Boston Legal - S01E01.mkv", "path": "/data/media/tv/Boston Legal/Season 01/Boston Legal - S01E01.mkv" } } -
Processing Flow:
- Translates path via
PATH_MAP. - Scans episode directory for existing companion
.srtfiles or embedded subtitle streams. - Executes
SubRefine(BiDi RLM punctuation, SDH removal, CP1255 encoding repair). - Returns
200 OKwith execution report.
- Translates path via
-
Supported Events:
Download,MovieFileImported. -
Payload Schema:
{ "eventType": "Download", "movie": { "title": "Gladiator", "folderPath": "/data/media/movies/Gladiator (2000)" }, "movieFile": { "relativePath": "Gladiator (2000).mkv", "path": "/data/media/movies/Gladiator (2000)/Gladiator (2000).mkv" } }
-
Supported Events:
Subtitle Downloaded. -
Payload Schema:
{ "event": "download", "subtitle": { "path": "/data/media/tv/Boston Legal/Season 01/Boston Legal - S01E01.he.srt", "language": "he" } } -
Processing Flow:
- Verifies language is Hebrew (
he/heb). - Executes instant mastering (RLM injection, CP1255 fix, SDH cleaning) in ~0.05s to 0.2s.
- Verifies language is Hebrew (
- Generic endpoint for ad-hoc external calls:
{ "path": "/media/tv/show.srt", "action": "refine" }
- Health check and operational status:
{ "status": "healthy", "version": "1.4.0", "uptime_seconds": 86400, "processed_count": 142 }
Container volumes frequently expose different mount prefixes.
RightSub supports flexible path translation via PATH_MAP:
Syntax: MAPPING=FROM_PREFIX:TO_PREFIX[,FROM_2:TO_2]
Example:
PATH_MAP="/data/media:/media"Translates incoming payload path:
/data/media/tv/Boston Legal/S01E01.mkv
Into container path:
/media/tv/Boston Legal/S01E01.mkv
version: "3.8"
services:
rightsub:
image: ghcr.io/omerninyo/rightsub:latest
container_name: rightsub
restart: unless-stopped
ports:
- "8775:8775"
environment:
- RIGHTSUB_PORT=8775
- PATH_MAP=/data/media:/media
- PUID=1000
- PGID=1000
- TZ=Asia/Jerusalem
volumes:
- /mnt/storage/media:/media
- /mnt/storage/appdata/rightsub:/config- Navigate to:
Settings->Connect-> click+and chooseWebhook. -
Name:
RightSub BiDi Master -
URL:
http://rightsub:8775/webhook/sonarr(or Docker host IP). -
Method:
POST -
Triggers: Check
On DownloadandOn Upgrade. - Click Test and Save.
- Navigate to:
Settings->Notifications-> selectWebhook. -
URL:
http://rightsub:8775/webhook/bazarr -
Notification Types: Check
On Subtitles Download.
-
Phase 1: Core Webhook Daemon:
- Implement
src/daemon/webhook_server.pywith zero heavy dependencies. - Built-in Sonarr, Radarr, and Bazarr parsers.
- Implement
-
Phase 2: Asynchronous Worker Queue & Path Mapping:
- Background thread-pool processing preventing HTTP timeouts on large batches.
- Prefix translation logic.
-
Phase 3: Docker Packaging & GHCR Pipeline:
- Streamlined
Dockerfile(python:3.11-slim). - GitHub Actions workflow publishing multi-arch images (
amd64,arm64) toghcr.io. - Official Unraid Community Applications template XML.
- Streamlined
RightSub Wiki — Subtitles Done Right. Powered by the SubRefine Algorithmic Engine & SubSwarm Multi-Agent AI.
- Home
- 📦 Global Installation Guide
- 🔰 Quickstart for Beginners
- BiDi & Plex Guide
- Pipeline Workflow
- On-Device STT & Sync (quicksubs)
- TMDb Metadata & Entity Resolution
- AI Assistants & Integration
- ⚖️ RightSub vs. Bazarr Comparison
- 🔄 Home Media & Download Integrations
- 🔮 Interactive CLI Specification
- 🔮 Setup & Health Wizard Specification
- 🔌 MCP Server Specification
- 💎 Semantic AI Polish & QC Specification
- 🐳 Docker Webhook Server Specification
- 🗺️ Product Roadmap
- 🚀 What's New & Release Notes
- Boston Legal Case Study
- CLI Reference
- דף הבית (Home HE)
- 📦 מדריך התקנה גלובלית והפצה
- 🔰 מדריך פשוט למתחילים
- מדריך BiDi ו-Plex
- תהליך עבודה מלא
- תמלול וסנכרון מקומי (quicksubs)
- אינטגרציית TMDb (עלילה ומגדר)
- חיבור לכלי בינה מלאכותית (AI)
- ⚖️ השוואה טכנית מול Bazarr
- 🔄 מדריך אינטגרציות ואוטומציה לשרתי מדיה
- 🔮 מפרט אשף פקודה אינטראקטיבי
- 🔮 מפרט אשף התקנה ואבחון
- 🔌 מפרט שרת MCP
- 💎 מפרט מנוע ליטוש סמנטי ו-QC
- 🐳 מפרט שרת Webhook וקונטיינר
- 🗺️ מפת דרכים ומעקב אבני-דרך
- 🚀 מה חדש ועדכוני גרסאות
- מקרה בוחן - בוסטון ליגל
- מדריך פקודות CLI