Update compose and documentation (#413)

This commit is contained in:
Alex
2026-01-08 20:46:24 +00:00
committed by GitHub
parent b97e48235b
commit 29a8d856a6
12 changed files with 97 additions and 220 deletions

View File

@@ -1,7 +1,7 @@
# Uses external Cloudflare bypasser (FlareSolverr/ByParr) instead of built-in Selenium
services:
calibre-web-automated-book-downloader-extbp:
image: ghcr.io/calibrain/calibre-web-automated-book-downloader-extbp:latest
image: ghcr.io/calibrain/calibre-web-automated-book-downloader-extbp:dev
environment:
# TZ: America/New_York
EXT_BYPASSER_URL: http://flaresolverr:8191

View File

@@ -1,7 +1,7 @@
# Routes all traffic through Tor - requires NET_ADMIN capability
services:
calibre-web-automated-book-downloader-tor:
image: ghcr.io/calibrain/calibre-web-automated-book-downloader-tor:latest
image: ghcr.io/calibrain/calibre-web-automated-book-downloader-tor:dev
environment:
FLASK_PORT: 8084
# TZ: America/New_York

View File

@@ -1,6 +1,6 @@
services:
calibre-web-automated-book-downloader:
image: ghcr.io/calibrain/calibre-web-automated-book-downloader:latest
image: ghcr.io/calibrain/calibre-web-automated-book-downloader:dev
container_name: calibre-web-automated-book-downloader
environment:
# TZ: America/New_York

View File

@@ -0,0 +1,20 @@
# Uses external Cloudflare bypasser (FlareSolverr/ByParr) instead of built-in Selenium
services:
calibre-web-automated-book-downloader-extbp:
image: ghcr.io/calibrain/calibre-web-automated-book-downloader-extbp:latest
environment:
TZ: America/New_York
EXT_BYPASSER_URL: http://flaresolverr:8191
# UID: 1000
# GID: 100
# CWA_DB_PATH: /auth/app.db
ports:
- 8084:8084
restart: unless-stopped
volumes:
- /tmp/data/calibre-web/ingest:/cwa-book-ingest
- /path/to/config:/config
# - /cwa/config/path/app.db:/auth/app.db:ro
flaresolverr:
image: ghcr.io/flaresolverr/flaresolverr:latest

View File

@@ -0,0 +1,19 @@
# Routes all traffic through Tor - requires NET_ADMIN capability
services:
calibre-web-automated-book-downloader-tor:
image: ghcr.io/calibrain/calibre-web-automated-book-downloader-tor:latest
environment:
FLASK_PORT: 8084
TZ: America/New_York
USING_TOR: true
# CWA_DB_PATH: /auth/app.db
cap_add:
- NET_ADMIN
- NET_RAW
ports:
- 8084:8084
restart: unless-stopped
volumes:
- /tmp/data/calibre-web/ingest:/cwa-book-ingest
- /path/to/config:/config
# - /cwa/config/path/app.db:/auth/app.db:ro

View File

@@ -0,0 +1,15 @@
services:
calibre-web-automated-book-downloader:
image: ghcr.io/calibrain/calibre-web-automated-book-downloader:latest
container_name: calibre-web-automated-book-downloader
environment:
TZ: America/New_York
# UID: 1000
# GID: 100
# CWA_DB_PATH: /auth/app.db
ports:
- 8084:8084
restart: unless-stopped
volumes:
- /tmp/data/calibre-web/ingest:/cwa-book-ingest # This is where the books will be downloaded and ingested by your book management application
- /path/to/config:/config # Configuration files and database

View File

@@ -2,7 +2,7 @@
services:
calibre-web-automated-book-downloader-extbp-dev:
extends:
file: ./docker-compose.extbp.yml
file: ./compose/edge/docker-compose.extbp.yml
service: calibre-web-automated-book-downloader-extbp
build:
context: .

View File

@@ -2,7 +2,7 @@
services:
calibre-web-automated-book-downloader-tor-dev:
extends:
file: ./docker-compose.tor.yml
file: ./compose/edge/docker-compose.tor.yml
service: calibre-web-automated-book-downloader-tor
build:
context: .

View File

@@ -2,7 +2,7 @@
services:
calibre-web-automated-book-downloader-dev:
extends:
file: ./docker-compose.yml
file: ./compose/edge/docker-compose.yml
service: calibre-web-automated-book-downloader
build:
context: .

View File

@@ -1,211 +0,0 @@
# Test stack for download client development
# Includes cwabd + all download clients on same network with shared volumes
#
# Usage:
# docker compose -f docker-compose.test-clients.yml up -d
# # Access cwabd at http://localhost:8084
# # Configure clients in Settings > Prowlarr > Download Clients
#
# Web UIs:
# - cwabd: http://localhost:8084
# - Prowlarr: http://localhost:9696 (no auth by default)
# - qBittorrent: http://localhost:8080 (admin / adminadmin - check logs for temp password)
# - Transmission: http://localhost:9091 (admin / admin)
# - Deluge: http://localhost:8112 (password: deluge)
# - NZBGet: http://localhost:6789 (nzbget / tegbzn6789)
# - SABnzbd: http://localhost:8085 (complete setup wizard for API key)
# - aMule: http://localhost:4711 (password: amule)
# - Amarr: http://localhost:8086 (torznab indexer + qBittorrent emulation for amule)
#
# Hot-reload: Python code changes are picked up automatically (source mounted)
# Rebuild needed only for: requirements changes, frontend changes, Dockerfile changes
services:
# ============ MAIN APPLICATION ============
cwabd:
build:
context: .
dockerfile: Dockerfile
target: cwa-bd
container_name: test-cwabd
environment:
TZ: UTC
DEBUG: "true"
# All client configuration is done via Settings UI
# Use Docker service names for URLs:
# - Transmission: http://transmission:9091
# - Deluge host: deluge (port 58846)
# - SABnzbd: http://sabnzbd:8080
ports:
- "8084:8084"
volumes:
# Config and state
- ./.local/test-clients/cwabd/config:/config
- ./.local/test-clients/cwabd/log:/var/log/cwa-book-downloader
# Book destination directory (where completed books go)
- ./.local/test-clients/books:/books
# Staging directory
- ./.local/test-clients/tmp:/tmp/cwa-book-downloader
# CRITICAL: Mount client download directories so cwabd can access completed files
- ./.local/test-clients/downloads:/downloads
# Mount source code for hot-reload (no rebuild needed for Python changes)
- ./cwa_book_downloader:/app/cwa_book_downloader:ro
# Mount tests for running pytest in container
- ./tests:/app/tests:ro
- ./pyproject.toml:/app/pyproject.toml:ro
# Mount client configs for integration tests to read credentials
- ./.local/test-clients/qbittorrent/config:/qbittorrent-config:ro
- ./.local/test-clients/sabnzbd/config:/sabnzbd-config:ro
depends_on:
- nzbget
- sabnzbd
- qbittorrent
- transmission
- deluge
restart: unless-stopped
# ============ PROWLARR (INDEXER MANAGER) ============
prowlarr:
image: lscr.io/linuxserver/prowlarr:latest
container_name: test-prowlarr
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
volumes:
- ./.local/test-clients/prowlarr/config:/config
ports:
- "9696:9696"
restart: unless-stopped
# ============ USENET CLIENTS ============
nzbget:
image: lscr.io/linuxserver/nzbget:latest
container_name: test-nzbget
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
volumes:
- ./.local/test-clients/nzbget/config:/config
- ./.local/test-clients/downloads:/downloads
- ./.local/test-clients/nzbget/custom-cont-init.d:/custom-cont-init.d:ro
ports:
- "6789:6789" # Web UI / JSON-RPC
restart: unless-stopped
sabnzbd:
image: lscr.io/linuxserver/sabnzbd:latest
container_name: test-sabnzbd
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
volumes:
- ./.local/test-clients/sabnzbd/config:/config
- ./.local/test-clients/downloads:/downloads
ports:
- "8085:8080" # Web UI (external:internal)
restart: unless-stopped
# ============ TORRENT CLIENTS ============
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: test-qbittorrent
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
- WEBUI_PORT=8080
volumes:
- ./.local/test-clients/qbittorrent/config:/config
- ./.local/test-clients/downloads:/downloads
- ./.local/test-clients/qbittorrent/custom-cont-init.d:/custom-cont-init.d:ro
ports:
- "8080:8080" # Web UI / API
- "6882:6881"
- "6882:6881/udp"
restart: unless-stopped
transmission:
image: lscr.io/linuxserver/transmission:latest
container_name: test-transmission
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
- USER=admin
- PASS=admin
volumes:
- ./.local/test-clients/transmission/config:/config
- ./.local/test-clients/downloads:/downloads
ports:
- "9091:9091" # Web UI / RPC
- "51413:51413"
- "51413:51413/udp"
restart: unless-stopped
deluge:
image: lscr.io/linuxserver/deluge:latest
container_name: test-deluge
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
- DELUGE_LOGLEVEL=error
volumes:
- ./.local/test-clients/deluge/config:/config
- ./.local/test-clients/downloads:/downloads
ports:
- "8112:8112" # Web UI
- "58846:58846" # Daemon RPC
- "6881:6881"
- "6881:6881/udp"
restart: unless-stopped
# ============ AMULE + AMARR BRIDGE ============
amule:
image: ngosang/amule:latest
container_name: test-amule
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
- GUI_PWD=amule
- WEBUI_PWD=amule
volumes:
- ./.local/test-clients/amule/config:/home/amule/.aMule
- ./.local/test-clients/downloads:/incoming
- ./.local/test-clients/amule/temp:/temp
ports:
- "4711:4711" # Web UI
- "4712:4712" # EC (External Connections) for Amarr
- "4662:4662" # ED2K TCP
- "4665:4665/udp" # ED2K global search
- "4672:4672/udp" # ED2K UDP
restart: unless-stopped
amarr:
image: vexdev/amarr:latest
container_name: test-amarr
environment:
- AMULE_HOST=amule
- AMULE_PORT=4712
- AMULE_PASSWORD=amule
- AMULE_FINISHED_PATH=/downloads
- AMARR_LOG_LEVEL=DEBUG
volumes:
- ./.local/test-clients/amarr/config:/config
- ./.local/test-clients/downloads:/downloads
ports:
- "8086:8080" # Amarr web/API (torznab indexer + qBittorrent emulation)
depends_on:
- amule
restart: unless-stopped
# All services automatically on same network (test-clients_default)

View File

@@ -129,6 +129,38 @@ change_ownership /tmp/cwa-book-downloader
make_writable ${CONFIG_DIR:-/config}
make_writable ${INGEST_DIR:-/books}
# Fallback to root if config dir is still not writable (common on NAS/Unraid after upgrade from v0.4.0)
CONFIG_PATH=${CONFIG_DIR:-/config}
set +e
test_write "$CONFIG_PATH" >/dev/null 2>&1
config_ok=$?
set -e
if [ $config_ok -ne 0 ] && [ "$RUN_UID" != "0" ]; then
config_owner=$(stat -c '%u' "$CONFIG_PATH" 2>/dev/null || echo "unknown")
if [ "$config_owner" = "0" ]; then
echo ""
echo "========================================================"
echo "WARNING: Permission issue detected!"
echo ""
echo "Config directory is owned by root but PUID=$RUN_UID."
echo "This typically happens after upgrading from v0.4.0 where"
echo "PUID/PGID settings were not respected."
echo ""
echo "Falling back to running as root to prevent data loss."
echo ""
echo "To fix this permanently, run on your HOST machine:"
echo " chown -R $RUN_UID:$RUN_GID /path/to/config"
echo ""
echo "Then restart the container."
echo "========================================================"
echo ""
RUN_UID=0
RUN_GID=0
USERNAME=root
fi
fi
# Always run Gunicorn (even when DEBUG=true) to ensure Socket.IO WebSocket
# upgrades work reliably on customer machines.
# Map app LOG_LEVEL (often DEBUG/INFO/...) to gunicorn's --log-level (lowercase).

View File

@@ -43,7 +43,7 @@ A unified web interface for searching and downloading books from multiple source
1. Download the docker-compose file:
```bash
curl -O https://raw.githubusercontent.com/calibrain/calibre-web-automated-book-downloader/main/docker-compose.yml
curl -O https://raw.githubusercontent.com/calibrain/calibre-web-automated-book-downloader/main/compose/stable/docker-compose.yml
```
2. Start the service:
@@ -51,6 +51,8 @@ A unified web interface for searching and downloading books from multiple source
docker compose up -d
```
> **Edge users**: If you're tracking the main branch (`:dev` tag), use compose files from `compose/edge/` instead.
3. Open `http://localhost:8084`
That's it! Configure settings through the web interface as needed.
@@ -114,7 +116,7 @@ docker compose up -d
### Tor Variant
Routes all traffic through Tor for enhanced privacy:
```bash
curl -O https://raw.githubusercontent.com/calibrain/calibre-web-automated-book-downloader/main/docker-compose.tor.yml
curl -O https://raw.githubusercontent.com/calibrain/calibre-web-automated-book-downloader/main/compose/stable/docker-compose.tor.yml
docker compose -f docker-compose.tor.yml up -d
```
@@ -126,7 +128,7 @@ docker compose -f docker-compose.tor.yml up -d
### External Cloudflare Resolver
Use FlareSolverr or ByParr instead of the built-in bypasser:
```bash
curl -O https://raw.githubusercontent.com/calibrain/calibre-web-automated-book-downloader/main/docker-compose.extbp.yml
curl -O https://raw.githubusercontent.com/calibrain/calibre-web-automated-book-downloader/main/compose/stable/docker-compose.extbp.yml
docker compose -f docker-compose.extbp.yml up -d
```