navidrome / navidrome

🎧☁️ Modern Music Server and Streamer compatible with Subsonic/Airsonic
https://www.navidrome.org
GNU General Public License v3.0
10.53k stars 801 forks source link

[Bug]: navidrome log is being spammed with "ReverseProxyWhitelist enabled but no proxy IP found in request context. Please report this error." #3046

Open michael-ball opened 3 weeks ago

michael-ball commented 3 weeks ago

I confirm that:

Version

v0.52.5

Current Behavior

I have set the "Address" config option to be a unix socket located at "/var/run/navidrome/navidrome.sock". Since enabling this I am getting constant messages in the navidrome log that look like this:

time="2024-05-24T22:11:06Z" level=error msg="ReverseProxyWhitelist enabled but no proxy IP found in request context. Please report this error."

I haven't set the "ReverseProxyWhitelist" option in my config so it should be set to whatever the default is.

Expected Behavior

Logs are not spammed with this message.

Steps To Reproduce

  1. Set Address config option to a unix socket
  2. Restart navidrome
  3. Observe the navidrome log

Environment

- OS: Raspberry Pi OS (Debian 12.5)
- Browser: N/A
- Client: N/A

How Navidrome is installed?

Binary (from downloads page)

Configuration

Address = "unix:/var/run/navidrome/navidrome.sock"
AutoImportPlaylists = true
EnableArtworkPrecache = false
EnableCoverAnimation = false
EnableTranscodingConfig = false
IgnoredArticles = "The El La Los Las Le Les Os As O A Der Die Das"
ImageCacheSize = "0"
LastFM.ApiKey = "redacted"
LastFM.Enabled = true
LastFM.Secret = "redacted"
MusicFolder = "/media/ssd/Music"
SubsonicArtistParticipations = true
TranscodingCacheSize = "0"

Relevant log output

`time="2024-05-24T22:11:06Z" level=error msg="ReverseProxyWhitelist enabled but no proxy IP found in request context. Please report this error."`

Anything else?

No response

Code of Conduct

deluan commented 3 weeks ago

Thanks for reporting this.

@crazygolem, do you have bandwidth to check this? If not, please let me know. Thanks in advance!

crazygolem commented 3 weeks ago

I will have a look.

crazygolem commented 3 weeks ago

@michael-ball as a workaround to not get spammed, you can set a dummy value for the ReverseProxyWhitelist option, such as @ to not get spammed (after this first check that generates the spam, the ReverseProxyWhitelist option is ignored when listening on unix sockets).

I find it a bit weird that listening on a unix socket automatically enables reverse proxy authentication, @deluan what do you think about explicitly enabling it also for unix sockets via the ReverseProxyWhitelist option? As the request's IP address is set to @ by the underlying lib for socket requests, we can just require to set @ in the option to enable it when listening to a unix socket.