Skip to content

Commit 85579dc

Browse files
pboguslawskizeripath
authored andcommitted
Disable unnecessary GitHooks elements
This mod fixes disabling unnecessary GitHooks elements. Related: #13129 Author-Change-Id: IB#1115251
1 parent 076eaad commit 85579dc

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

custom/conf/app.example.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ INTERNAL_TOKEN=
398398
;; By modifying the Gitea database, users can gain Gitea administrator privileges.
399399
;; It also enables them to access other resources available to the user on the operating system that is running the Gitea instance and perform arbitrary actions in the name of the Gitea OS user.
400400
;; WARNING: This maybe harmful to you website or your operating system.
401+
;; WARNING: Setting this to true does not change existing hooks in git repos; adjust it before if necessary.
401402
;DISABLE_GIT_HOOKS = true
402403
;;
403404
;; Set to true to disable webhooks feature.

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ Certain queues have defaults that override the defaults set in `[queue]` (this o
497497
It also enables them to access other resources available to the user on the operating system that is running the
498498
Gitea instance and perform arbitrary actions in the name of the Gitea OS user.
499499
This maybe harmful to you website or your operating system.
500+
Setting this to true does not change existing hooks in git repos; adjust it before if necessary.
500501
- `DISABLE_WEBHOOKS`: **false**: Set to `true` to disable webhooks feature.
501502
- `ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SET`: **true**: Set to `false` to allow local users to push to gitea-repositories without setting up the Gitea environment. This is not recommended and if you want local users to push to Gitea repositories you should set the environment appropriately.
502503
- `IMPORT_LOCAL_PATHS`: **false**: Set to `false` to prevent all users (including admin) from importing local path on server.

templates/admin/user/edit.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
<input name="restricted" type="checkbox" {{if .User.IsRestricted}}checked{{end}}>
117117
</div>
118118
</div>
119-
<div class="inline field">
119+
<div class="inline field"{{if DisableGitHooks}} hidden{{end}}>
120120
<div class="ui checkbox tooltip" data-content="{{.i18n.Tr "admin.users.allow_git_hook_tooltip"}}" data-variation="very wide">
121121
<label><strong>{{.i18n.Tr "admin.users.allow_git_hook"}}</strong></label>
122122
<input name="allow_git_hook" type="checkbox" {{if .User.CanEditGitHook}}checked{{end}} {{if DisableGitHooks}}disabled{{end}}>

0 commit comments

Comments
 (0)