Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Related Tools

Notices

Reply
 
Thread Tools Search this Thread
Old 08-25-2022, 10:15 PM   #1876
jaceygan
Enthusiast
jaceygan began at the beginning.
 
Posts: 27
Karma: 10
Join Date: Aug 2022
Device: Kobo Clara 2E
Quote:
Originally Posted by jaceygan View Post
Thanks for your response.

I did some more troubleshooting and found the issue is actually from Calibre (still trying to find out if the issue is with Calbre itself or with the resizing plugin).

After changing the book cover image, the cover.jpg outside of the epub is updated but the book cover image in the epub itself is not. Only after I right click and select "Edit Book" from Calibre (without doing anything) then the image in the epub is updated.

COPS is sending me the book cover image fine now after I have selected "Edit Book" in Calibre and letting it sync on my rPi. Now I just need to find a way to automate this.

Thanks again for helping to look at my issue.
In case anyone encounters this. Here is the solution: https://www.mobileread.com/forums/sh...=150982&page=7
jaceygan is offline   Reply With Quote
Old 10-31-2022, 03:26 AM   #1877
khoinguyen1407
Junior Member
khoinguyen1407 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2022
Device: Kindle
Hi everyone,
I am newbie, and I am using COPS to manage my books via personal website. But I have problem: if the size of book is over 150MB, I can not download it, the website said error.
So, how can I edit in source .php to increase file size download?
THanks and best regards,
khoinguyen1407 is offline   Reply With Quote
Advert
Old 10-31-2022, 08:06 AM   #1878
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
@khoinguyen1407

In ../cops/config_local.php set (if using apache)
Code:
    /*
     * Wich header to use when downloading books outside the web directory
     * Possible values are :
     *   X-Accel-Redirect   : For Nginx
     *   X-Sendfile         : For Lightttpd or Apache (with mod_xsendfile)
     *   No value (default) : Let PHP handle the download
     */
    $config['cops_x_accel_redirect'] = "X-Sendfile";
and try again.

In apache2 first enable mod_xsendfile (from terminal: a2enmod x-sendfile)

Hope this works, let us know.
mariosipad is offline   Reply With Quote
Old 11-01-2022, 04:35 AM   #1879
khoinguyen1407
Junior Member
khoinguyen1407 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2022
Device: Kindle
Quote:
Originally Posted by mariosipad View Post
@khoinguyen1407

In ../cops/config_local.php set (if using apache)
Code:
    /*
     * Wich header to use when downloading books outside the web directory
     * Possible values are :
     *   X-Accel-Redirect   : For Nginx
     *   X-Sendfile         : For Lightttpd or Apache (with mod_xsendfile)
     *   No value (default) : Let PHP handle the download
     */
    $config['cops_x_accel_redirect'] = "X-Sendfile";
and try again.

In apache2 first enable mod_xsendfile (from terminal: a2enmod x-sendfile)

Hope this works, let us know.

Thanks for your reply, in your comment "In apache2 first enable mod_xsendfile (from terminal: a2enmod x-sendfile)",
I understand that I will use SSH, then run "a2enmod x-sendfile", is it right?
khoinguyen1407 is offline   Reply With Quote
Old 11-01-2022, 04:56 AM   #1880
khoinguyen1407
Junior Member
khoinguyen1407 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2022
Device: Kindle
Dear @mariosipad
From idea in your comment, I go to Web Station, then edit PHP Setting and change the value of memory_limit to 1024M
And everything is fine,
Thanks
khoinguyen1407 is offline   Reply With Quote
Advert
Old 11-09-2022, 07:52 AM   #1881
simonbuttress
Junior Member
simonbuttress began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Nov 2022
Device: Raspberry Pi
COPS error/No metadata.db file on Raspberry Pi

Hello, I've read through some similar situations on configuring RPi installations but there's nothing I've found that can help me progress hence my plea here. Total CLI noob so go easy.

I'm trying to set up the COPS through a domain so I can access my ebooks on any device anywhere. I've got the domain set up, SSL certs installed, Calibre installed I believe correctly but I'm now confronted with the following situation when I access the domain when trying to run and configure my setup (see attached file - COPS error)

I've put a couple of ebooks in the folder and as far as I understand the calibre database file is generated as a result of the presence of books. Now what I'm unsure about is that whether I somehow need to run Calibre first to generate the file and then run the COPS bit but I'm at a loss as how to do it.
  • Value of $config['calibre_directory'] in config_local.php (Does it end with a '/'?) - yes it does, i checked that
  • Value of open_basedir in your php.ini - unsure of where this is
  • The access rights of the Calibre Database - for the purposes of troubleshooting I've set it to 777 to remove this as an issue

So yeah I'm kinda stuck. Any pointers would be greatly appreciated.



Moderator Notice
I am moving this post to the COPs thread
Attached Thumbnails
Click image for larger version

