Skip to content

Instantly share code, notes, and snippets.

@francoisjacques
Forked from dryqin/calibre-web-on-FreeNAS.md
Last active June 10, 2024 04:13
Show Gist options
  • Save francoisjacques/bc96ec2a92628a06d2dc3a2fbe0e17df to your computer and use it in GitHub Desktop.
Save francoisjacques/bc96ec2a92628a06d2dc3a2fbe0e17df to your computer and use it in GitHub Desktop.

Calibre-web on FreeNAS

-- Being edited, if this line is present when you read this, I haven't managed to complete the procedure yet. YMMV.
-- That said, I managed to get to step 7, so the worst is behind.

Creating the Jail

  • Step 1 - Name Jail and Choose FreeBSD Release

    • Name: calibre-jail
    • Jail Type: Default(Clone Jail)
    • Release: 13.2-RELEASE
    • iocage create --name calibre-web --release 13.3-RELEASE
  • Step 2 - Configure Networking

    • DHCP Autoconfigure IPv4 (check)
    • VNET (check)
      • My command line jail-fu isn't reached network-dan guru level. Use the GUI to tweak it.
  • Step 3 - Confirm Options

Running the Jail and setting up calibre-web

  1. Start the jail and go to the shell. Please, do yourself a favor and do that through ssh. But if you insist on your misery, you can start the shell from the TrueNAS web interface.
iocage console calibre-web -f
  1. Make sure you have updated the package manager:
# switch to sh
sh
pkg update
  1. Install git, pip, python, libxml2, libxslt, sqlite3 and rust:
# libxml2 and libxslt are missing from upstream gist, which is also outdated (py39 nowadays)
pkg install git python sqlite3 libxml2 libxslt py39-pip py39-sqlite3
# strike enter to accept default
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# source rust environment in sh
. "$HOME/.cargo/env"
  1. Clone the calibre-web repository
mkdir -p /opt/calibre-web
# unless you want the history of the project locally, shallow clone is good enough (`depth 1`)
git clone --depth 1 https://github.com/janeczku/calibre-web.git /opt
  1. Follow the "Quick start":
cd /opt/calibre-web/
pip install calibreweb
  1. Execute:
cps

Open your web browser and go to http://[jail-ip-address]:8083, if everything goes fine you will see:

  1. Stop the Jail and add the mountpoint of your library (do not forget to check the Auto-start box in the edit section)

  2. Start the Jail, go to the jail's shell and create an startup script:

touch /calibre-web/cw-startup.sh

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
  1. Add the script to the crontab
echo '@reboot root /calibre-web/cw-startup.sh' >> /etc/crontab
  1. Restart the jail and go to http://[jail-ip-address]:8083
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment