buds 4 and 6 implemented

This commit is contained in:
Your Name
2025-09-03 13:13:07 -04:00
parent 5838dc4dfc
commit d845f7822f
14 changed files with 14114 additions and 655 deletions

View File

@@ -88,15 +88,43 @@ This document tracks the implementation status of ginxsom, a high-performance Fa
## BUD-03: Server List (User Server Lists) ⚪ **FOR CLIENTS, NOT SERVERS**
## BUD-04: Blob Mirroring **PARTIAL**
## BUD-04: Blob Mirroring **COMPLETE**
### Current Status
### HTTP Client Implementation
- [x] CURL library integration and HTTP client functions
- [x] `write_callback()` - Download response data with dynamic buffering
- [x] `header_callback()` - Extract Content-Type headers
- [x] `download_blob_from_url()` - Complete HTTP download with security controls
- [x] Memory management and error handling
### PUT /mirror Endpoint
- [x] nginx endpoint configured (`PUT /mirror`)
- [x] FastCGI routing established
- [ ] URL downloading implementation
- [ ] Hash verification after download
- [ ] Authorization handling for mirroring
- [ ] Inter-server mirroring testing
- [x] FastCGI routing and request handling
- [x] JSON request body parsing (extract `url` field)
- [x] URL validation and security checks (HTTPS-only, SSRF protection)
- [x] Remote blob downloading with CURL
- [x] SHA-256 hash calculation and verification
- [x] Content-Type detection (headers, URL extension, file signature)
- [x] File storage with proper extensions (.png, .jpg, etc.)
- [x] Database metadata storage
- [x] Blob descriptor JSON response
### Security Features
- [x] HTTPS-only URL validation (no HTTP allowed)
- [x] SSRF protection (blocks localhost, private IPs: 127.x, 192.168.x, 10.x, 172.16-31.x)
- [x] File size limits (100MB maximum)
- [x] Request timeouts (30s total, 10s connect)
- [x] SSL certificate verification
- [x] Authorization hash verification (when provided)
### Testing Status
- [x] Mirror request with valid HTTPS URL (HTTP 200)
- [x] Hash verification against downloaded content
- [x] Content-Type detection from PNG file
- [x] File accessibility after mirroring
- [x] HEAD request metadata retrieval
- [x] Error handling for invalid URLs
- [x] Security validation (private IP blocking)
---
@@ -112,24 +140,24 @@ This document tracks the implementation status of ginxsom, a high-performance Fa
---
## BUD-06: Upload Requirements **NOT IMPLEMENTED**
## BUD-06: Upload Requirements **COMPLETE**
### HEAD /upload Pre-flight Validation
- [ ] `HEAD /upload` endpoint implementation
- [ ] Client header parsing (X-SHA-256, X-Content-Length, X-Content-Type)
- [ ] Pre-flight validation without file transfer:
- [ ] SHA-256 format validation
- [ ] File size limit checking
- [ ] MIME type restrictions
- [ ] Authentication validation
- [ ] Duplicate detection
- [ ] Banned hash checking
- [ ] Proper HTTP status codes (200, 400, 401, 403, 411, 413, 415)
- [ ] X-Reason headers for error messages
- [x] `HEAD /upload` endpoint implementation
- [x] Client header parsing (X-SHA-256, X-Content-Length, X-Content-Type)
- [x] Pre-flight validation without file transfer:
- [x] SHA-256 format validation
- [x] File size limit checking (100MB default)
- [ ] MIME type restrictions (policy 415 not enforced yet)
- [x] Authentication validation (optional via rules system)
- [x] Duplicate detection (policy configurable)
- [x] Banned hash checking (via rules engine)
- [x] Proper HTTP status codes (200, 400, 401, 409, 411, 413; 415 reserved for future MIME policy)
- [x] X-Reason headers for error messages
### Upload Policy Configuration
- [ ] Server configuration system
- [ ] Maximum file size limits
- [ ] Maximum file size limits (currently hard limit in code; move to config)
- [ ] Allowed MIME type restrictions
- [ ] Rate limiting implementation
- [ ] DOS protection benefits