mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-10-06 13:55:39 -04:00
fix(jellyfin): support v12 auth and Docker host access
This commit is contained in:
6 files changed
+19
-8
No files matched your search
+4
-2
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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!);
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
@@ -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
@@ -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:-}
|
||||
|
||||
Reference in new issue
Block a user