Intelligent media file organizer with drag-and-drop web interface
Sortify automatically organizes your photos and media files by date with a clean, modern web interface. Simply drag and drop your files, and Sortify will intelligently extract dates from filenames and EXIF data to organize them into a structured folder hierarchy.
- π₯οΈ Modern Web Interface - Responsive UI built with Lit web components
- π Smart Organization - Automatic date-based folder structure (YYYY/Month)
- π Chunked Uploads - Handle large files with resume capability
- πΌοΈ Real-time Thumbnails - Image previews during upload
- π¨ Duplicate Detection - Prevents duplicate files with checksum verification
- π‘οΈ Security First - Minimal scratch-based Docker image, non-root execution
- βοΈ Configurable - Environment-based configuration for all settings
- π Platform Support - Optimized for AMD64 architecture
- Download docker-compose.yml:
curl -O https://raw.githubusercontent.com/Steven-Harris/sortify/main/docker-compose.yml- Start Sortify:
docker compose up -d- Open your browser: http://localhost:8080
docker run -d \
--name sortify \
-p 8080:8080 \
-e MEDIA_PATH=/media \
-e TEMP_PATH=/tmp \
-v ./media:/media:rw \
-v ./temp:/tmp:rw \
Steven-Harris/sortify:latest| Variable | Default | Description |
|---|---|---|
MEDIA_PATH |
/media |
Path for organized media files |
TEMP_PATH |
/tmp |
Path for temporary upload files |
PORT |
8080 |
Server port |
LOG_LEVEL |
info |
Log level (debug, info, warn, error) |
CORS_ORIGINS |
* |
CORS allowed origins (comma-separated or * for all) |
| Host Path | Container Path | Purpose |
|---|---|---|
./media |
/media |
Persistent storage for organized files |
./temp |
/tmp |
Temporary storage for upload processing |
To avoid permission issues, you can run the container with custom user and group IDs using the --user flag:
docker run -d \
--name sortify \
--user 1234:1234 \
-p 8080:8080 \
-v ./media:/media:rw \
-v ./temp:/tmp:rw \
Steven-Harris/sortify:latestFind your user ID:
id -u # User ID
id -g # Group IDImportant: Make sure the host directories have the correct ownership:
sudo chown -R 1234:1234 ./media ./temp
# Or for unRAID: sudo chown -R 99:100 ./media ./tempSortify supports uploading files from mobile devices. Some features to be aware of:
- Checksum Verification: For improved reliability on mobile devices, Sortify includes fallback mechanisms for handling checksum verification issues that may occur on some mobile browsers.
- Video Files: When uploading large video files from mobile devices, Sortify will automatically handle format differences and process them accordingly.
- Go 1.24+
- Node.js 18+
- pnpm
- just (optional, for task runner)
# Clone the repository
git clone https://github.com/Steven-Harris/sortify.git
cd sortify
# Install dependencies (if using just)
just setup
# Or manually
cd frontend && pnpm install# Start both backend and frontend (if using just)
just dev
# Or manually
# Terminal 1: Backend
cd backend && go run cmd/server/main.go
# Terminal 2: Frontend
cd frontend && pnpm run dev- Backend: http://localhost:8080
- Frontend: http://localhost:5173 (Vite dev server)
just setup # Install dependencies
just dev # Start development environment
just build # Build both frontend and backend
just test # Run tests
just docker-build # Build Docker image
just docker-run # Run with Docker ComposeSortify organizes files using this structure:
media/
βββ 2024/
β βββ January/
β β βββ IMG_20240115_143022.jpg
β β βββ vacation_photo.png
β βββ December/
β βββ holiday_pics.jpg
βββ 2025/
βββ March/
βββ spring_cleanup.jpg
- EXIF DateTimeOriginal - Most accurate for photos
- EXIF DateTime - Camera timestamp
- Filename patterns - Recognizes common formats:
IMG_20240115_143022.jpg2024-01-15_photo.pngphoto_2024_01_15.jpg
- File modification time - Fallback option
- File Selection - Drag & drop or click to select
- Thumbnail Generation - Real-time image previews
- Chunked Upload - Large files uploaded in chunks
- Metadata Extraction - Date and EXIF analysis
- Duplicate Check - SHA256 checksum verification
- Organization - File moved to date-based folder
- Scratch-based container - Minimal attack surface
- Non-root execution - Runs as user 1001
- No shell access - Container has no shell or utilities
- Dependency scanning - Automated security scans in CI/CD
- CORS protection - Configurable origin restrictions
The application is configured with permissive CORS headers (CORS_ORIGINS=*) by default to ensure it works correctly in various deployment scenarios:
- Direct access via different URLs (e.g., http://example.local:8888, http://10.0.0.1:8888)
- Access through reverse proxies with custom domains
- Any other access method users might choose
This permissive CORS configuration ensures:
- File uploads work correctly regardless of access method
- Users don't need to configure CORS settings themselves
- The application is compatible with various deployment scenarios
While wildcard CORS (*) is less restrictive than specific origins, the security impact is minimal for this application because:
- The application is typically deployed in a controlled environment
- Authentication (if any) uses its own security mechanisms
- The main functionality (file uploads) requires permissive access anyway
If you need to restrict access, modify the CORS_ORIGINS environment variable:
- CORS_ORIGINS=https://your-specific-domain.com,https://another-domain.comIf you experience upload problems:
- Check browser developer tools (F12) for any CORS-related errors
- Verify the
CORS_ORIGINS=*setting is properly applied in your Docker environment - Ensure your proxy server (if any) is configured to forward all necessary headers
- Architecture: AMD64 (x86_64) required
- Memory: Minimum 512MB RAM recommended
- Storage: Adequate space for media files
- Docker: Version 20.10+ or compatible container runtime
services:
sortify:
image: Steven-Harris/sortify:latest
restart: unless-stopped
ports:
- "8080:8080"
environment:
- MEDIA_PATH=/media
- TEMP_PATH=/tmp
- LOG_LEVEL=warn
# Default wildcard CORS allows access from any origin
- CORS_ORIGINS=*
# For restricted access, use specific domains:
# - CORS_ORIGINS=https://yourdomain.com
volumes:
- /path/to/media:/media:rw
- /path/to/temp:/tmp:rw
healthcheck:
test: ["/healthcheck"]
interval: 30s
timeout: 10s
retries: 3server {
listen 80;
server_name sortify.yourdomain.com;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# For large file uploads
client_max_body_size 500M;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
}
}curl http://localhost:8080/api/health# Docker logs
docker logs sortify --tail 100 -f
# Or with Docker Compose
docker compose logs -f- 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
- Go: Follow standard Go conventions, use
gofmt - TypeScript: Prettier formatting, ESLint rules
- Commits: Conventional commits format
This project is licensed under the MIT License - see the LICENSE file for details.
- Lit - Web components framework
- Tailwind CSS - Utility-first CSS framework
- Vite - Next generation frontend tooling
β Star this repo if you find it helpful!
