Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 06-21-2017, 06:20 PM   #1
Rayha
Member
Rayha began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Jan 2015
Location: Norway
Device: Kindle Paperwhite
Calibre 3.0 Content Server standalone

Hi,

I have previously ran Calibre content server as a stand alone command-line like this:
"C:\Program Files (x86)\Calibre2\calibre-server.exe" --auto-reload --daemonize --port 8082 --with-library u:\eBooks

And when needed, I've started Calibre GUI to update and manage my library.

This is obviously not possible anymore. I'm not that interested in reading books in web-browser, but the new content server GUI looks good. Is there a way to start content server in read-only mode?
Rayha is offline   Reply With Quote
Old 06-21-2017, 10:33 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,744
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, you need to either run the server from within the GUI (there is an option to autostart the server when the GUI is started) or stop the standalone server when you are launching the GUI.
kovidgoyal is offline   Reply With Quote
Advert
Old 06-22-2017, 06:39 AM   #3
paluster
Junior Member
paluster began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2017
Device: Android running fbreader
I really don't understand why this change has been made. At home with only one user it is really annoying, but anywhere with multiple users accessing a shared background server it is a real deal breaker. You can't shut down the server every time you want to run the GUI and you can't leave a workstation logged on all the time running the gui plus the server. Also, what happened to the option to run the server against a specific virtual library?
paluster is offline   Reply With Quote
Old 06-22-2017, 07:17 AM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,691
Karma: 6240117
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kovidgoyal View Post
No, you need to either run the server from within the GUI (there is an option to autostart the server when the GUI is started) or stop the standalone server when you are launching the GUI.
Kovid, what do you think of simulating read-only content server access by using CALIBRE_OVERRIDE_DATABASE_PATH? The content server startup script would copy the metadata.db somewhere, set the env var, then start the content server.

I see two failure modes:
1) The user makes changes using the content server. These changes could modify the library folder structure but would not get written to the correct db. Result: library and db out of sync.
2) The user makes changes using the GUI. In this case the library that the content server sees could be out of sync with its db.

The first one is a "you got what you deserve" sort of error. The "promise" has to be that the content server never makes changes to the library, even if it can.

The second one can be worked around with a script that checks the timestamp on metadata.db, stops the content server(s), copies the metadata.db file, then restarts the content server. This is more-or-less what I do with my library in dropbox being served by my VPS. I don't want the content server to have the "real" db open so I avoid dropbox sync problems.

Yes, this is a hack, but is it an egregious one?
chaley is offline   Reply With Quote
Old 06-22-2017, 07:40 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,744
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by paluster View Post
I really don't understand why this change has been made. At home with only one user it is really annoying, but anywhere with multiple users accessing a shared background server it is a real deal breaker. You can't shut down the server every time you want to run the GUI and you can't leave a workstation logged on all the time running the gui plus the server. Also, what happened to the option to run the server against a specific virtual library?
Because if you have two independent programs making changes to the same data store, you get data loss. I dont see why you cannot leave the GUI running, its not like leaving it running somehow consumes extra resources. Your RAM does not care how full it is.

As for a virtual library, setup a user account and specify as many library and virtual library restrictions as you like.
kovidgoyal is offline   Reply With Quote
Advert
Old 06-22-2017, 07:44 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,744
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@chaley: This is pretty much a recipe for data loss. I really dont want to encourage usage modes that cause data loss.

The proper solution is to have the GUI be able to connect to a running server as the backend. The problem is making that work with acceptable performance and correct locking semantics is a pretty huge task.
kovidgoyal is offline   Reply With Quote
Old 06-22-2017, 09:10 AM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,744
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Actually, the more I think about it, the more it seems that trying to get the GUI to work with a remote server as the backend is a little too ambitiuos. Might be better to just create a "device" that connects to a remote server. That way you can just connect to the server in the GUI and copy books back and forth from the remote server, as you would from a device.

Much easier to implement and while it does not address the use case of running the server and the GUI simultaneously on the same machine, it goes a long way towards addressing the question of how to manage a calibre library on a remote, headless server.
kovidgoyal is offline   Reply With Quote
Old 06-22-2017, 09:23 AM   #8
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,691
Karma: 6240117
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kovidgoyal View Post
Actually, the more I think about it, the more it seems that trying to get the GUI to work with a remote server as the backend is a little too ambitiuos. Might be better to just create a "device" that connects to a remote server. That way you can just connect to the server in the GUI and copy books back and forth from the remote server, as you would from a device.

Much easier to implement and while it does not address the use case of running the server and the GUI simultaneously on the same machine, it goes a long way towards addressing the question of how to manage a calibre library on a remote, headless server.
That sounds a lot like the wireless device.

