Calibre OPDS (and HTML) PHP Server : web-based light alternative to Calibre content server / Calibre2OPDS to serve ebooks (epub, mobi, pdf, ...)
PHP JavaScript CSS HTML Other
Clone or download
Permalink
Failed to load latest commit information.
images Déplacement du répertoire /icons dans /images et correction du template Aug 31, 2016
lang Translation updates - april-2018 Apr 11, 2018
lib Partially fix the download of kepub. Jan 7, 2018
resources Remove php-epub-meta and load via Composer. Jun 30, 2016
styles Declare Monocle as global for Scrutinizer. Jun 29, 2016
templates Updated from Font Awesome 3.2.1 to Font Awesome Free 5.0.13 May 22, 2018
test Moving PHP embedded server from 8888 to 8080 seems to work ... don't … May 12, 2017
tools Switch to linux EOL May 23, 2018
.gitignore Simplify .gitignore and handle cops packages better Dec 22, 2016
.hgtags Étiquette 1.1.2 ajoutée à la révision a8934d81cf99 Jun 26, 2018
.htaccess Updated .htaccess Mar 28, 2016
.scrutinizer.yml Change the PHP version to 7.1 to avoid Scrutinizer crash Jan 7, 2018
.travis.yml [fix] Hopefully fix the automatic uploading of releases Jul 10, 2018
CHANGELOG Prepare next changelog Jun 26, 2018
COPYING Add v0.0.1 May 28, 2012
README.md Add a credit for Jetbrains Jun 26, 2018
about.html Fixed the link to all COPS contributors. Thanks to horus68 for the re… Dec 13, 2016
base.php Prepare next release Jun 26, 2018
build.xml Fix the automatic generation of package into Github. May 3, 2017
checkconfig.php Update checkconfig.php on Database Error to better help a majority of… May 21, 2018
composer-dl.sh Added installation of Composer FXP asset plugin. Jun 29, 2016
composer.json Add xmlwriter to list of dependencies (used in OPDS_renderer) May 23, 2018
composer.lock Update lock file Jun 26, 2018
config.php Fix COPS Basic Authentication Apr 28, 2017
config_default.php Enhance the docs to show the default value used by the SMTP port if s… Apr 26, 2017
config_local.php.example Add a mention in config_local.php.example to find all configuration i… Dec 17, 2016
epubfs.php Fix config loading order for test. Oct 25, 2016
epubreader.php Fix Scrutinizer majors. Jun 29, 2016
favicon.ico Add v0.0.1 May 28, 2012
feed.php Fix Scrutinizer majors. Jun 29, 2016
fetch.php Update fetch.php Feb 25, 2018
getJSON.php Fix Scrutinizer majors. Jun 29, 2016
index.php [fix] Fix an error with PHP 7.2.X where create_function was deprecated Jul 9, 2018
login.html Avoid mixed content if login is accessed over HTTPS. thanks to polyta… Dec 14, 2016
phpunit.xml.dist Fix PHPUnit tests. Jun 29, 2016
sendtomail.php Merge pull request #339 from ubupl/master Apr 25, 2017
transliteration.php Own badges in README. Small fix to transliteration.php. Jun 29, 2016
util.js Updated from Font Awesome 3.2.1 to Font Awesome Free 5.0.13 May 22, 2018
web.config Windows to Linux line endings. No code change. Jun 29, 2016

README.md

COPS

COPS stands for Calibre OPDS (and HTML) Php Server.

See : COPS's home for more details.

Don't forget to check the Wiki.

Scrutinizer Code Quality

Code Coverage

Build Status / Scrutinizer

Build Status

Selenium Test Status

Why ?

In my opinion Calibre is a marvelous tool but is too big and has too much dependencies to be used for its content server.

That's the main reason why I coded this OPDS server. I needed a simple tool to be installed on a small server (Seagate Dockstar in my case).

I initially thought of Calibre2OPDS but as it generate static file no search was possible.

Later I added an simple HTML catalog that should be usable on my Kobo.

So COPS's main advantages are :

  • No need for many dependencies.
  • No need for a lot of CPU or RAM.
  • Not much code.
  • Search is available.
  • With Dropbox / owncloud it's very easy to have an up to date OPDS server.
  • It was fun to code.

If you want to use the OPDS feed don't forget to specify feed.php at the end of your URL.

Prerequisites

  1. PHP 5.3, 5.4, 5.5, 5.6, 7.X or hhvm with GD image processing, Libxml, Intl, Json & SQLite3 support (PHP 5.6 or later recommended).
  2. A web server with PHP support. I tested with various version of Nginx and Apache. Other people reported it working with Apache and Cherokee. You can also use PHP embedded server (https://github.com/seblucas/cops/wiki/Howto---PhpEmbeddedServer)
  3. The path to a calibre library (metadata.db, format, & cover files).

On any Debian based Linux you can use : apt-get install php5-gd php5-sqlite php5-json php5-intl

If you use Debian Stretch : apt-get install php7.0-gd php7.0-sqlite3 php7.0-json php7.0-intl php7.0-xml php7.0-mbstring php7.0-zip

On Centos you may have to add : yum install php-xml

Install a release (Easiest way)

  1. Extract the zip file you got from the release page to a folder in web space (visible to the web server).
  2. If you're doing a first-time install, copy config_local.php.example to config_local.php
  3. Edit config_local.php to match your config.
  4. If needed add other configuration item from config_default.php

If you like Docker, you can also try these docker containers. x64 armhf arm64

Install from sources

git clone https://github.com/seblucas/cops.git # or download lastest zip see below
cd cops
wget https://getcomposer.org/composer.phar
php composer.phar global require "fxp/composer-asset-plugin:~1.1"
php composer.phar install --no-dev --optimize-autoloader

After that you can use the previous how-to starting at the second step.

Note that instead of cloning you can also get latest master as zip

Note that if your PHP version is lower that 5.6, then you may have to remove composer.lock before starting the last line.

Where to put my Calibre directory ?

Long story short : ALWAYS outside of COPS's directory especially if COPS is installed on a VPS / Server. If you follow my advice then your data will be safe.

If you choose to put your Calibre directory inside your web directory and use Nginx then you will have to edit /etc/nginx/mime.types to add this line : application/epub+zip epub;

Known problems

Not a lot, except for the bad quality of the code (first PHP project ever) ;)

Please see https://github.com/seblucas/cops/issues for open issues

Need help

Please read https://github.com/seblucas/cops/wiki and check the FAQ.

Contributing

As you could see here, I appreciate every contributions and there were a lot over time. So don't be shy and submit your Pull Requests.

Note to translators : please prefer using Transifex instead of doing a PR.

I only have one limit (I may have more but that one is the worse) : COPS' goal is to provide an alternative to Calibre's content server and not to replace Calibre entirely. So I will refuse any PR making changes to the database content.

Credits

External libraries used :

Copyright & License

COPS - 2012-2017 (c) Sébastien Lucas

See COPYING and file headers for license info