Add MinIO primary storage with backend markers - #36
Conversation
Introduces a shared S3 object-store layer with MinIO as primary and Cloudflare R2 as fallback, including startup bucket bootstrap, health-based presign routing, write fallback, and per-object backend markers in DB (artifacts, log archives, and workspace logos). Updates artifact/log/logo flows, janitor cleanup, and download/presign paths to route by stored backend so mixed-host storage works safely. Also adds session idle-timeout enforcement/config, stronger webhook secret validation, and request tracing that logs method+path only to avoid query-secret leakage.
✅ Deploy Preview for overup-app ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (32)
📝 WalkthroughWalkthroughThe change adds MinIO as the primary object store with R2 fallback, introduces per-object backend markers, routes artifact, log, and logo operations through shared storage abstractions, adds bucket bootstrap and local MinIO setup, and enforces configurable session idle expiration. ChangesStorage routing and session hardening
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant Runner
participant Backend
participant Storage
participant Database
participant ObjectStore
Runner->>Backend: request artifact upload
Backend->>Storage: select upload backend
Storage->>ObjectStore: create presigned PUT URL
Backend->>Database: save pending key and backend marker
Runner->>ObjectStore: upload artifact
Runner->>Backend: complete upload
Backend->>Database: load pending artifact
Backend->>ObjectStore: verify object size using stored backend
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
There was a problem hiding this comment.
Summary
This PR successfully introduces MinIO as a primary storage backend with Cloudflare R2 as fallback, along with important security improvements. The implementation is well-structured with proper separation of concerns.
Key Changes Reviewed
- Storage Layer: New generic S3-compatible storage abstraction supporting MinIO (primary) and R2 (fallback) with per-object backend markers in the database
- Security Enhancements:
- Webhook secret validation (minimum 16 bytes)
- Session idle timeout enforcement with configurable timeout
- Request tracing sanitization to prevent query parameter logging (prevents OAuth codes and session tickets from appearing in logs)
- Infrastructure: MinIO configuration with endpoint validation, automatic bucket creation, and health-based failover routing
Architecture Assessment
The storage abstraction is well-designed with:
- Health-based routing for presigned upload grants
- Reactive fallback for server-side writes
- Per-object backend markers ensuring operations route to the correct storage
- Proper handling of legacy data (R2 as default for unmarked objects)
Security Posture
✅ No critical security issues identified
- Proper credential handling (never logged)
- Strong webhook secret validation added
- Query string sanitization in request logs
- Session idle timeout adds defense against stolen tokens
- MinIO endpoint validation with TLS warnings for non-loopback HTTP
The implementation follows security best practices and maintains backward compatibility with existing R2-only deployments.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
Introduces a shared S3 object-store layer with MinIO as primary and Cloudflare R2 as fallback, including startup bucket bootstrap, health-based presign routing, write fallback, and per-object backend markers in DB (artifacts, log archives, and workspace logos). Updates artifact/log/logo flows, janitor cleanup, and download/presign paths to route by stored backend so mixed-host storage works safely. Also adds session idle-timeout enforcement/config, stronger webhook secret validation, and request tracing that logs method+path only to avoid query-secret leakage.
Summary by CodeRabbit
New Features
Security