fileloft
fileloft is a Rust implementation of the tus resumable upload protocol. It ships as a small set of composable crates you can embed in an existing HTTP server, or run as a standalone tus endpoint via the published container image.
- Framework agnostic — protocol core with no transport assumptions, plus adapters for Axum, Actix Web, and Rocket.
- Pluggable storage — a
DataStoretrait with in-memory and filesystem backends; bring your own for object storage or other backends. - Standalone or embedded — use it as a library or run the prebuilt image when you only need a tus endpoint.
- Safe by default —
#![forbid(unsafe_code)]across the workspace, with conservative defaults for limits, locking, and checksums.
Crates: fileloft-core, fileloft-store-memory, fileloft-store-fs, fileloft-axum, fileloft-actix, fileloft-rocket.
Getting started
Use as a library (Axum)
Add dependencies (versions should match what you use elsewhere; see crates.io):
[]
= "0.1"
= "0.1"
= "0.1" # or fileloft-actix / fileloft-rocket
= { = "1", = ["full"] }
Mount a tus router (other adapters follow the same pattern: build a TusHandler, then use the framework-specific router):
use Arc;
use tus_router;
use ;
use ;
async
Full tus 1.0.0 core plus optional extensions (creation, expiration, checksum, termination, concatenation) are configured via Config. API details: docs.rs/fileloft-core.
Run the container
The server listens on :8080 and stores data under /var/lib/fileloft. Common environment overrides:
| Variable | Default | Description |
|---|---|---|
FILELOFT_BIND |
0.0.0.0:8080 |
Address the HTTP server binds to. |
FILELOFT_DATA_DIR |
/var/lib/fileloft |
Directory used by the filesystem store. |
FILELOFT_MAX_SIZE |
unset | Maximum allowed upload size, in bytes. |
FILELOFT_BASE_PATH |
/files |
Path the tus endpoints are mounted under. |
More detail lives in the Hugo site under docs-site.
Quick health check with any tus 1.0.0 client:
A 201 Created response with a Location header indicates the endpoint is ready.
Build and test from this repository
The Hugo documentation site lives under docs-site; build it with:
&&
Contributing
- Issues and PRs — open an issue to discuss larger changes; pull requests are welcome for fixes and improvements that match the project’s scope (tus protocol implementation, adapters, and stores).
- Checks — before submitting, run
cargo fmt --all,cargo clippy --workspace --all-targets, andcargo test --workspaceso CI stays green. This repo pins a Rust toolchain withrustfmtandclippyinrust-toolchain.toml. - Style — follow existing patterns in the crate you touch; the workspace forbids
unsafe_code. Prefer explicit error handling over panicking in library and application code. - Documentation — user-facing behavior worth explaining should be reflected in crate docs or the
docs-sitecontent when it affects how people integrate or operate fileloft.
Licensed under the MIT license (see crate metadata).