Allow http URLs for all local-network Navidrome and Jellyfin hosts#2331
Merged
Conversation
The private-host check used during server URL validation only recognized localhost, 127.0.0.1, .local names, and private IPv4 literals. Local servers reached via single-label LAN hostnames, router DNS suffixes (.lan, .home, .internal, .home.arpa), IPv6 loopback/link-local/unique- local literals, or carrier-grade NAT addresses (100.64.0.0/10, used by Tailscale) were still rejected over http. Centralize the check as CloudStreamSecurity.isLocalOrPrivateHost and use it from both NavidromeCredentials and JellyfinCredentials so the two integrations stay in sync.
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.
Fixes #2327
Problem
#2329 relaxed the Navidrome server URL validation to accept http for
localhost,127.0.0.1,*.local, and private IPv4 literals, matching Jellyfin. However, many common local setups are still rejected over http by both integrations:http://mynas:4533) resolved by router DNS.lan,.home,.internal,.home.arpa(RFC 8375)http://[::1]:4533,http://[fd00::1]:4533)100.64.0.0/10(RFC 6598) — what Tailscale assigns, a very common way to reach a self-hosted NavidromeChanges
CloudStreamSecurity.isLocalOrPrivateHost(host)covering all of the above host forms in one place.NavidromeCredentials.connectionValidationErrorandJellyfinCredentials.connectionValidationError, replacing the duplicated inline checks so the two integrations stay in sync.No changes were needed downstream:
NavidromeApiService, the stream proxies, and the Coil image loader all use cleartext-capable OkHttp clients, and the network security config already permits cleartext, so http works end-to-end once validation passes.Tests
CloudStreamSecurityTest: new coverage forisLocalOrPrivateHost(accepts local/private forms, rejects public hosts including100.32.x.xoutside the CGNAT range).NavidromeCredentialsTest: local http acceptance extended to hostname/IPv6/CGNAT forms.JellyfinCredentialsTest(new): parity coverage for the Jellyfin validation.All 16 tests in the three classes pass via
:app:testDebugUnitTest.