xaintly
Cadet
- Joined
- Aug 7, 2019
- Messages
- 7
I have an ebook library that I wanted to share. It is managed by calibre on windows, using a SMB share from FreeNAS, so I tried out these two servers.
Comparing the UI:
Calibre Server:
If you have >1000 books, showing them 50 at a time is worthless.
Images:
COPS:
Images:
Installation:
Caveat: I tried to install COPS & Calibre on another linux machine and failed. Calibre uses a sqlite database, which doesn't work over NFS.
Installing both in a jail worked fine.
Installing Calibre:
This is probably the simplest install, there is already a package for calibre, which includes calibre server.
Calibre includes its own web server and starts up on port 8080.
You can visit it immediately after it starts up by going to http://[ip-of-your-jail]:8080/
You could run it as root to avoid having to create a user & make sure everything is accessible to it, but don't.
Installing COPS:
COPS does not include a web server, so we need to install one of those as well. In this example, I'm using apache, but use whatever server you like the most.
COPS should now be running if you go to http://[ip-of-your-jail]/
Some notes:
Comparing the UI:
Calibre Server:
- Initial page is 'Choose a library' even if there's only 1 library
- Default display ('Cover Grid') shows 50 book covers at a time
- Alternate display ('Detailed List') shows 50 books, cover + synopsis
- Custom display - you can modify the Detailed List so it shows different data
- Search - Here is where you can search by title or drill down to authors / series / tags
- Add Books - You can upload books to your library
- Customization: You can configure what is shown on search results / detailed list and how many books per page to show
If you have >1000 books, showing them 50 at a time is worthless.
Images:
COPS:
- Initial page shows 'Authors', 'Series', 'Tags', 'All Books (by Title)'
- It only displays from 1 library, whichever it is configured to show
- No upload feature
- Search feature has a single box that simultaneously searches titles, authors, etc
- No UI 'back' button to go to previous screen from an author, but browser back button works
- Doesn't show a synopsis on the same page as the book listing
- Customization: You can hide some options from the main screen, like browsing by publishers, ratings, languages
- You can set a limit on the number of books to display as well
Images:
Installation:
Caveat: I tried to install COPS & Calibre on another linux machine and failed. Calibre uses a sqlite database, which doesn't work over NFS.
Installing both in a jail worked fine.
- Create a jail with any name, default options
- Add a mountpoint /media/library pointing to whatever folder has your calibre metadata.db file
Installing Calibre:
Code:
pkg install calibre # Add a calibre user, needs read/write on all files & folders in the library # The easiest way to is give it the same uid as the owner of the library $ adduser Username: calibre Full name: <whatever> Uid: <whatever the UID owns the library> ** defaults for all other options ** # Note that if this user doesn't have rights to read/write every file & folder in the libary, calibre-server will explode # Add these lines to /etc/rc.conf calibre_enable="YES" calibre_user="calibre" calibre_library="/media/library" # start calibre-server $ sudo /usr/local/etc/rc.d/calibre start
This is probably the simplest install, there is already a package for calibre, which includes calibre server.
Calibre includes its own web server and starts up on port 8080.
You can visit it immediately after it starts up by going to http://[ip-of-your-jail]:8080/
You could run it as root to avoid having to create a user & make sure everything is accessible to it, but don't.
Installing COPS:
COPS does not include a web server, so we need to install one of those as well. In this example, I'm using apache, but use whatever server you like the most.
Code:
pkg install -y php74-gd php74-sqlite3 php74-json php74-intl php74-xml php74-zip php74-mbstring php74-phar php74-filter php74-openssl php74-zlib php74-xmlwriter php74-pdo_sqlite php74-ctype php74-dom git wget cd /usr/local/www git clone https://github.com/seblucas/cops.git cd cops wget https://getcomposer.org/download/1.10.6/composer.phar php composer.phar global require "fxp/composer-asset-plugin:~1.1" php composer.phar install --no-dev --optimize-autoloader cp config_local.php.example config_local.php # edit config_local.php $config['calibre_directory'] = '/media/library/'; /* must end in trailing slash! */ # install & configure a web server, using apache in this example pkg install -y apache24 mod_php74 ###### edit /usr/local/etc/apache24/httpd.conf ServerName yourserver.com # Modify to add index.php after index.html <IfModule dir_module> DirectoryIndex index.html index.php </IfModule> # Add this <FilesMatch "\.php$"> SetHandler application/x-httpd-php </FilesMatch> <FilesMatch "\.phps$"> SetHandler application/x-httpd-php-source </FilesMatch> # Modify DocumentRoot & directory to run Cops instead of default web page # If you are adding this to an existing web server running other stuff, you're on your own # Change these lines to reference cops instead of /usr/local/etc/apache24/data DocumentRoot "/usr/local/www/cops" <Directory "/usr/local/www/cops"> #### end of edits to httpd.conf # edit /etc/rc.conf apache24_enable="YES" # start apache $ apachectl start
COPS should now be running if you go to http://[ip-of-your-jail]/
Some notes:
- COPS website: https://github.com/seblucas/cops
- The website says it only needs 4 libraries, but it needs at least these 15
- The website says to download the latest version of composer, but it doesn't work, you have to use 1.10.6 (other versions might work also)
- COPS only needs read-access to your library & files, not read-write
- There's a docker image for COPS as well, that might be easier