A temporary file hosting service built with Echo, inspired by 0x0.st. Perfect for personal, self-hosted temporary file sharing.
Disclaimer: While this project is inspired by 0x0.st, it is by no means intended to provide full API compatibility with their implementation. This is a personal project with its own features and limitations.
- Upload files up to configurable size limit (default 1024MB)
- Dynamic file expiration based on size
- One-time download links
- Secret (hard-to-guess) URLs
- File management (delete, update expiration)
- Metadata persistence using SQLite
- Preview protection for one-time links
- Docker deployment support
- Chunked uploads for large files with resume capability
- Admin panel for simple file management
- Configurable privacy features (IP tracking can be disabled)
-
Clone and setup:
git clone https://github.com/marianozunino/drop.git cd drop go mod tidy -
Run with task:
# Generate templates and run development server task dev # Or build and run task build task serve
-
Docker deployment:
# Option 1: Use pre-built image (recommended) docker pull ghcr.io/marianozunino/drop:latest docker run -p 3000:3000 -v ./uploads:/app/uploads -v ./config:/app/config -v ./data:/app/data ghcr.io/marianozunino/drop:latest # Option 2: Build from source docker build -t drop . docker run -p 3000:3000 -v ./uploads:/app/uploads -v ./config:/app/config -v ./data:/app/data drop
Edit ./config/config.yaml:
port: 3000
min_age_days: 30
max_age_days: 365
max_size_mib: 1024
upload_path: ./uploads
check_interval_min: 60
expiration_manager_enabled: true
base_url: "http://localhost:3000/"
sqlite_path: "./data/dump.db"
id_length: 4
chunk_size_mib: 4
preview_bots:
- slack
- slackbot
- facebookexternalhit
- twitterbot
- discordbot
- whatsapp
- googlebot
- linkedinbot
- telegram
- skype
- viber
streaming_buffer_size_kb: 64
admin_panel_enabled: false
ip_tracking_enabled: true
url_shortening_enabled: trueport- HTTP server portmin_age_days- Minimum file retention period in daysmax_age_days- Maximum file retention period in daysmax_size_mib- Maximum file size in MiBupload_path- Directory for uploaded filescheck_interval_min- Interval to check for expired files in minutesexpiration_manager_enabled- Enable/disable automatic file expirationbase_url- Base URL for generated file linkssqlite_path- Path to SQLite database fileid_length- Length of generated file IDschunk_size_mib- Size of chunks for chunked uploads in MiBpreview_bots- List of user-agent substrings to identify preview botsstreaming_buffer_size_kb- Buffer size for streaming file content (in KB)admin_panel_enabled- Enable/disable the admin panel featureip_tracking_enabled- Enable/disable IP address tracking for uploaded filesurl_shortening_enabled- Enable/disable URL shortening feature
Drop includes several feature flags that allow you to control specific functionality:
- Default:
true - Purpose: Controls whether to capture and store IP addresses of users who upload files
- Use Cases:
- Set to
falsefor GDPR/privacy compliance - Reduce database storage requirements
- Disable for privacy-focused deployments
- Set to
- Behavior: When disabled, the
ip_addressfield in the database remains empty
- Default:
true - Purpose: Controls the URL shortening feature that allows creating short links to external URLs
- Use Cases:
- Disable if you only need file hosting (not URL shortening)
- Reduce attack surface by disabling unused features
- Simplify the service for specific use cases
- Behavior: When disabled, requests with
shortenparameter return "URL shortening feature is disabled" error
- Default:
false - Purpose: Controls access to the administrative web interface
- Requirements: When enabled,
admin_password_hashmust be configured - Use Cases:
- Enable for file management and monitoring
- Disable for headless/API-only deployments
# Upload a file
curl -F'file=@yourfile.png' http://localhost:3000/
# Upload from URL
curl -F'url=http://example.com/image.jpg' http://localhost:3000/
# Generate a secret URL
curl -F'file=@yourfile.png' -F'secret=' http://localhost:3000/
# Create a one-time download link
curl -F'file=@yourfile.png' -F'one_time=' http://localhost:3000/
# Set custom expiration (24 hours)
curl -F'file=@yourfile.png' -F'expires=24' http://localhost:3000/
# JSON response
curl -H "Accept: application/json" -F'file=@yourfile.png' http://localhost:3000/Note: This feature can be disabled via the url_shortening_enabled configuration flag.
# Shorten a URL
curl -F'shorten=' -F'url=https://example.com' http://localhost:3000/
# Shorten with custom expiration (24 hours)
curl -F'shorten=' -F'url=https://example.com' -F'expires=24' http://localhost:3000/
# Create a one-time short URL
curl -F'shorten=' -F'url=https://example.com' -F'one_time=' http://localhost:3000/
# JSON response for URL shortening
curl -H "Accept: application/json" -F'shorten=' -F'url=https://example.com' http://localhost:3000/# Delete a file
curl -X POST -F'token=your_token_here' -F'delete=' http://localhost:3000/filename.ext
# Update expiration
curl -X POST -F'token=your_token_here' -F'expires=48' http://localhost:3000/filename.extFor large files, use the chunked upload feature:
# Initialize chunked upload
curl -X POST http://localhost:3000/upload/init \
-F "filename=large-video.mp4" \
-F "size=104857600" \
-F "chunk_size=4194304"
# Upload individual chunks
curl -X POST http://localhost:3000/upload/chunk/abc123/0 \
-F "chunk=@chunk_0.bin"
# Check upload progress
curl http://localhost:3000/upload/status/abc123- Complete API Documentation - Detailed API reference with examples
- Admin Panel Documentation - Comprehensive admin panel guide
- Web Interface - Interactive upload interface
- Chunked Upload Interface - Drag & drop for large files
MIT License - See LICENSE file for details