- Notifications
You must be signed in to change notification settings - Fork 0
Home
虚拟世界的懒猫 edited this page Feb 26, 2026 · 7 revisions
A high-performance, multi-path file search HTTP server built with Rust.
FileHunter is a lightweight HTTP server that routes incoming requests by URL prefix to configurable groups of search directories, serves the first matching file via chunked streaming, and returns 404 if nothing is found. It is designed for scenarios where files are distributed across multiple storage paths and need to be served efficiently through a single HTTP endpoint.
- Multi-prefix URL routing — longest-prefix-match dispatches requests to different directory groups
- Per-path extension filtering — restrict each search path to specific file types (e.g.,
jpg,png) - Three search modes —
sequential,concurrent, andlatest_modifiedto fit different access patterns - Async streaming — built on tokio + hyper 1.x with
ReaderStreamchunked transfer - HTTP/1.1 & HTTP/2 auto negotiation — seamless protocol support via hyper-util
- Security hardened — path traversal protection, dotfile blocking, null byte rejection, symlink escape prevention
- CORS support — configurable cross-origin resource sharing with fine-grained origin, method, and header control
- Per-IP rate limiting — GCRA-based rate limiter with configurable burst size and automatic cleanup
- Basic Authentication — optional global HTTP Basic Auth with constant-time password comparison; health endpoints exempt
- Response compression — optional gzip, deflate, Brotli, and zstd compression with configurable algorithms and minimum size threshold
- Human-friendly TOML config — sizes like
"10MB", intuitive[[locations]]array syntax - Tiny binary — ~3 MB with LTO + strip enabled
cargo build --release ./target/release/filehunter --config config.tomldocker compose up -d[server] bind = "0.0.0.0:8080" [[locations]] prefix = "/" [[locations.paths]] root = "/data/files"| Page | Description |
|---|---|
| Architecture | Layered architecture diagram and design decisions |
| Configuration Reference | Complete field reference with types and defaults |
| Configuration Examples | 11 real-world TOML configuration scenarios |
| Search Modes | Deep dive into sequential, concurrent, latest_modified |
| Routing | URL prefix matching, path stripping, segment boundaries |
| Deployment | Docker, Docker Compose, Nginx, systemd |
| Security | Path traversal protection, dotfile blocking, size limits |
| Testing | Test suite overview: 73 unit + 33 integration tests |
MIT License · GitHub · Built with Rust 🦀
FileHunter Wiki
🇬🇧 English
- Home
- Architecture
- Configuration Reference
- Configuration Examples
- Search Modes
- Routing
- Deployment
- Security
- Testing
🇨🇳 中文