Initial commit: StashHandler

Bridge between qBittorrent and Stash that polls for completed torrents,
deduplicates via SHA256 hashing and SQLite, and imports new media files.
Supports daemon mode (continuous polling) and scan mode (bulk operations).
Configuration via environment variables for Docker Swarm compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-16 11:25:05 -05:00
commit f09d94e34b
10 changed files with 617 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
services:
stash-handler:
build: .
container_name: stash-handler
restart: unless-stopped
environment:
QBIT_URL: "http://qbittorrent:8080"
QBIT_USERNAME: "admin"
QBIT_PASSWORD: "adminadmin"
STAGING_DIR: "/staging"
IMPORT_DIR: "/import"
DB_PATH: "/data/seen.db"
POLL_INTERVAL: "300"
MEDIA_EXTENSIONS: ".mp4,.mkv,.avi,.wmv,.mov,.webm,.flv,.m4v"
HASH_ALGORITHM: "sha256"
MOVE_MODE: "move"
LOG_LEVEL: "INFO"
volumes:
- /data/staging:/staging:ro
- /data/stash-import:/import
- /data/stash-handler:/data
depends_on:
- qbittorrent
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
environment:
- PUID=1000
- PGID=1000
volumes:
- /data/staging:/downloads
- /data/qbittorrent/config:/config
ports:
- "8080:8080"
restart: unless-stopped
stash:
image: stashapp/stash:latest
container_name: stash
volumes:
- /data/stash-import:/data/import
- /data/stash/config:/root/.stash
- /data/stash/library:/data/library
ports:
- "9999:9999"
restart: unless-stopped