janeczku / calibre-web

:books: Web app for browsing, reading and downloading eBooks stored in a Calibre database
GNU General Public License v3.0
12.78k stars 1.35k forks source link

Endless login / Help with VirtualHost configuration #3175

Closed FeralFox closed 2 days ago

FeralFox commented 1 week ago

Describe the bug/problem

I run calibre-web using docker and I guess I need some help with the Virtualhost configuration file.

Currently, everytime I click a link, I am redirected to the login page. If i login again, I will get to the desired page, but when clicking the next link, I will be redirected to the login page again. As far as I know, this happens as the authentication cookie is not forwarded correctly.

To Reproduce

Steps to reproduce the behavior:

  1. Login
  2. Click any link
  3. Login again
  4. Click any other link
  5. Login again ...

Environment (please complete the following information):

Additional context

This is the VirtualHost file I use. It was working until some weeks ago. Then, the login-issue appeared (probably after some system updates)

<VirtualHost *:80>
DocumentRoot "/home/me/test"
ServerName calibreweb.myserver.net

ProxyRequests On
ProxyPreserveHost On

ProxyPass / http://0.0.0.0:8083/
ProxyPassReverse / http://0.0.0.0:8083/
ProxyPassReverseCookiePath / /
</VirtualHost>

Does somebody know what could be the issue?

Thank you very much in advance!

robajr commented 5 days ago

I have the same problem. If I log in directly (serverip:8083) I have no issues. If I login via an nginx proxy (prettyurl.com) I timeout to a 504 timeout.

I tried CORS (via nginx, and via implementing flask-cors in the app python) and that didn't solve the issue. Calibre admin logfile shows no errors.

I also tried setting lm.session_protection = None -- as there were timeouts related to that in the past, and it didn't help

Also tried the changes in commit 0d359e9

I switched to the nightly, since there were comments on proxy enabling, and that still didn't fix the issue.

robajr commented 5 days ago

Attempted to update flask-login to v0.7, did not resolve proxy issues.

FeralFox commented 2 days ago

For me it worked again after the latest update (0.6.23). I didn't change the VirtualHost configuration.