piecemeal

module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: MIT

README

piecemeal

A self-hosted BitTorrent client: one Go binary built on anacrolix/torrent, with a modern web UI, its own REST API, and the qBittorrent WebAPI, so Radarr, Sonarr, Prowlarr and VueTorrent work with it as they do with qBittorrent.

Website and docs · Install · Configuration · API reference

piecemeal's torrent list, with downloads in progress and seeding torrents

Features

  • A drop-in for the *arrs. Add piecemeal as a qBittorrent download client, with a scoped API key. CI runs Radarr, Sonarr and Prowlarr against it, and compares its API with a real qBittorrent 5.3.
  • A web UI for desktop and phone, with live updates, keyboard shortcuts, filters by state, category, tag and tracker, file priorities and renames, and a live piece map.
  • Users and SSO: a local admin, plus users from any OpenID Connect provider with allowed and admin groups, and API keys scoped to full access, the qBittorrent API, or reading.
  • RSS feeds and download rules with qBittorrent's matching, episode filters and the smart episode filter.
  • Queueing, seeding goals, speed limits and a schedule for alternative limits.
  • VPN-friendly: run in a WireGuard container and forward the peer port with NAT-PMP.
  • Safe by default: confined save paths, an SSRF filter on fetched URLs, sign-in limits, CSRF checks and an audit log.
  • Operable: Prometheus metrics, health checks, online backups, and import from Transmission and qBittorrent.

No per-torrent speed limits, search, super seeding, I2P or SSL torrents yet. See how it compares with qBittorrent, Transmission and Deluge.

Quick start

docker run --rm -i ghcr.io/sebdanielsson/piecemeal hash-password   # type a password, copy the hash
docker run -d --name piecemeal \
  -p 8080:8080 -p 6881:6881 -p 6881:6881/udp \
  -v piecemeal-data:/data -v /path/to/downloads:/downloads \
  -e PIECEMEAL_ADMIN_PASSWORD_HASH='$argon2id$...' \
  ghcr.io/sebdanielsson/piecemeal:latest

Open http://localhost:8080 and sign in as admin. Then connect Radarr, Sonarr and Prowlarr, or move your torrents from Transmission or qBittorrent.

Documentation

The docs are in docs/ and on the website:

Contributing

See Development for building, testing and conventions. Report security issues privately through GitHub's vulnerability reporting.

License

MIT

Directories

