#1575 Limit repo creation

This commit is contained in:
Unknwon 2015-12-10 12:37:53 -05:00
parent c6083c335e
commit 2a0bb1fa90
15 changed files with 73 additions and 14 deletions

View file

@ -31,6 +31,7 @@ type AdminEditUserForm struct {
Password string `binding:"MaxSize(255)"`
Website string `binding:"MaxSize(50)"`
Location string `binding:"MaxSize(50)"`
MaxRepoCreation int
Active bool
Admin bool
AllowGitHook bool

File diff suppressed because one or more lines are too long

View file

@ -98,6 +98,7 @@ var (
Repository struct {
AnsiCharset string
ForcePrivate bool
MaxCreationLimit int
PullRequestQueueLength int
}
RepoRootPath string
@ -379,9 +380,9 @@ func NewContext() {
RepoRootPath = path.Clean(RepoRootPath)
}
ScriptType = sec.Key("SCRIPT_TYPE").MustString("bash")
Repository.AnsiCharset = sec.Key("ANSI_CHARSET").String()
Repository.ForcePrivate = sec.Key("FORCE_PRIVATE").MustBool()
Repository.PullRequestQueueLength = sec.Key("PULL_REQUEST_QUEUE_LENGTH").MustInt(10000)
if err = Cfg.Section("repository").MapTo(&Repository); err != nil {
log.Fatal(4, "Fail to map Repository settings: %v", err)
}
// UI settings.
sec = Cfg.Section("ui")