feat(signalr): opt-in SignalR/WebSocket passthrough for proxied arrs (#91) - #111
Open
bakerboy448 wants to merge 1 commit into
Open
feat(signalr): opt-in SignalR/WebSocket passthrough for proxied arrs (#91)#111bakerboy448 wants to merge 1 commit into
bakerboy448 wants to merge 1 commit into
Conversation
…otifiarr#91) Adds an nginx /signalr location that WebSocket-proxies /<base>/signalr/* to the backend arr, using an internal auth_request to signalr/auth.php which resolves the scoped key via getAppFromProxiedKey, gates on a new per-app 'signalr' opt-in flag (migration 009), validates the backend URL, and swaps the scoped access_token for the backend's real key. PHP cURL cannot proxy WebSockets, so this stays at the nginx layer. Bazarr templates opt in; admin UI adds the toggle. Closes Notifiarr#91
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #91: pass
/<base>/signalr/*through to the backend arr so consumers that use the arr SignalR real-time channel (Bazarr first) keep working when repointed at starrproxy with a scoped key.How it works
location ~ ^(.*)/signalr/(.*)$WebSocket-proxies to the backend, using an internalauth_requestto a small newsignalr/auth.php.auth.phpresolves the scoped key with the existinggetAppFromProxiedKey(), then returns the backend URL + the backend's real key + rewritten query args (scopedaccess_tokenswapped for the real key) via response headers for nginx to proxy_pass with.signalrflag (migration009, default0) gates it -auth.phpreturns 403 unless the app enabled it. Admin UI adds the toggle; the Bazarr templates opt in./api,/feed,/backup,/health, PHP, and static routes are unchanged.Testing note: authored without a live build - PHP not linted locally and the WebSocket path needs testing against a live Sonarr/Radarr + Bazarr (including the disabled-flag 403 case). Happy to iterate.
Closes #91