File tree Expand file tree Collapse file tree 12 files changed +188
-189
lines changed
gitea-repositories-meta/user2/git_hooks_test.git/hooks/pre-receive.d Expand file tree Collapse file tree 12 files changed +188
-189
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,9 @@ import (
1313 "code.gitea.io/gitea/modules/log"
1414)
1515
16+ // Security settings
17+
1618var (
17- // Security settings
1819 InstallLock bool
1920 SecretKey string
2021 InternalToken string // internal access token
2728 ReverseProxyTrustedProxies []string
2829 MinPasswordLength int
2930 ImportLocalPaths bool
30- DisableGitHooks bool
31+ DisableGitHooks = true
3132 DisableWebhooks bool
3233 OnlyAllowPushIfGiteaEnvironmentSet bool
3334 PasswordComplexity []string
Original file line number Diff line number Diff line change @@ -131,15 +131,9 @@ func NewFuncMap() template.FuncMap {
131131 "EnableTimetracking" : func () bool {
132132 return setting .Service .EnableTimetracking
133133 },
134- "DisableGitHooks" : func () bool {
135- return setting .DisableGitHooks
136- },
137134 "DisableWebhooks" : func () bool {
138135 return setting .DisableWebhooks
139136 },
140- "DisableImportLocal" : func () bool {
141- return ! setting .ImportLocalPaths
142- },
143137 "UserThemeName" : userThemeName ,
144138 "NotificationSettings" : func () map [string ]any {
145139 return map [string ]any {
Original file line number Diff line number Diff line change @@ -3538,6 +3538,7 @@ versions = Versions
35383538versions.view_all = View all
35393539dependency.id = ID
35403540dependency.version = Version
3541+ search_in_external_registry = Search in %s
35413542alpine.registry = Setup this registry by adding the url in your <code>/etc/apk/repositories</code> file:
35423543alpine.registry.key = Download the registry public RSA key into the <code>/etc/apk/keys/</code> folder to verify the index signature:
35433544alpine.registry.info = Choose $branch and $repository from the list below.
Original file line number Diff line number Diff line change @@ -313,6 +313,8 @@ func editUserCommon(ctx *context.Context) {
313313 ctx .Data ["PageIsAdminUsers" ] = true
314314 ctx .Data ["DisableRegularOrgCreation" ] = setting .Admin .DisableRegularOrgCreation
315315 ctx .Data ["DisableMigrations" ] = setting .Repository .DisableMigrations
316+ ctx .Data ["DisableGitHooks" ] = setting .DisableGitHooks
317+ ctx .Data ["DisableImportLocal" ] = ! setting .ImportLocalPaths
316318 ctx .Data ["AllowedUserVisibilityModes" ] = setting .Service .AllowedUserVisibilityModesSlice .ToVisibleTypeSlice ()
317319 ctx .Data ["DisableGravatar" ] = setting .Config ().Picture .DisableGravatar .Value (ctx )
318320}
Original file line number Diff line number Diff line change 128128 <input name="restricted" type="checkbox" {{if .User.IsRestricted}}checked{{end}}>
129129 </div>
130130 </div>
131- <div class="inline field {{if DisableGitHooks}}tw-hidden{{end}}">
131+ <div class="inline field {{if . DisableGitHooks}}tw-hidden{{end}}">
132132 <div class="ui checkbox" data-tooltip-content="{{ctx.Locale.Tr "admin.users.allow_git_hook_tooltip"}}">
133133 <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}}>
135135 </div>
136136 </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}}">
138138 <div class="ui checkbox">
139139 <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}}>
141141 </div>
142142 </div>
143143 {{if not .DisableRegularOrgCreation}}
Original file line number Diff line number Diff line change 3535 </tr>
3636 </thead>
3737 <tbody>
38+ {{$tooltipSearchInNuget := ctx.Locale.Tr "packages.search_in_external_registry" "nuget.org"}}
3839 {{range $framework, $dependencies := .PackageDescriptor.Metadata.Dependencies}}
3940 {{range $dependencies}}
4041 <tr>
41- <td>{{.ID}}</td>
42- <td>{{.Version}}</td>
42+ <td>{{.ID}} <a target="_blank" rel="noreferrer" href="https://www.nuget.org/packages/{{.ID}}" data-tooltip-content="{{$tooltipSearchInNuget}}">{{svg "octicon-link-external"}}</a> </td>
43+ <td>{{.Version}} <a target="_blank" rel="noreferrer" href="https://www.nuget.org/packages/{{.ID}}/{{.Version}}" data-tooltip-content="{{$tooltipSearchInNuget}}">{{svg "octicon-link-external"}}</a> </td>
4344 <td>{{$framework}}</td>
4445 </tr>
4546 {{end}}
Original file line number Diff line number Diff line change 11#! /bin/bash
2-
3- echo Hello, World!
2+ echo " TestGitHookScript"
You can’t perform that action at this time.
0 commit comments