diff options
author | Kyle D <kdumontnu@gmail.com> | 2021-04-15 10:53:57 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-15 18:53:57 +0200 |
commit | f44543a1bb776fa8bdfd3b605d67197d1466eb20 (patch) | |
tree | b9a014285b40c3eb45dd90bcafa7ccc17c1031d8 /modules | |
parent | af2adb4e35ea71ca5c7fbb1e51b9d25fe49af2e4 (diff) | |
download | gitea-f44543a1bb776fa8bdfd3b605d67197d1466eb20.tar.gz gitea-f44543a1bb776fa8bdfd3b605d67197d1466eb20.zip |
Disable Stars config option (#14653)
* Add config option to disable stars
* Replace "stars" with watched in user profile
* Add documentation
Diffstat (limited to 'modules')
-rw-r--r-- | modules/context/context.go | 1 | ||||
-rw-r--r-- | modules/setting/repository.go | 2 | ||||
-rw-r--r-- | modules/structs/settings.go | 1 |
3 files changed, 4 insertions, 0 deletions
diff --git a/modules/context/context.go b/modules/context/context.go index b876487d5e..523499aa61 100644 --- a/modules/context/context.go +++ b/modules/context/context.go @@ -704,6 +704,7 @@ func Contexter() func(next http.Handler) http.Handler { ctx.Data["EnableSwagger"] = setting.API.EnableSwagger ctx.Data["EnableOpenIDSignIn"] = setting.Service.EnableOpenIDSignIn ctx.Data["DisableMigrations"] = setting.Repository.DisableMigrations + ctx.Data["DisableStars"] = setting.Repository.DisableStars ctx.Data["ManifestData"] = setting.ManifestData diff --git a/modules/setting/repository.go b/modules/setting/repository.go index 139512bf00..a6fc73651a 100644 --- a/modules/setting/repository.go +++ b/modules/setting/repository.go @@ -43,6 +43,7 @@ var ( PrefixArchiveFiles bool DisableMirrors bool DisableMigrations bool + DisableStars bool `ini:"DISABLE_STARS"` DefaultBranch string AllowAdoptionOfUnadoptedRepositories bool AllowDeleteOfUnadoptedRepositories bool @@ -154,6 +155,7 @@ var ( PrefixArchiveFiles: true, DisableMirrors: false, DisableMigrations: false, + DisableStars: false, DefaultBranch: "master", // Repository editor settings diff --git a/modules/structs/settings.go b/modules/structs/settings.go index e15c750356..842b12792d 100644 --- a/modules/structs/settings.go +++ b/modules/structs/settings.go @@ -9,6 +9,7 @@ type GeneralRepoSettings struct { MirrorsDisabled bool `json:"mirrors_disabled"` HTTPGitDisabled bool `json:"http_git_disabled"` MigrationsDisabled bool `json:"migrations_disabled"` + StarsDisabled bool `json:"stars_disabled"` TimeTrackingDisabled bool `json:"time_tracking_disabled"` LFSDisabled bool `json:"lfs_disabled"` } |