- Python 98.4%
- Dockerfile 1.6%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0143fCXziqoXiCzmfuCtEBd4 |
||
| app | ||
| tests | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| docker-compose.yml | ||
| Dockerfile | ||
| LICENSE | ||
| README.md | ||
| requirements.txt | ||
kosync-bookwyrm
A small self-hosted bridge between an e-reader and BookWyrm.
The reader syncs its position to this server with the KOReader Sync (KOSync) protocol, which CrossPoint and KOReader already speak. The bridge stores the position like a normal KOSync server, so syncing between devices keeps working, and forwards it to your BookWyrm account:
| Reader progress | BookWyrm |
|---|---|
| from 1 % | shelf Currently reading (start date today) |
| every further 5 % | progress update in percent on the open read-through |
| from 98 % | shelf Read (finish date today) |
No public status is posted: only the shelf changes and progress updates you could also make by hand. Thresholds are configurable.
How it talks to BookWyrm
BookWyrm has no client API yet (bookwyrm#785), so the bridge logs in like a browser (session cookie plus CSRF token) and posts the same forms as the website. That works with any instance, but a BookWyrm update that changes those forms can break it; errors show up on the bridge's web page and in the log, and the reader keeps syncing regardless. Accounts with two-factor login are not supported.
Books are matched by ISBN when the reader sends one, otherwise by title and author among the books your instance already knows. A book BookWyrm does not know, or an ambiguous one, waits on the web page until you link it by pasting its BookWyrm URL.
Run it
cp .env.example .env # fill in both logins
docker compose up -d --build
The bridge listens on port 8081. Put it behind HTTPS (Pangolin, Caddy, Traefik…) if the reader reaches it over the internet. The KOSync password travels as an MD5 hash, which is no protection without TLS.
Start with DRY_RUN=true to see in the log what would be sent.
The web page at https://<host>/ (same login as KOSYNC_USER / KOSYNC_PASSWORD)
lists every synced book with its progress, BookWyrm match, status and last error,
and lets you link, re-search or unlink a book.
Reader setup (CrossPoint)
Settings → CrossPoint Sync:
- Sync Server URL:
https://<host> - Username / password:
KOSYNC_USER/KOSYNC_PASSWORD, then Authenticate (Sign Up also works with the same values; other names are refused) - Server Type: Other. With this type CrossPoint also sends the book's ISBN, which gives the most reliable match. CrossPoint works too, but matches by title and author only. Strict KoSync drops the book metadata, so every book then has to be linked by hand.
Then use CrossPoint Sync in the reader menu while reading. KOReader can use the same server through its Progress sync plugin, but KOReader sends no title, so its books must be linked by hand on the web page.
Settings
| Variable | Default | |
|---|---|---|
KOSYNC_USER, KOSYNC_PASSWORD |
required | login for the reader and the web page |
BOOKWYRM_URL |
required | e.g. https://bookwyrm.social |
BOOKWYRM_USER, BOOKWYRM_PASSWORD |
required | your BookWyrm login (username or e-mail) |
START_THRESHOLD |
0.01 |
progress that moves a book to Currently reading |
FINISH_THRESHOLD |
0.98 |
progress that moves a book to Read |
PROGRESS_STEP |
0.05 |
minimum change between progress updates |
DRY_RUN |
false |
log only |
DATA_DIR |
/data |
SQLite database location |
Development
pip install -r requirements.txt pytest
python -m pytest
The tests run against a fake BookWyrm and cover login, re-login after session expiry, ISBN and title matching, manual linking and the shelf/progress flow.
License
MIT