Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple libraries - COPS on Docker [SOLVED] #503

Open
bitnikrbt opened this issue Jun 1, 2021 · 6 comments
Open

Multiple libraries - COPS on Docker [SOLVED] #503

bitnikrbt opened this issue Jun 1, 2021 · 6 comments

Comments

@bitnikrbt
Copy link

My configuration:
Docker 19.03.8
Portainer 2.1.1
Cops 1.1.3 packed by Linuxserver (Linuxserver/cops)
Installed on WD MyCloudEx2Ultra

I want to get access to multiple Calibre libraries stored on my WD MyCloudEx2Ultra NAS. I already manage to configure COPS to get access to one of them.

Now I am clueless on how to preceed from now on.

I am seeking advice to conconfigure COPSs to access multiple libraries with the above mentioned configuration.

Thanks

Roberto

@jvanderzande
Copy link

Just add a second directory to your config_local.php like:


$config['calibre_directory'] = array ("Nederlands" => "./ebooks/Calibrebibliotheek-NL-NAS/", "English" => "./ebooks/Calibrebibliotheek-EN-NAS/");

Jos

@bitnikrbt
Copy link
Author

Jos thank you very much for your help.

After some testing with no positive output I think the problem is that COPS is installed as a Portainer App.

By using the command "array" in the config_local.php as you suggested I think that the configuration conflicts with the container of the books and with the host configured in Portainer.

These are problems that go beyond my basic skills.

So if anyone is able to support me I would be grateful.

Thanks

Rob

@bitnikrbt bitnikrbt changed the title Multiple libraries - COPS on Docker Multiple libraries - COPS on Docker [SOLVED] Jun 2, 2021
@bitnikrbt
Copy link
Author

bitnikrbt commented Jun 2, 2021

I have found a solution that works for me.

This procedure is applied in case of installation of COPS from APP TEMPLATES in Portainer.
In my case the COPS template is based on linuxserver / cops.

Install the template and add a container - host (binded to container) pair for each book collection you want to make accessible.
The host must point to the folder where the metadata.db file of the reference collection is located.
example:
container = books - host = /path-to-library-on-your-nas/books
container = books1 - host =/path-to-library-on-your-nas/books1
etc.

Deploy the ammended container.

In Portainer, stop the COPS container that has started automatically.

Download the config_local.php file from the NAS and edit it as follows:

command $ config ['calibre_internal_directory']: add a line for each container created. (using example reference :)
$ config ['calibre_internal_directory'] = '/books/';
$ config ['calibre_internal_directory'] = '/books1/';

command "$ config ['calibre_directory'] = array" enter the desired name for the collection and the reference to "calibre_internal_directory" and NOT to the path where the collections are located. (using example reference :)
$ config ['calibre_directory'] = array ("READ THIS" => "/books/", "READ MORE" => "/books1/");

Save the config_local.php, overwrite the original file by uploading it to the same location it was downloaded from.

In Portainer restart the COPS container.

Check on the local port if there are all the collections set up.

This solution works for me.

Hope will help someone else.

Rob

@horus68
Copy link
Contributor

horus68 commented Jun 3, 2021

In your config you have caliber word but it should be calibre
Note: you can also edit your text here and place the code inside code tags

@itsalljustdata
Copy link

I went with the following....

/books/ is the "base" folder where all of my ebook libraries exist one subfolder down

    $config['calibre_directory'] = array();

    foreach (array_map('dirname',glob('/books/*/metadata.db')) as $dir) {
        $name = basename($dir);
        $config['calibre_directory'][$name] = $dir.'/';
    }

@marsimgit
Copy link

marsimgit commented Jun 29, 2022

I went with the following....

/books/ is the "base" folder where all of my ebook libraries exist one subfolder down

    $config['calibre_directory'] = array();

    foreach (array_map('dirname',glob('/books/*/metadata.db')) as $dir) {
        $name = basename($dir);
        $config['calibre_directory'][$name] = $dir.'/';
    }

I tried this and it works partially i.e. you can browse all configured libraries but cannot neither view not download ebooks. I suppose that $config['calibre_internal_directory'] has to be changed in a similar fashion but don't know yet how to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants