11-18-2010, 09:54 AM | #1 |
Enthusiast
Posts: 27
Karma: 10
Join Date: Nov 2010
Device: Andoid
|
Login/Password for Calibre Server
I'd like to use Calibre server with WordPlay, etc. on my Android phone, but when I attempt to log in with my username and password, I get errors.
I've set the port, username, and password for Calibre Server using the preferences pane, but the login/password protection sometimes does not work, and sometimes prevents me from accessing the content. In these examples, I use the command line tool to demonstrate the problem of setting calibre to require a username and password, and then being unable to log in to the server. Code:
643 ~: calibre-server --version calibre-server (calibre 0.7.18) Code:
: curl --user foo --include http://localhost:8083 Enter host password for user 'foo': HTTP/1.1 401 Unauthorized Date: Thu, 18 Nov 2010 13:31:55 GMT Content-Length: 1344 Content-Type: text/html Www-Authenticate: Digest realm="Password to access your calibre library. Username is foo", nonce="c8c2b42f5a613eb2290a2a2921826d3c", algorithm="MD5", qop="auth" Server: CherryPy/3.1.2 Code:
File "/usr/lib/pymodules/python2.6/cherrypy/_cprequest.py", line 591, in respond self.hooks.run('on_start_resource') File "/usr/lib/pymodules/python2.6/cherrypy/_cprequest.py", line 98, in run hook() File "/usr/lib/pymodules/python2.6/cherrypy/_cprequest.py", line 58, in __call__ return self.callback(**self.kwargs) File "/usr/lib/pymodules/python2.6/cherrypy/lib/auth.py", line 74, in digest_auth raise cherrypy.HTTPError(401, "You are not authorized to access that resource") Code:
: calibre-server --username foo --port 8083 Code:
File "/usr/lib/pymodules/python2.6/cherrypy/_cprequest.py", line 591, in respond self.hooks.run('on_start_resource') File "/usr/lib/pymodules/python2.6/cherrypy/_cprequest.py", line 98, in run hook() File "/usr/lib/pymodules/python2.6/cherrypy/_cprequest.py", line 58, in __call__ return self.callback(**self.kwargs) File "/usr/lib/pymodules/python2.6/cherrypy/lib/auth.py", line 74, in digest_auth raise cherrypy.HTTPError(401, "You are not authorized to access that resource") HTTPError: (401, 'You are not authorized to access that resource') I also get the impression that from time to time, even when I require a username and password in the preferences, Calibre will let me through without one -- but that's a problem for a different day. I installed Calibre from Debian unstable, and cherrypy is version 3.1.2-1l, also Debian unstable. |
11-18-2010, 09:55 AM | #2 |
Enthusiast
Posts: 27
Karma: 10
Join Date: Nov 2010
Device: Andoid
|
P.S. I should mention that on the eReader forums on this site, Android users have run across similar problems. I'm not quite at the phone stage just yet -- I am still trying to make this work locally.
|
Advert | |
|
11-18-2010, 12:29 PM | #3 |
creator of calibre
Posts: 44,564
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
use a binary calibre install, don't use the version from debian.
|
11-18-2010, 05:20 PM | #4 |
Enthusiast
Posts: 27
Karma: 10
Join Date: Nov 2010
Device: Andoid
|
Not fixed.
I've used the official download, 0.7.28, in /usr/local. Code:
: curl --user yudkowsky --include http://localhost:8083 Enter host password for user 'yudkowsky': HTTP/1.1 401 Unauthorized Date: Thu, 18 Nov 2010 21:14:21 GMT Content-Length: 1173 Content-Type: text/html Www-Authenticate: Digest realm="Password to access your calibre library. Username is yudkowsky", nonce="50d31711349c7d128dcc34c0970febf1", algorithm="MD5", qop="auth" Server: CherryPy/3.1.2 Code:
File "/home/kovid/build/calibre/src/cherrypy/_cprequest.py", line 591, in respond File "/home/kovid/build/calibre/src/cherrypy/_cprequest.py", line 98, in run File "/home/kovid/build/calibre/src/cherrypy/_cprequest.py", line 58, in __call__ File "/home/kovid/build/calibre/src/cherrypy/lib/auth.py", line 74, in digest_auth HTTPError: (401, 'You are not authorized to access that resource') |
11-18-2010, 05:26 PM | #5 | |
Enthusiast
Posts: 27
Karma: 10
Join Date: Nov 2010
Device: Andoid
|
Here's another possible clue:
Quote:
If I use calibre-server --username calibre --port 8083 --password "" then I can access the server using calibre and a blank password If I use calibre-server --username calibre --port 8083 --password "foo" Then neither a blank nor "foo" work as the password. Please let me know if I can be any further assistance. |
|
Advert | |
|
11-18-2010, 06:13 PM | #6 |
creator of calibre
Posts: 44,564
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you're using curl you need to add --digest
so use curl --user whatever --digest http://localhost:8083 |
11-19-2010, 10:04 AM | #7 |
Enthusiast
Posts: 27
Karma: 10
Join Date: Nov 2010
Device: Andoid
|
Thank you for your help so far -- caliber-server now works with authentication on both my local machine, from remote machines, and from my Android's browser.
It does not work from either WordPlay or from Aldiko. Both refuse to authenticate. I'm using a URL of the form http://example.com:1234 - I have tried it with and without the /stanza portion of the URL, but of course my issue is authentication. I'll try their forums next, but I was wondering if I'm overlooking something obvious. |
11-20-2010, 01:09 AM | #8 |
Member
Posts: 12
Karma: 10
Join Date: Nov 2010
Device: Sony PRS-650
|
@myudkowsky: Hi, you know that I had a similar problem with calibre. After installing the new version, all the problems are gone ! Maybe you also have to install and try the version 0.7.29
Have a nice day and happy reading ! |
11-20-2010, 09:31 PM | #9 |
Enthusiast
Posts: 27
Karma: 10
Join Date: Nov 2010
Device: Andoid
|
Paede, thanks for the suggestion, and I just downloaded the 0.7.29 edition.
I still can't log in from Aldiko or WordPlayer. It's very odd. Aldiko clearly reaches the Calibre server but will not accept my login and password. |
11-20-2010, 09:35 PM | #10 |
Enthusiast
Posts: 27
Karma: 10
Join Date: Nov 2010
Device: Andoid
|
I should also mention that I can clearly see the access attempts in the server log, but that I do not see any associated errors.
|
11-20-2010, 10:03 PM | #11 |
creator of calibre
Posts: 44,564
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
IIRC neither aldiko nor wordplayer support digest auth.
|
11-21-2010, 08:45 AM | #12 |
Enthusiast
Posts: 27
Karma: 10
Join Date: Nov 2010
Device: Andoid
|
Other than using just a login and not a password, do you have any suggestions for alternative Android readers? And for eBook readers that support login/password?
|
11-21-2010, 11:21 AM | #13 |
creator of calibre
Posts: 44,564
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
not really, I don't own any android devices. But I am going to be adding an embedded reader to the content server soon, so you wont need to use any third party readers at all.
You can also integrate the content server into apache with WSGI and try using basic auth (instructions are in the tutorial section of the User Manual) |
11-21-2010, 03:03 PM | #14 |
Enthusiast
Posts: 27
Karma: 10
Join Date: Nov 2010
Device: Andoid
|
Thanks, almost there. I've enabled WSGI. I get a 500 error message with the following error report:
Code:
[Sun Nov 21 12:48:16 2010] [error] [client 127.0.0.1] mod_wsgi (pid=15170): Target WSGI script '/var/www/calibre-apache-config/scripts/calibre-wsgi-adapter.py' cannot be loaded as Python module. [Sun Nov 21 12:48:16 2010] [error] [client 127.0.0.1] mod_wsgi (pid=15170): Exception occurred processing WSGI script '/var/www/calibre-apache-config/scripts/calibre-wsgi-adapter.py'. [Sun Nov 21 12:48:16 2010] [error] [client 127.0.0.1] Traceback (most recent call last): [Sun Nov 21 12:48:16 2010] [error] [client 127.0.0.1] File "/var/www/calibre-apache-config/scripts/calibre-wsgi-adapter.py", line 38, in <module> [Sun Nov 21 12:48:16 2010] [error] [client 127.0.0.1] from calibre.library.server.main import create_wsgi_app [Sun Nov 21 12:48:16 2010] [error] [client 127.0.0.1] ImportError: No module named calibre.library.server.main Code:
CALIBRE_RESOURCES_PATH=/usr/local/calibre/resources CALIBRE_EXTENSIONS_PATH=/usr/local/calibre/plugins CALIBRE_PYTHON_PATH=/usr/local/calibre/loader:/usr/local/calibre:/usr/local/calibre/loader.zip Code:
# The first entry from CALIBRE_PYTHON_PATH sys.path.insert(0, '/usr/local/calibre/loader') |
11-21-2010, 04:39 PM | #15 |
creator of calibre
Posts: 44,564
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
you cannot use a binary installation, you have to install from source as typically the binary installs python modules will be mismatched with the python installation used by apache.
|
Tags |
login/password, server |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can't access password protected calibre server | ganymede | Calibre | 3 | 11-15-2010 07:24 AM |
Classic Softrooted nook & password protected Calibre server | sherman | Nook Developer's Corner | 5 | 08-22-2010 12:24 PM |
Calibre server | zzmijarevic | Calibre | 10 | 08-21-2010 07:40 AM |
Calibre Server Mismatch | da_jane | Calibre | 10 | 10-28-2009 02:09 AM |
Installation of Calibre-Admin Password Wanted | Knocka | Calibre | 3 | 03-15-2009 06:52 AM |