cvmfs-rust
A pure Rust implementation of the CernVM-FS client. Mount remote CVMFS repositories as local filesystems via FUSE, with full content verification and transparent decompression.
Why Rust?
The original CernVM-FS client is written in C++. This project rewrites the client in Rust to get:
- Memory safety without garbage collection
- Fearless concurrency for multi-threaded FUSE operations
- Modern tooling: cargo, clippy, built-in testing, dependency management
- Smaller binary: single static binary, no shared library dependencies beyond FUSE
Features
- FUSE filesystem mounting via
fuse_mt(multi-threaded) - Transparent zlib decompression of content-addressed objects
- RSA-PKCS1v15 signature verification of repository manifests
- SQLite catalog traversal with nested catalog support
- Chunked file reassembly for large files
- Local object caching with content-addressed storage
- HTTP/HTTPS retrieval from Stratum-1 replica servers
Quick Start
Prerequisites
- Rust (stable)
- FUSE 3 libraries:
- macOS: macFUSE (
brew install --cask macfuse) - Linux:
sudo apt install libfuse3-dev(Debian/Ubuntu) orsudo dnf install fuse3-devel(Fedora)
- macOS: macFUSE (
Build
Mount a Repository
Then browse /tmp/cvmfs_mount like any local directory. Unmount with:
# macOS
# Linux
CLI Reference
cvmfs-cli <repository_url> <mount_point> [cache_directory]
| Argument | Required | Default | Description |
|---|---|---|---|
repository_url |
Yes | URL of the CernVM-FS repository | |
mount_point |
Yes | Local directory to mount | |
cache_directory |
No | /tmp/cvmfs |
Directory for cached objects |
Logging
RUST_LOG=info
Library Usage
cvmfs-rust exposes a library crate for programmatic access:
use ;
let fetcher = new?;
let mut repo = new?;
// List root directory
for entry in repo.list_directory?
// Read a file
let mut file = repo.get_file?;
let mut contents = Stringnew;
file.read_to_string?;
Development
License
BSD 3-Clause. See LICENSE.