mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-06 17:26:07 +00:00
feat(repo): split repository creation limit into user and org scopes (#37872)
## Background `MAX_CREATION_LIMIT` applies to whoever owns a new repository, with no distinction between individual users and organizations. Admins who want different limits for the two - most commonly "block personal repos but let orgs create freely" - currently have to set per-user / per-org overrides on every entity. ## Changes Adds two new `[repository]` settings: - `USER_MAX_CREATION_LIMIT`: global limit for individual users - `ORG_MAX_CREATION_LIMIT`: global limit for organizations `MAX_CREATION_LIMIT` is kept as a shortcut: when set, it becomes the default value for both new keys. When the new keys are explicitly configured, they take precedence. Deployments that only set `MAX_CREATION_LIMIT` see behavior identical to now. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
@@ -1024,9 +1024,18 @@ LEVEL = Info
|
||||
;; Default private when using push-to-create
|
||||
;DEFAULT_PUSH_CREATE_PRIVATE = true
|
||||
;;
|
||||
;; Global limit of repositories per user, applied at creation time. -1 means no limit
|
||||
;; Global limit of repositories per user or org, applied at creation time. -1 means no limit
|
||||
;; To configure independent limits for users and orgs, use USER_MAX_CREATION_LIMIT and ORG_MAX_CREATION_LIMIT
|
||||
;MAX_CREATION_LIMIT = -1
|
||||
;;
|
||||
;; Global limit of repositories per user, applied at creation time. -1 means no limit
|
||||
;; Takes precedence over MAX_CREATION_LIMIT when set
|
||||
;USER_MAX_CREATION_LIMIT = -1
|
||||
;;
|
||||
;; Global limit of repositories per organization, applied at creation time. -1 means no limit
|
||||
;; Takes precedence over MAX_CREATION_LIMIT when set
|
||||
;ORG_MAX_CREATION_LIMIT = -1
|
||||
;;
|
||||
;; Preferred Licenses to place at the top of the List
|
||||
;; The name here must match the filename in options/license or custom/options/license
|
||||
;PREFERRED_LICENSES = Apache License 2.0,MIT License
|
||||
|
||||
Reference in New Issue
Block a user