Calibre in the plugin jail

Fafners

Cadet
Joined
Aug 15, 2016
Messages
2
Followed this guide and managed to install Calibre very easy. Great work!
But sadly its not really the solution i was hopeing for. It seems to be a very basic version of Calibre. You cant even edit the books (Info/Cover). I mainly use my freenas for Plex, so was hopeing it could be a great way to see my eBooks remotely aswell... Also the security with the Cron script, atleast only works half the time for me, so the security isn't really great either.

If you know a good alternative for Ebooks for Freenas, leave a reply, thanks!
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
I've just recreated my calibre server using iocage in 11.1-u4 and the latest version of calibre-server is much better than the old one. You can create user accounts, access multiple libraries, read books in the browser window (not the nicest interface) and even add new books (although not tried this yet). You can also edit the metadata :D
 

meatservo80

Cadet
Joined
Feb 21, 2016
Messages
9
I've just recreated my calibre server using iocage in 11.1-u4 and the latest version of calibre-server is much better than the old one. You can create user accounts, access multiple libraries, read books in the browser window (not the nicest interface) and even add new books (although not tried this yet). You can also edit the metadata :D
Great. Though my plan is to move everything to from jails to containers for ease of future updating. Then just use nfs mount from freenas where all data is stored.
 

dedek603

Cadet
Joined
Dec 7, 2012
Messages
8
Dear Gents, is there any chance that somebody sumarize short HOW TO install Calibre with iocage? or is any way How to verify that installation has all dependencies ?

I tried several ways but still withou succes....

f.e. when I try to run:
calibre-server --library-path=/books

I got:
Shared object "libdl.so.1" not found, required by "python2.7"

Thanks a lot.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
This might be too summarized, but I don;t have much spare time on my hands at the minute:

1.Create FreeNAS jail (default settings - I called it calibre-server)

Code:
iocage create --name “<JAIL_NAME>” -r 11.1-RELEASE ip4_addr=”vnet0|<JAIL_IP>/24″ defaultrouter=”<IPV4_DEFAULT_GATEWAY>″ vnet=”on” allow_raw_sockets=”1″ boot=”on”


<JAIL_NAME> with the name you want the iocage jail to have (I have used "calibre-server")
<JAIL_IP> with the IP address you want the jail to have, within a useable range
<IPV4_DEFAULT_GATEWAY> with the value in Network > Global Configuration

2. Enter shell of new jail

Code:
iocage console calibre-server


3. Run 'pkg upgrade' and then 'pkg install calibre'
4. Add storage to jail (i.e. mount the location of your Calibre library to the jail - I just used /mnt)

From the FreeNAS shell, not inside the jail

Code:
iocage fstab -a calibre-server "/mnt/pool/<LOCATION_OF_YOUR_CALIBRE_LIBRARY> /mnt nullfs rw 0 0"


5. In the WUI create a Cron Job (Tasks > Cron Job) with the appropriate flags (mine looks like iocage exec calibre calibre-server --enable-auth /mnt)

6. Run the Cron Job

Here's a link to the Calibre documentation if any of this doesn't work! I recreated mine in iocage back in May and it's been working perfectly since. And the new Calibre UI in 3.x is fantastic!

preview
 

Baenwort

Explorer
Joined
Feb 19, 2015
Messages
93
So how does one go about adding something like this to the official plug in list? It seems like it would slot in right next to Emby and the other media server plugins.
 

dedek603

Cadet
Joined
Dec 7, 2012
Messages
8
@adrianwi solution works, but hangs on Error:
Shared object "libdl.so.1" not found, required by "python2.7"

but I used solution from here, to downgrade some python packages and now Calibre server works like charm.
Thanks a lot for help!
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
That libdl error is popping up all over as the current stable release is now running well out of sync with FreeBSD.

Hopefully, once 11.2 is released we'll get back to s slightly more stable state of affairs.
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
Yep, That error makes me scared to upgrade any pkg in my jails now. 11.2 can't come soon enough.
You guys seen calibre-web ? Its an awesome webui for a calibre library. Its fluid, modern and imo way better than the default one.
https://github.com/janeczku/calibre-web
 

glauco

Guru
Joined
Jan 30, 2017
Messages
526
Thank you for this tutorial!
I think it would help newcomers to find that you can add authenticated users with:
calibre-server --manage-users

5. In the WUI create a Cron Job (Tasks > Cron Job) with the appropriate flags (mine looks like iocage exec calibre calibre-server --enable-auth /mnt)
Since I can't find how to start the calibre-server as a service (the proper way), as a workaround I added the following job to root's crontab in the jail:
Code:
echo "@reboot /usr/local/bin/calibre-server --enable-auth --daemonize --log /dev/stdout /media" > /var/cron/tabs/root

I know it's bad practice to edit crontab files directly, but it won't require noobs to learn vi.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
Yep, That error makes me scared to upgrade any pkg in my jails now. 11.2 can't come soon enough.
You guys seen calibre-web ? Its an awesome webui for a calibre library. Its fluid, modern and imo way better than the default one.
https://github.com/janeczku/calibre-web

It took me a while to get around to looking at this, but Calibre-web is indeed awesome.

My calibre server jail has been switched off and I'm just using Calibre-web in a docker container pointed to the calibre database. I don't even use Calibre on my Mac anymore for managing the library, as it can all be done in Calibre-web, including firing books straight to my Kindle via e-mail.

Thanks for the heads up!
 

Christopher_P

Dabbler
Joined
Nov 10, 2019
Messages
10
It took me a while to get around to looking at this, but Calibre-web is indeed awesome.

