b2004f0c0e6fc32721003e68ba9a28920b948bb1
Some checks failed
Deploy quoter Microservice on push / deploy (push) Failing after 38m5s
### Fixed (Thumbnail Error Logging) - **🔇 Reduced Noise**: Убраны избыточные warning логи для несуществующих thumbnails - **🎯 Smart Logging**: NoSuchKey ошибки (нормальное поведение) больше не логируются как проблемы - **🧹 Code Cleanup**: Удалена избыточная проверка `thumbnail_exists_in_storj` перед генерацией - **⚡ Performance**: Уменьшено количество лишних запросов к Storj S3 ### Technical Details - `thumbnail.rs`: Добавлена фильтрация NoSuchKey/Not Found ошибок в `load_cached_thumbnail_from_storj()` - `serve_file.rs`: Убрана двойная проверка существования thumbnail в кэше - Логи теперь показывают только реальные проблемы, не нормальное отсутствие кэша ### Compatibility - **Обратная совместимость**: Все существующие API endpoints работают без изменений - **Graceful degradation**: Thumbnails генерируются on-demand если отсутствуют в кэше
Quoter 🚀
Simple file upload proxy with quotas. Upload to S3, thumbnails via Vercel.
Focus: Upload + Storage. Thumbnails managed by Vercel Edge API for better performance.
What it does
- 📤 Upload files to S3/Storj with user quotas
- 🔐 JWT authentication with session management
- 📦 File serving with caching and optimization
- 🌐 CORS support for web apps
🚀 Quick Start
# Setup
cargo build
cp .env.example .env # Configure environment
cargo run
# Test
curl http://localhost:8080/ # Health check
🔧 API
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Health check or user info (need auth token) |
POST |
/ |
Upload file (need auth token) |
GET |
/{filename} |
Get file or thumbnail |
Upload file
curl -X POST http://localhost:8080/ \
-H "Authorization: Bearer your-token" \
-F "file=@image.jpg"
Get thumbnail
# Legacy thumbnails (fallback only)
curl http://localhost:8080/image_300.jpg
# 💡 Recommended: Use Vercel Image API
https://yoursite.com/_next/image?url=https://files.dscrs.site/image.jpg&w=300&q=75
🏗️ Architecture & Setup
Simple 3-tier architecture:
- Upload: Quoter (auth + quotas + S3 storage)
- Download: Vercel Edge API (thumbnails + optimization)
- Storage: S3/Storj (files) + Redis (quotas/cache)
Upload: Client → Quoter → S3/Storj
Download: Client → Vercel → Quoter (fallback)
💋 Simplified approach: Quoter handles uploads, Vercel handles thumbnails.
📋 Environment Setup
# Required
REDIS_URL=redis://localhost:6379
STORJ_ACCESS_KEY=your-key
STORJ_SECRET_KEY=your-secret
JWT_SECRET=your-secret
# Optional
PORT=8080
RUST_LOG=info
🧪 Testing
cargo test # 36 tests passing
./scripts/test-coverage.sh # Coverage report
📚 Documentation
docs/configuration.md- Environment setupdocs/architecture.md- Technical detailsdocs/vercel-og-integration.md- Vercel integration
For detailed setup and deployment instructions, see the docs folder.
Languages
Rust
98.6%
Dockerfile
1.4%