Name:	COPS Error.png
Views:	104
Size:	47.4 KB
ID:	197627  

Last edited by chaley; 11-09-2022 at 08:25 AM.
simonbuttress is offline   Reply With Quote
Old 11-09-2022, 05:39 PM   #1882
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
@simonbuttress

How does all this work? simple if you know it. I will try to explain.

1 - Download calibre on a PC (Windows/ Mac or Linux) https://calibre-ebook.com/

2 - add e-books to calibre through the gui menu. Then close calibre.

3 - copy the directory with the calibre database and the e-books in subdirectories to your Raspberry Pi.

4 - point COPS to the directory where you copied point 3 to.

5 enjoy COPS

Do not forget to protect your e-books from unwanted visitors with a password.
mariosipad is offline   Reply With Quote
Old 11-11-2022, 05:05 AM   #1883
cbalmforth
Member
cbalmforth began at the beginning.
 
Posts: 23
Karma: 10
Join Date: May 2010
Device: Kindle Paperwhite
What I did was install Calibre on my local machine and add my books using the program interface, then upload the complete library to my remote machine. This transfers the missing file as well and worked on my remote headless server. Alternatively, if your remote server has a gui then you could run Calibre on it and add the books through the calibre interface. This would generate the missing file.

Quote:
Originally Posted by simonbuttress View Post
Hello, I've read through some similar situations on configuring RPi installations but there's nothing I've found that can help me progress hence my plea here. Total CLI noob so go easy.

I'm trying to set up the COPS through a domain so I can access my ebooks on any device anywhere. I've got the domain set up, SSL certs installed, Calibre installed I believe correctly but I'm now confronted with the following situation when I access the domain when trying to run and configure my setup (see attached file - COPS error)

I've put a couple of ebooks in the folder and as far as I understand the calibre database file is generated as a result of the presence of books. Now what I'm unsure about is that whether I somehow need to run Calibre first to generate the file and then run the COPS bit but I'm at a loss as how to do it.
  • Value of $config['calibre_directory'] in config_local.php (Does it end with a '/'?) - yes it does, i checked that
  • Value of open_basedir in your php.ini - unsure of where this is
  • The access rights of the Calibre Database - for the purposes of troubleshooting I've set it to 777 to remove this as an issue

So yeah I'm kinda stuck. Any pointers would be greatly appreciated.




I am moving this post to the COPs thread
cbalmforth is offline   Reply With Quote
Old 11-11-2022, 08:02 AM   #1884
simonbuttress
Junior Member
simonbuttress began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Nov 2022
Device: Raspberry Pi
Thumbs up That is creative genius!

Quote:
Originally Posted by mariosipad View Post
@simonbuttress

How does all this work? simple if you know it. I will try to explain.

1 - Download calibre on a PC (Windows/ Mac or Linux) https://calibre-ebook.com/

2 - add e-books to calibre through the gui menu. Then close calibre.

3 - copy the directory with the calibre database and the e-books in subdirectories to your Raspberry Pi.

4 - point COPS to the directory where you copied point 3 to.

5 enjoy COPS

Do not forget to protect your e-books from unwanted visitors with a password.
Quote:
Originally Posted by cbalmforth View Post
What I did was install Calibre on my local machine and add my books using the program interface, then upload the complete library to my remote machine. This transfers the missing file as well and worked on my remote headless server. Alternatively, if your remote server has a gui then you could run Calibre on it and add the books through the calibre interface. This would generate the missing file.
Mint. Absolutely mint. I'll be trying that tonight when I finish work. Thank you both so much for your guidance.
simonbuttress is offline   Reply With Quote
Old 11-11-2022, 04:20 PM   #1885
simonbuttress
Junior Member
simonbuttress began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Nov 2022
Device: Raspberry Pi
Helllo, it worked. Love you guys, thank you!!
simonbuttress is offline   Reply With Quote
Old 11-22-2022, 07:35 PM   #1886
mstevens
Junior Member
mstevens began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Apr 2011
Device: Viewsonic g-Tablet
Using a raspberry Pi with NGINX. I have no difficulty accessing various test .html and .php files (currently just from within my LAN or on the rPi itself).

IF I go to 127.0.0.1/ebooks, I get the following error (and everything else says "OK" or "Client side rendering"):

File /media/pi/external/ebooks/metadata.db not found, Please check
Value of $config['calibre_directory'] in config_local.php (Does it end with a '/'?)

Value of
open_basedir
in your php.ini The access rights of the Calibre Database

However, ls -l /media/pi/external/ebooks/metadata.db correctly returns

-rwxrwxrwx 1 pi pi 7076864 Nov 20 23:48 /media/pi/external/ebooks/metadata.db (so clearly it CAN be found)

The directory in config_local.php is:

$config['calibre_directory'] = '/media/pi/external/ebooks/';

