[Support] Linuxserver.io - Calibre-Web


Recommended Posts

Hello all and first of all thanks to the team at LinuxServers for their amazing job!  Second, let me apologize for any grammar or spelling errors, english is not my mother language.

I setup the calibre-web docker in my unraid server and managed to have everything working, at least locally.

However I seem not to be smart enough to get it working from outside my lan using Nginx Proxy Manager. Could anyone provide a tutorial (or link to one) on how to properly set it up? All I got is a "502 bad gateway" error.

 

Thanks in advance,

Khonshu.

Link to comment
  • 2 weeks later...

I've got the calibre-web container running beautifully when I access it locally... But when I access it thru my reverse proxy (Nginx Proxy Manager) it keeps kicking me to the login page when i try to change views or look at a book's details.

I have included the following options on the NPM advanced tab as suggested:

proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k;

I do not have "Allow Reverse Proxy Authentication" selected in the feature configuration page.

 

Ideas?

 

EDIT - might have fixed this myself by unchecking the NPM options for 'cache assets', 'block common exploits' and 'websockets support'. Will see how it continues to behave.

 

nope. still kicking me to the login screen for calibre-web

Edited by Liner81
  • Like 1
Link to comment
  • 3 weeks later...

I am attempting to use the "Gmail Account with OAuth2 Verification" option to configure my Email Server Settings. When I click on the "Setup Gmail Account as E-Mail Server" button, the webpage just spins and no activity can be completed on the page until I restart the docker container. 

 

