A blazing-fast, secure file uploader built with Go and Fiber that supports files up to 50GB with a beautiful terminal-style web interface and powerful CLI tool - inspired by bashupload.com.
- π High Performance - Built with Fiber for lightning-fast uploads
- π Configurable File Size - Upload limit configurable via environment (default 1GB)
- π Secure Links - Unique download URLs with original file extensions
- β° Auto-Expiry - Files expire after 3 days and configurable download limit
- π API Authentication - Optional API key protection for private instances
- π» CLI Tool - Powerful command-line interface with progress bars
- π Terminal Web Interface - Retro terminal-style web UI inspired by bashupload
- π Progress Tracking - Real-time upload/download progress
- ποΈ SQLite Database - Lightweight database for metadata storage
- π³ Docker Ready - Complete containerization support
- π Cross-Platform - Works on Linux, macOS, and Windows
- Terminal-style retro interface inspired by bashupload.com
- Green-on-black matrix-style design with monospace fonts
- Real-time progress bars for uploads
- Instant shareable download links with file extensions
- Single download policy - files are removed after first download
$ ./bashupload upload largefile.zip
π Uploading: largefile.zip (500 MB)
Uploading... ββββββββββββββββββββββββββββββββββββββββ 100% | 500 MB/500 MB
β
Upload successful!
π File: largefile.zip
π Size: 500 MB
π ID: a1b2c3d4e5f6g7h8
π Download URL: http://localhost:3000/d/a1b2c3d4e5f6g7h8.zip
# Clone the repository
git clone https://github.com/yourusername/bashupload.git
cd bashupload
# Start with Docker Compose
make compose-up
# Or manually with Docker
make docker-run
# Clone the repository
git clone https://github.com/yourusername/bashupload.git
cd bashupload
# Install dependencies
make deps
# Build the project
make build
# Run the server
make run
The server will start on http://localhost:3000
- Open
http://localhost:3000
in your browser - Drag and drop files or click to select
- Upload files up to 10GB
- Get instant shareable download links
./bashupload upload path/to/your/file.zip
./bashupload upload file.txt --api-key your_secret_key
./bashupload upload file.txt --server https://your-domain.com --api-key your_key
./bashupload info a1b2c3d4e5f6g7h8
./bashupload download a1b2c3d4e5f6g7h8.zip output.zip
./bashupload --help
POST /api/upload
Content-Type: multipart/form-data
X-API-Key: your_secret_key (if required)
curl -X POST -F "file=@example.zip" -H "X-API-Key: your_key" http://localhost:3000/api/upload
# Public instance
curl http://localhost:3000 -T your_file.txt
# Private instance
curl -H "X-API-Key: your_key" http://localhost:3000 -T your_file.txt
GET /d/{filename-with-extension}
GET /download/{filename-with-extension}
GET /api/files/{file-id}
GET /api/stats
- Go 1.21+
- SQLite3
- Docker (optional)
- Make (optional, for convenience commands)
# Clone repository
git clone https://github.com/yourusername/bashupload.git
cd bashupload
# Install dependencies
make deps
# Run in development mode (with auto-reload)
make dev
# Build for current platform
make build
# Build for specific platforms
make build-linux
make build-windows
make build-darwin
# Create release package
make release
# Run tests
make test
# Run tests with coverage
make test-coverage
# Run benchmarks
make benchmark
version: '3.8'
services:
fileuploader:
build: .
ports:
- "3000:3000"
volumes:
- ./uploads:/app/uploads
- ./fileuploader.db:/app/fileuploader.db
restart: unless-stopped
# Start services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
# Build image
docker build -t bashupload .
# Run container
docker run -d \
--name bashupload \
-p 3000:3000 \
-v $(pwd)/uploads:/app/uploads \
-v $(pwd)/bashupload.db:/app/bashupload.db \
bashupload
Variable | Default | Description |
---|---|---|
PORT |
3000 |
Server port |
MAX_UPLOAD_SIZE |
1GB |
Maximum upload size (supports: 100MB, 1GB, 5GB, etc.) |
MAX_DOWNLOADS |
1 |
Number of times file can be downloaded before deletion |
FILE_EXPIRE_AFTER |
3D |
File expiration time (supports: 1D, 1W, 1M, 1Y, etc.) |
API_KEY |
"" |
API key for authentication (optional) |
GIN_MODE |
debug |
Gin mode (debug/release) |
You can configure the maximum upload size using human-readable strings:
# Set to 5GB
export MAX_UPLOAD_SIZE=5GB
# Set to 100MB
export MAX_UPLOAD_SIZE=100MB
# Set to 500MB
export MAX_UPLOAD_SIZE=500MB
# Set to 2.5GB (decimal supported)
export MAX_UPLOAD_SIZE=2.5GB
# Still supports bytes if you prefer
export MAX_UPLOAD_SIZE=1073741824
Supported formats:
- Bytes:
1024
,1073741824
- Kilobytes:
100K
,100KB
,100KiB
- Megabytes:
100M
,100MB
,100MiB
- Gigabytes:
1G
,1GB
,1GiB
,2.5GB
- Terabytes:
1T
,1TB
,1TiB
Case insensitive: 1gb
, 1GB
, 1Gb
all work the same
To run a private instance that requires API key authentication:
# Set API key environment variable
export API_KEY="your_super_secret_api_key_here"
# Set custom upload limit (human readable)
export MAX_UPLOAD_SIZE=5GB
# Allow multiple downloads per file
export MAX_DOWNLOADS=5
# Set custom expiration time
export FILE_EXPIRE_AFTER=1W
# Run bashupload server
./bashupload-server
Or with Docker:
# Edit docker-compose.yml and set environment variables
docker-compose up -d
Example configurations:
# Quick sharing: 1 hour, single download, small files
export MAX_UPLOAD_SIZE=50MB
export MAX_DOWNLOADS=1
export FILE_EXPIRE_AFTER=1H
./bashupload-server
# Team sharing: 1 week, multiple downloads, larger files
export MAX_UPLOAD_SIZE=2.5GB
export MAX_DOWNLOADS=10
export FILE_EXPIRE_AFTER=1W
./bashupload-server
# Long-term storage: 6 months, unlimited downloads
export MAX_UPLOAD_SIZE=1GB
export MAX_DOWNLOADS=999
export FILE_EXPIRE_AFTER=6MO
./bashupload-server
# Archive sharing: 1 year, 100 downloads, large files
export MAX_UPLOAD_SIZE=10GB
export MAX_DOWNLOADS=100
export FILE_EXPIRE_AFTER=1Y
./bashupload-server
Or with Docker:
# Edit docker-compose.yml and uncomment API_KEY line
docker-compose up -d
The server can be configured by environment variables:
- Upload Limit: Configurable via
MAX_UPLOAD_SIZE
(default 1GB) - Download Limit: Configurable via
MAX_DOWNLOADS
(default 1) - File Expiration: Configurable via
FILE_EXPIRE_AFTER
(default 3 days) - Timeouts: Read/Write timeout set to 30 minutes
- Rate Limiting: 100 requests per minute per IP
bashupload/
βββ main.go # Main server application
βββ cmd/cli/main.go # CLI application
βββ templates/
β βββ index.html # Web interface template
βββ static/
β βββ style.css # Terminal-style CSS
βββ go.mod # Go module definition
βββ go.sum # Go module checksums
βββ Dockerfile # Docker configuration
βββ docker-compose.yml # Docker Compose configuration
βββ Makefile # Build and development commands
βββ setup.sh # Project setup script
βββ README.md # This file
βββ uploads/ # Upload directory (created automatically)
βββ bashupload.db # SQLite database (created automatically)
{
"success": true,
"message": "File uploaded successfully",
"unique_id": "a1b2c3d4e5f6g7h8",
"download_url": "http://localhost:3000/d/a1b2c3d4e5f6g7h8",
"file_size": 1048576
}
{
"success": true,
"data": {
"id": 1,
"unique_id": "a1b2c3d4e5f6g7h8",
"original_name": "example.zip",
"file_size": 1048576,
"mime_type": "application/zip",
"extension": ".zip",
"uploaded_at": "2023-12-07T10:30:00Z",
"downloads": 5
}
}
- Concurrent uploads: Supports multiple simultaneous uploads
- Streaming: Uses streaming for memory-efficient large file handling
- Progress tracking: Real-time progress updates
- Rate limiting: Built-in protection against abuse
- Compression: Automatic response compression
- Upload Speed: Up to 1GB/s (network dependent)
- Memory Usage: ~50MB base memory
- Concurrent Users: 1000+ simultaneous connections
- File Size: Tested with files up to 10GB
- Rate limiting: Protection against spam uploads
- File size validation: Prevents oversized uploads
- Unique file IDs: Cryptographically secure random IDs
- CORS protection: Configurable cross-origin policies
- Input validation: Comprehensive request validation
- Check available disk space
- Increase Docker container memory if using Docker
- Verify network timeout settings
# Check server URL
./uploader upload file.txt --server http://correct-url:3000 --verbose
# Reset database
make db-reset
# Check logs
docker-compose logs fileuploader
# Restart container
docker-compose restart fileuploader
Enable verbose logging:
# CLI
./uploader upload file.txt --verbose
# Server
PORT=3000 GIN_MODE=debug ./server
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Follow Go conventions
- Add tests for new features
- Update documentation
- Use meaningful commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ and Go - Inspired by bashupload.com