I'm not really sure what to make of the "open_basedir" message (it makes no difference if it's left unset or set to /media/pi/external/ebooks or /media/pi/external/ebooks/), nor the "The access rights of the Calibre Database" (since the rights are pretty wide open):

drwxrwxrwx 1 pi pi 159744 Nov 21 00:16 ebooks (and all directories are files below are the same permissions)

Before upgrading to Bullseye, I was running calibre-server with no issues. I can't run Calibre or calibre-server on that rPi now, which is why I'm trying COPS. My books are on an external USB hard drive both because of space and because of MUCH faster speed when using rsync to synchronize books among my MacBook, this rPi, and a backup rPi located in another country.

Any ideas? I have a sinking feeling there's something it doesn't like about having the library directory on an external drive.
mstevens is offline   Reply With Quote
Old 11-22-2022, 10:04 PM   #1887
mstevens
Junior Member
mstevens began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Apr 2011
Device: Viewsonic g-Tablet
Quote:
Originally Posted by mstevens View Post
Using a raspberry Pi with NGINX. I have no difficulty accessing various test .html and .php files (currently just from within my LAN or on the rPi itself).
...
File /media/pi/external/ebooks/metadata.db not found, Please check
Value of $config['calibre_directory'] in config_local.php (Does it end with a '/'?)
I found this earlier post about the same issue. As far as I can tell, that poster's issue is exactly the same as mine, and the attempted fixes (such as trying a symlink) fail for me as well.

Unfortunately, I can't use that poster's solution (moving the library to the rPi's SD card) because my library is much too large to fit in the available space. In any event, I think it's much better to put things that require frequent writes (such as my almost-daily Calibre updates) on disk drives rather than SD cards.

Surely somebody else has tried to use COPS on a raspberry Pi with the library on an external drive?
mstevens is offline   Reply With Quote
Old 11-23-2022, 05:47 AM   #1888
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
@mstevens

I am using apache2 and not NGINX so there might be a difference there, but I have no problems accessing Calibre directories on mounted drives with COPS.

A few questions (Q) and remarks (R):
1 - (R) forget (for now) about "open_basedir". On a sinology it is important, but to on a pi.
2 - (Q) what is ls -l /media/pi/external/ebooks/? The directory should be readable by COPS (and NGINX and PHP).
3 - (Q) how did you mount the USB drive?
4 - (Q) Calibre directories on the SD card work (as a test) with COPS?
5 - (R) The best way to run an OS on a pi is through a external SSD. Put the system (raspbian) on a SSD just like you would on a SD card, boot from the SSD and if the SSD is large enough (256GB) you can put the calibre directory on the SSD. (Buy a cheap SSD from a "local" reseller and a uGreen USB 2.5" enclosure from AliExpress and it should work.)
6- (Q) how is the external USB drive formatted (exfat, ntfs, ext4)?
7 - (R) if a symlink does not work, maybe a "mount bind" (in /etc/fstab) will.
mariosipad is offline   Reply With Quote
Old 12-14-2022, 11:43 AM   #1889
jajaX
Junior Member
jajaX began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Jul 2022
Device: samsung galaxy Z fold 2 5G
compatibilty with php 8.x ?

hi,

Is Cops compatible with php 8 ?
specifically, version 8.2
jajaX is offline   Reply With Quote
Old 12-15-2022, 05:56 AM   #1890
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 719
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
@jajaX

Question: Is Cops compatible with php 8 ?

Answer: NO, not with the original code from https://github.com/seblucas/cops

However (YES) if you are willing to dive into the code and edit 1 line. Then COPS should work with PHP 8 (never tried with PHP 8.2).
Reference: https://github.com/seblucas/cops/issues/492

How:
1 - open file ../cops/vendor/seblucas/dot-php/doT.php
2 - change line 94
Code:
return @create_function ('$it', $func);
3 - to
Code:
return @function ($it) use ($func) {
        return eval($func);
        };
I did it like this:
Code:
        // For PHP 8 replace this line 
        //return create_function ('$it', $func);
        // with
        return function ($it) use ($func) {
        return eval($func);
        };
        // end replace
Please report back if it works for you.

Last edited by mariosipad; 01-12-2023 at 09:35 AM.
mariosipad is offline   Reply With Quote
Reply

Tags
calibre opds, dns, kobo aura, synology


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre OPDS server with windows apps? nickdma Related Tools 10 03-03-2024 02:53 PM
[Old Thread] Android FBreader and Calibre OPDS server question kalex Calibre 5 12-24-2015 10:16 PM
PHP+Apache web server for calibre ... chaley Related Tools 254 04-28-2014 08:18 PM
External OPDS catalogue in Calibre bolton Calibre 1 09-05-2012 06:14 AM
Calibre Command Line usage with PHP artoros Related Tools 13 07-01-2010 09:57 AM


All times are GMT -4. The time now is 11:48 AM.


MobileRead.com is a privately owned, operated and funded community.