Skip to content
ArchiveLabsPublic

About

The open source Library-in-a-Box to preserve and lend digital books.

Topics

Resources

Stars

25 stars

Watchers

4 watching

Forks

Repository files navigation

Lenny logo

Lenny

A self-hosted, open source digital library for ebook lending. Lenny lets a library keep its EPUB collection on its own server, lend each copy to one patron at a time (controlled digital lending), and publish the catalog as an OPDS feed. Patrons read in the browser through Readium and Thorium Web.

CI License: AGPL-3.0

Website · Install · Admin guide · Configuration · API · Issues

Why

Most libraries lend ebooks through a vendor's platform, on the vendor's terms. Lenny is the other option: the library runs the server, keeps the files and sets the loan rules. Lenny is made by Archive Labs and is free software under the AGPL.

What it does

  • Lending. Each copy goes to one patron at a time. Loans return themselves after a set number of days. You set the per-patron loan limit and loan length in the admin UI.
  • Reading in the browser. Patrons read in Thorium Web, served by your own node. Lenny never offers a download link.
  • Three access modes. A book is open to anyone, borrowable with a loan, or members-only for the paying members of a Ghost site, who read straight from a post or newsletter without a Lenny account. See Members-only books with Ghost.
  • OPDS 2.0 catalog at /v1/api/opds, with search and incremental harvesting, for reading apps and aggregators such as Open Library.
  • A catalog site at / where patrons browse, sign in and borrow.
  • Admin UI at /admin: a dashboard, books, bulk import, loans, Ghost members and reading stats, staff accounts, lending and sign-in settings.
  • Patron sign-in through Open Library one-time passwords, your own OIDC provider (Keycloak, Auth0, Okta and others), or Internet Archive keys.
  • OAuth 2.0 server, so other apps (Open Library, reader.archive.org) can borrow on a patron's behalf.
  • Metadata from Open Library. Every book is keyed to an Open Library edition.
  • One-command updates with prebaked images for amd64 and arm64, and a database backup before each update.

Quick start

You need Linux or macOS, Docker with Compose v2, git, make and bc. See Install for details.

git clone https://github.com/ArchiveLabs/lenny.git
cd lenny
make start

make start writes the config files with fresh secrets, pulls the images and starts the stack. Then:

Open For
http://localhost:8080/ the catalog patrons use
http://localhost:8080/admin the admin UI. Sign in as admin with ADMIN_PASSWORD from auth.env
http://localhost:8080/v1/api/opds the OPDS feed
http://localhost:8080/v1/api/docs the API reference

Add some public domain books from Standard Ebooks to try it out:

make preload items=10

Add your own EPUB, keyed to its Open Library edition:

make addbook olid=OL60638966M filepath=~/books/mybook.epub encrypted=true

To put the node on the internet, see Public access and HTTPS. To turn on lending, see Lending modes.

Update later with:

make update

Documentation

Guide Covers
Install and operate requirements, install, updates, backups, ARM, tunnels and HTTPS
Configuration every config file, environment variable and make target
Admin guide staff accounts, adding books, access and lending modes, patron sign-in, the reader
Members-only books with Ghost selling reading access through a Ghost membership: setup, webhooks, stats, troubleshooting
API REST and OPDS endpoints, harvesting, health check
Development local builds, tests, migrations, the admin app, contributing
Troubleshooting common failures and how to recover
OAuth 2.0 app access letting other apps sign patrons in and borrow
External OIDC sign-in using your own identity provider for patrons
Database migrations Alembic workflow

Getting help

Contributing

Issues and pull requests are welcome. Start with Development. It covers the local setup, tests, and the VERSION bump CI asks for when a change ships to servers.

Security

Please report vulnerabilities privately through GitHub's vulnerability reporting, not in a public issue.

Credits

Lenny is built on:

License

GNU Affero General Public License v3.0. If you run a modified Lenny for others, the AGPL requires you to offer them your source.

About

The open source Library-in-a-Box to preserve and lend digital books.

Topics

Resources

Stars

25 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages