fix(jellyfin): support v12 auth and Docker host access
Docker Build & Push / build-and-test (push) Canceled after 0s
Docker Build & Push / docker (push) Canceled after 0s

This commit is contained in:
joshpatra committed 2026-09-14 14:15:00 -04:00
1 parent fac1ffeda5
commit 9887fd69d5
6 files changed
+19 -8

No files matched your search

+4 -2
View File
@@ -80,8 +80,10 @@ CACHE_TRANSCODE_MINUTES=60
SUBSONIC_URL=http://localhost:4533
# ===== JELLYFIN CONFIGURATION =====
# Server URL (required if using Jellyfin backend)
JELLYFIN_URL=http://localhost:8096
# Server URL (required if using Jellyfin backend).
# From Docker, localhost is the Allstarr container. Use host.docker.internal for
# Jellyfin on the Docker host, or the Jellyfin service name on a shared network.
JELLYFIN_URL=http://host.docker.internal:8096
# API key for SERVER-SIDE operations only (get from Jellyfin Dashboard > API Keys)
# This is used by Allstarr to query Jellyfin's library on behalf of the server
+6 -2
View File
@@ -200,8 +200,8 @@ Choose your preferred provider via the `MUSIC_SERVICE` environment variable. Add
# Backend selection
BACKEND_TYPE=Jellyfin
# Jellyfin server URL
JELLYFIN_URL=http://localhost:8096
# Jellyfin on the Docker host (use its service name on a shared Docker network)
JELLYFIN_URL=http://host.docker.internal:8096
# API key (get from Jellyfin Dashboard > API Keys)
JELLYFIN_API_KEY=your-api-key-here
@@ -213,6 +213,10 @@ Choose your preferred provider via the `MUSIC_SERVICE` environment variable. Add
JELLYFIN_LIBRARY_ID=
```
`localhost` inside the Allstarr container points to Allstarr itself, not to
Jellyfin. The Compose file maps `host.docker.internal` on Linux, macOS, and
Windows for a Jellyfin server running on the Docker host.
```bash
# Path where downloaded songs will be stored
DOWNLOAD_PATH=./downloads
+3 -1
View File
@@ -63,7 +63,9 @@ public class AdminAuthControllerTests
Assert.NotNull(capturedRequest);
Assert.Equal(HttpMethod.Post, capturedRequest!.Method);
Assert.Equal("http://jellyfin.local/Users/AuthenticateByName", capturedRequest.RequestUri?.ToString());
Assert.Contains("X-Emby-Authorization", capturedRequest.Headers.Select(h => h.Key));
Assert.StartsWith("MediaBrowser Client=\"AllstarrAdmin\"",
capturedRequest.Headers.GetValues("Authorization").Single());
Assert.False(capturedRequest.Headers.Contains("X-Emby-Authorization"));
Assert.NotNull(capturedBody);
Assert.Contains("\"Username\":\"josh\"", capturedBody!);
+1 -1
View File
@@ -9,5 +9,5 @@ public static class AppVersion
/// <summary>
/// Current application version.
/// </summary>
public const string Version = "2.0.2";
public const string Version = "2.0.3";
}
+1 -1
View File
@@ -64,7 +64,7 @@ public class AdminAuthController : ControllerBase
{
Content = new StringContent(loginJson, Encoding.UTF8, "application/json")
};
httpRequest.Headers.TryAddWithoutValidation("X-Emby-Authorization", authHeader);
httpRequest.Headers.TryAddWithoutValidation("Authorization", authHeader);
using var response = await _httpClient.SendAsync(httpRequest);
+4 -1
View File
@@ -66,6 +66,9 @@ services:
start_period: 40s
networks:
- allstarr-network
extra_hosts:
# Lets Linux containers reach Jellyfin running on the Docker host.
- "host.docker.internal:host-gateway"
environment:
- ASPNETCORE_ENVIRONMENT=Production
# Backend type: Subsonic or Jellyfin (default: Subsonic)
@@ -101,7 +104,7 @@ services:
- Subsonic__PlaylistsDirectory=${PLAYLISTS_DIRECTORY:-playlists}
# ===== JELLYFIN BACKEND =====
- Jellyfin__Url=${JELLYFIN_URL:-http://localhost:8096}
- Jellyfin__Url=${JELLYFIN_URL:-http://host.docker.internal:8096}
- Jellyfin__ApiKey=${JELLYFIN_API_KEY:-}
- Jellyfin__UserId=${JELLYFIN_USER_ID:-}
- Jellyfin__LibraryId=${JELLYFIN_LIBRARY_ID:-}