mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Disable custom Git Hooks globally via configuration file (#2450)
* Create option to disable githooks globally via configuration file * Update comment in app.ini to align with @ethantkoenig's suggestion Signed-off-by: Matti Ranta <matti@mdranta.net>
This commit is contained in:
committed by
Lauris BH
parent
3fecf94086
commit
9bdbfbf6f3
@@ -124,6 +124,7 @@ var (
|
||||
ReverseProxyAuthUser string
|
||||
MinPasswordLength int
|
||||
ImportLocalPaths bool
|
||||
DisableGitHooks bool
|
||||
|
||||
// Database settings
|
||||
UseSQLite3 bool
|
||||
@@ -817,6 +818,7 @@ func NewContext() {
|
||||
ReverseProxyAuthUser = sec.Key("REVERSE_PROXY_AUTHENTICATION_USER").MustString("X-WEBAUTH-USER")
|
||||
MinPasswordLength = sec.Key("MIN_PASSWORD_LENGTH").MustInt(6)
|
||||
ImportLocalPaths = sec.Key("IMPORT_LOCAL_PATHS").MustBool(false)
|
||||
DisableGitHooks = sec.Key("DISABLE_GIT_HOOKS").MustBool(false)
|
||||
InternalToken = sec.Key("INTERNAL_TOKEN").String()
|
||||
if len(InternalToken) == 0 {
|
||||
secretBytes := make([]byte, 32)
|
||||
|
@@ -155,6 +155,9 @@ func NewFuncMap() []template.FuncMap {
|
||||
}
|
||||
return out.String()
|
||||
},
|
||||
"DisableGitHooks": func() bool {
|
||||
return setting.DisableGitHooks
|
||||
},
|
||||
}}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user