Path Synopsis
cmd
piecemeal command
Command piecemeal is a BitTorrent client with a native REST API, a qBittorrent-compatible WebAPI and an embedded web UI.
Command piecemeal is a BitTorrent client with a native REST API, a qBittorrent-compatible WebAPI and an embedded web UI.
internal
api
Package api is piecemeal's native REST API under /api/piecemeal/v1, built with Huma.
Package api is piecemeal's native REST API under /api/piecemeal/v1, built with Huma.
auth
Package auth authenticates people and tools: the local admin's password, session cookies for the web UI and for qBittorrent clients (SID), and named API keys sent as Bearer tokens to either API.
Package auth authenticates people and tools: the local admin's password, session cookies for the web UI and for qBittorrent clients (SID), and named API keys sent as Bearer tokens to either API.
auth/authtest
Package authtest has a fake OpenID Connect provider for tests.
Package authtest has a fake OpenID Connect provider for tests.
config
Package config reads piecemeal's startup configuration from environment variables.
Package config reads piecemeal's startup configuration from environment variables.
engine
Package engine owns the anacrolix/torrent client and everything torrent-shaped: adding, removing, starting and stopping torrents, limits, seed goals, categories and tags, and the state the rest of piecemeal reads.
Package engine owns the anacrolix/torrent client and everything torrent-shaped: adding, removing, starting and stopping torrents, limits, seed goals, categories and tags, and the state the rest of piecemeal reads.
engine/enginetest
Package enginetest has helpers for tests that need a BitTorrent swarm: a seeder serving generated content on loopback, and client settings that keep anacrolix off the network.
Package enginetest has helpers for tests that need a BitTorrent swarm: a seeder serving generated content on loopback, and client settings that keep anacrolix off the network.
fetch
Package fetch downloads .torrent files from URLs given to the add endpoints, and RSS feeds.
Package fetch downloads .torrent files from URLs given to the add endpoints, and RSS feeds.
logbuf
Package logbuf keeps the most recent log records in memory, for the log endpoints of both APIs.
Package logbuf keeps the most recent log records in memory, for the log endpoints of both APIs.
metrics
Package metrics exports engine state to Prometheus.
Package metrics exports engine state to Prometheus.
natpmp
Package natpmp keeps a TCP and a UDP port mapping open on a NAT-PMP gateway, such as a VPN provider's, and reports the forwarded port.
Package natpmp keeps a TCP and a UDP port mapping open on a NAT-PMP gateway, such as a VPN provider's, and reports the forwarded port.
proxy
Package proxy connects through a SOCKS5 or HTTP proxy server: TCP connections with SOCKS5 CONNECT (RFC 1928, with RFC 1929 username and password) or HTTP CONNECT, and UDP datagrams through a SOCKS5 proxy's UDP relay (UDP ASSOCIATE).
Package proxy connects through a SOCKS5 or HTTP proxy server: TCP connections with SOCKS5 CONNECT (RFC 1928, with RFC 1929 username and password) or HTTP CONNECT, and UDP datagrams through a SOCKS5 proxy's UDP relay (UDP ASSOCIATE).
proxy/proxytest
Package proxytest runs SOCKS5 and HTTP CONNECT proxies for tests, and records every destination they are asked to reach.
Package proxytest runs SOCKS5 and HTTP CONNECT proxies for tests, and records every destination they are asked to reach.
qbit
Package qbit serves the qBittorrent WebAPI v2 under /api/v2 on top of the engine, so Radarr, Sonarr, Prowlarr and other qBittorrent clients can use piecemeal unchanged.
Package qbit serves the qBittorrent WebAPI v2 under /api/v2 on top of the engine, so Radarr, Sonarr, Prowlarr and other qBittorrent clients can use piecemeal unchanged.
rss
Package rss reads RSS and Atom feeds and downloads matching torrents by rules, like qBittorrent's RSS downloader.
Package rss reads RSS and Atom feeds and downloads matching torrents by rules, like qBittorrent's RSS downloader.
settings
Package settings holds piecemeal's runtime settings: the ones that can be changed through the API while it runs.
Package settings holds piecemeal's runtime settings: the ones that can be changed through the API while it runs.
store
Package store keeps piecemeal's own state in SQLite: settings, users, sessions, API keys, categories, tags and everything about torrents that anacrolix does not persist.
Package store keeps piecemeal's own state in SQLite: settings, users, sessions, API keys, categories, tags and everything about torrents that anacrolix does not persist.
watch
Package watch adds the .torrent and .magnet files dropped into a directory.
Package watch adds the .torrent and .magnet files dropped into a directory.
webui
Package webui serves the web UI that `pnpm -C web build` writes to internal/webui/dist, embedded into the binary.
Package webui serves the web UI that `pnpm -C web build` writes to internal/webui/dist, embedded into the binary.
test
e2e/seeder command
Command seeder seeds generated content for the end-to-end tests.
Command seeder seeds generated content for the end-to-end tests.
load command
Command load measures piecemeal with many torrents: it writes data for n single-file torrents, adds them with the data in place, waits for piecemeal to verify them, and then measures memory, idle CPU and the latency of the list endpoints the web UI and the *arrs poll.
Command load measures piecemeal with many torrents: it writes data for n single-file torrents, adds them with the data in place, waits for piecemeal to verify them, and then measures memory, idle CPU and the latency of the list endpoints the web UI and the *arrs poll.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL