Untone b795f76d54
Some checks failed
Deploy quoter / deploy (push) Failing after 5m59s
[0.6.11] - 2025-10-05
### 🐛 FIX: Double Extension in Uploaded Files
- ** Исправлена критическая ошибка upload**: `filename.png.png` → `filename.png`
  - **Проблема**: `generate_key_with_extension()` добавляла расширение к уже существующему
  - **Следствие**: Файлы не находились в S3 (404), т.к. путь в Redis был неправильный
  - **Решение**: Убираем существующее расширение перед добавлением нового
  - **Файлы**: `quoter/src/s3_utils.rs` строки 77-81
  - **Note**: Upload **уже загружает в Storj**, не в AWS (это правильно!)

### 🔧 FIX: Duplicate Nginx Upstream Error
- ** Исправлен nginx конфиг**: Убрано дублирование `upstream quoter-8080`
  - **Проблема**: `nginx: [emerg] duplicate upstream "quoter-8080"`
  - **Причина**: upstream определялся дважды - в цикле и после него
  - **Решение**: Вынесли `{{ end }}` раньше, чтобы upstream создавался только один раз
  - **Файлы**: `nginx.conf.sigil` строка 148
  - 🚀 Деплой успешен, CDN работает стабильно

### 🔧 FIX: Nginx 413 Content Too Large
- ** Создан `nginx.conf.sigil` для Dokku**: Увеличены лимиты для больших файлов
  - `client_max_body_size 500M` (было: 1M default)
  - `client_body_timeout 300s` (5 минут для больших файлов)
  - `proxy_request_buffering off` (не буферим в Nginx, стримим напрямую)
  - `proxy_buffering off` (экономия памяти)
  - Увеличены timeouts: connect/send/read до 300s
  - Решает 413 ошибку при загрузке файлов >1MB на v3.dscrs.site
2025-10-05 13:03:32 +03:00
2025-09-02 09:09:34 +03:00
2025-08-12 15:59:51 +03:00
2025-10-05 10:46:25 +03:00
2025-09-30 21:46:47 +03:00
2025-10-05 09:12:53 +03:00
2025-09-01 22:52:33 +03:00
2025-08-12 15:59:51 +03:00
2025-10-05 13:03:32 +03:00
2025-09-22 09:32:45 +03:00
2025-08-02 00:18:09 +03:00
2025-09-30 21:46:47 +03:00

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_KEY=your-secret  # Должен совпадать с @core

# Optional
PORT=8080
RUST_LOG=info

🧪 Testing

cargo test  # 36 tests passing
./scripts/test-coverage.sh  # Coverage report

📚 Documentation

For detailed setup and deployment instructions, see the docs folder.

Description
quota guarded uploader and thumbs generator for progressive image load
Readme MIT 1.2 MiB
Languages
Rust 98.6%
Dockerfile 1.4%