mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	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>
This commit is contained in:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user