Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kobo api endpoint from localhost #1990

Closed
gwenvador opened this issue May 16, 2021 · 3 comments
Closed

Kobo api endpoint from localhost #1990

gwenvador opened this issue May 16, 2021 · 3 comments
Labels

Comments

@gwenvador
Copy link

I am using a seedbox to host my calibre-web server so I don't have control over the calibre installation and server configuration. The app is a bundle (calibre and calibre-web) and access to the web server is done through a thin client (so I will appear as coming from localhost).
When I want to generate the Kobo Auth URL I have the error message: PLease access calibre-web from non localhost to get valid api_endpoint for kobo device. Is there a way to bypass this error or generate the API a different way? Any reason for restricting the API generation from localhost?

Environment (please complete the following information):

  • OS: Linux / Seedbox
  • Python version: python2.7
  • Calibre-Web version: 0.6.9
@OzzieIsaacs
Copy link
Collaborator

The problem with localhost is that you would normally get a string displayed to enter it in your kobo reader. If kobo tries to access it's localhost to sync the books this isn't working. For unexperienced users this is not obvious, therefore the string isn't shown.
So if I understand you right accessing the machine via it's hostname (e.g. desktop) isn't possible.
The only chance you have is to edit the app.db file with a sqlite browser and enter the apiendpoint data by yourself:
grafik
PLease replace id with the user id, you find in the user table, the auth_token should be a random string (normal alphanumeric characters).
Another option would be to copy app.db file and start with this app.db another calibre-web instance which you could access via "non-localhost" so you will get the auth_token generated automatically

@gwenvador
Copy link
Author

gwenvador commented May 19, 2021

Thanks for your answer. I was able to setup the auth_token this way but unfortunately the kobo API is returning the book URL as 127.0.0.1 instead of the public address. So I guess the sync cannot work :(
I will contact my seedbox host to see if there is a way to configure the web server a different way.

@gwenvador
Copy link
Author

gwenvador commented May 20, 2021

@OzzieIsaacs To follow up on this discussion would it be possible to configure the url_base as an option in the configuration (the same way as url_port) ?

OzzieIsaacs added a commit that referenced this issue Jan 25, 2022
…1990)

Create kobo sync token button is now "unclicked" after closing dialog
Additional localhost route is catched
If book format is deleted this also deletes the book synced to kobo status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants