From cb8a0ee1f6328f8ab1a933764f82d9f8989e0b9b Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Mon, 23 Feb 2026 09:08:32 -0600 Subject: [PATCH 1/2] fix: Navidrome reverse proxy config --- services/navidrome.nix | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/services/navidrome.nix b/services/navidrome.nix index f71f0ce..9ac3bdf 100644 --- a/services/navidrome.nix +++ b/services/navidrome.nix @@ -46,6 +46,11 @@ in { source_directories = map (d: "${stateDirectory}/${d}") [ "data" ]; }; + # Modified from + # - + # - + # Modifications are exclusively changes from Docker hostnames to 127.0.0.1 and + # port numbers services.caddy.virtualHosts."music.millironx.com".extraConfig = '' # Authentik output endpoint reverse_proxy /outpost.goauthentik.io/* http://127.0.0.1:${authentikPort} @@ -57,8 +62,31 @@ in { copy_headers X-Authentik-Username>Remote-User } + # Authentik uses the Authorization header if present, so should be able to + # authenticate subsonic clients that support BasicAuth. Requests from the + # Navidrome Web App will be authenticated via the existing session cookie. + # If you want to have Navidrome authenticate subsonic requests, remove this + # forward_auth block. + @subsonic path /rest/* + forward_auth @subsonic http://127.0.0.1:${authentikPort} { + uri /outpost.goauthentik.io/auth/caddy + copy_headers X-Authentik-Username>Remote-User + + # Some clients that claim to support basicauth still expect a subsonic + # response in case of authentication failure instead of a proper basicauth + # response. + @error status 1xx 3xx 4xx 5xx + handle_response @error { + respond < + + + SUBSONICERR 200 + } + } + # Forward everything to Navidrome - reverse_proxy 127.0.0.1:${port} + reverse_proxy http://127.0.0.1:${port} ''; users.users."${user}" = { @@ -84,7 +112,8 @@ in { image = "docker.io/deluan/navidrome:latest"; environments = { ND_BASEURL = "https://music.millironx.com"; - ND_EXTAUTH_TRUSTEDSOURCES = "10.0.0.0/8"; + # pasta appears to use the static host IP so trust that + ND_EXTAUTH_TRUSTEDSOURCES = "23.239.13.247/24"; }; secrets = map (s: "${s},type=env") [ "ND_LASTFM_APIKEY" "ND_LASTFM_SECRET" ]; From 41025b4b5574eb4f4df1eb831ec7441934fb2f27 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Mon, 23 Feb 2026 09:10:46 -0600 Subject: [PATCH 2/2] fix: Navidrome mount point --- services/navidrome.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/navidrome.nix b/services/navidrome.nix index 9ac3bdf..9db322a 100644 --- a/services/navidrome.nix +++ b/services/navidrome.nix @@ -118,7 +118,7 @@ in { secrets = map (s: "${s},type=env") [ "ND_LASTFM_APIKEY" "ND_LASTFM_SECRET" ]; volumes = [ - "${s3MountDirectory}:/music:Uro" + "${s3MountDirectory}:/music:ro" "${stateDirectory}/data:/data:U" ]; publishPorts = [ "127.0.0.1:${port}:${port}" ];