From dfdabd1d02e35ec8bd85f01d4694f83cb3515d29 Mon Sep 17 00:00:00 2001 From: Vuong Hoang Date: Mon, 20 Apr 2026 22:14:38 -0700 Subject: [PATCH] calibre: replace with Calibre-Web-Automated on esh-docker-vm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Retire the linuxserver.io calibre + calibre-web pair. CWA (crocodilestick/calibre-web-automated) is an all-in-one: combined web UI with Calibre backend, auto-ingest via drop folder, scheduled metadata maintenance — single container on :8083. - Reuses the existing library at /mnt/books/calibre/calibre_library (NFS) and the existing calibre-web config at /opt/docker/conf/calibre-web, so user accounts and the book catalogue carry over. - Requires NETWORK_SHARE_MODE=true (library is on NFS; SQLite WAL would corrupt otherwise). - New drop-zone at /mnt/books/calibre/ingest; files placed there are ingested into the library and then removed. - Loses the LSIO desktop Calibre GUI (ports 8082/8181/8281) — run Calibre locally if you need the desktop UI. Old compose dirs (/opt/docker/compose/{calibre,calibre-web}) removed on esh-docker-vm; old images can be pruned at leisure. --- servers/esh-docker-vm/README.md | 3 +- stacks/calibre-web-automated/.env.example | 40 +++++++ stacks/calibre-web-automated/README.md | 121 ++++++++++++++++++++++ stacks/calibre-web-automated/compose.yaml | 45 ++++++++ 4 files changed, 207 insertions(+), 2 deletions(-) create mode 100644 stacks/calibre-web-automated/.env.example create mode 100644 stacks/calibre-web-automated/README.md create mode 100644 stacks/calibre-web-automated/compose.yaml diff --git a/servers/esh-docker-vm/README.md b/servers/esh-docker-vm/README.md index 9ca599e..dd5f67b 100644 --- a/servers/esh-docker-vm/README.md +++ b/servers/esh-docker-vm/README.md @@ -44,8 +44,7 @@ General-purpose Docker host at the **ESH home-lab site** (`esteban.net` / `10.0. | homeassistant | macvlan `10.0.50.46:8123` | Home automation (direct LAN IP via macvlan on `ens18`) | | esphome | host net / 6052 | ESPHome firmware dashboard | | mosquitto | 1883 | MQTT broker | -| calibre | 8082 / 8181 / 8281 | Ebook server | -| calibre-web | 8083 | Ebook web UI | +| calibre-web-automated | 8083 | All-in-one ebook library + web UI; replaced `calibre` + `calibre-web` pair on 2026-04-20 | | paperless-ngx (+ redis broker + volume-backup sidecar) | 8200 | Document archive; Postgres on `10.0.50.60:5432` | | pgadmin (+ volume-backup sidecar) | 5050 | Postgres admin UI | | drawio | 8087 / 8447 | Diagram editor | diff --git a/stacks/calibre-web-automated/.env.example b/stacks/calibre-web-automated/.env.example new file mode 100644 index 0000000..9a07720 --- /dev/null +++ b/stacks/calibre-web-automated/.env.example @@ -0,0 +1,40 @@ +# Calibre-Web-Automated tunables. +# +# Copy to .env on the host. The directory paths MUST exist and be +# writable by PUID:PGID before the first container start. + +# Image pin +CWA_VERSION=latest + +# Port on the host (and inside the container — CWA_PORT_OVERRIDE sets both). +CWA_PORT=8083 + +# UID/GID owning the mounted files. 2000:2000 matches what the old +# calibre + calibre-web stacks used on esh-docker-vm. +PUID=2000 +PGID=2000 + +TZ=America/Los_Angeles + +# NETWORK_SHARE_MODE disables SQLite WAL. REQUIRED when /calibre-library +# or /config is on NFS / SMB. Leave this on unless you move everything +# to local disk. +NETWORK_SHARE_MODE=true + +# Optional: enables the Hardcover metadata provider. Sign up at +# hardcover.app and issue a token. Leave empty if unused. +HARDCOVER_TOKEN= + +# Host directories — use the same library as the old stacks to keep the +# book catalogue. Migrate the old calibre-web config in place. +# +# Example values for esh-docker-vm: +# CWA_CONFIG_DIR=/opt/docker/conf/calibre-web-automated +# CWA_INGEST_DIR=/mnt/books/calibre/ingest +# CWA_LIBRARY_DIR=/mnt/books/calibre/calibre_library +# +# ⚠ The ingest directory is a drop zone — files placed there are DELETED +# after CWA processes them into the library. Pick a dedicated folder. +CWA_CONFIG_DIR= +CWA_INGEST_DIR= +CWA_LIBRARY_DIR= diff --git a/stacks/calibre-web-automated/README.md b/stacks/calibre-web-automated/README.md new file mode 100644 index 0000000..b19c472 --- /dev/null +++ b/stacks/calibre-web-automated/README.md @@ -0,0 +1,121 @@ +# calibre-web-automated + +All-in-one replacement for the old `calibre` (linuxserver desktop GUI) + +`calibre-web` (read-only web UI) pair on esh-docker-vm. + +Upstream: https://github.com/crocodilestick/Calibre-Web-Automated + +## What changes vs. the old pair + +| Concern | Old | CWA | +|---|---|---| +| Web UI | `calibre-web` on :8083 | `calibre-web-automated` on :8083 | +| Library management | `calibre` desktop GUI on :8082 | Built into the CWA web UI | +| Auto-ingest (drop folder) | n/a | `/cwa-book-ingest` drop zone; processed books land in library, source file is **deleted** | +| Metadata editing | desktop GUI only | Web UI + scheduled tasks | +| Host containers | 2 | 1 | + +Losing the separate `calibre` container also loses the full desktop Calibre +experience (content server, news fetching, mobile companion apps bound to +port 8081). If you used those specifically, keep the old calibre container +or run Calibre locally. + +## Volumes + +- **`/config`** (`CWA_CONFIG_DIR`) — holds `app.db` (users/settings), logs. + **Reusable** from the old calibre-web config. Migration path: point this + at `/opt/docker/conf/calibre-web-automated` (new) or just reuse + `/opt/docker/conf/calibre-web` directly if you want zero-touch migration. +- **`/cwa-book-ingest`** (`CWA_INGEST_DIR`) — drop zone. Files dropped here + are auto-ingested into the library and then **removed from the drop + zone**. Pick a dedicated folder; don't point it at something you care + about keeping untouched. +- **`/calibre-library`** (`CWA_LIBRARY_DIR`) — the Calibre library root + (contains `metadata.db` + author/book subdirs). Reuse the existing path + so the catalogue is preserved. + +## NFS caveat (important) + +The library on esh-docker-vm lives on NFS (`/mnt/books/...`). CWA uses +SQLite for its database; by default it writes in WAL mode, which corrupts +over NFS. The env var `NETWORK_SHARE_MODE=true` disables WAL — **keep this +on** as long as `/calibre-library` or `/config` is on a network share. + +## Migration plan + +1. **Back up the current state** while the old containers are still up: + ```bash + ssh esh-docker-vm 'tar -C /opt/docker/conf -czf /tmp/calibre-web-config-backup-$(date +%F).tar.gz calibre-web' + ``` + And confirm the library itself already lives in the NAS backup pipeline. + +2. **Stop and remove the old stacks** (but leave the library + config in + place): + ```bash + ssh -t esh-docker-vm ' + cd /opt/docker/compose/calibre && sudo docker compose down && + cd /opt/docker/compose/calibre-web && sudo docker compose down + ' + ``` + Port 8083 is now free for CWA. + +3. **Create the CWA stack dir + seed .env** (one-time): + ```bash + ssh -t esh-docker-vm 'sudo mkdir -p /opt/docker/compose/calibre-web-automated /mnt/books/calibre/ingest && + sudo chown lkraven:lkraven /opt/docker/compose/calibre-web-automated && + sudo chown 2000:2000 /mnt/books/calibre/ingest' + + ssh -t esh-docker-vm 'sudo tee /opt/docker/compose/calibre-web-automated/.env > /dev/null <