Skip to content

Add MinIO primary storage with backend markers - #36

Merged
BotCoder254 merged 1 commit into
mainfrom
feat/log-chunk-sections
Jul 16, 2026
Merged

Add MinIO primary storage with backend markers#36
BotCoder254 merged 1 commit into
mainfrom
feat/log-chunk-sections

Conversation

@BotCoder254

@BotCoder254 BotCoder254 commented Jul 16, 2026

Copy link
Copy Markdown
Owner

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

    • Added MinIO support as the default object-storage backend, with Cloudflare R2 fallback.
    • Improved artifact, log archive, and workspace logo handling across multiple storage backends.
    • Added automatic MinIO bucket setup during startup.
    • Added configurable session idle timeouts alongside existing session expiration.
  • Security

    • Strengthened webhook secret validation.
    • Reduced sensitive data exposure in request tracing by excluding query strings.

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.
@netlify

netlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploy Preview for overup-app ready!

Name Link
🔨 Latest commit 4848348
🔍 Latest deploy log https://app.netlify.com/projects/overup-app/deploys/6a5929952aff970008cfaff5
😎 Deploy Preview https://deploy-preview-36--overup-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel

vercel Bot commented Jul 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
overup Ready Ready Preview, Comment Jul 16, 2026 6:57pm

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 049bbba6-4607-451f-b402-95327ee96d5e

📥 Commits

Reviewing files that changed from the base of the PR and between eeac578 and 4848348.

📒 Files selected for processing (32)
  • CLAUDE.md
  • backend/.env.example
  • backend/migrations/20260716100001_storage_backend_markers.sql
  • backend/src/config.rs
  • backend/src/db/artifacts.rs
  • backend/src/db/pipeline_jobs.rs
  • backend/src/db/sessions.rs
  • backend/src/db/users.rs
  • backend/src/db/workspaces.rs
  • backend/src/handlers/artifacts.rs
  • backend/src/handlers/dashboard_ws.rs
  • backend/src/handlers/github_installations.rs
  • backend/src/handlers/jobs.rs
  • backend/src/handlers/me.rs
  • backend/src/handlers/pipelines.rs
  • backend/src/handlers/runner_ws.rs
  • backend/src/handlers/sessions.rs
  • backend/src/handlers/workspaces.rs
  • backend/src/main.rs
  • backend/src/middleware/auth.rs
  • backend/src/models/artifact.rs
  • backend/src/models/pipeline.rs
  • backend/src/models/workspace.rs
  • backend/src/routes/mod.rs
  • backend/src/services/janitor.rs
  • backend/src/services/log_archive.rs
  • backend/src/services/minio.rs
  • backend/src/services/mod.rs
  • backend/src/services/object_store.rs
  • backend/src/services/r2.rs
  • backend/src/state.rs
  • docker-compose.yml

📝 Walkthrough

Walkthrough

The 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.

Changes

Storage routing and session hardening

Layer / File(s) Summary
Configuration, schema, and session contracts
CLAUDE.md, backend/.env.example, backend/config.rs, backend/migrations/*, backend/src/db/sessions.rs, backend/src/handlers/{dashboard_ws,github_installations,sessions}.rs, backend/src/middleware/auth.rs, backend/src/routes/mod.rs
MinIO configuration, session idle timeout handling, backend marker columns, session query changes, authentication wiring, and query-string-free tracing spans are added.
Shared object-storage construction and routing
backend/src/services/{object_store,minio,r2,mod}.rs, backend/src/state.rs, backend/src/main.rs, docker-compose.yml
A shared S3Store and Storage router support MinIO primary, R2 fallback, marker-based routing, presigned operations, health checks, and MinIO bucket bootstrap.
Backend-aware artifact upload and cleanup
backend/src/db/artifacts.rs, backend/src/handlers/{artifacts,pipelines,runner_ws}.rs, backend/src/services/janitor.rs, backend/src/models/artifact.rs
Artifact uploads persist their selected backend, completion checks use the pending marker, downloads presign against the marked store, and cleanup routes deletions per artifact.
Backend-aware log archival and pruning
backend/src/db/pipeline_jobs.rs, backend/src/models/pipeline.rs, backend/src/services/log_archive.rs, backend/src/handlers/pipelines.rs, backend/src/services/janitor.rs
Archived logs record their storage backend, archive writes use Storage, archived-log redirects select the recorded backend, and hot-log pruning requires configured object storage.
Backend-aware workspace logo lifecycle
backend/src/db/{users,workspaces}.rs, backend/src/handlers/{me,workspaces}.rs, backend/src/models/workspace.rs
Workspace logo records store backend markers, presigned URLs target the correct store, and replacement or account deletion cleans up objects using their recorded backend.

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
Loading

Note

🎁 Summarized by CodeRabbit Free

Your 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 @coderabbitai help to get the list of available commands.

@BotCoder254
BotCoder254 merged commit 2bd5750 into main Jul 16, 2026
7 of 8 checks passed

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.


⚠️ This PR contains more than 30 files. Amazon Q is better at reviewing smaller PRs, and may miss issues in larger changesets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant