About this project

OpenPT is a lightweight, configuration-driven BitTorrent tracker announce tool aimed at private tracker (PT) seeding scenarios. It works from .torrent files alone: no real content download is required, and the program simulates a client periodically reporting seeding status, uploaded amount, port and client identity to the tracker. Because it reports numbers rather than transferring data, it is a seeding-simulation utility rather than a BitTorrent client; tracker rules and acceptable-use policies remain the operator's responsibility. Documented capabilities include automatic scanning of the torrents directory and loading of .torrent files; a configurable limit on simultaneous seeds (0 means unlimited); client spoofing files for qBittorrent, Transmission, Deluge and uTorrent; three upload strategies (none, conservative_rate, configured_rate) with jitter and refresh intervals; upload speed allocated dynamically from the peers returned by the tracker; a target share ratio that stops a torrent once reached; exponential backoff retry after announce failures; HTTP, HTTPS and UDP tracker support; BitTorrent v1, hybrid and v2-only info hashes; automatic archiving of corrupted or unparsable torrent files; persisted upload totals and completion state so it can resume after restart; a stopped announce when a torrent file is deleted; and Prometheus-format metrics plus a health check endpoint. Deployment paths are a locally built binary started as openpt --config config.toml, or the published Docker image chenbin3625/openpt run through Docker Compose with PUID/PGID mapping and a ./data volume containing the torrents directory. Configuration is TOML, copied from examples/config.example.toml, and covers simultaneous_seed, client, torrents_dir, clients_dir, archive_dir, state_file, scan interval, shutdown stop timeout, upload strategy and rate bounds, ratio_target, announce port/IP/IPv6, tracker timeout, proxy (HTTP or SOCKS5, used only for HTTP/HTTPS trackers, with UDP trackers returning a clear error), backoff limits, metrics listen address and path, and logging output. The built-in Web UI is written with Vite, React and antd and embedded into the binary through go:embed; the built frontend output is committed, so a fresh clone can be built or tested directly with the Go toolchain. The UI shows active and abnormal torrent counts, current upload speed, total uploaded, next announce time, per-torrent size, uploaded, speed, peers and share ratio, last/next announce time and interval, tracker host and switch index, plus status and error details, with column sorting, status filtering and search by name or tracker. The metrics listener also serves /metrics and /healthz; /healthz remains available even when metrics.enabled is false. Sending SIGHUP hot-reloads a subset of settings (simultaneous seeds, upload strategy and rates, ratio target, shutdown stop timeout, announce port/IP/IPv6, tracker timeout, proxy and backoff), while client spoofing files, directories, state file, scan interval, log file and metrics/Web UI options require a restart. By default announce.port = 0 generates a random dynamic port in the 49152-65535 range at each startup rather than reusing common defaults such as 6881. The project is released under the MIT License.