Skip to content

Bound persistent Git repository storage - #134

Closed
LIghtJUNction wants to merge 1 commit into
mainfrom
codex/propose-fix-for-git-storage-quota-issue
Closed

LIghtJUNction wants to merge 1 commit into
mainfrom
codex/propose-fix-for-git-storage-quota-issue

Conversation

@LIghtJUNction

Copy link
Copy Markdown
Contributor

Motivation

  • The public Git hosting implementation only enforced per-blob and per-request limits and allowed unaudited repository creation, enabling remote exhaustion of the co-located filesystem and denial of service.
  • The change's intent is to bound durable Git storage with conservative global, per-repository, and per-identity quotas and to enforce those quotas atomically before accepting updates.

Description

  • Add configurable repository quotas to src/msgd/config.py, including repository-count, per-identity counts, per-repo/per-identity/global byte limits, and object/count limits.
  • Serialize repository creation and quota checks in src/msgd/gitrepos.py by acquiring a .quota.lock, enforcing repository-count and per-identity creation limits, and recording a msgd-owner for newly created repositories.
  • Replace the simple per-blob pre-receive check with a hook that inspects all incoming objects and rejects pushes that exceed per-object, per-push object-count, per-repository bytes, per-identity bytes, global bytes, or total object-count limits, and compute repository/identity/global usage under a lock to avoid race conditions.
  • Wire SSH push handling to pass the authenticated owner id to ensure_repository, update deployment defaults in deploy/etc/msg-lmm-best/msg.conf, document quotas in src/msgd/render.py, and add regression tests in tests/test_gitrepos.py for per-identity creation limits and cumulative growth rejection.

Testing

  • ✅ Ran formatter and linter checks with uv run ruff format --check . and uv run ruff check . which passed.
  • ✅ Ran the focused Git repo tests with uv run python -m unittest -v tests.test_gitrepos and the added tests passed.
  • ✅ Ran the full test suite with uv run python -m unittest discover -s tests -v which completed successfully with 147 passed, 1 skipped.

Codex Task

Copilot AI lite review requested due to automatic review settings September 28, 2026 11:43

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-09-28T11:52:42.403885Z c222af3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@LIghtJUNction

Copy link
Copy Markdown
Contributor Author

已被 #143 取代,关闭。旧补丁打在已删除的 src/msgd 上;现行 src/msg 的对应容量上限在分支 fix/capacity-recovery-20260928(head e77b53b),该分支已包含合并后的 #142。

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants