Skip to content

feature: calibre content server - #1530

Open
benjitobz wants to merge 3 commits into
crocodilestick:mainfrom
benjitobz:pr/calibre-content-server
Open

feature: calibre content server#1530
benjitobz wants to merge 3 commits into
crocodilestick:mainfrom
benjitobz:pr/calibre-content-server

Conversation

@benjitobz

Copy link
Copy Markdown

Description
Runs calibre's own content server alongside the CWA web UI, off by default. When enabled, calibre-server starts as a managed subprocess against the library, giving external tools a real calibre API endpoint (OPDS, cdb/* writes) without a second container.

Admin page gains the toggle, port, listen address, and trusted-IP settings. Access is either basic-auth (a userdb is generated from configured credentials) or an explicit anonymous-writes mode; the password field supports set/clear without ever redisplaying the stored value.

calibredb is routed through the running server. calibre-server holds the library open, and calibredb refuses to open the same library directly while it does — so the metadata embedder, conversion task, cover enforcer, and ingest processor address the library through the server, falling back to the library path when it's disabled. convert-library works on format files on disk and needs the library to itself, so the server is stopped around it and restarted afterwards.

The server reloads when the library database changes externally (ingest, another tool writing metadata.db), so it never serves stale records.

With the setting off (the default), nothing starts and behavior is unchanged.

Database Migration
NO migration file. New settings columns are added automatically by the existing settings-table column migration on startup.

How was this tested?
Docker (linux/amd64) on an Ubuntu server host.

  • Weeks of real use pushing books/metadata/deletes into the running server from an external tool, alongside normal ingest and cover enforcement. No more library lock fights since calibredb goes through the server.
  • Both auth modes work, including setting and clearing the password from the admin page.
  • Changes made to the library from outside show up without restarting CWA.
  • convert-library stops the server and brings it back when done.

benjitobz and others added 3 commits September 8, 2026 20:21
Start calibre-server as a managed subprocess next to the web UI, off by
default. Access is either basic-auth against a generated userdb or an
explicit anonymous-writes mode; the admin page gains the toggle, port,
and credential fields, with set/clear handling for the stored password.
…d through the running server

Expose the listen address and trusted IPs as settings, and point CWA's own
calibredb invocations (ingest, conversion, cover enforcement, embedding) at
the running content server instead of opening the library database directly,
so the two never contend for it.
…ally

Watch the library's metadata.db and restart the content server when another
writer (ingest, an external tool) changes it, so it never serves stale
records.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant