stonith404 / pingvin-share

A self-hosted file sharing platform that combines lightness and beauty, perfect for seamless and efficient file sharing.
https://stonith404.github.io/pingvin-share/
BSD 2-Clause "Simplified" License
3.44k stars 238 forks source link

🐛 Bug Report: local login not working if App-URL points to external URL #618

Closed ap88 closed 2 months ago

ap88 commented 2 months ago

👟 Reproduction steps

The service is available through nginx from the internet perfectly. The configuration requires to set the App-URL to the address on which the links are accessible like https://fileshare.xyz.com. If I do that I'm no longer able to log in on the lan address like http://192.168.0.2:3333

👍 Expected behavior

Log in

👎 Actual Behavior

Keeps showing the login page.

📜 Logs

[Nest] 61 - 09/26/2024, 8:45:49 PM LOG [AuthService] Successful password login for user ap@xyz.com from IP 192.168.0.16

The protocol shows the expected entry but the service is not continuing to the main page.

stonith404 commented 2 months ago

That happens because the app URL starts with https and when you're trying to access the site over the LAN, you are using http. If the app URL starts with https, Pingvin Share will set the access token as a secure-only cookie which means it only gets set if you're accessing the site over https.

I can't really change this behavior without compromising the security. What is the reason that you want to access Pingvin Share also over the LAN?

ap88 commented 2 months ago

I see. It's a performance issue and I have two other services running (gotify, Vaultwarden) where this work's well.