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-18-2017, 02:10 AM   #1
mcaron1234
Junior Member
mcaron1234 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Sep 2009
Location: Washington
Device: Kindle Voyage
V3.0 commandlline calibre-server userdb

I am trying to run the commandline calibre content server on linux mint 18.1. I can't figure out how to correctly use auth.

Can I use the userdb of the content server built into the gui or do i need to create seperate userdb file?
If I need to create a userdb file what does that file need to contain and what format should it be in?

Here is the commandline I am trying to use:

Code:
$ /usr/bin/calibre-server --port 8080 --url-prefix=/cops --enable-auth  --auth-mode=basic --userdb=/opt/calibre/resources/content-server '/home/matt/mounts/ServerFolders/Books/Calibre Library Oden/'
Which give this error when I try to log in to the server (I assume because it can't find a userdb):

Code:
Unhandled exception in state: State: _job_done Client: 192.168.1.142:50409 Request: GET /interface-data/books-init?library_id=Calibre_Library_Oden&sort=timestamp.desc&1497761553701 HTTP/1.1
Traceback (most recent call last):
  File "site-packages/calibre/srv/loop.py", line 518, in tick
  File "site-packages/calibre/srv/loop.py", line 278, in _job_done
  File "site-packages/calibre/srv/pool.py", line 35, in run
  File "site-packages/calibre/srv/http_response.py", line 439, in run_request_handler
  File "site-packages/calibre/srv/routes.py", line 300, in dispatch
  File "site-packages/calibre/srv/auth.py", line 215, in __call__
  File "site-packages/calibre/srv/auth.py", line 250, in do_http_auth
  File "site-packages/calibre/srv/auth.py", line 209, in check
  File "site-packages/calibre/srv/users.py", line 128, in get
  File "site-packages/calibre/srv/users.py", line 77, in conn
CantOpenError: CantOpenError: unable to open database file
If I drop all the auth options from the commandline above the server works, but I really do need some sort of auth on it.
mcaron1234 is offline   Reply With Quote
Advert
Old 06-18-2017, 06:25 AM   #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: 31,851
Karma: 8697710
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre-server --manage-users
kovidgoyal is offline   Reply With Quote
Old 06-18-2017, 10:31 AM   #3
mcaron1234
Junior Member
mcaron1234 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Sep 2009
Location: Washington
Device: Kindle Voyage
Quote:
Originally Posted by kovidgoyal View Post
calibre-server --manage-users
When I do this, it tells me "The username reader already exists" (I had already added a user via the main program gui). How do I to tell the commandline to use an existing userdb?
mcaron1234 is offline   Reply With Quote
Old 06-18-2017, 11:04 AM   #4
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: 31,851
Karma: 8697710
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre-server -h | grep USERDB
kovidgoyal is offline   Reply With Quote
Old 06-18-2017, 12:16 PM   #5
mcaron1234
Junior Member
mcaron1234 began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Sep 2009
Location: Washington
Device: Kindle Voyage
I guess my question wasn't precise enough (i have read the help file extensively). I should have asked how to tell the calibre-server to use the existing userdb?

This is what I just tried:
Code:
$ /usr/bin/calibre-server --port 8080 --url-prefix=/cops --enable-auth  --auth-mode=basic --userdb=USERDB '/home/matt/mounts/ServerFolders/Books/Calibre Library Oden/'
But my password is always rejected. I tried adding a new user with calibre-server --manage-users, but I still can't log in.
mcaron1234 is offline   Reply With Quote
Old 06-18-2017, 01:20 PM   #6
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 1,286
Karma: 5400000
Join Date: Jun 2010
Device: Windows 10 tablet,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by mcaron1234 View Post
I guess my question wasn't precise enough (i have read the help file extensively). I should have asked how to tell the calibre-server to use the existing userdb?

This is what I just tried:
Code:
$ /usr/bin/calibre-server --port 8080 --url-prefix=/cops --enable-auth  --auth-mode=basic --userdb=USERDB '/home/matt/mounts/ServerFolders/Books/Calibre Library Oden/'
But my password is always rejected. I tried adding a new user with calibre-server --manage-users, but I still can't log in.
Your path is wrong;
Quote:
--userdb

Path to user database. Path to a file in which to store the user and password information. Normally a file in the calibre configuration directory is used.
The configuration is usually a hidden directory for example:
Code:
/home/username/.config/calibre


bernie.
gbm is online now   Reply With Quote
Old 06-18-2017, 02:08 PM   #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: 31,851
Karma: 8697710
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If you want it to use the same password database as the GUI, supply no --userdb argument, provided the user account you run the server and the gui under are the same, they will use the same userdb.

If you want it to use a userdb in a particular location, supply the full path to the user database file, and not a directory. So for instance

--userdb ~/.config/calibre/server-users.sqlite
kovidgoyal is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Porting Calibre's built-in web server to a remote server? perryja Related Tools 6 05-02-2013 10:05 AM
calibre-server: Doesn't server up newly added files kaistian Calibre 5 03-17-2013 12:54 PM
calibre-server OPDS catalog - manual move to web server HaakonME Related Tools 5 09-21-2012 04:11 AM
500 Internal Server Error accessing content server Calibre 0.8.8 DaddyO57 Calibre 1 07-20-2012 07:08 PM
Calibre-server port not open issue on Fedora server stueyboy Devices 0 08-17-2011 05:57 PM


All times are GMT -4. The time now is 08:54 PM.


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