cops icon indicating copy to clipboard operation
cops copied to clipboard

How can I specify the database as a remote connection?

Open 873578156 opened this issue 4 years ago • 9 comments

This is a great project.

However,

How can I specify the database as a remote connection?

Like the metadata.db in my FTP.

E.g. http://mywebsite/metadata.db

E.g. ftp://mywebsite/metadata.db

Because, my website and store when separate.

873578156 avatar Mar 15 '20 21:03 873578156

Can site and storage be separated?

873578156 avatar Mar 16 '20 07:03 873578156

If you can mount a remote directory with a calibre database on it it should work just like any local directory/calibre database.

For me it worked with a mounted samba share (on Debian). Just enter the path to the mounted directory in config_local.php.

marioscube avatar Mar 17 '20 13:03 marioscube

The directory cannot be mounted. It only supports HTTP and FTP.

873578156 avatar Mar 17 '20 16:03 873578156

You can try to mount http as/with webdav.

(My Debian server / client don't want to at the moment, but ........ I think google and the apache docs will help in the end.)

After some fiddling with the settings for apache webdav it is for me now possible to:

  • mount webdav in /mnt/webdav on a debian client where COPS is running
  • configure access to /mnt/webdav/calibre_library in config_local.php
  • work with COPS (default web interface) as if the remote directory is local for COPS

So http access to a remote server will work for COPS, but it's not a setting in COPS. You need to install or activate webdav on the server.

A ftp server can also be mounted on the client where COPS runs (next little-project for me :-) ) Update: Does not seem to work for me...... and now it does (?) but due to very slow hardware used not really usable YMMV Update2: on slow hardware (ftp server on really old Synology DS-110j and COPS server on old ATOM 270) it works, but unbearably slow. You really need some more modern faster hardware!

Respond in this thread to see if I can be of assistance to make it work for you.

marioscube avatar Mar 17 '20 17:03 marioscube

I think it's necessary to add a function to read and cache the remote metadata.db so that it can display the directory. The download link is directly rewritten as the remote link, because webdev is too slow

873578156 avatar Mar 19 '20 03:03 873578156

1 - mounting a ftp server with curlftpfs did not give satisfactory results. I stopped testing this.

2 - mounting http with davfs (webdav) works but is just to slow to be practical if: a - slow hardware (I have a lot of older slower units I like to tinker with). Faster hardware might speed things op a bit) b - size of calibre library to share. Small libraries are ok. with larger libraries (>1000 books) everything slows down to a waiting game.

3 - davfs does cache (a lot), even the calibre database and covers. But on my hardware (even with libraries and cache on SSD's) COPS + webdav is just slow the first time it is started, even when I let COPS cache the covers. Running COPS + libraries local is faster but never fast.

What is your hardware situation like? Fast or slow hardware?

marioscube avatar Mar 19 '20 13:03 marioscube

I tried webdav, curlftpfs, httpdirfs, but they all failed to satisfy me. I thought it was time to change the architecture of the program to support remote HTTP directory and FTP storage. I have more than 6,000 books in my library (340GB), but my website only has 30GB of space, which I have to store remotely.

873578156 avatar Mar 19 '20 14:03 873578156

I'm playing with webdav -> davfs2 [Debian Buster, Apache 2.4, PHP 7.3] as COPS server, now on an Asrock Deskmini 110 with Intel Pentium G4560 CPU and NVME drive instead of the Atom 270 with SSD. All on a gigabit LAN.

This makes COPS {webinterface on a OSX desktop with Firefox) a good enough experience. Only if I start the "Recent additions" view (set to show all of my 3000 books in a library) startup takes some time and generating the covers makes me wait a bit. The other views such as Authors are really fast enough.

Even on an older iPad with Marvin the OPDS view is actually rather snappy. Except for waiting for 3000 "Recent additions", that takes a few (10, 20?) seconds, but it works.

Your problem might be: 1 - "not fast enough" COPS server 2 - "network speed constraints between COPS- and dataserver. DO you use encryption (VPN/SSL) on the network connection?

Can't you install COPS on the remote storage server? And then use reverse proxy for COPS from your server to the Storage/COPS server?

marioscube avatar Mar 19 '20 15:03 marioscube

The remote storage server is a virtual host and only supports HTTP/HTTPS

873578156 avatar Mar 19 '20 20:03 873578156