cops icon indicating copy to clipboard operation
cops copied to clipboard

multiple database & nginx

Open joshp23 opened this issue 6 years ago • 3 comments

I can't seem to get this working with multiple databases and NGINX. I can browse the databases, but downloads all fail. I followed directions according to the wiki. Am I missing something that isn't explicitly stated in the wiki?

joshp23 avatar Jan 21 '19 22:01 joshp23

I was able to get this working with the following setup:

config.local.php

Set the path to the 2 libraries explicitly as per instructions:

$config['calibre_directory'] = array ("Default" => "/home/USER/path/to/Calibre/epub/", "PDF" => "/home/USER/path/to/Calibre/pdf/");

In the same file, use the following to ensure the correct directory is set per database being browsed, making sure to order the databases correctly according to their appearance in the above array, starting with 0:

if (!empty ($_GET) && isset($_GET['db']) && $_GET['db'] != '') {
	if ( $_GET['db'] == 0 )
		$config['calibre_internal_directory'] = "/epub/";
	elseif ( $_GET['db'] == 1 )
   		$config['calibre_internal_directory'] = "/pdf/";
}

nginx

Set directories for the above locations like so:

location "/epub" {
    root "/home/USER/path/to/Calibre/";
    internal;
}

location "/pdf" {
    root "/home/USER/path/to/Calibre/";
    internal;
}

If there is a better way to do this, this guy is all ears.

joshp23 avatar Jan 24 '19 01:01 joshp23

The if statement code block above provided what I needed to get downloads working for multiple databases in this COPS docker container.

Chirishman avatar Sep 21 '19 17:09 Chirishman

The if statement code block above provided what I needed to get downloads working for multiple databases in this COPS docker container.

I got it working, when i set internal directory to '' and mounted the libaries under /books

Fotoratte avatar May 04 '21 12:05 Fotoratte