I followed all the instructions (https://github.com/janeczku/calibre-web/wiki/Setup-Mailserver) to setup the Google OAuth2 portion, mapped the resulting gmail.json file to the container, and added the additional environment variable (OAUTHLIB_RELAX_TOKEN_SCOPE=1) mentioned in a recent post (https://discourse.linuxserver.io/t/docker-calibre-web-problem-enabling-gmail-account-with-oauth2-verification/3052).

 

Here's the docker create command used:

/usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker create --name='calibre-web' --net='bridge' 
	-e TZ="America/Los_Angeles" 
	-e HOST_OS="Unraid" 
	-e 'DOCKER_MODS'='linuxserver/calibre-web:calibre' 
	-e 'OAUTHLIB_RELAX_TOKEN_SCOPE'='1' 
	-e 'PUID'='99' 
	-e 'PGID'='100' 
	-p '8083:8083/tcp' 
	-v '/mnt/user/Media/Books/Calibre/Library/':'/books':'rw' 
	-v '/mnt/user/appdata/calibre-web/gmail.json':'/app/calibre-web/gmail.json':'rw' 
	-v '/mnt/user/appdata/calibre-web':'/config':'rw' 
	'linuxserver/calibre-web'

 

There doesn't appear to be any detail as to why the webpage just spins in the calibre-web.log or in the docker logs.

 

Has anyone else been able to get this working?

Link to comment
  • 2 weeks later...
On 6/9/2021 at 9:58 PM, Liner81 said:

I've got the calibre-web container running beautifully when I access it locally... But when I access it thru my reverse proxy (Nginx Proxy Manager) it keeps kicking me to the login page when i try to change views or look at a book's details.

I have included the following options on the NPM advanced tab as suggested:

proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k;

I do not have "Allow Reverse Proxy Authentication" selected in the feature configuration page.

 

Ideas?

 

EDIT - might have fixed this myself by unchecking the NPM options for 'cache assets', 'block common exploits' and 'websockets support'. Will see how it continues to behave.

 

nope. still kicking me to the login screen for calibre-web

 

I'm having the same issue as you. Did you find a fix for it?

 

I had the exact same setup on a previous server and did not have any problems then so I wonder if this is related to a change to the container application.

Link to comment
On 7/10/2021 at 6:06 AM, norsemanGrey said:

 

I'm having the same issue as you. Did you find a fix for it?

 

I had the exact same setup on a previous server and did not have any problems then so I wonder if this is related to a change to the container application.

 

So I believe my issue was caused by cloudflare. The only solution I found was to bypass the cloudflare services for my calibre-web subdomain by selecting dns only (no proxy) for that address. The cloudflare proxy appears to be incompatible with the calibre-web authentication protocol.

 

Found some help diagnosing the issue here... 

 

Edited by Liner81
link
  • Like 1
Link to comment

I had a Calibre-Web update available today, so I updated it. After updating my Docker page now gives me this warning:

 

Quote

Warning: file_put_contents(/var/lib/docker/unraid/images/calibre-web-icon.png): failed to open stream: Read-only file system in /usr/local/emhttp/plugins/dynamix.docker.manager/include/DockerClient.php on line 90

 

Any ideas on what I'm supposed to be doing to resolve this? It *appears* that Calibre-Web did successfully update since it says "up-to-date" whenever I check for updates. But Calibre-Web no longer works. I get an page cannot be displayed error when trying to access the WebUI. Below is a screenshot of the Docker page.

 

image.png

 

EDIT: I tried restarting the server, and that causes it to say:

 

Execution Error

Error code 403

Edited by IFireflyl
Link to comment
On 7/10/2021 at 5:06 AM, norsemanGrey said:

 

I'm having the same issue as you. Did you find a fix for it?

 

I had the exact same setup on a previous server and did not have any problems then so I wonder if this is related to a change to the container application.

  

On 7/12/2021 at 6:21 AM, Liner81 said:

 

So I believe my issue was caused by cloudflare. The only solution I found was to bypass the cloudflare services for my calibre-web subdomain by selecting dns only (no proxy) for that address. The cloudflare proxy appears to be incompatible with the calibre-web authentication protocol.

 

Found some help diagnosing the issue here... 

 

 

These are the steps I took to resolve this issue:

  1. In your appdata/calibre-web folder create a new folder called "custom-cont-init.d" (without the quotation marks).
  2. In the new folder, create a file called "patch-session-protection.sh" (without the quotation marks).
  3. In the new file, copy the following text and save it:
     
    #!/bin/bash
    echo "**** patching calibre-web - removing session protection ****"
    sed -i "/lm.session_protection = 'strong'/d" /app/calibre-web/cps/__init__.py

     

  4. Restart your container.

You're right that Cloudflare is causing the issue, but only because of a security measure put in place in the last few months by Calibre-Web that is extremely unnecessary for what Calibre-Web is (just a book library).

 

https://flask-login.readthedocs.io/en/latest/#session-protection

 

The session protection that was added by Calibre-Web set lm.session_protection to strong, and that simply doesn't work with Cloudflare. The steps I listed bypass this newly added security feature.

Edited by IFireflyl
  • Thanks 1
Link to comment
49 minutes ago, IFireflyl said:

I had a Calibre-Web update available today, so I updated it. After updating my Docker page now gives me this warning:

 

 

Any ideas on what I'm supposed to be doing to resolve this? It *appears* that Calibre-Web did successfully update since it says "up-to-date" whenever I check for updates. But Calibre-Web no longer works. I get an page cannot be displayed error when trying to access the WebUI. Below is a screenshot of the Docker page.

 

image.png

 

EDIT: I tried restarting the server, and that causes it to say:

 

Execution Error

Error code 403

 

Well, I tried to reboot my server to see if that would fix it. Now the Calibre-Web docker is completely missing and I have to re-install it. *le sigh*

  • Thanks 1
Link to comment
3 hours ago, IFireflyl said:

  

 

These are the steps I took to resolve this issue:

  1. In your appdata/calibre-web folder create a new folder called "custom-cont-init.d" (without the quotation marks).
  2. In the new folder, create a file called "patch-session-protection.sh" (without the quotation marks).
  3. In the new file, copy the following text and save it:
     
    
    #!/bin/bash
    echo "**** patching calibre-web - removing session protection ****"
    sed -i "/lm.session_protection = 'strong'/d" /app/calibre-web/cps/__init__.py

     

  4. Restart your container.

You're right that Cloudflare is causing the issue, but only because of a security measure put in place in the last few months by Calibre-Web that is extremely unnecessary for what Calibre-Web is (just a book library).

 

https://flask-login.readthedocs.io/en/latest/#session-protection

 

The session protection that was added by Calibre-Web set lm.session_protection to strong, and that simply doesn't work with Cloudflare. The steps I listed bypass this newly added security feature.

 

Thanks so much for this! Yes, it appears to fix the issue with Cloudflare proxy... no more kicking to the login screen with proxy enabled. Much appreciated!

  • Like 1
Link to comment
On 7/14/2021 at 11:38 PM, IFireflyl said:

 

Well, I tried to reboot my server to see if that would fix it. Now the Calibre-Web docker is completely missing and I have to re-install it. *le sigh*

That has nothing to do with the container. It's an unraid issue.

  • Thanks 1
Link to comment
On 7/14/2021 at 5:38 PM, IFireflyl said:

 

Well, I tried to reboot my server to see if that would fix it. Now the Calibre-Web docker is completely missing and I have to re-install it. *le sigh*

Without diagnostics, odds on you have to delete the docker.img and reinstall everything via Apps - Previous Apps.  It should be like nothing happened.

Link to comment
22 minutes ago, Squid said:

Without diagnostics, odds on you have to delete the docker.img and reinstall everything via Apps - Previous Apps.  It should be like nothing happened.

 

Yep, that's what I ended up doing. I have no idea what caused it, or how to find out. But it appears to be working fine after a re-install. Thanks!

Edited by IFireflyl
Link to comment
On 6/27/2021 at 2:41 PM, majestic said:

I am attempting to use the "Gmail Account with OAuth2 Verification" option to configure my Email Server Settings. When I click on the "Setup Gmail Account as E-Mail Server" button, the webpage just spins and no activity can be completed on the page until I restart the docker container. 

 

I followed all the instructions (https://github.com/janeczku/calibre-web/wiki/Setup-Mailserver) to setup the Google OAuth2 portion, mapped the resulting gmail.json file to the container, and added the additional environment variable (OAUTHLIB_RELAX_TOKEN_SCOPE=1) mentioned in a recent post (https://discourse.linuxserver.io/t/docker-calibre-web-problem-enabling-gmail-account-with-oauth2-verification/3052).

 

Here's the docker create command used:



/usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker create --name='calibre-web' --net='bridge' 
	-e TZ="America/Los_Angeles" 
	-e HOST_OS="Unraid" 
	-e 'DOCKER_MODS'='linuxserver/calibre-web:calibre' 
	-e 'OAUTHLIB_RELAX_TOKEN_SCOPE'='1' 
	-e 'PUID'='99' 
	-e 'PGID'='100' 
	-p '8083:8083/tcp' 
	-v '/mnt/user/Media/Books/Calibre/Library/':'/books':'rw' 
	-v '/mnt/user/appdata/calibre-web/gmail.json':'/app/calibre-web/gmail.json':'rw' 
	-v '/mnt/user/appdata/calibre-web':'/config':'rw' 
	'linuxserver/calibre-web'

 

There doesn't appear to be any detail as to why the webpage just spins in the calibre-web.log or in the docker logs.

 

Has anyone else been able to get this working?

 

 

I've just been through the same thing. The first time you use your OAUTH JSON file, it pops a browser window (on the host OS - so presumably somewhere INSIDE the docker container) asking you to confirm you are happy for this app to do stuff on your behalf. Obv this doesn't go so well...

 

I installed calibreweb locally on my PC (and the optional requirements.txt) and then the popup came on my desktop machine. Now that this is done should be good (the popup is just for the first time).

 

Although.... it's just first time for the user - how does the docker container know who i'm (google-ey) logged in as. It's still just spinning for me.... To be continued....

 

 

EDIT - i have a suspicion i'll need to reboot my unRAID server into GUI mode and the window will pop up there. but not this evening.... (GMT+8)

Edited by Meles Meles
did some more thunking.....
Link to comment
  • 1 month later...
  • 2 weeks later...
On 6/1/2021 at 5:27 PM, Khonshu said:

Hello all and first of all thanks to the team at LinuxServers for their amazing job!  Second, let me apologize for any grammar or spelling errors, english is not my mother language.

I setup the calibre-web docker in my unraid server and managed to have everything working, at least locally.

However I seem not to be smart enough to get it working from outside my lan using Nginx Proxy Manager. Could anyone provide a tutorial (or link to one) on how to properly set it up? All I got is a "502 bad gateway" error.

 

Thanks in advance,

Khonshu.

I have the same problem, have you found a solution?

Link to comment
  • 4 weeks later...
On 7/15/2021 at 3:56 AM, IFireflyl said:

  

 

These are the steps I took to resolve this issue:

  1. In your appdata/calibre-web folder create a new folder called "custom-cont-init.d" (without the quotation marks).
  2. In the new folder, create a file called "patch-session-protection.sh" (without the quotation marks).
  3. In the new file, copy the following text and save it:
     
    #!/bin/bash
    echo "**** patching calibre-web - removing session protection ****"
    sed -i "/lm.session_protection = 'strong'/d" /app/calibre-web/cps/__init__.py

     

  4. Restart your container.

You're right that Cloudflare is causing the issue, but only because of a security measure put in place in the last few months by Calibre-Web that is extremely unnecessary for what Calibre-Web is (just a book library).

 

https://flask-login.readthedocs.io/en/latest/#session-protection

 

The session protection that was added by Calibre-Web set lm.session_protection to strong, and that simply doesn't work with Cloudflare. The steps I listed bypass this newly added security feature.

Hello, I'm having the same issue. I followed the instructions, but it didn't help, I keep being kicked out to login page every 3 clicks or so. Is there anything else I can be missing? Should I add custom location block (there's conflicting information about it)? Thanks!

  • Like 1
Link to comment
22 hours ago, vadimbz said:

Hello, I'm having the same issue. I followed the instructions, but it didn't help, I keep being kicked out to login page every 3 clicks or so. Is there anything else I can be missing? Should I add custom location block (there's conflicting information about it)? Thanks!

yeah, something happened to cause problems again. I still have the fix applied, but its not working 100%. If I log out and back in, sometimes it works fine, otherwise I can't progress beyond a few clicks without it locking up. I really should try to revert back a few versions.

Link to comment
  • 2 weeks later...

Hello,

 

Calibre-web refuses to save the location of the calibre database. I am able to login to calibre-web.  It shows me the usual calibre-web interface.  I either fill in manually or use the file picker to specify the path to metadata.db. I click save and nothing happens.  Click on any other link and I'm returned to http://...:8083/admin/dbconfig page with the field for the path blank again.

 

Everything is updated to the latest version.  I tried removing everything and reinstalling but I run into the same problem.  I'm lost at what more I can do.  Can anyone help?

Link to comment
  • 3 weeks later...
On 10/17/2021 at 10:06 AM, vadimbz said:

Hello, I'm having the same issue. I followed the instructions, but it didn't help, I keep being kicked out to login page every 3 clicks or so. Is there anything else I can be missing? Should I add custom location block (there's conflicting information about it)? Thanks!

 

On 10/18/2021 at 8:52 AM, Liner81 said:

yeah, something happened to cause problems again. I still have the fix applied, but its not working 100%. If I log out and back in, sometimes it works fine, otherwise I can't progress beyond a few clicks without it locking up. I really should try to revert back a few versions.

 

Edit your Calibre-Web docker, and find and change the Repository section to this:

 

lscr.io/linuxserver/calibre-web:amd64-0.6.12-ls130

 

It should look like this:
 

image.thumb.png.39091af57cb152e66be2f061137054f4.png

 

That will downgrade your Calibre-Web docker to the older version (released approximately three months ago) where the workaround I mentioned actually works. We'll have to be satisfied with this until they release a fix for this in the future.

  • Thanks 1
Link to comment
  • 5 months later...

So I was having issues trying to get this working, (nuked & re-installed 4 / 5 times)then checked the logs...

 

[mod-init] Curl/JQ was not found on this system for Docker mods installing

This error is triggered by lack of network on container start-up...

 

So I set Autostart and wait to 5 seconds, now it's pulling some archives and applying it to the image?

 

Will update if working. Seems to be stuck thinking about something.

Screenshot 2022-05-17 at 21.03.30.png

Link to comment

Yep, that worked.

 

I left it for about an hour with the log open an all sorts of stuff was downloading / unstuffing and happening!!

 

All up and running now.

 

Just be patient, it seems to be hung on;

 

[mod-init] Attempting to run Docker Modification Logic
[mod-init] Applying linuxserver/calibre-web:calibre files to container

 

But if you just leave it alone t sorts itself out.

Link to comment
  • 4 months later...

I've got the calibre-web container running and can access it locally just fine. Problem I'm having is trying to setup a reverse proxy via (Nginx Proxy Manager) it keeps giving me an internal error.
I followed janeczku gudie https://github.com/janeczku/calibre-web/wiki/Setup-Reverse-Proxy#nginx-proxy-manager to no avail and was wondering if anyone else has got this to work? I attached a pic of my npm setup can any one see where I went wrong? thanks1.thumb.png.6175da7eb7f6c5781882eda3e1e07ade.png

Link to comment
On 9/30/2022 at 11:35 PM, Funny718 said:

I've got the calibre-web container running and can access it locally just fine. Problem I'm having is trying to setup a reverse proxy via (Nginx Proxy Manager) it keeps giving me an internal error.
I followed janeczku gudie https://github.com/janeczku/calibre-web/wiki/Setup-Reverse-Proxy#nginx-proxy-manager to no avail and was wondering if anyone else has got this to work? I attached a pic of my npm setup can any one see where I went wrong? thanks1.thumb.png.6175da7eb7f6c5781882eda3e1e07ade.png

Hey just want to let everyone know that the only way I was able to solve this was by switch over to swag. And wow I'm amazed at how easy it was to setup. Well using video from ibracrop on YouTube. Lol love them

Link to comment
  • 3 months later...
  • 4 months later...

Hoping this is a simple fix. Calibre web was running well to my knowledge (though I haven't used it in a while) before I reset me docker.img file. Added all other dockers back without a problem using existing setting, however Calibre-Web is producing the following error in the logs. I consoled into the docker and ran the suggested command however it says that pip is an unknown command.

 

10500K .......... .......... .......... .......... .......... 99% 6.70M 0s
10550K ......... 100% 371M=1.6s

2023-06-04 03:11:38 (6.36 MB/s) - '/calibre-web/kindlegen/kindlegen_linux_2.6_i386_v2_9.tar.gz' saved [10813137/10813137]

[INFO] Extracting kindlegen_linux_2.6_i386_v2_9.tar.gz into directory: /calibre-web/kindlegen
[INFO] Change the ownership of /calibre-web/kindlegen (including subfolders) to calibre:calibre
[INFO] kindlegen (Amazon Kindle Generator) will be linked into /calibre-web/app/vendor
[INFO] Creating the vendor directory: /calibre-web/app/vendor
[INFO] Change the ownership of /calibre-web/app/vendor (including subfolders) to calibre:calibre
> create kindlegen link /calibre-web/app/vendor/kindlegen assigned to source /calibre-web/kindlegen/kindlegen
> change the ownership of /calibre-web/app/vendor/kindlegen to calibre:calibre
[INFO] Creating directory for temporary directories and files: /tmp
[INFO] Change the ownership of /tmp (including subfolders) to calibre:calibre
[INFO] Launching Calibre-Web ...
*** "flask-limiter" is needed for calibre-web to run. Please install it using pip: "pip install flask-limiter" ***
*** "flask-limiter" is needed for calibre-web to run. Please install it using pip: "pip install flask-limiter" ***

 

Any help would be appreciated.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.