feat(proxy): add PROXY_USERS_DEFAULT_QUOTA for personal spaces#2895
Open
flash7777 wants to merge 1 commit into
Open
feat(proxy): add PROXY_USERS_DEFAULT_QUOTA for personal spaces#2895flash7777 wants to merge 1 commit into
flash7777 wants to merge 1 commit into
Conversation
When a new user logs in and their personal space is created, the quota was only set if a role-specific quota was configured via role_quotas. Without that, personal spaces got unlimited quota by default. This adds a new PROXY_USERS_DEFAULT_QUOTA environment variable that serves as a fallback when no role-specific quota is configured. Setting it to e.g. 1000000000 (1GB) ensures all new personal spaces get a sensible default quota, preventing individual users from filling up the entire storage volume. A value of 0 (default) preserves the existing behavior (unlimited). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | -21 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PROXY_USERS_DEFAULT_QUOTAenvironment variable (config:default_users_quota) that sets a default quota in bytes for newly created personal spacesrole_quotas0(default) preserves the existing behavior (unlimited quota)Motivation
Currently, personal spaces are created without any quota unless a role-specific quota mapping is configured. This means that by default, every user gets unlimited storage on their personal space. On systems with limited storage (e.g. a 100GB volume), a single user can fill the entire disk -- which is what happened on our production system, causing a full outage.
The existing
GRAPH_SPACES_DEFAULT_QUOTAonly applies to project spaces created via the Graph API. There was no equivalent for personal spaces created during user login.Usage
Or in
proxy.yaml:Changes
services/proxy/pkg/config/config.goDefaultUsersQuotawith envPROXY_USERS_DEFAULT_QUOTAservices/proxy/pkg/middleware/options.goservices/proxy/pkg/middleware/create_home.godefaultUsersQuotawhen no role quota matchesservices/proxy/pkg/command/server.goTest plan
PROXY_USERS_DEFAULT_QUOTA=1000000000and create a new user -- personal space should have 1GB quotaWith support of Claude Code