[COPS] Calibre OPDS (and HTML) PHP Server


The original sources :

The story behind this ynh app :

On my side, I use it with ownCloud and Calibre :

  • Calibre is running on my laptop
  • Its library is saved on an folder synced automatically with ownCloud hosted on my YunoHost
  • Then COPS creates the OPDS and HTML server looking at the files in the right folder of /home/yunohost.app/owncloud/

The OPDS is best used with e-ink readers and mobile app ereaders, which is why it is in Public, sadly out of the great SSO, and behind a basic http auth.

koreader GitHub - koreader/koreader: An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more is a great reader with OPDS support.

Notice :

Don’t let you library accessible in the open !
Even if your ebooks are legal it could be considered as counterfeiting and you don’t want that.

1 Like

Hello Maxime,

what do you need ?
Your use case is mine, I plan to setup COPS on my Yunohost test VM, using with y Kobo or for direct readin in HTML (lan or remote).
I’m not DEV, but OPS, I can test some things, if it can help :slight_smile:


So far, I can access the OPDS server with koreader and download epub files. it works fine.
In this case, the app needs to be public and with basic auth activated.

If I stay behind the yunohost walls, and keep the app private, I can access the html server with kobo native browser (so no need to install anything on the kobo). However, I cannot download epubs with the current nginx configuration.

I am no expert in nginx, but more likely we need to apply https://github.com/seblucas/cops/wiki/Url-Rewriting-with-COPS

  location /download/ {
      rewrite ^/download/(\d+)/(\d+)/.*\.(.*)$ /fetch.php?data=$1&db=$2&type=$3 last;
      rewrite ^/download/(\d+)/.*\.(.*)$ /fetch.php?data=$1&type=$2 last;

but as the app is already in a subfolder, location /download/ doesn’t work.

If any body knows how to sort this, that would be great.

@TopheC Have you installed the app and configure it so that you can access your library ?

Hello Maxime,
happy new year :slight_smile:

I have not yet installed on Yunohost, but some month(year?) ago, was able to use OPDS on a seagate NAS with the slucas setup.
I’ll setup a fresh Yunohost VM, in the next WE, to test cops_ynh. Calibre is running on my Linux Mint Desktop, too. Owncloud apps is fully functional on my YNH production server.
Stay tuned !

Hello Everyone.
Maxime did you try to put the apps COPS on the root of a new subdomain like https://cops.domain.tld/
i know it seems simple but maybe.
I just installed cops at the root of a new subdomain like https://cops.domain.tld/ and configured owncloud.
I have to install Calibre on a Desktop ( sorry i dont have any readers i don’t use eInk readers ihave only Books ) try to install a little database with calibre to synchronise with nextcloud and i will ask if it work.
Maybe you will try this before me.
But i ask you if it works tomorrow !!