Skip to content

Commit 1d941c3

Browse files
authored
Merge branch 'main' into fix-repo-create
2 parents 8b68280 + d030cac commit 1d941c3

File tree

12 files changed

+188
-189
lines changed

12 files changed

+188
-189
lines changed

modules/setting/security.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ import (
1313
"code.gitea.io/gitea/modules/log"
1414
)
1515

16+
// Security settings
17+
1618
var (
17-
// Security settings
1819
InstallLock bool
1920
SecretKey string
2021
InternalToken string // internal access token
@@ -27,7 +28,7 @@ var (
2728
ReverseProxyTrustedProxies []string
2829
MinPasswordLength int
2930
ImportLocalPaths bool
30-
DisableGitHooks bool
31+
DisableGitHooks = true
3132
DisableWebhooks bool
3233
OnlyAllowPushIfGiteaEnvironmentSet bool
3334
PasswordComplexity []string

modules/templates/helper.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff 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{

options/locale/locale_en-US.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3538,6 +3538,7 @@ versions = Versions
35383538
versions.view_all = View all
35393539
dependency.id = ID
35403540
dependency.version = Version
3541+
search_in_external_registry = Search in %s
35413542
alpine.registry = Setup this registry by adding the url in your <code>/etc/apk/repositories</code> file:
35423543
alpine.registry.key = Download the registry public RSA key into the <code>/etc/apk/keys/</code> folder to verify the index signature:
35433544
alpine.registry.info = Choose $branch and $repository from the list below.

routers/web/admin/users.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

templates/admin/user/edit.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,16 @@
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}}

templates/package/content/nuget.tmpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,12 @@
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}}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
#!/bin/bash
2-
3-
echo Hello, World!
2+
echo "TestGitHookScript"

0 commit comments

Comments
 (0)