A simple, self-contained file sharing server written in Rust using the Actix-web framework. Easily upload and download files from any device on your local network via a modern web interface.
- Upload & Download Files: Share files between devices using a clean, responsive web UI.
- Easy Access: Displays your local IP and a QR code for quick access from mobile devices.
- Preload Files: Optionally preload files to share at startup.
- Nuke Option: Easily delete all temporary shared files with a command-line flag.
- Authentication (Optional): Protect your server with a password, requiring users to log in before accessing file sharing features.
- Modern Rust Stack: Built with Actix-web, Askama, and more.
- Nix Support: Run instantly with Nix, or build manually with Cargo.
You can install crane-rs using the provided installation script. This will automatically install Rust (if needed), clone the repository, build the project, and install the binary to /usr/local/bin.
curl -fsSL https://raw.githubusercontent.com/santoshxshrestha/crane-rs/main/scripts/install.sh | bashOptions:
--dry-runShow what would be done without making changes--repo=URLUse a custom repository URL-h,--helpShow help message
After installation, you can run crane-rs from anywhere in your terminal.
For more details about installation and uninstallation scripts, see scripts/README.md.
You can install crane-rs directly from crates.io (or GitHub) using Cargo:
cargo install crane-rsOr, to install the latest version from GitHub:
cargo install --git https://github.com/santoshxshrestha/crane-rsnix run github:santoshxshrestha/crane-rs- Clone the repository:
git clone https://github.com/santoshxshrestha/crane-rs.git cd crane-rs - Build with Cargo:
cargo build --release
- Run the server:
./target/release/crane-rs
| Option | Description | Default |
|---|---|---|
-p, --port |
Port to run the server on | 8080 |
-f, --file |
File(s) to preload and share | |
-n, --nuke |
Nuke (delete) all temporary shared files | false |
-a, --auth |
Enable password authentication | false |
Examples:
- Run on port 9000:
./crane-rs --port 9000
- Preload files for sharing:
./crane-rs -f ./myfile.txt -f ./photo.jpg
- Nuke all shared files:
./crane-rs --nuke
- Enable authentication:
You will be prompted to enter a password interactively. All users must log in with this password to access the server.
./crane-rs --auth
- Home: Links to upload and download pages.
- Upload: Select and upload files from your device.
- Download: Download any files currently shared on the server.
- Login: If authentication is enabled, users are redirected to the login page and must enter the password to access file sharing features.
- Local Network Only: Designed for trusted local networks. Authentication is optional and can be enabled via the CLI.
- Authentication (Optional): Enable password protection for all web routes except login and authentication endpoints. When enabled, users must log in with a password to access file sharing features.
- Temporary Storage: Uploaded and preloaded files are stored in your system's temp directory under
crane-rs. - File Size Limits: Supports uploads up to 10GB per file (configurable in code).
- When authentication is enabled, all routes except
/loginand/authenticationrequire a valid session cookie. - Users are redirected to
/loginif not authenticated. - The password is set interactively at server startup and is not stored anywhere.
- To disable authentication, simply omit the
--authflag when starting the server.
MIT License. See LICENSE for details.
Contributions, issues, and feature requests are welcome! Please open an issue or PR on GitHub.