From a9713bd497be9622cdcb51b24cc1cb589bbd3ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Sierra-Velasquez?= Date: Thu, 19 Feb 2026 18:14:14 +0100 Subject: [PATCH] Fix Kobo sync failure behind reverse proxy: rewrite library_sync URL in init response The HandleInitRequest() function rewrites image URLs to point to the local Calibre-Web instance, but library_sync was left pointing to storeapi.kobo.com. This caused Kobo e-readers to call Kobo's servers for sync instead of the local server, resulting in no books being synced when running behind a reverse proxy. --- cps/kobo.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cps/kobo.py b/cps/kobo.py index da9c9bc55..776510a10 100644 --- a/cps/kobo.py +++ b/cps/kobo.py @@ -1101,6 +1101,8 @@ def HandleInitRequest(): width="{width}", height="{height}", isGreyscale='false')) + kobo_resources["library_sync"] = calibre_web_url + url_for("kobo.HandleSyncRequest", + auth_token=kobo_auth.get_auth_token()) else: kobo_resources["image_host"] = url_for("web.index", _external=True).strip("/") kobo_resources["image_url_quality_template"] = unquote(url_for("kobo.HandleCoverImageRequest", @@ -1118,6 +1120,9 @@ def HandleInitRequest(): height="{height}", isGreyscale='false', _external=True)) + kobo_resources["library_sync"] = url_for("kobo.HandleSyncRequest", + auth_token=kobo_auth.get_auth_token(), + _external=True) response = make_response(jsonify({"Resources": kobo_resources})) response.headers["x-kobo-apitoken"] = "e30="