Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuring per-user limits on upload size. #385

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Half-Shot
Copy link
Contributor

I believe the spec allows for this by making this endpoint authenticated. The need for this feature is to support lowering the media uploads allowed by bridge users while retaining a higher limit for native Matrix users.

@@ -33,3 +33,19 @@ func IsUserWithinQuota(ctx rcontext.RequestContext, userId string) (bool, error)

return true, nil // no rules == no quota
}

func GetUserUploadMaxSizeBytes(ctx rcontext.RequestContext, userId string) int64 {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could probably easily go in upload/upload.go, but got lazy. Shout if this function needs moving.

@turt2live
Copy link
Member

Competing PR: #332

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

Successfully merging this pull request may close these issues.

2 participants