mirror of
https://github.com/go-gitea/gitea.git
synced 2026-07-23 05:17:29 +02:00
Merge branch 'limit-repo-size' of https://github.com/DmitryFrolovTri/gitea into limit-repo-size
This commit is contained in:
+19
-16
@@ -23,15 +23,16 @@ var Indexer = struct {
|
||||
IssueIndexerName string
|
||||
StartupTimeout time.Duration
|
||||
|
||||
RepoIndexerEnabled bool
|
||||
RepoType string
|
||||
RepoPath string
|
||||
RepoConnStr string
|
||||
RepoIndexerName string
|
||||
MaxIndexerFileSize int64
|
||||
IncludePatterns []glob.Glob
|
||||
ExcludePatterns []glob.Glob
|
||||
ExcludeVendored bool
|
||||
RepoIndexerEnabled bool
|
||||
RepoIndexerRepoTypes []string
|
||||
RepoType string
|
||||
RepoPath string
|
||||
RepoConnStr string
|
||||
RepoIndexerName string
|
||||
MaxIndexerFileSize int64
|
||||
IncludePatterns []glob.Glob
|
||||
ExcludePatterns []glob.Glob
|
||||
ExcludeVendored bool
|
||||
}{
|
||||
IssueType: "bleve",
|
||||
IssuePath: "indexers/issues.bleve",
|
||||
@@ -39,13 +40,14 @@ var Indexer = struct {
|
||||
IssueConnAuth: "",
|
||||
IssueIndexerName: "gitea_issues",
|
||||
|
||||
RepoIndexerEnabled: false,
|
||||
RepoType: "bleve",
|
||||
RepoPath: "indexers/repos.bleve",
|
||||
RepoConnStr: "",
|
||||
RepoIndexerName: "gitea_codes",
|
||||
MaxIndexerFileSize: 1024 * 1024,
|
||||
ExcludeVendored: true,
|
||||
RepoIndexerEnabled: false,
|
||||
RepoIndexerRepoTypes: []string{"sources", "forks", "mirrors", "templates"},
|
||||
RepoType: "bleve",
|
||||
RepoPath: "indexers/repos.bleve",
|
||||
RepoConnStr: "",
|
||||
RepoIndexerName: "gitea_codes",
|
||||
MaxIndexerFileSize: 1024 * 1024,
|
||||
ExcludeVendored: true,
|
||||
}
|
||||
|
||||
func loadIndexerFrom(rootCfg ConfigProvider) {
|
||||
@@ -71,6 +73,7 @@ func loadIndexerFrom(rootCfg ConfigProvider) {
|
||||
Indexer.IssueIndexerName = sec.Key("ISSUE_INDEXER_NAME").MustString(Indexer.IssueIndexerName)
|
||||
|
||||
Indexer.RepoIndexerEnabled = sec.Key("REPO_INDEXER_ENABLED").MustBool(false)
|
||||
Indexer.RepoIndexerRepoTypes = strings.Split(sec.Key("REPO_INDEXER_REPO_TYPES").MustString("sources,forks,mirrors,templates"), ",")
|
||||
Indexer.RepoType = sec.Key("REPO_INDEXER_TYPE").MustString("bleve")
|
||||
Indexer.RepoPath = filepath.ToSlash(sec.Key("REPO_INDEXER_PATH").MustString(filepath.ToSlash(filepath.Join(AppDataPath, "indexers/repos.bleve"))))
|
||||
if !filepath.IsAbs(Indexer.RepoPath) {
|
||||
|
||||
@@ -92,6 +92,7 @@ var (
|
||||
// Issue Setting
|
||||
Issue struct {
|
||||
LockReasons []string
|
||||
MaxPinned int
|
||||
} `ini:"repository.issue"`
|
||||
|
||||
Release struct {
|
||||
@@ -229,8 +230,10 @@ var (
|
||||
// Issue settings
|
||||
Issue: struct {
|
||||
LockReasons []string
|
||||
MaxPinned int
|
||||
}{
|
||||
LockReasons: strings.Split("Too heated,Off-topic,Spam,Resolved", ","),
|
||||
MaxPinned: 3,
|
||||
},
|
||||
|
||||
Release: struct {
|
||||
|
||||
@@ -251,7 +251,13 @@ func loadRunModeFrom(rootCfg ConfigProvider) {
|
||||
if RunMode == "" {
|
||||
RunMode = rootSec.Key("RUN_MODE").MustString("prod")
|
||||
}
|
||||
IsProd = strings.EqualFold(RunMode, "prod")
|
||||
|
||||
// non-dev mode is treated as prod mode, to protect users from accidentally running in dev mode if there is a typo in this value.
|
||||
RunMode = strings.ToLower(RunMode)
|
||||
if RunMode != "dev" {
|
||||
RunMode = "prod"
|
||||
}
|
||||
IsProd = RunMode != "dev"
|
||||
|
||||
// check if we run as root
|
||||
if os.Getuid() == 0 {
|
||||
|
||||
Reference in New Issue
Block a user