summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-01-17 21:48:38 +0100
committerGitHub <noreply@github.com>2021-01-17 21:48:38 +0100
commit21da519c0cd6e243888ebe573e3496e4eda01f10 (patch)
treea4e2fe5cf6dae77091e8089fa6b98c8684b07fe1 /modules
parentca63a9d3f1120d8c76eb83ff1fd07e0992a683a8 (diff)
downloadgitea-21da519c0cd6e243888ebe573e3496e4eda01f10.tar.gz
gitea-21da519c0cd6e243888ebe573e3496e4eda01f10.zip
Implement ghost comment mitigation (#14349)
* Implement ghost comment mitigation Adds a config option USER_DELETE_WITH_COMMENTS_MAX_DAYS to the [service] section. See https://codeberg.org/Codeberg/Discussion/issues/24 for the underlying issue. * cleanup * use setting module correctly * add to docs Co-authored-by: Moritz Marquardt <git@momar.de>
Diffstat (limited to 'modules')
-rw-r--r--modules/setting/service.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/setting/service.go b/modules/setting/service.go
index 5e74641d27..86f46898ac 100644
--- a/modules/setting/service.go
+++ b/modules/setting/service.go
@@ -50,6 +50,7 @@ var Service struct {
AutoWatchNewRepos bool
AutoWatchOnChanges bool
DefaultOrgMemberVisible bool
+ UserDeleteWithCommentsMaxDays int
// OpenID settings
EnableOpenIDSignIn bool
@@ -102,6 +103,7 @@ func newService() {
Service.DefaultOrgVisibility = sec.Key("DEFAULT_ORG_VISIBILITY").In("public", structs.ExtractKeysFromMapString(structs.VisibilityModes))
Service.DefaultOrgVisibilityMode = structs.VisibilityModes[Service.DefaultOrgVisibility]
Service.DefaultOrgMemberVisible = sec.Key("DEFAULT_ORG_MEMBER_VISIBLE").MustBool()
+ Service.UserDeleteWithCommentsMaxDays = sec.Key("USER_DELETE_WITH_COMMENTS_MAX_DAYS").MustInt(0)
sec = Cfg.Section("openid")
Service.EnableOpenIDSignIn = sec.Key("ENABLE_OPENID_SIGNIN").MustBool(!InstallLock)