Actually, having the remote server connect as a wireless device isn't silly. The protocol and code are stable, it is already well-integrated into calibre, and the functionality is understood. It works with plugins such as reading list. On the other hand, there is the issue of which instance would be in control. For the wireless device, like all devices, the device initiates the connection but the calibre GUI provides the UI. Also, the device protocol doesn't do a very good job of uploading from the device because it doesn't ask the device for known metadata, instead using the metadata in the book.
chaley is offline   Reply With Quote
Old 06-22-2017, 09:46 AM   #9
paluster
Junior Member
paluster began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2017
Device: Android running fbreader
Because in a work environment you don't just walk off and go home leaving a workstation or the management terminal on a server logged in. This is a serious security "no no" and in a lot of environments the devices will be programmed to log off and/or shut down overnight. As I said, it's only annoying at home, but this change cripples Calibre as an enterprise application, which is a shame because the 2.x version was great in that context.
paluster is offline   Reply With Quote
Old 06-22-2017, 10:02 AM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,744
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Why would you be running a personal book server on your work workstation? Surely IT doesn't allow employees to run random services that listen for incoming connections on the internal network?

And if you want the behavior of 2.0, simply create a script to launch the GUI that first shutd down the server, and then restarts it when the GUI exits.
kovidgoyal is offline   Reply With Quote
Old 06-22-2017, 10:15 AM   #11
paluster
Junior Member
paluster began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2017
Device: Android running fbreader
We were IT (I'm retired now). We were setting up to have all the technical documentation for the IT department on line as pdf or epub and accessible via browser at the desktop or download to hand-helds for use in the server rooms. If they finished the roll out after I left, then v3.0 will have crashed the whole thing.

Why use a "personal" library manager in a work environment, because it actually is that good - classic FOSS problem of the best software getting used in much bigger set-ups than the development intended
paluster is offline   Reply With Quote
Old 06-22-2017, 10:34 AM   #12
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,744
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
For that kind of setup, the best way to architect it would be to have your main calibre library on a different computer. Use only the GUI there and rsync the library folder to the server.
kovidgoyal is offline   Reply With Quote
Old 06-22-2017, 10:37 AM   #13
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,744
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@chaley: Yeah it does sound a lot like the wireless device The only question is to what extent do we allow two way data flow. Metadata updates from device->calibre? How does one handle conflicts -- all the usual distributed data reconciliation headaches...
kovidgoyal is offline   Reply With Quote
Old 06-22-2017, 03:13 PM   #14
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,691
Karma: 6240117
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kovidgoyal View Post
@chaley: Yeah it does sound a lot like the wireless device The only question is to what extent do we allow two way data flow. Metadata updates from device->calibre? How does one handle conflicts -- all the usual distributed data reconciliation headaches...
The wireless device is in the end a calibre device. It doesn't do much more than the standard device interface, which as you know is mostly one way: calibre to the device. The plumbing is there to update local metadata using information from the device; it is currently used to sync a bool "read" column and a "date" date-read column. I haven't extended it any further for exactly the reason you suggest: conflicts. IMO that problem is close to irreconcilable without human intervention in the conflict reconciliation process, especially for is_multiple columns.
chaley is offline   Reply With Quote
Old 06-23-2017, 03:26 AM   #15
Rayha
Member
Rayha began at the beginning.
 
Posts: 21
Karma: 10
Join Date: Jan 2015
Location: Norway
Device: Kindle Paperwhite
Thanks for the feedback and the discussion.

It looks like more users that just me, are using the system this way. Running content server to present the library for users via web, and using GUI for maintaining the library.

Some use one workstation for both purposes, and some use a NAS/server for content server and workstation for GUI. And with new functionallity in Calibre 3, none of these way of using the system, will work. And there are reasons why it is not practical to have GUI running all the time.

For me, I can use the workaround with a wrapper script as suggestet above, to stop content server, before starting GUI, and then start content server again after closing GUI. This will work as long as you use same workstation for both services. I would like to move content server to my Synology NAS in the future, but I'm not there yet. And then I need another solution.

I have a suggestion that could solve both problems above, without using workarounds and 2 copies of the whole library.

Let content server and GUI run independently against 2 copies of metadata.db. And handle version control, merging and conflicts within GUI application.

I don't know too much about the new functionallity in content server, and what information it actually write to the database. But my guess is that it have to do with the reading books functionallity. And even though it is possible to read books through GUI as well, the normal maintenance done in GUI, like updating metadata, adding books and new formats of books, will not conflict with data that is related to reading functionallity.

Another suggestion, is to move the information related to reading functonallity out of metadata.db and into a reading-info database. This way, the GUI could use metadata.db for maintaining the library, and reading-info database when starting reading sessions from GUI. And then you need to handle version control, merging and conflicts with this database only.

This is really a great way of handling eBook libraries, so I hope you will consider these improvements to get an even better solution
Rayha is offline   Reply With Quote
Reply

Tags
calibre 3.0, content server, read-only, standalone

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
calibre-sync: Automatically download books from your Calibre Content Server onto Kobo mishagale Related Tools 14 05-13-2019 05:18 PM
Calibre Content Server and Windows Home Server 2011 HughMcC Calibre 8 10-01-2014 07:26 AM
Standalone content-server and Calibre Companion issues duckpuppy Devices 2 11-08-2012 07:54 AM
500 Internal Server Error accessing content server Calibre 0.8.8 DaddyO57 Calibre 1 07-20-2012 06:08 PM
calibre content server only. nesvarbu Calibre 5 02-18-2011 03:40 AM


All times are GMT -4. The time now is 05:06 AM.


MobileRead.com is a privately owned, operated and funded community.