{{ message }}
feat: Add user quota management system#5658
Draft
jondkelley wants to merge 3 commits into
Draft
Conversation
Introduces comprehensive quota management with real-time usage tracking, frontend components, backend API endpoints, and TUS upload integration for storage limit enforcement.
Author
Member
|
Just wanna say that this is quite a large PR, so it may take longer to take a look at. |
|
Nice PR ! |
Member
|
@jondkelley I really want to look at this, but now I see there's quite a few conflicts. If you have time, could you rebase it? |
Member
|
Over the past months, I've realized I don't have enough time to review new features, especially quite large ones. Sadly, I need to mark this PR. Read more on https://hacdias.com/2026/03/11/filebrowser/ |
Author
|
Just had a newborn child, so will have to revisit this. I also don't have time for this at the moment. We're using this branch in production though, seems worthwhile to add at some point. |
Member
kumaraguru1735
added a commit
to kumaraguru1735/filebrowser-laravel
that referenced
this pull request
Mar 31, 2026
Bug fixes: - filebrowser#5627: Skip inaccessible subfolders in directory listing (was 500) - filebrowser#5294: Cap text editor content at 5MB (prevents memory exhaustion DoS) - filebrowser#5683: Allow copy/move TO root directory (was blocked) - filebrowser#5835: Share creation requires both share AND download permissions - filebrowser#5834: Reject negative/zero TUS Upload-Length, add 10GB sanity cap - filebrowser#5239: Block sharing root directory (too broad, accidental exposure) - filebrowser#5216: Validate JWT signature on token renewal - filebrowser#2078: Support BMP thumbnails, skip GIF resize (preserve animation) - filebrowser#5306: Normalize paths in copy/rename (strip trailing slashes) Ported PRs: - filebrowser#5876: Reject negative TUS upload-length - filebrowser#5875: Check download perm when sharing - filebrowser#5873: Deep conflict resolution — merge dirs, preserve non-conflicting - filebrowser#5832: Optional directory sizes via ?dirSizes=true param - filebrowser#5658: User quota management — configurable quota_resolver callback Config additions: - quota_resolver: callable for per-user disk quotas - max_content_size: cap for text editor loading (default 5MB) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.


Description
Introduces comprehensive quota management with real-time usage tracking, frontend components, backend API endpoints, and TUS upload integration for storage limit enforcement.
Additional Information
This PR implements a complete quota management system with the following technical approach:
Backend Architecture:
users/users.go):QuotaLimit(bytes),QuotaUnit(GB/TB),EnforceQuota(hard/soft limit), andQuotaUsed(calculated on-demand)users/quota.go) that walk the user's directory tree to sum file sizes, with 30-second timeout protectionhttp/quota.go) that intercepts file upload/update operations and validates against quotas before processinghttp/resource.go) for POST and PUT operationsGET /api/users/{id}/quotafor real-time usage trackingTUS Upload Integration:
http/quota.goto extract file size from bothUpload-Lengthheader (TUS protocol) andContent-Lengthheaderfrontend/src/api/tus.ts) to handle 413 status codes, disable retries on quota exceeded, and display quota information from response headersFrontend Components:
QuotaInput.vuefor admin configuration with unit selection (GB/TB) and enforcement toggleQuotaUsage.vuewith color-coded progress bar (green <80%, yellow 80-95%, red >95%) and warning messagesCLI Support:
cmd/users.go,cmd/users_add.go,cmd/users_update.go) with--quota.limit,--quota.unit, and--quota.enforceflagssettings/defaults.goEnforcement Modes:
Design Decisions:
X-Quota-Limit,X-Quota-Used) provide detailed feedback on quota exceeded errorsError Handling:
ErrQuotaExceededandErrInvalidQuotaUniterrorsChecklist
Before submitting your PR, please indicate which issues are either fixed or closed by this PR. See GitHub Help: Closing issues using keywords.
Closes #2090
Closes #711
Addresses #1214
masterbranch.Explanation: