arrstack: set *arr AuthenticationMethod=External (proxy-trusted) #382
Reference in New Issue
Block a user
Delete Branch "benvin/arr-external-auth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The *arr UIs reached through arrproxy were prompting "Authentication Required". Sonarr v4 (and Radarr/Prowlarr on the same Servarr auth code) refuses remote access when
AuthenticationMethod=None, so the web UI kept demanding a login even though arrproxy + oauth2-proxy already authenticate every user at the front door. That is a double prompt with no purpose.Change
Extend the existing
apikey-initcontainer for sonarr / radarr / prowlarr to also idempotently enforce, in/config/config.xml:<AuthenticationMethod>External</AuthenticationMethod><AuthenticationRequired>Enabled</AuthenticationRequired>Create-or-replace both elements (same idempotent sed/printf pattern already used for
<ApiKey>/<UrlBase>), without disturbing ApiKey or UrlBase. Pods useRecreate, so they roll and re-run the init container on apply.Why this is the correct, header-less fix
In the Servarr v4 source,
AddExternal()registers the identicalNoAuthenticationHandlerasAddNone()—Externalrequires no username header (noX-Forwarded-User/Remote-User). It differs fromNoneonly in that it is exempt from the None remote-access block, so the UI stops prompting while remote access is permitted.This matters because arrproxy's
trustBoundarydeliberately strips all inbound identity headers and forwards only the realX-Api-Keyto the upstream *arr — it forwards no username header. BecauseExternalneeds none, that stripping is irrelevant and no arrproxy change is required. The API path is unaffected (arrproxy injects the real key; *arr API auth is key-based regardless of AuthenticationMethod).Validation
kustomize build --enable-helm apps/overlays/au-syd1/arrstack→ OK (rendered init carries the auth logic for all 3 apps)Versions in scope: sonarr 4.0.19, radarr 6.3.0, prowlarr 2.5.2 (all share the Servarr v4 auth handler).