aboutsummaryrefslogtreecommitdiffstats
path: root/modules/setting
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-05-08 23:51:50 +0800
committerGitHub <noreply@github.com>2022-05-08 17:51:50 +0200
commitd4834071da9ce010fd4677ef339c598dd23dc130 (patch)
treeee6692b9b44e259d79158c2dc2b867d8f3286630 /modules/setting
parent6a969681cd862bf153fa7921485278be1e8a092a (diff)
downloadgitea-d4834071da9ce010fd4677ef339c598dd23dc130.tar.gz
gitea-d4834071da9ce010fd4677ef339c598dd23dc130.zip
Repository level enable package or disable (#19323)
Diffstat (limited to 'modules/setting')
-rw-r--r--modules/setting/repository.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/setting/repository.go b/modules/setting/repository.go
index 96b37f6980..f24bc841d6 100644
--- a/modules/setting/repository.go
+++ b/modules/setting/repository.go
@@ -295,6 +295,10 @@ func newRepository() {
log.Fatal("Failed to map Repository.PullRequest settings: %v", err)
}
+ if !Cfg.Section("packages").Key("ENABLED").MustBool(false) {
+ Repository.DisabledRepoUnits = append(Repository.DisabledRepoUnits, "repo.packages")
+ }
+
// Handle default trustmodel settings
Repository.Signing.DefaultTrustModel = strings.ToLower(strings.TrimSpace(Repository.Signing.DefaultTrustModel))
if Repository.Signing.DefaultTrustModel == "default" {