From 73d7d674fc174117427488f1eb13ab3f6ed898b6 Mon Sep 17 00:00:00 2001 From: "ginnoir (outpost agent)" Date: Thu, 3 Dec 2026 03:58:09 -0600 Subject: [PATCH] fix(media): load chaptarr scripts from /config, not a ./ mount A relative bind resolves to Portainer's internal /data/compose// path and would bind an empty dir, so chaptarr couldn't find start.sh. Load the scripts from /config/chaptarr/scripts (already mounted at /config) instead. Co-Authored-By: Claude Opus 5.5 --- stacks/media/BOOKS.md | 4 ++-- stacks/media/docker-compose.yml | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/stacks/media/BOOKS.md b/stacks/media/BOOKS.md index 167ee2c..23c28d3 100644 --- a/stacks/media/BOOKS.md +++ b/stacks/media/BOOKS.md @@ -64,9 +64,9 @@ sudo chown -R 1000:1000 /config/chaptarr /config/calibre-web-automated /config/a ## Hardlinks + chaptarr's ebook copy (2026-12-03) -- Chaptarr mounts `/storage1` **once**. `chaptarr/start.sh` (the entrypoint wrapper) symlinks `/downloads`, `/audiobooks` and `/ebooks` into it. With separate bind mounts, `link()` fails with EXDEV and chaptarr silently copied every import instead, so seeding audiobooks existed twice. The container paths didn't change, so chaptarr's DB needed no migration. +- Chaptarr mounts `/storage1` **once**. `/config/scripts/start.sh` (the entrypoint wrapper; host `/config/chaptarr/scripts/`, canonical copy `stacks/media/chaptarr/`, scp it on change) symlinks `/downloads`, `/audiobooks` and `/ebooks` into it. With separate bind mounts, `link()` fails with EXDEV and chaptarr silently copied every import instead, so seeding audiobooks existed twice. The container paths didn't change, so chaptarr's DB needed no migration. - `/ebooks` → `/storage1/Media/Ebooks` is chaptarr's own ebook folder (it used to be the CWA ingest folder, which CWA empties, so chaptarr thought every ebook was missing). -- Connect → Custom Script **"CWA ingest"** (`/scripts/cwa-ingest.sh`, On Import + On Upgrade) hardlinks each newly imported ebook into `/storage1/complete/books-ingest//`. CWA deletes its link after ingest, and chaptarr's file remains. +- Connect → Custom Script **"CWA ingest"** (`/config/scripts/cwa-ingest.sh`, On Import + On Upgrade) hardlinks each newly imported ebook into `/storage1/complete/books-ingest//`. CWA deletes its link after ingest, and chaptarr's file remains. - Existing Calibre books were backfilled by hardlinking them from `/storage1/Media/Books` into `/storage1/Media/Ebooks//` and rescanning. - Hardlinks share content, so never edit files in `/storage1/Media/Ebooks` in place (e.g. chaptarr metadata writing). That would also change Calibre's copy of a backfilled book. diff --git a/stacks/media/docker-compose.yml b/stacks/media/docker-compose.yml index 6d4b6c6..ec45e97 100644 --- a/stacks/media/docker-compose.yml +++ b/stacks/media/docker-compose.yml @@ -252,10 +252,10 @@ services: # ============================================================ BOOKS # Prowlarr -> chaptarr -> qbittorrent/nzbget (/storage1/complete). Chaptarr # keeps its own ebook copy in /storage1/Media/Ebooks (so it knows what it has) - # and its Custom Script hook (chaptarr/cwa-ingest.sh) hardlinks each new ebook + # and its Custom Script hook (/config/scripts/cwa-ingest.sh) hardlinks each new ebook # into the CWA ingest folder (CWA owns the Calibre library and deletes ingested # files). Audiobooks go straight into the ABS library. - # /storage1 is mounted once and chaptarr/start.sh symlinks /downloads, + # /storage1 is mounted once and /config/scripts/start.sh symlinks /downloads, # /audiobooks, /ebooks into it — separate bind mounts break hardlinks (EXDEV). # Storyteller reads both libraries read-only and writes aligned EPUBs to its # own /data. Readarr is retired upstream — do not add it. @@ -270,12 +270,14 @@ services: nofile: { soft: 65536, hard: 65536 } environment: - UMASK=002 - entrypoint: ["/bin/sh", "/scripts/start.sh"] + # Scripts live in /config/chaptarr/scripts on the host (canonical copy: + # stacks/media/chaptarr/; scp on change). Not a ./ mount: that resolves to the + # Portainer-internal /data/compose//... path and binds an EMPTY dir. + entrypoint: ["/bin/sh", "/config/scripts/start.sh"] command: ["dotnet", "/app/Chaptarr.dll", "-nobrowser", "-data=/config"] volumes: - /config/chaptarr:/config - /storage1:/storage1 - - ./chaptarr:/scripts:ro ports: - "8789:8789"