$ show 9001/copyparty
copyparty is a portable, multi-protocol file server written in Python. It serves files over HTTP/WebDAV, FTP, SFTP, TFTP, and SMB/CIFS, with a rich web UI for browsing, uploading (resumable, chunked, deduplicated), searching, and media playback. The server supports user authentication, per-volume permissions, event hooks, metadata extraction, thumbnail generation, and audio transcoding. It can run on minimal dependencies (Python 3.3+), and is packaged as a self-extracting script, Docker image, or native installer. The architecture is modular: a central service hub (SvcHub) orchestrates protocol servers, a virtual filesystem (VFS) enforces permissions, and a broker pattern handles parallel tasks. The codebase includes a large set of example hooks, handlers, and plugins for customization. While the project is actively maintained and well-documented, it carries some technical debt from supporting very old Python versions and vendored libraries.
The LLM identified 3 files worth highlighting for reuse:
Provides a clean abstraction layer over filesystem operations (chmod, makedirs, utime, etc.) that isolates platform-specific behavior. This module is self-contained, has no internal imports beyond standard library, and can be extracted and reused in any Python project that needs a portable filesystem interface.
Implements a secure XML parser that disables DTD entity expansion and external entity resolution, preventing XML bombs and SSRF attacks. It wraps Python's xml.etree.ElementTree with safe defaults and provides a simple API. This is a self-contained, reusable component for any Python application that needs to parse untrusted XML.
Implements a multiprocessing broker pattern for parallel task execution. It manages a pool of worker processes, a job queue, and result collection with error handling. The design is clean, with clear separation of concerns, and can be extracted for use in other Python applications needing distributed task processing.