[Support] Linuxserver.io - COPS (Calibre OPDS PHP Server)


Recommended Posts

linuxserver_medium.png

 

Application Name: COPS (Calibre OPDS PHP Server)

Application Site:  https://github.com/seblucas/cops

Docker: https://hub.docker.com/r/linuxserver/cops/

Github: https://github.com/linuxserver/docker-cops/

 

Please post any questions/issues relating to this docker you have in this thread.

 

If you are not using Unraid (and you should be!) then please do not post here, instead head to linuxserver.io to see how to get support

Edited by linuxserver.io
Link to comment

You just point /books at your calibre database.  It reads that and grabs the files from there, it doesn't copy them to /config...

 

Sent from my LG-H815 using Tapatalk

Nah, my problem is with Calibre itself.  It won't let me create a database within my existing ebook folder, and insists on an empty folder, and then proceeds to ultimately copy all of the books from my master folder to its library location.  Like I said, not strictly your problem, but a calibre one.  Just an annoyance with the way that calibre works.  I'm just going to rearrange my organization to reflect this fact of life.  Beyond that, I much prefer COPS to Ubooquity.

 

Link to comment

I created my library where I wanted it and it stays there.

 

As part of the import process it does copy files into the final location and organise them so I kind of get what you mean.

 

But once the library is in the place you want it then it's fine.

 

Yeah I prefer this to Ubooquity as well, purely for the ability to email books directly to my Kindle account from the webui.

 

Sent from my LG-H815 using Tapatalk

 

 

Link to comment
  • 2 weeks later...

I've tried installing this a few times.  When I try to hit the WebUI, I get a blank page.  The NGINX error log shows this:

 

2016/08/28 11:38:31 [error] 255#0: *1 open() "/var/www/localhost/cops/api/tokens" failed (2: No such file or directory), client: 192.168.0.210, server: _, request: "POST /api/tokens HTTP/1.1", host: "192.168.0.202:8080", referrer: "http://192.168.0.202:8080/"
2016/08/28 11:38:31 [error] 255#0: *2 open() "/var/www/localhost/cops/app/home/templates/home.html" failed (2: No such file or directory), client: 192.168.0.210, server: _, request: "GET /app/home/templates/home.html HTTP/1.1", host: "192.168.0.202:8080", referrer: "http://192.168.0.202:8080/"

 

Note, I changed the external port to 8080 as it is my understanding leaving it set to 80 would prevent me from getting to the unRAID webui.

 

Thanks,

D

Link to comment
  • 5 weeks later...

A small issue I've run into is that the viewing function will fail due to a missing Zlib. Specifically, the error is:

 

clsTbsZip ERROR with the zip archive: Unable to uncompress file "META-INF/container.xml" because extension Zlib is not installed.

 

Now, installing this is trivial within the container, but it would be great if the fix is included in the docker build itself.

 

 

Link to comment

A small issue I've run into is that the viewing function will fail due to a missing Zlib. Specifically, the error is:

 

clsTbsZip ERROR with the zip archive: Unable to uncompress file "META-INF/container.xml" because extension Zlib is not installed.

 

Now, installing this is trivial within the container, but it would be great if the fix is included in the docker build itself.

 

Hey, thanks for this, but what is the viewing function?  Can't reproduce this error here, maybe because all my ebooks are mobi.  :-\

Link to comment

A small issue I've run into is that the viewing function will fail due to a missing Zlib. Specifically, the error is:

 

clsTbsZip ERROR with the zip archive: Unable to uncompress file "META-INF/container.xml" because extension Zlib is not installed.

 

Now, installing this is trivial within the container, but it would be great if the fix is included in the docker build itself.

 

Installing zlib and php5-zlib is trivial, but after doing so I can confirm it doesn't solve the issue.  We'll look into it, but no promises at the moment.  ;)

 

God knows what I was doing last night, but adding php5-zlib does indeed solve this, new build ready.  :o

Link to comment

Also, any recommendations on getting the files into the share?

 

I tried to use Calibre on my Windows box and have it use the share, but I'm just getting errors when I try to import.

 

I'm guessing I'll set everything up on my pc then move all of it into the share, but there has to be a better way.

 

Sent from mobile

 

 

Link to comment

Porque esta en Espanol???

 

Looks like it is working, but the darn thing shows up in Spanish... Can't find where to tell it to switch to English.

 

