TrueNAS – calibre-web in a jail
Steps:
Create the jail
-
Name Jail and Choose FreeBSD Release Name: calibre-web Jail Type: Default (Clone Jail) Release: 12.2-RELEASE
Note that a calibre package, not to be confused with calibre-web, does not exist in FreeNAS 11.x
-
Configure Networking:
Check VNET, and statically assign an IP address.
-
After creation, under Basic Properties, make sure Auto-start is checked, so the jail starts on boot up.
Configuring the jail and installing calibre-web
- Before starting the jail, add your Calibre library (from the desktop app) as a remote mount point of the jail.
-
Start the jail and go to the shell in FreeNAS.
-
Install the package manager and update the list of packages:
pkg update
-
Install git, pip, python, and sqlite3:
pkg install git py37-pip python sqlite3 py37-sqlite3 calibre
-
Clone the calibre-web repository:
cd /
git clone https://github.com/janeczku/calibre-web.git
-
Install calibre-web:
cd calibre-web/
pip install --target vendor -r requirements.txt
-
Run calibre-web for the first time:
python cps.py
Open your web browser and go to http://[jail-ip-address]:8083, if everything goes fine you will see:
The Library Configuration is the location, on the jail, that the metdata.db file is located.
If you can't remember, run this in the shell on the jail:
find / -name metadta.db -print /mnt/calibreDB/metdata.db
-
Create a startup script, so calibre-web so it starts when the jail boots:
echo '#\!/bin/sh' > /calibre-web/cw-startup.sh
echo 'nohup python /calibre-web/cps.py &' >> /calibre-web/cw-startup.sh
chmod +x /calibre-web/cw-startup.sh
-
Add the startup script to crontab:
echo '@reboot root /calibre-web/cw-startup.sh' >> /etc/crontab
-
Restart the jail and go to http://[jail-ip-address]:8083
Default username/password is admin/admin123
Reference
GitHub Gist https://gist.github.com/guillesup/ec0c66dd746cc5e9808ebc0c88871f82