🌐 A complete, containerized media management system with WebDAV and S3 support, Apache Camel integration, and a modern web interface.
- Unified Storage: Seamlessly manage files across WebDAV and S3 storage backends
- Media Processing: Automatic thumbnail generation and media metadata extraction
- Multi-protocol Access: Access files via WebDAV, S3 API, or the web interface
- User Management: Role-based access control for secure file sharing
- Scalable: Built on Docker and Kubernetes-ready architecture
- Self-hosted: Full control over your data and privacy
- Extensible: Plugin architecture for adding custom processors and integrations
┌─────────────────────────────────────────────────────────────────┐
│ Client Applications │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Web App │ │ Mobile App │ │ 3rd Party Clients │ │
│ └─────┬───────┘ └──────┬──────┘ └──────────┬──────────┘ │
│ │ │ │ │
└────────┼───────────────────┼─────────────────────┼──────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────────────┐
│ API Gateway (Nginx) │
└───────────────────────────────┬───────────────────────────────┘
│
┌─────────────┴─────────────┐
│ │
▼ ▼
┌─────────────────────────┐ ┌─────────────────────────┐
│ WebDAV Server │ │ Backend API │
│ (Nginx + WebDAV) │ │ (Node.js + Express) │
└───────────┬─────────────┘ └───────────┬─────────────┘
│ │
│ │
▼ ▼
┌─────────────────────────┐ ┌─────────────────────────┐
│ Storage Backend │ │ Database (PostgreSQL) │
│ • Local Filesystem │ │ - User accounts │
│ • S3-Compatible │ │ - File metadata │
│ • WebDAV Mounts │ │ - Access controls │
└─────────────────────────┘ └─────────────────────────┘
- Docker 20.10+
- Docker Compose 2.0+
- Git
- At least 2GB RAM (4GB recommended)
- At least 10GB free disk space
-
Clone the repository
git clone https://github.com/yourusername/mediacamel.git cd mediacamel -
Setup the environment
make setup
This will:
- Create a
.envfile from.env.exampleif it doesn't exist - Create necessary directories
- Set up file permissions
- Create a
-
Configure (optional) Edit the
.envfile to customize your setup:cp .env.example .env nano .env
Key settings to review:
WEBDAV_USERandWEBDAV_PASSWORDMINIO_ROOT_USERandMINIO_ROOT_PASSWORDfor S3 access- Port configurations if you need to change defaults
- Storage paths and S3 bucket settings
-
Build and start the services
make build make up
-
Access the services
- Web Interface: http://localhost:9083
- MinIO Console: http://localhost:9001 (default credentials: minioadmin/minioadmin)
- API Documentation: http://localhost:9084/api-docs
- WebDAV Access: http://localhost:9081/webdav
-
Verify the installation Check the logs to ensure all services are running:
make logs
make status
This will show all running services and their status.
-
Access the services
- Web Dashboard: http://localhost:8085
- WebDAV Server: http://localhost:8081
- Filestash Client: http://localhost:8082
- API: http://localhost:8084/health
make setup # Setup project environment
make build # Build all Docker containers
make up # Start all services
make down # Stop and remove all containers
make restart # Restart all services
make logs # Show logs for all services
make clean # Remove all containers, networks, and volumes
make status # Show service status and URLs
make test-webdav # Test WebDAV connection
make test-api # Test API endpoints
- WebDAV Server - Secure file storage with authentication
- Filestash Web Client - Modern web-based file manager
- Media Processing - Automatic processing of uploaded files
- RESTful API - Comprehensive API for media management
- Responsive Dashboard - Clean, modern web interface
- Docker Support - Easy deployment with Docker Compose
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐ ┌──────────────────┐
│ Web Users │ │ Filestash Web │ │ Apache Camel │ │ MedaVault │
│ │───▶│ Client │ │ Integration │───▶│ Photo Vault │
│ (Upload files) │ │ (WebDAV GUI) │ │ (Processing) │ │ (Storage) │
└─────────────────┘ └──────────────────┘ └─────────────────┘ └──────────────────┘
│ │
▼ ▼
┌──────────────────┐ ┌─────────────────┐
│ WebDAV Server │ │ PostgreSQL │
│ (nginx) │ │ Database │
│ Port: 8081 │ │ (Metadata) │
└──────────────────┘ └─────────────────┘
| Service | Port | Description |
|---|---|---|
| WebDAV Server | 8081 | WebDAV file access |
| Filestash Client | 8082 | Web-based file manager |
| Status Endpoint | 8084 | WebDAV server status |
| MedaVault Backend | 8084 | REST API and business logic |
| Web Dashboard | 8085 | Admin dashboard and monitoring |
- Docker 20.10+
- Docker Compose 2.0+
- 4GB RAM (minimum)
- 10GB free disk space
- Port: 8081 (HTTP), 8443 (HTTPS)
- Secure WebDAV server with authentication
- File upload/download via WebDAV protocol
- Integration with Filestash and Camel
- Supports multiple concurrent connections
- Status endpoint at
:8084/status
- Port: 8082
- Modern web-based file manager
- Supports multiple protocols: WebDAV, S3, SFTP, Git, and more
- Drag & drop file uploads
- File previews and thumbnails
- Open source (AGPL-3.0)
- Monitors WebDAV for new files
- Processes media files (images, videos, documents)
- Generates thumbnails and extracts metadata
- Routes files to appropriate storage
- Handles error conditions and retries
- Port: 8084
- RESTful API for media management
- PostgreSQL database for metadata
- User authentication and authorization
- Media processing and transformation
- Search and filtering capabilities
- Port: 8085
- Real-time service monitoring
- System status overview
- Quick access to all services
- Responsive design for all devices
- System monitoring and statistics
- Media gallery and preview
- User and permission management
- Real-time logs and notifications
- Docker 20.10.0+
- Docker Compose 2.0.0+
- 4GB RAM (minimum)
- 10GB free disk space
# Clone the repository
git clone https://github.com/wronai/mediacamel.git
cd mediacamel
# Copy and configure environment variables
cp .env.example .env
# Edit .env file if needed
# Make setup script executable
chmod +x setup.sh# Build and start all services
./setup.sh- 🌐 Web Dashboard: http://localhost:8085
- 📁 WebDAV Server: http://localhost:8081
- 🖥️ Filestash Client: http://localhost:8082
- 🔧 API Documentation: http://localhost:8084/api-docs
URL: http://localhost:8081
Username: webdav
Password: medavault123
# Run the test script
./scripts/test-webdav.sh- Open http://localhost:8082
- Select "WebDAV" as storage type
- Enter WebDAV credentials:
- URL:
http://webdav-server - Username:
webdav - Password:
medavault123
- URL:
- Drag and drop files to upload
curl -u webdav:medavault123 \
-T your-file.jpg \
"http://localhost:8081/your-file.jpg"- Configure rclone:
rclone config create webdav webdav \ url=http://localhost:8081 \ vendor=other \ user=webdav \ pass=medavault123
- Copy files:
rclone copy local-folder/ webdav:
# Install davfs2
sudo apt install davfs2
# Add user to davfs2 group
sudo usermod -aG davfs2 $(whoami)
# Mount WebDAV
sudo mount -t davfs http://localhost:8081 /mnt/webdav- Open File Explorer
- Right-click "This PC" and select "Map network drive"
- Enter:
\\localhost@8081\ - Enter credentials when prompted
- In Finder, press Cmd+K
- Enter:
http://localhost:8081 - Use "Connect As" with username/password
- Upload: User uploads file via WebDAV
- Detection: Camel integration detects new file
- Download: File is downloaded for processing
- Processing:
- Images: Generate thumbnails, extract metadata
- Videos: Extract metadata, generate previews
- Documents: Index content, extract text
- Storage: File is stored in MedaVault
- Cleanup: Optional removal from WebDAV after processing
mediacamel/
├── docker-compose.yml # Main Docker Compose configuration
├── .env # Environment variables
├── config/ # Configuration files
│ ├── nginx/ # Nginx configurations
│ ├── filestash/ # Filestash configuration
│ └── medavault/ # MedaVault application configs
├── camel-integration/ # Apache Camel integration
│ ├── Dockerfile
│ ├── CamelWebDAVProcessor.groovy
│ └── lib/ # Custom Java/Groovy libraries
├── medavault-backend/ # Node.js API
│ ├── src/
│ ├── package.json
│ └── Dockerfile
├── web-dashboard/ # React/Vue dashboard
│ ├── public/
│ ├── src/
│ └── package.json
├── storage/ # Persistent storage
│ ├── incoming/ # New uploads
│ ├── processed/ # Successfully processed files
│ └── failed/ # Failed processing attempts
├── scripts/ # Utility scripts
│ ├── setup.sh # Initial setup
│ ├── test-webdav.sh # WebDAV connection test
│ └── backup.sh # Backup utilities
└── logs/ # Application logs
MedaVault uses MinIO as an S3-compatible object storage backend. Files can be accessed using any S3-compatible client.
Configuration Options:
S3_ENDPOINT: MinIO server URL (default: http://minio:9000)S3_BUCKET: Default bucket name (default: medavault)S3_ACCESS_KEY_ID: Access key for S3 APIS3_SECRET_ACCESS_KEY: Secret key for S3 APIS3_REGION: AWS region (default: us-east-1)
Example using AWS CLI:
aws --endpoint-url http://localhost:9000 s3 ls s3://medavaultWebDAV is fully supported for both client access and as a storage backend.
Configuration Options:
WEBDAV_ENABLED: Enable/disable WebDAV (default: true)WEBDAV_URL: Base URL for WebDAV serverWEBDAV_USERNAME: Authentication usernameWEBDAV_PASSWORD: Authentication password
Mounting WebDAV on Linux:
sudo apt install davfs2
sudo mkdir /mnt/medavault
sudo mount -t davfs http://localhost:9081/webdav /mnt/medavaultMedaVault includes Apache Camel routes for advanced file processing and integration:
- File Routing: Automatically route files between different storage backends
- Media Processing: Generate thumbnails, extract metadata, transcode videos
- Event-Driven: React to file changes in real-time
- Extensible: Add custom processors and routes
from("webdav://{{webdav.host}}:{{webdav.port}}{{webdav.path}}?username={{webdav.username}}&password={{webdav.password}}&recursive=true")
.routeId("webdav-to-s3")
.log("Processing file: ${header.CamelFileName}")
.process(exchange -> {
// Add custom processing logic here
String fileName = exchange.getIn().getHeader("CamelFileName", String.class);
exchange.getIn().setHeader("CamelAwsS3Key", "processed/" + fileName);
})
.to("aws2-s3://{{s3.bucket}}?accessKey={{s3.accessKey}}&secretKey={{s3.secretKey}}®ion={{s3.region}}")
.log("Successfully uploaded ${header.CamelFileName} to S3");- Place your Camel route files in the
camel-routesdirectory - Configure the routes in
application.yml - Restart the backend service:
make restart backend
# View logs for all services
docker-compose logs -f
# View logs for specific service
docker-compose logs -f service_name
# Check service status
docker-compose ps# Restart a specific service
docker-compose restart service_name
# Rebuild and restart a service
docker-compose up -d --build service_name
# Access container shell
docker-compose exec service_name sh# Backup database
docker-compose exec medavault-db pg_dump -U postgres medavault > backup.sql
# Clean up old files
# Clean processed files older than 7 days
find storage/processed -type f -mtime +7 -delete
# Stop all services
docker-compose downEdit the .env file to configure:
- Database credentials
- WebDAV authentication
- Storage paths
- Logging levels
- Service ports
To change WebDAV credentials:
- Edit the
.envfile:WEBDAV_USER=newuser WEBDAV_PASSWORD=newpassword - Rebuild the WebDAV server:
docker-compose up -d --build webdav-server
By default, files are stored in the storage directory. To change this:
- Update
.env:STORAGE_PATH=/path/to/your/storage - Ensure the directory exists and has proper permissions
- Restart the services
Logs are stored in the logs directory by default. You can configure log rotation and levels in the respective service configurations.
Edit config/application.properties to configure processing rules:
# WebDAV connection
webdav.url=http://webdav-server
webdav.username=${WEBDAV_USER}
webdav.password=${WEBDAV_PASSWORD}
# Processing rules
camel.poll.delay=5000
camel.cleanup.processed=true
# MedaVault API
medavault.api.url=http://medavault-backend:8084/apiChange default credentials in the .env file before deploying to production.
Always use HTTPS with a valid SSL certificate in production environments.
Restrict access to ports:
- 8085 (Dashboard) - Admin access only
- 8081, 8082 (WebDAV/Filestash) - Trusted networks only
- 8084 (API) - Internal access recommended
Keep all components updated:
docker-compose pull
docker-compose up -d- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
-
Install development dependencies:
# Install Node.js dependencies cd medavault-backend npm install # Install frontend dependencies cd ../web-dashboard npm install
-
Start development servers:
# Backend with hot-reload cd medavault-backend npm run dev # Frontend with hot-reload cd ../web-dashboard npm run serve
- Verify the WebDAV server is running:
docker-compose ps | grep webdav - Check logs:
docker-compose logs webdav-server - Test connection:
./scripts/test-webdav.sh
- Check if PostgreSQL is running:
docker-compose ps | grep db - View database logs:
docker-compose logs medavault-db - Test database connection:
docker-compose exec medavault-db psql -U postgres -c "\l"
If you encounter permission errors:
# Set correct permissions on storage directories
sudo chown -R 1000:1000 storage/
sudo chmod -R 775 storage/This project is licensed under the MIT License - see the LICENSE file for details.
For issues and feature requests, please open an issue in the repository.
POST /api/auth/login
Content-Type: application/json
{
"username": "admin",
"password": "yourpassword"
}POST /api/auth/refresh-token
Authorization: Bearer <refresh_token>GET /api/media
Authorization: Bearer <token>POST /api/media/upload
Authorization: Bearer <token>
Content-Type: multipart/form-data
# Form Data:
# file: <file>
# metadata: {"title":"My File","description":"Description"}GET /api/media/{id}
Authorization: Bearer <token>GET /api/users
Authorization: Bearer <token>POST /api/users
Authorization: Bearer <token>
Content-Type: application/json
{
"username": "newuser",
"password": "securepassword",
"email": "user@example.com",
"role": "user"
}GET /api/healthGET /api/system/info
Authorization: Bearer <token>- Nautilus: Built-in support (Files > Connect to Server)
- Dolphin: Built-in WebDAV support
- rclone: Command-line tool
- File Explorer: Built-in WebDAV support
- WinSCP: Free SFTP, FTP, WebDAV client
- Cyberduck: Open source client
- Finder: Built-in WebDAV support
- Transmit: Feature-rich FTP/WebDAV client
- ForkLift: Dual-pane file manager
GET /metrics
- Application logs:
logs/app.log - Access logs:
logs/access.log - Error logs:
logs/error.log
# Create backup
docker-compose exec medavault-db pg_dump -U postgres medavault > backup_$(date +%Y%m%d).sql
# Restore from backup
cat backup_file.sql | docker-compose exec -T medavault-db psql -U postgres medavault# Backup storage directory
tar -czvf medavault_storage_backup_$(date +%Y%m%d).tar.gz storage/
# Restore
mkdir -p storage
tar -xzvf medavault_storage_backup.tar.gz-
Environment Setup
# Set production environment echo "NODE_ENV=production" >> .env # Update API URL echo "API_URL=https://yourdomain.com/api" >> .env # Set secure secrets openssl rand -base64 32 | sed 's/[^a-zA-Z0-9]//g' | head -c 32 echo "JWT_SECRET=generated_secret_here" >> .env
-
Start in Production Mode
docker-compose -f docker-compose.prod.yml up -d
-
Set Up Reverse Proxy (Nginx Example)
server { listen 80; server_name yourdomain.com; return 301 https://$host$request_uri; } server { listen 443 ssl http2; server_name yourdomain.com; ssl_certificate /path/to/cert.pem; ssl_certificate_key /path/to/key.pem; location / { proxy_pass http://localhost:8085; 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; } location /api { proxy_pass http://localhost:8084; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } }
# Backend tests
cd medavault-backend
npm test
# Frontend tests
cd ../web-dashboard
npm test# Backend coverage
cd medavault-backend
npm run test:coverage
# Frontend coverage
cd ../web-dashboard
npm run test:coverage- Secure File Storage: Encrypted storage with access control
- Media Processing: Automatic thumbnails and metadata extraction
- User Management: Role-based access control
- API-First Design: RESTful API for all operations
- Web Interface: Modern dashboard for easy management
- WebDAV Support: Standard protocol integration
- File Versioning: Keep track of file changes
- Search: Full-text search across all content
- Tags & Collections: Organize your media
- Sharing: Share files with external users
- File uploads/downloads
- Storage usage
- User activity
- System performance
- Prometheus for metrics collection
- Grafana for visualization
- ELK Stack for log analysis
- Backup your data
- Update the repository
- Run database migrations
- Update environment variables
- Restart services
- GitHub Issues - Report bugs and request features
- Discord - Join our community
- Documentation - Full documentation
We welcome contributions! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
- WebDAV server integration
- File processing pipeline
- User authentication
- API documentation
- Initial release
- Basic file upload/download
- User management
- Web interface
This project is licensed under the Apache License - see the LICENSE file for details.
For issues and feature requests, please open an issue in the repository.
# Get all media
GET /api/media
# Get media by type
GET /api/media?type=image&limit=10
# Get specific media
GET /api/media/{id}
# Download media
GET /api/media/{id}/download
# Get thumbnail
GET /api/media/{id}/thumbnail
# System statistics
GET /api/stats
# Health check
GET /health# List files
PROPFIND /webdav/
# Upload file
PUT /webdav/filename.jpg
# Download file
GET /webdav/filename.jpg
# Delete file
DELETE /webdav/filename.jpg
# Create directory
MKCOL /webdav/newfolder/# Sprawdź logi Camel
docker-compose logs camel-integration
# Zweryfikuj połączenie z WebDAV
curl -u webdav:medavault123 \
-X PROPFIND \
"http://localhost:8081/webdav/"- Sprawdź czy WebDAV server działa: http://localhost:8081/status
- Zweryfikuj dane logowania
- Sprawdź CORS headers w nginx config
# Check WebDAV permissions
docker-compose exec webdav-server ls -la /var/www/webdav
# Check storage space
df -h storage/# Restart database
docker-compose restart medavault-db
# Check database logs
docker-compose logs medavault-db- Images: ~100ms per thumbnail
- Videos: ~2-5s per file (metadata extraction)
- Documents: ~50ms per file
- Concurrent Processing: 5 files simultaneously
- Development: 10GB+ free space
- Production: 100GB+ with backup
- Database: SSD recommended for metadata
- Horizontal: Multiple Camel instances
- Storage: External S3/MinIO backend
- Database: PostgreSQL cluster
- Load Balancing: nginx upstream
- HTTPS: Enable SSL certificates
- Authentication: Replace basic auth with OAuth/LDAP
- Network: Firewall rules, VPN access
- Backup: Regular database and storage backups
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";- WebDAV upload success rate
- Camel processing latency
- Database connection health
- Storage space utilization
- Failed processing count
# Centralized logging with ELK stack
docker-compose logs | logstash -f logstash.conf- Fork the repository
- Create feature branch
- Make changes
- Test thoroughly
- Submit pull request
To connect to the WebDAV server, use the following URL: http://localhost:8081/webdav/
To upload a file, use the PUT method with the file path as the request body. For example:
curl -u webdav:medavault123 \
-T test.txt \
"http://localhost:8081/webdav/test.txt"To download a file, use the GET method with the file path as the request URL. For example:
curl -u webdav:medavault123 \
"http://localhost:8081/webdav/test.txt"To delete a file, use the DELETE method with the file path as the request URL. For example:
curl -u webdav:medavault123 \
-X DELETE \
"http://localhost:8081/webdav/test.txt"This project is licensed under the Apache 2.0 License.
- Issues: GitHub Issues
- Documentation: This README
- Community: Discord/Slack channel
🎉 Enjoy your WebDAV + Camel + MedaVault system!
Built with ❤️ using:
- Filestash for WebDAV web client
- Apache Camel for integration
- Sardine for WebDAV connectivity
- PostgreSQL for metadata storage
- Bootstrap for responsive UI