A modern, secure file sharing and URL shortening platform built with Go.
β
βπΉ Featuresβ
β
β
βπ Installβ
β
β
βπ Documentationβ
β
β
βπ Contributeβ
ββ
- π€ Secure file uploads with customizable expiration
- π Multiple URL generation styles (UUID, GfyCat-style, etc.)
- π File access tracking and analytics
- β° Automatic cleanup of expired files
- π User-based file management
- ποΈ Store files locally or in GCS buckets
- π€ Custom vanity URLs
- π Comprehensive click analytics
- π Geographic tracking
- π± QR code generation
- β±οΈ Configurable expiration dates
- π JWT-based authentication
- π API token management
- π₯ User account system
- π± Mobile-responsive UI
- π HTMX-powered interactions
- π Structured logging with environment-aware log levels
- Create a new directory and navigate to it:
mkdir volaticus && cd volaticus- Download the compose file:
curl -o compose.yml https://raw.githubusercontent.com/DKolter/volaticus-go/main/compose.example.yml- Create a
.envfile with a secure random secret:
cat > .env << 'EOL'
# Server configuration
PORT=8080
APP_ENV=production
BASE_URL=http://localhost:8080
# Database configuration
DB_HOST=db
DB_PORT=5432
DB_DATABASE=volaticus_db
DB_USERNAME=volaticus_service
DB_PASSWORD=change_this_password
DB_SCHEMA=public
# File upload configuration
UPLOAD_MAX_SIZE=150MB
UPLOAD_USER_MAX_SIZE=500MB
UPLOAD_EXPIRES_IN=24
# Storage configuration
STORAGE_PROVIDER=local
UPLOAD_DIR=/app/uploads # mounted
# GCS settings (if STORAGE_PROVIDER=gcs)
GCS_PROJECT_ID=
GCS_BUCKET_NAME=
# Optional: Base64 encoded service account credentials
# Only needed if not using Workload Identity or running outside GCP
# GOOGLE_CLOUD_CREDENTIALS=<base64-encoded-service-account-json>
EOL
# Generate and append a secure secret
echo "SECRET=$(openssl rand -base64 32)" >> .env- Start the services:
docker compose up -dThe application will be available at http://localhost:8080.
- Clone the repository:
git clone https://github.com/DKolter/volaticus-go.git
cd volaticus- Create a
.envfile based on the example:
cp .env.example .env- Configure your environment variables in
.env:
# Server configuration
PORT=8080
APP_ENV=production
BASE_URL=http://localhost:8080
# Database configuration
DB_HOST=localhost
DB_PORT=5432
DB_DATABASE=volaticus_db
DB_USERNAME=volaticus_service
DB_PASSWORD=very_secure_password
DB_SCHEMA=public
# Application secrets
SECRET=your-secret-
# File upload configuration
UPLOAD_MAX_SIZE=150MB
UPLOAD_USER_MAX_SIZE=500MB
UPLOAD_EXPIRES_IN=24
# Storage configuration
STORAGE_PROVIDER=local # or 'gcs'
# Local storage settings (if STORAGE_PROVIDER=local)
UPLOAD_DIR=./uploads
# GCS settings (if STORAGE_PROVIDER=gcs)
GCS_PROJECT_ID=your-project-id
GCS_BUCKET_NAME=your-bucket-name
# Optional: Base64 encoded service account credentials
# Only needed if not using Workload Identity or running outside GCP
# GOOGLE_CLOUD_CREDENTIALS=<base64-encoded-service-account-json>- Start the application:
docker compose up -dRequirements:
- Go 1.23 or higher
- Clone and setup:
git clone https://github.com/DKolter/volaticus-go.git
cd volaticus
cp .env.example .env- Install dependencies:
make dev-install- Download Maxmind Geo-IP database, if you want to enable Geographic tracking
curl -L -o GeoLite2-City.mmdb https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-City.mmdb- Build the application:
make build- Run:
make runAdditional make commands:
make watch: Run with live reloadmake test: Run testsmake clean: Clean build filesmake docker-down: Stop Docker containers
Example NGINX configuration for reverse proxy:
server {
listen 80;
server_name your-domain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name your-domain.com;
ssl_certificate /path/to/your/certificate.crt;
ssl_certificate_key /path/to/your/private.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256';
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_stapling on;
ssl_stapling_verify on;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
# File upload settings
client_max_body_size 150M;
proxy_read_timeout 600;
proxy_connect_timeout 600;
proxy_send_timeout 600;
}
}Volaticus implements a sophisticated logging system using zerolog for structured, leveled logging that adapts to your environment.
-
π¨ Beautiful console output with visual hierarchy
- Color-coded HTTP methods and status codes
- Clear request/response correlation via request IDs
- Human readable timestamps and file sizes
-
π¬ Environment-aware logging
- Development: Detailed debug information for local development
- Production: Clean, performance-optimized info logging
- Automatic static asset filtering to reduce noise
-
π Privacy-conscious logging
- IP address anonymization
- User agent summarization
- No sensitive data logging
The system supports multiple log levels in order of verbosity:
- DEBUG: Detailed information for development and troubleshooting
- INFO: General operational entries about system behavior
- WARN: Warning messages for potentially harmful situations
- ERROR: Error events that might still allow the application to continue running
Log levels are automatically set based on the environment but can be manually controlled via the APP_ENV variable.
Set the environment in .env:
# Development: Detailed debug logs with all information
APP_ENV=local/development
# Production: Clean, filtered info logs
APP_ENV=productionYou can upload files programmatically using the API endpoint. Here's how to use it with curl:
First generate an API token in the web interface under Settings
# Upload a file
curl -X POST http://localhost:8080/api/v1/upload \
-H "Authorization: Bearer your_api_token" \
-F "file=@/path/to/your/file.jpg"Response will contain the file URL:
{
"success": true,
"url": "http://localhost:8080/f/unique-file-url"
}Customize the URL format (optional)
# Available types: default, original_name, random, date, uuid, gfycat
curl -X POST http://localhost:8080/api/v1/upload \
-H "Authorization: Bearer your_api_token" \
-H "Url-Type: gfycat" \
-F "file=@/path/to/your/file.jpg"We welcome contributions! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
For development, we provide a specialized Docker Compose setup that includes:
- Live reload for Go code changes
- GCS (Google Cloud Storage) emulator for local development
- PostgreSQL with persistent storage
- Development-specific logging and configurations
- Clone the repository:
git clone https://github.com/DKolter/volaticus-go.git
cd volaticus- Create a development
.envfile:
cat > .env << 'EOL'
# Server configuration
PORT=8080
APP_ENV=development
BASE_URL=http://localhost:8080
# Database configuration
DB_HOST=psql
DB_PORT=5432
DB_DATABASE=volaticus_db
DB_USERNAME=volaticus_service
DB_PASSWORD=dev_password
DB_SCHEMA=public
# File upload configuration
MAX_UPLOAD_SIZE=150MB
UPLOAD_USER_MAX_SIZE=150MB
UPLOAD_EXPIRES_IN=24h
UPLOAD_DIR=./uploads
# GCS Emulator settings
STORAGE_PROVIDER=gcs
GCS_PROJECT_ID=test-project
GCS_BUCKET_NAME=test-bucket
EOL
# Generate and append a secure secret
echo "SECRET=$(openssl rand -base64 32)" >> .env- Use the provided Make commands to manage the development environment:
# Start the development environment
make dev-up
# View logs in real-time
make dev-logs
# Stop the environment
make dev-down
# Clean up volumes and containers
make dev-clean- Follow Go best practices and idioms
- Write tests for new features
- Update documentation as needed
- Follow the existing code style
- Use meaningful commit messages
- Update the README.md with details of changes if needed
- Update any relevant documentation
- Add tests for new functionality
- Ensure the test suite passes
- Get approval from maintainers