My calibre server jail has been switched off and I'm just using Calibre-web in a docker container pointed to the calibre database. I don't even use Calibre on my Mac anymore for managing the library, as it can all be done in Calibre-web, including firing books straight to my Kindle via e-mail.

Thanks for the heads up!

Agreed, I am also a huge fan of calibre-web. Did something in the 11.4 upgrade break calibredb/calibre-server? I can't seem to find anything on it but the binary paths in my existing jail all changed and are no longer executable (error below). I tried to rebuild in a new jail but I can't find the packages anymore either! Can calibre-web be used as the database?


Same error no matter what parameters I give it or which binary I try to execute:

root@calibre:/ # /opt/calibre/bin/calibre-server start
ELF binary type "0" not known.
/opt/calibre/bin/calibre-server: Exec format error. Binary file not executable.

Packages seem to be non-existent:
root@calibre-rebuild:/ # pkg install calibre
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'calibre' have been found in the repositories
root@calibre-rebuild:/ # pkg search calibre
 

stualden

Explorer
Joined
Apr 11, 2015
Messages
80
It took me a while to get around to looking at this, but Calibre-web is indeed awesome.

My calibre server jail has been switched off and I'm just using Calibre-web in a docker container pointed to the calibre database. I don't even use Calibre on my Mac anymore for managing the library, as it can all be done in Calibre-web, including firing books straight to my Kindle via e-mail.

Thanks for the heads up!
I need to move my calibre installation, and I was wondering - will calibre-web also do the web scraping ("recipe") and packaging the emailing the resulting ebook? I really like using that to get my news on my tablet in the morning. Thanks.
 

adrianwi

Guru
Joined
Oct 15, 2013
Messages
1,231
Can't help with either of those, sorry.

I'm running 11.3-U5 and my jails are running 11.3 P5, but my Calibre jail isn't even running as I just use Calibre-web in a Docker VM.

And I just use it for cataloguing books and then sending these to my Kindle!
 

glauco

Guru
Joined
Jan 30, 2017
Messages
526
Agreed, I am also a huge fan of calibre-web. Did something in the 11.4 upgrade break calibredb/calibre-server? I can't seem to find anything on it but the binary paths in my existing jail all changed and are no longer executable (error below). I tried to rebuild in a new jail but I can't find the packages anymore either! Can calibre-web be used as the database?


Same error no matter what parameters I give it or which binary I try to execute:

root@calibre:/ # /opt/calibre/bin/calibre-server start
ELF binary type "0" not known.
/opt/calibre/bin/calibre-server: Exec format error. Binary file not executable.

Packages seem to be non-existent:
root@calibre-rebuild:/ # pkg install calibre
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: No packages available to install matching 'calibre' have been found in the repositories
root@calibre-rebuild:/ # pkg search calibre
I have no idea what could have caused that, buf if I were you I would go to the jail console and force a pkg update like so: pkg update -f and then force a reinstall of all packages like so: pkg upgrade -fy.
 

Christopher_P

Dabbler
Joined
Nov 10, 2019
Messages
10
I have no idea what could have caused that, buf if I were you I would go to the jail console and force a pkg update like so: pkg update -f and then force a reinstall of all packages like so: pkg upgrade -fy.
Thanks for the suggestion but still getting goose egg. Maybe I shouldn't have upgraded by jails to 11.4...


I can't tell if the deployment of calibre-web has the calibre database schema built in. At initial configuration, I mounted the location where my old calibredb/calibre-server was storing books. Since this is no longer working and doesn't seem be recoverable, I'm wondering if I can point lazylibrarian at calibre-web. The calibre-web admin settings don't seem to have any type of data management tools. Any help folks can provide would be very much appreciated. I will end up digging through the app directory and source code at a later date anyway to see what I can come up with.
 

glauco

Guru
Joined
Jan 30, 2017
Messages
526
Why don't you iocage fetch 12.2-RELEASE, iocage create -r 12.2-RELEASE -n test-calibre dhcp=on, install calibre and calibre-web and see if it works?
 

NotAHaggis

Cadet
Joined
Nov 23, 2020
Messages
3
Tonight I created a basic jail and then pulled down the latest release e.g.

$ cd /usr/local/share
$ wget https://github.com/janeczku/calibre-web/releases/download/0.6.9/calibre-web-0.6.9.zip
$ unzip calibre-web-0.6.9.zip
$ mv calibre-web-0.6.9 calibre
$ pkg install -y python py37-pip
$ pip install --target vendor -r requirements.txt
$ /usr/sbin/daemon -p /var/run/calibre.pid -l syslog /usr/local/bin/python3.7 /usr/local/share/calibre/cps.py

Now, this runs as root, I will eventually create a calibre account and use the daemon -u flag to run as calibre.

I have written a basic / rudimentary rc.d script:

#!/bin/sh
#
# PROVIDE: calibre
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following to /etc/rc.conf[.local] to enable this service
# calibre_enable="YES"

. /etc/rc.subr

name="calibre"
rcvar="calibre_enable"

: ${calibre_enable:=NO}
: ${python:=/usr/local/bin/python3.7}
: ${calibre_script:=/usr/local/share/calibre/cps.py}
: ${pidfile:=/var/run/${name}.pid}

command="/usr/sbin/daemon"

# pidfile="/var/run/${name}.pid"

command_args="-p ${pidfile} -l syslog ${python} ${calibre_script}"

echo ${command} ${command_args}

load_rc_config ${name}

run_rc_command "$1"

It works for me, still needs some polish though...
 
Top