YunoHost-Apps / airsonic_ynh

Airsonic package for YunoHost
https://airsonic.github.io/
GNU General Public License v3.0
9 stars 7 forks source link

Nginx madsonic rewrite breaks 3rd party auth #72

Open robocephalic opened 1 year ago

robocephalic commented 1 year ago

Describe the bug

Third party clients expect the XML response to begin with "subsonic-response". The Yuno airsonic nginx config rewrites it to begin with "madsonic-response"

Context

The Yunohost airsonic nginx config modifies the Airsonic XML response to start with "madsonic-response". This is only needed for DSub, and breaks third-party clients like Ultrasonic and MusicBee. The rewrite should probably only occur when user-agent = "DSub"

Steps to reproduce

Attempt to authenticate with Ultrasonic or Musicbee

Expected behavior

The client authenticates

Logs

image

robocephalic commented 1 year ago

As an update, I added a custom config at /etc/nginx/conf.d/mappings.conf with the below content:

map $http_user_agent $dsub_map {
  DSub          "madsonic";
  default       "subsonic";
}

I then changed line 30 of domain.d/airsonic.conf to read as below sub_filter 'subsonic' $dsub_map;

This is probably not proper, but management of the mapping file could be handled by the Airsonic install script