File tree 10 files changed +184
-187
lines changed
gitea-repositories-meta/user2/git_hooks_test.git/hooks/pre-receive.d
10 files changed +184
-187
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,9 @@ import (
13
13
"code.gitea.io/gitea/modules/log"
14
14
)
15
15
16
+ // Security settings
17
+
16
18
var (
17
- // Security settings
18
19
InstallLock bool
19
20
SecretKey string
20
21
InternalToken string // internal access token
27
28
ReverseProxyTrustedProxies []string
28
29
MinPasswordLength int
29
30
ImportLocalPaths bool
30
- DisableGitHooks bool
31
+ DisableGitHooks = true
31
32
DisableWebhooks bool
32
33
OnlyAllowPushIfGiteaEnvironmentSet bool
33
34
PasswordComplexity []string
Original file line number Diff line number Diff line change @@ -131,15 +131,9 @@ func NewFuncMap() template.FuncMap {
131
131
"EnableTimetracking" : func () bool {
132
132
return setting .Service .EnableTimetracking
133
133
},
134
- "DisableGitHooks" : func () bool {
135
- return setting .DisableGitHooks
136
- },
137
134
"DisableWebhooks" : func () bool {
138
135
return setting .DisableWebhooks
139
136
},
140
- "DisableImportLocal" : func () bool {
141
- return ! setting .ImportLocalPaths
142
- },
143
137
"UserThemeName" : userThemeName ,
144
138
"NotificationSettings" : func () map [string ]any {
145
139
return map [string ]any {
Original file line number Diff line number Diff line change @@ -313,6 +313,8 @@ func editUserCommon(ctx *context.Context) {
313
313
ctx .Data ["PageIsAdminUsers" ] = true
314
314
ctx .Data ["DisableRegularOrgCreation" ] = setting .Admin .DisableRegularOrgCreation
315
315
ctx .Data ["DisableMigrations" ] = setting .Repository .DisableMigrations
316
+ ctx .Data ["DisableGitHooks" ] = setting .DisableGitHooks
317
+ ctx .Data ["DisableImportLocal" ] = ! setting .ImportLocalPaths
316
318
ctx .Data ["AllowedUserVisibilityModes" ] = setting .Service .AllowedUserVisibilityModesSlice .ToVisibleTypeSlice ()
317
319
ctx .Data ["DisableGravatar" ] = setting .Config ().Picture .DisableGravatar .Value (ctx )
318
320
}
Original file line number Diff line number Diff line change 128
128
<input name="restricted" type="checkbox" {{if .User.IsRestricted}}checked{{end}}>
129
129
</div>
130
130
</div>
131
- <div class="inline field {{if DisableGitHooks}}tw-hidden{{end}}">
131
+ <div class="inline field {{if . DisableGitHooks}}tw-hidden{{end}}">
132
132
<div class="ui checkbox" data-tooltip-content="{{ctx.Locale.Tr "admin.users.allow_git_hook_tooltip"}}">
133
133
<label><strong>{{ctx.Locale.Tr "admin.users.allow_git_hook"}}</strong></label>
134
- <input name="allow_git_hook" type="checkbox" {{if .User.CanEditGitHook}}checked{{end}} {{if DisableGitHooks}}disabled{{end}}>
134
+ <input name="allow_git_hook" type="checkbox" {{if .User.CanEditGitHook}}checked{{end}} {{if . DisableGitHooks}}disabled{{end}}>
135
135
</div>
136
136
</div>
137
- <div class="inline field {{if or (DisableImportLocal) (.DisableMigrations)}}tw-hidden{{end}}">
137
+ <div class="inline field {{if or (. DisableImportLocal) (.DisableMigrations)}}tw-hidden{{end}}">
138
138
<div class="ui checkbox">
139
139
<label><strong>{{ctx.Locale.Tr "admin.users.allow_import_local"}}</strong></label>
140
- <input name="allow_import_local" type="checkbox" {{if .User.CanImportLocal}}checked{{end}} {{if DisableImportLocal}}disabled{{end}}>
140
+ <input name="allow_import_local" type="checkbox" {{if .User.CanImportLocal}}checked{{end}} {{if . DisableImportLocal}}disabled{{end}}>
141
141
</div>
142
142
</div>
143
143
{{if not .DisableRegularOrgCreation}}
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
-
3
- echo Hello, World!
2
+ echo " TestGitHookScript"
You can’t perform that action at this time.
0 commit comments