I cannot reproduce this at all.  It should autoselect your language (Author's code not dockerfile) so no idea whatsoever on why it thinks your machine is in Espana....

 

Looking at the COPS code there's this optional parameter in config_default.php

 

/*
     * Set language code to force a language (see lang/ directory for available languages).
     * When empty it will auto detect the language.
     */
    $config['cops_language'] = '';

 

So it looks like for some reason it's autodetecting as Spanish  :o

 

Now config_local.php overrides config_default.php and is the user editable file

 

Here's our default as is pulled from our repository:

 

<?php
    if (!isset($config))
        $config = array();

    /*
     * The directory containing calibre's metadata.db file, with sub-directories
     * containing all the formats.
     * BEWARE : it has to end with a /
     */
    $config['calibre_directory'] = '/books/';

    $config['calibre_internal_directory'] = '/books/';

    /*
     * Catalog's title
     */
    $config['cops_title_default'] = "COPS";

    /*
     * use URL rewriting for downloading of ebook in HTML catalog
     * See README for more information
     *  1 : enable
     *  0 : disable
     */
    $config['cops_use_url_rewriting'] = "0";

/*
     * Which header to use when downloading books outside the web directory
     * Possible values are :
     *   X-Accel-Redirect   : For Nginx
     *   X-Sendfile         : For Lightttpd or Apache (with mod_xsendfile)
     *   No value (default) : Let PHP handle the download
     */

 $config['cops_x_accel_redirect'] = "X-Accel-Redirect";
    /* Enable cache folder
     * especially useful for lower power hosts
     */
         $config['cops_thumbnail_handling'] = "";
         $config['cops_thumbnail_cache_directory'] = "/config/cache/";
    /*
     * Enable and configure Send To Kindle (or Email) feature.
     *
     * Don't forget to authorize the sender email you configured in your Kindle's  Approved Personal Document E-mail List.
     *
     * If you want to use a simple smtp server (provided by your ISP for example), you can configure it like that :
     * $config['cops_mail_configuration'] = array( "smtp.host"     => "smtp.free.fr",
     *                                           "smtp.username" => "",
     *                                           "smtp.password" => "",
     *                                           "smtp.secure"   => "",
     *                                           "address.from"  => "cops@slucas.fr"
     *                                           );
     *
     * For Gmail (ssl is mandatory) :
     * $config['cops_mail_configuration'] = array( "smtp.host"     => "smtp.gmail.com",
     *                                           "smtp.username" => "YOUR GMAIL ADRESS",
     *                                           "smtp.password" => "YOUR GMAIL PASSWORD",
     *                                           "smtp.secure"   => "ssl",
     *                                           "address.from"  => "cops@slucas.fr"
     *                                           );
     *
     * You'll also need to enable Allow Less Secure Apps in you Gmail account.
     */

$config['cops_mail_configuration'] = array( "smtp.host"     => "",
					    "smtp.username" => "",
					    "smtp.password" => "",
					    "smtp.secure"   => "ssl",
					    "address.from"  => "COPS"
);

 

So in theory adding in

 

/*
* Set language code to force a language (see lang/ directory for available languages).
* When empty it will auto detect the language.
*
*/
$config['cops_language'] ="en";

 

Right at the bottom of config_local.php should make it English. 

Link to comment

Also, any recommendations on getting the files into the share?

 

I tried to use Calibre on my Windows box and have it use the share, but I'm just getting errors when I try to import.

 

I'm guessing I'll set everything up on my pc then move all of it into the share, but there has to be a better way.

 

Sent from mobile

 

I personally have my Calibre library on Unraid and use a Calibre docker to access it, both aptalca and Sparklyballs have a version.  In the past I've successfully used a Windows box to access this Calibre database, but it must be on a mapped drive, (ie mapped with a drive letter within Windows)

Link to comment

Thank you. I looked at the config file I didn't see the language parameter, but that happens often enough (my wife would say I can go to the beach and not find the ocean).

 

I'll give a calibre docker a shot. Calibre website warns not to use a network drive...

 

I am using Aptalca's RDP-Calibre docker and it is awesome.

 

You get both the "desktop" version of Calibre, and a web based one to access your books from your device. Here is my config page for it. I think I added a few paths and variables... the /library one is where all by books are stored along w/ the database. You access the "desktop" version in your browser via a VNC remote desktop connection. There is no longer a need to have a Mac or Win version of Calibre.

 

wNfO3bq.png

 

The /library folder has stuff like this:

0xmfyX0.png

 

If you use the Mac or Win version of Calibre, copy the database folder to the /library folder and then follow all my settings. There is one there for URLPREFIX, use that one only if you use reverse proxy.

 

 

 

 

Link to comment

Thank you. I looked at the config file I didn't see the language parameter, but that happens often enough (my wife would say I can go to the beach and not find the ocean).

 

I'll give a calibre docker a shot. Calibre website warns not to use a network drive...

 

I am using Aptalca's RDP-Calibre docker and it is awesome.

 

You get both the "desktop" version of Calibre, and a web based one to access your books from your device. Here is my config page for it. I think I added a few paths and variables... the /library one is where all by books are stored along w/ the database. You access the "desktop" version in your browser via a VNC remote desktop connection. There is no longer a need to have a Mac or Win version of Calibre.

 

wNfO3bq.png

 

The /library folder has stuff like this:

0xmfyX0.png

 

If you use the Mac or Win version of Calibre, copy the database folder to the /library folder and then follow all my settings. There is one there for URLPREFIX, use that one only if you use reverse proxy.

 

 

I copied over my Calibre library and all my books how up in the Calibre interface when I rdp in.  However, when I go to the content server it says there are no books in the library.  I looked at the content server settings in the Calibre UI and it isn't even running (and the default port is defined), so I assume the content server in this docker is decoupled from the content server presented in the UI.  How do I get the content server to show what's in the actual Calibre library?

Link to comment

Map /books to the location of your Calibre metadata.db

 

Sorry, I realized I kind of hijacked this thread.  :P  I was actually asking hernandito in regards to the rdp-calibre setup he posted and was referring to the native content server that comes with Calibre.

 

Oh my bad, sorry, carry on...  ;D 

 

Although the whole point of this container is you don't need to bother running the Calibre OPDS server anymore.  So the Calibre RDP container can be stopped when you're not using the webui.

Link to comment

Map /books to the location of your Calibre metadata.db

 

Sorry, I realized I kind of hijacked this thread.  :P  I was actually asking hernandito in regards to the rdp-calibre setup he posted and was referring to the native content server that comes with Calibre.

 

Oh my bad, sorry, carry on...  ;D 

 

Although the whole point of this container is you don't need to bother running the Calibre OPDS server anymore.  So the Calibre RDP container can be stopped when you're not using the webui.

 

I thought I understood this docker, however your line above confuses me.  Do I need to use Calibre RDP along with this Docker or just use this docker for everything?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.