XDGFX / ultrasonics

Sync music playlists between all your music services. Do more with your music.
GNU General Public License v3.0
225 stars 19 forks source link

Keeps redirecting to HTTP when behind HTTPS proxy #37

Open karbowiak opened 3 years ago

karbowiak commented 3 years ago

Hello there, i recently setup ultrasonics to synchronize Spotify and Plex, but i'm putting it behind a Traefik 2 proxy that does HTTPS, but eeeeeevery single time i take any action in ultrasonics, i get redirected to the http version of it.

I could setup http->https redirecting, but that just seems redundant, considering no other application does this kind of forced http redirecting.

Any chance of handling this in Ultrasonics, or am i forced to handle it in Traefik? :P

XDGFX commented 3 years ago

Hmm, I'm not too sure why that is. I assume the issue is happening when I use

return redirect(request.path, code=302)

But this seems to be the recommend way to redirect when searching online. It looks like I could force a redirect to https but then we get the same issue in reverse.

How have you set up your Traefik 2 proxy? I have one set up that does redirect the user to the https:// url, but all ssl is between the user and Traefik - once inside my home network (between Traefik and ultrasonics, sonarr, radarr etc) it's all plain http.

karbowiak commented 3 years ago

Yeah my Traefik us setup so everything between the browser and Traefik is https, only between Traefik and the Ultrasonics container is it http.

My guess is that i'm not passing along the right header, i ended up fixing it by forcing all http to get redirected to https - fixed the issue, and also solved a few issues i had with some other things, lol

If anyone needs the setup in the future - just ping me, i should have a backup of the config even a few years from this post :P

nrrogers commented 2 years ago

Hello there, i recently setup ultrasonics to synchronize Spotify and Apple Music, but i'm putting it behind a Traefik 2 proxy that does HTTPS, but eeeeeevery single time i take any action in ultrasonics, i get redirected to the http version of it.

Apologies for hijacking this, but @karbowiak mentioned syncing Spotify and Apple Music. I'm not seeing an official Apple Music plug-in. Is there a third party plug-in that is available somewhere?

karbowiak commented 2 years ago

@nrrogers i think it's a case of "writing one thing while reading another and writing that" 😂

Totally ment Spotify and Plex - at this point i got no clue why i wrote Apple Music

nrrogers commented 2 years ago

@karbowiak No worries, I was just excited that there might be something out there I'm missing. I'll keep my fingers crossed for a potential Apple Music plug-in from someone with more skills than me!

delize commented 2 years ago

@karbowiak

In the end, did you just set up a HTTP > HTTPS redirect?

karbowiak commented 2 years ago

@delize yep, i setup a redirect from http to https using traefik2 :)

delize commented 2 years ago

Hm, this is not working for me.

Are you doing this from a subfolder / URL base, or from domain.org?

Otherwise, maybe this does not work with LinuxServer's swag in some way. 🤔