Skip to content

feat(opds): add headless server on the current sharing runtime - #181

Merged
phildenhoff merged 3 commits into
mainfrom
opds-refresh-server
Oct 21, 2026
Merged

phildenhoff merged 3 commits into
mainfrom
opds-refresh-server

Conversation

@phildenhoff

@phildenhoff phildenhoff commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Replaces #151. Retains the original implementation's author credit; the legacy native stack prevents retargeting the original PR.

Serve one Calibre library without launching the desktop app, using the same framework-independent OPDS runtime and current sharing lifecycle.

  • Add citadel-server, TOML configuration, lifecycle logging and signal shutdown.
  • Read multiple headless users from CITADEL_OPDS_USERS, a JSON array of USER:PASSWORD strings. Hold credentials in memory only; never load or save credential files. Missing users prevent startup when authentication is enabled.
  • Default headless state to $XDG_STATE_HOME/citadel or ~/.local/state/citadel on Unix, with an optional absolute stateDirectory override (local app data on Windows). The state directory is currently reserved and empty.
  • Add explicit IPv4/IPv6 listener addresses without interface enumeration. Validate exposure in the shared service: public addresses require sign-in; wildcard, link-local and non-unicast addresses are rejected.
  • Preserve desktop credential persistence, live credential replacement, authentication backoff and local/all-network modes. Headless credential changes take effect after restart.
  • Open the library through feat(libcalibre): support opening libraries without database writes #185's read-only connection, preserving its schema and journal mode.
  • Fix the existing socket-release test to await listener shutdown.

Includes configuration tests and a Unix process test covering 401/authenticated catalog access, GET/HEAD/range acquisition and SIGTERM shutdown. The non-Unix Ctrl-C handler is not covered by that process test.

Stack: #185 → #181 → #182 → #183 → #184. Merge the read-only library prerequisite #185 first.

Validation on the updated stack: 399 workspace tests passed (2 ignored). bun lint, bun format:check, and bun run typecheck passed. The standalone #181 runtime/server suite passed 70 tests.

@github-actions

Copy link
Copy Markdown

libcalibre Test Coverage Report

Overall coverage: 81.12%

📊 Download HTML Report

Coverage breakdown available in the artifacts.

@github-actions

Copy link
Copy Markdown

libcalibre Test Coverage Report

Overall coverage: 81.12%

📊 Download HTML Report

Coverage breakdown available in the artifacts.

@phildenhoff
phildenhoff changed the base branch from main to codex/read-only-library October 21, 2026 05:02
@phildenhoff
phildenhoff force-pushed the opds-refresh-server branch 2 times, most recently from 3c878ea to 5b209f5 Compare October 21, 2026 05:16
Base automatically changed from codex/read-only-library to main October 21, 2026 07:28
@phildenhoff
phildenhoff marked this pull request as ready for review October 21, 2026 07:29
@github-actions

Copy link
Copy Markdown

libcalibre Test Coverage Report

Overall coverage: 81.36%

📊 Download HTML Report

Coverage breakdown available in the artifacts.

@phildenhoff
phildenhoff merged commit a379a4c into main Oct 21, 2026
7 checks passed
@phildenhoff
phildenhoff deleted the opds-refresh-server branch October 21, 2026 07:38
@linear-code

linear-code Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

CDL-31

CDL-32

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