-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Disable custom Git Hooks globally via configuration file #2450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,7 +86,7 @@ | |
| <div class="inline field"> | ||
| <div class="ui checkbox"> | ||
| <label><strong>{{.i18n.Tr "admin.users.allow_git_hook"}}</strong></label> | ||
| <input name="allow_git_hook" type="checkbox" {{if .User.CanEditGitHook}}checked{{end}}> | ||
| <input name="allow_git_hook" type="checkbox" {{if .User.CanEditGitHook}}checked{{end}} {{if DisableGitHooks}}disabled{{end}}> | ||
|
||
| </div> | ||
| </div> | ||
| <div class="inline field"> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this feedback, especially linking me to where I could look. Investigating this (by calling the API to see what the response would be), I found that it only returns the standard gitea/slack/discord/etc.. hooks, and couldn't find it returning the githooks.