Mondo Diaz
ee14dbe878
Remove unused imports
...
- routes.py: Remove unused re, hashlib, ArtifactResponse imports
- storage.py: Remove unused ABC, abstractmethod imports (using Protocol instead)
2026-01-05 15:47:22 -06:00
Mondo Diaz
af66fd5845
Add security fixes: SHA256 hash validation and streaming file size enforcement
...
- Add field_validator to ResumableUploadInitRequest to validate expected_hash
is a valid 64-character lowercase hex SHA256 hash (normalizes to lowercase)
- Add FileSizeExceededError exception for file size limit violations
- Enforce file size limits in storage layer during streaming (prevents
Content-Length header spoofing)
- Add FileSizeExceededError handler in upload endpoint returning HTTP 413
- Add node_modules and frontend/dist to .gitignore
2026-01-05 15:43:19 -06:00
Mondo Diaz
e215ecabcd
Add S3 configuration options and improved error handling
...
- Add s3_verify_ssl config option for SSL/TLS verification
- Add s3_connect_timeout and s3_read_timeout config options
- Add s3_max_retries config option with adaptive retry mode
- Add S3StorageUnavailableError for backend availability issues
- Add HashCollisionError for detecting extremely rare hash collisions
- Add hash collision detection by comparing file sizes on dedup
- Handle network interruption and timeout errors explicitly
- Update routes.py to handle new exception types with appropriate HTTP codes
2026-01-05 14:46:18 -06:00
Mondo Diaz
109677e43a
Add storage abstraction, stats endpoints, garbage collection, and test infrastructure
...
- Add StorageBackend protocol for backend-agnostic storage interface
- Add health check with storage and database connectivity verification
- Add garbage collection endpoints for orphaned artifacts (ref_count=0)
- Add deduplication statistics endpoints (/api/v1/stats, /stats/storage, /stats/deduplication)
- Add per-project statistics endpoint
- Add verify_integrity method for post-upload hash validation
- Set up pytest infrastructure with mock S3 client
- Add unit tests for hash calculation and duplicate detection
2026-01-05 11:16:46 -06:00
Mondo Diaz
865812af98
Add ref_count management for deletions with atomic operations and error handling
...
- Add DELETE endpoints for tags, packages, and projects with proper ref_count
decrements for all affected artifacts
- Implement atomic ref_count operations using SELECT FOR UPDATE row-level locking
to prevent race conditions
- Add custom storage exceptions (HashComputationError, S3ExistenceCheckError,
S3UploadError) with retry logic for S3 existence checks
- Handle race conditions in upload by locking artifact row before modification
- Add comprehensive logging for all ref_count changes and deduplication events
- Include ref_count in upload response schema
2026-01-05 10:04:59 -06:00
Mondo Diaz
2df97ae94a
Add presigned URL support for direct S3 downloads ( #48 )
2025-12-15 16:06:51 -06:00
Mondo Diaz
3fd2747ae4
Store SHA256 checksums with artifacts and add multiple hash support
2025-12-15 14:47:30 -06:00
Mondo Diaz
c119ab4a04
Implement backend upload/download API enhancements
2025-12-11 18:05:08 -06:00
Mondo Diaz
2261bfc830
Rewrite from Go + vanilla JS to Python (FastAPI) + React (TypeScript)
...
- Backend: Python 3.12 with FastAPI, SQLAlchemy, boto3
- Frontend: React 18 with TypeScript, Vite build tooling
- Updated Dockerfile for multi-stage Node + Python build
- Updated CI pipeline for Python backend
- Removed old Go code (cmd/, internal/, go.mod, go.sum)
- Updated README with new tech stack documentation
2025-12-05 17:16:43 -06:00