janeczku / calibre-web

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

Calibre-Web v0.6.21 failing to finish authentication with timeout while behind cloudflare #3038

Open JValentine9 opened 2 months ago

JValentine9 commented 2 months ago

Describe the bug/problem I am serving Calibre-Web through Nginx Proxy Managed, accessed through Cloudflare. I am able to utilize the site well locally, but I am unable to login when accessing the server through Cloudflare. I also have Authelia running to provide security for the site when accessing through Cloudflare due to this process

To Reproduce Steps to reproduce the behavior: Setup and Configure Calibre-Web Configure NGINX Proxy Manager as a reverse proxy Configure the traffic to flow through a cloudflare tunnel so it is accessible on the web through Cloudflare Attempt to login to Calibre-Web Get the Timeout error screen from Cloudflare

Logfile calibre-web.log access.log

Expected behavior

Login as anticipated

Screenshots

image

Environment (please complete the following information):

Additional context

OzzieIsaacs commented 2 months ago

Sorry man: You gave the answer by yourself: "I am able to utilize the site well locally". I'm maintaining calibre-web and not your setup around it. As you wrote this is working. The only think I can suggest is to change the session protection in the admin section -> basic configuration -> security to "simple", with little hope that it helps. I will leave the issue open for some time, maybe somebody else can help you (my feeling is no)

vysmaty commented 1 month ago

Hi @JValentine9 , I have the following setup Cloudflare DNS -> Cloudflare with ZeroTrust+SSO -> Cloudflare Tunnel pointing to Traefik:81 (HTTP)! Traefik pointing to calibre-web (HTTP)!

Traffic outside the tunnel then goes from Traefik over HTTPS and HTTP has a rewrite to HTTPS.

I've had it this long. So I don't remember the specific settings. Cloudflare login works. (SSO and also Calibre-Web). Session protection I have Strong.

I'd guess your problem is somewhere along the way at SSL. If you're capable, you could also look at Trusted Hosts (Comma Separated) in the Calibre-Web settings.

I would rather not look for glitch down in calibre-web.

That's all I can do.

And thank you very much @OzzieIsaacs for calibre-web. ;)

JValentine9 commented 1 month ago

@OzzieIsaacs Absolutely thanks for all your work! Didn't want this to necessarily be a feature or please fix, just wasn't sure where else to go for community questions - I figured I just had something wrong. @vysmaty thanks for the info! I'll take a look at it!