janeczku / calibre-web

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

Resetting image host urls to http from https #3082

Closed savvasdalkitsis closed 23 hours ago

savvasdalkitsis commented 1 week ago

Describe the bug/problem

I am running my calibre-web instance behind a reverse proxy with https.

Given a configuration like this:

api_endpoint=https://DOMAIN/kobo/TOKEN
image_host=https://DOMAIN
image_url_quality_template=https://DOMAIN/kobo/TOKEN/{ImageId}/{width}/{height}/{Quality}/isGreyscale/image.jpg
image_url_template=https://DOMAIN/kobo/TOKEN/{ImageId}/{width}/{height}/false/image.jpg

After I disconnect my device, either immediately or after a little while, the images of the kobo store and others are failing to load.

Checking the config file again shows that calibre-web has automatically re-written the following urls (api_endpoint, image_host, image_url_quality_template and image_url_template) to use simple http instead of https which i believe is the reason for the images failing to load

image_host=http://DOMAIN
image_url_quality_template=http://DOMAIN/kobo/TOKEN/{ImageId}/{width}/{height}/{Quality}/isGreyscale/image.jpg
image_url_template=http://DOMAIN/kobo/TOKEN/{ImageId}/{width}/{height}/false/image.jpg

Note that the api_endpoint url remains unmodified to https

OzzieIsaacs commented 1 week ago

Something with your proxy config is wrong, so calibre-web gets accessed via http instead of https.