8d9d29cff15bb9dac96e5a5eaaae118be49ea3d4
GMMC Media Server
A high-performance, public media download server built with Rust and Axum. It is designed to serve extremely large files (100GB+) seamlessly and features a retro, Minecraft-themed web dashboard for easy access.
Features
- Blazing Fast & Lightweight: Powered by Rust, Axum, and Tokio.
- Large File Optimization: Streams files using configurable chunk sizes (default 8MB) to handle massive files with low memory footprint.
- Resume Support: Full support for HTTP
Rangerequests, allowing paused or interrupted downloads to be resumed. - Retro Dashboard: A dynamic, Minecraft-style UI built with vanilla HTML/CSS and the VT323 font. Includes 1-click copy-to-clipboard commands for terminal downloading.
- No Authentication Required: Built for public, hassle-free access.
- Security & Access Control: Built-in security headers and optional IP whitelisting.
Prerequisites
- Rust & Cargo (edition 2021)
- A
.envfile for server configuration - A
media_config.jsonfile for file registry
Configuration
1. Environment Variables (.env)
Create a .env file in the root directory:
PORT=3000
HOST=0.0.0.0
# Request timeout in seconds (default 3600 for 1 hour)
REQUEST_TIMEOUT_SECS=3600
# Streaming chunk size in KB (default 8192 for 8MB)
CHUNK_SIZE_KB=8192
# Optional: comma-separated list of allowed IPs
# ALLOWED_IPS=127.0.0.1,192.168.1.100
# Optional: Domain for generating absolute download URLs
# DOMAIN=https://downloads.example.com
2. Media Registry (media_config.json)
Define the files you want to host. Create a media_config.json in the root directory:
{
"files": {
"ubuntu-iso": {
"name": "Ubuntu 24.04 LTS",
"path": "/path/to/ubuntu-24.04-desktop-amd64.iso",
"description": "The latest LTS release of Ubuntu.",
"content_type": "application/x-iso9660-image"
},
"large-dataset": {
"name": "AI Training Dataset",
"path": "./data/dataset.tar.gz",
"description": "Huge 150GB dataset for machine learning models."
}
}
}
Running the Server
- Clone the repository and navigate to the project root.
- Build and run the server:
cargo run --release - Open your browser and navigate to
http://localhost:3000(or your configuredHOSTandPORT).
Usage
- Web Dashboard: Visit the root URL to view available files, their sizes, and descriptions. Click "Download" or copy the provided cURL commands.
- Direct Download (Browser):
http://localhost:3000/download/{file_id} - cURL Download:
(For resumable downloads via cURL, add
curl -O http://localhost:3000/download/{file_id}-C -)
Tech Stack
Description
Languages
Rust
51.1%
HTML
48.9%