Mobileread
Docker Calibre and KOReader
#1  feffe 09-29-2019, 10:26 AM
Hello, I'm having a problem with connecting my kobo aura one running koreader with my calibre server.

This is my setup:
Docker swarm.
port 8083:8080 #guac
port 8081:8081 #webserver

After using the guac interface to enable the server it is reachable on <swarm-node>:8081.
Since it's running in a swarm, the server is accessible from any node at port 8081.
Running for example 192.168.1.244:8081 in the browser works. (from another machine on the same network).
Using that under "calibre wireless connection" ultimately results in an info message saying:
"Cannot connect to calibre server."

On a sort of related side not, I've been trying to figure out where koreader stores its logs but haven't been able to find anything, would probably help a bit if I knew where it was ^^
Reply 

#2  Frenzie 09-29-2019, 11:02 AM
The crash.log file in KOReader's directory. You'll get a lot still more if you enable debug logging in Advanced settings (in the file manager tools menu).

Note that there are at least two types of calibre server. If I'm not mistaken content server is OPDS and wireless connection is wireless connection, but the fact that you're talking about visiting from the browser suggests OPDS?
Reply 

#3  feffe 09-29-2019, 12:23 PM
Quote Frenzie
Note that there are at least two types of calibre server. If I'm not mistaken content server is OPDS and wireless connection is wireless connection, but the fact that you're talking about visiting from the browser suggests OPDS?
Thank you I think I figured it out now. I was using wireless connection under tools when I should have been using OPDS Catalog under the search tab. Specifying <node-hostname>:8081/opds works fine and downloading works. And I also see that this enables me to specify username and password so I can open the server externally, so that's nice. Kind of thought it wouldn't have that functionality .

Anyways, thank you for the clarification!

I'm now trying to get authentication to work, I've created a user under "Sharing over the internet > User accounts", enabled the option requiring authentication under "Sharing over the internet > Main" and entered the credentials under the opds catalog entry in koreader. This setup just returns error 400 (aka bad request).

This is how a request looked before entering the credentials:
Code
09/29/19-16:33:47 INFO request { ["url"] = "http://canti:8081/opds", ["method"] = "HEAD", ["headers"] = { ["Authorization"] = "Basic Og==", ["Host"] = "canti" }, ["sink"] = function: 0x2ff49fb0
}
09/29/19-16:33:47 INFO request { ["url"] = "http://canti:8081/opds", ["method"] = "GET", ["headers"] = { ["Authorization"] = "Basic Og==", ["Host"] = "canti" }, ["sink"] = function: 0x2ff4d890
}
And this is how it looks now with credentials specified:
Code
09/29/19-16:41:39 INFO request { ["url"] = "http://canti:8081/opds", ["method"] = "HEAD", ["headers"] = { ["Authorization"] = "Basic <snip>", ["Host"] = "canti" }, ["sink"] = function: 0x301b9270
}
09/29/19-16:41:39 INFO request { ["url"] = "http://canti:8081/opds", ["method"] = "GET", ["headers"] = { ["Authorization"] = "Basic <snip>", ["Host"] = "canti" }, ["sink"] = function: 0x301bcb40
}
Any ideas? Afaik 400 is only supposed to be used if any part of the request is bork but doesn't take into account content. So for example if "Authorization" had a bad value it would return 401. I don't see any difference here so in request layout so idk why it would return 400.

EDIT: and yes I've restarted the container multiple times after editing user and server settings.
Reply 

#4  NiLuJe 09-29-2019, 12:25 PM
I vaguely recall issues with authentication & calibre's OPDS servcer, which is why I mentioned yesterday in the thread below yours that it might need to be passwordless.

I don't recall the details, but I'm sure there's at least a couple issues about it on github.
Reply 

#5  Frenzie 09-29-2019, 12:30 PM
https://github.com/koreader/koreader/issues/3953#issuecomment-420949393
Quote
As a workaround, you can enable basic authentication support:
Calibre -> Preferences -> Sharing over the net -> Advanced tab and set:
Choose the type of authentication userd: basic and restart content server.
Reply 

#6  feffe 09-29-2019, 12:56 PM
Quote Frenzie
https://github.com/koreader/koreader/issues/3953#issuecomment-420949393
Thank you, that got it working with authentication as well.


In short if anyone finds this later:

If you want to use calibre as a content server, use opds.
OPDS is accesible as part of the content server.

In koreader: Search > OPDS catalog, specify a url to the opds server which is hosted on the same port as content server under "/opds" aka something along the lines of "http://<hostname>:8081/opds".
Reply 

#7  Ken Maltby 09-29-2019, 11:02 PM
If you long press on "Local calibre catalog" and select "Edit", you can add the KOReader side of the Content server interface.

Luck;
Ken
Reply 

Today's Posts | Search this Thread | Login | Register