Skip to content

Commit 7c72fef

Browse files
committed
Follow reviews
1 parent ebd430e commit 7c72fef

File tree

9 files changed

+16
-15
lines changed

9 files changed

+16
-15
lines changed

custom/conf/app.example.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,8 +878,8 @@ ROUTER = console
878878
;; Allow deletion of unadopted repositories
879879
;ALLOW_DELETION_OF_UNADOPTED_REPOSITORIES = false
880880

881-
;; Dont' allow download source tar files from UI
882-
;DISABLED_DOWNLOAD_SOURCE = false
881+
;; Don't allow download source archive files from UI
882+
;DISABLED_DOWNLOAD_SOURCE_ARCHIVES = false
883883

884884
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
885885
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
7878
- `DEFAULT_BRANCH`: **main**: Default branch name of all repositories.
7979
- `ALLOW_ADOPTION_OF_UNADOPTED_REPOSITORIES`: **false**: Allow non-admin users to adopt unadopted repositories
8080
- `ALLOW_DELETION_OF_UNADOPTED_REPOSITORIES`: **false**: Allow non-admin users to delete unadopted repositories
81+
- `DISABLED_DOWNLOAD_SOURCE_ARCHIVES`: **false**: Don't allow download source archive files from UI
8182

8283
### Repository - Editor (`repository.editor`)
8384

modules/setting/repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var (
4848
DefaultBranch string
4949
AllowAdoptionOfUnadoptedRepositories bool
5050
AllowDeleteOfUnadoptedRepositories bool
51-
DisabledDownloadSource bool
51+
DisabledDownloadSourceArchives bool
5252

5353
// Repository editor settings
5454
Editor struct {

modules/templates/base.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ func BaseVars() Vars {
3535
"IsLandingPageExplore": setting.LandingPageURL == setting.LandingPageExplore,
3636
"IsLandingPageOrganizations": setting.LandingPageURL == setting.LandingPageOrganizations,
3737

38-
"ShowRegistrationButton": setting.Service.ShowRegistrationButton,
39-
"ShowMilestonesDashboardPage": setting.Service.ShowMilestonesDashboardPage,
40-
"ShowFooterBranding": setting.ShowFooterBranding,
41-
"ShowFooterVersion": setting.ShowFooterVersion,
42-
"DisabledDownloadSource": setting.Repository.DisabledDownloadSource,
38+
"ShowRegistrationButton": setting.Service.ShowRegistrationButton,
39+
"ShowMilestonesDashboardPage": setting.Service.ShowMilestonesDashboardPage,
40+
"ShowFooterBranding": setting.ShowFooterBranding,
41+
"ShowFooterVersion": setting.ShowFooterVersion,
42+
"DisabledDownloadSourceArchives": setting.Repository.DisabledDownloadSourceArchives,
4343

4444
"EnableSwagger": setting.API.EnableSwagger,
4545
"EnableOpenIDSignIn": setting.Service.EnableOpenIDSignIn,

routers/web/web.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func RegisterRoutes(m *web.Route) {
290290
}
291291

292292
dlSourceEnabled := func(ctx *context.Context) {
293-
if setting.Repository.DisabledDownloadSource {
293+
if setting.Repository.DisabledDownloadSourceArchives {
294294
ctx.Error(http.StatusNotFound)
295295
return
296296
}

templates/mail/release.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<br>
3232
{{.locale.Tr "mail.release.downloads"}}
3333
<ul>
34-
{{if not .DisabledDownloadSource}}
34+
{{if not .DisabledDownloadSourceArchives}}
3535
<li>
3636
<a href="{{.Release.Repo.Link}}/archive/{{.Release.TagName | PathEscapeSegments}}.zip" rel="nofollow"><strong>{{.locale.Tr "mail.release.download.zip"}}</strong></a>
3737
</li>

templates/repo/branch/list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{{svg "octicon-git-branch"}}
2727
</div>
2828
{{end}}
29-
{{if not .DisabledDownloadSource}}
29+
{{if not $.DisabledDownloadSourceArchives}}
3030
<div class="ui basic jump dropdown icon button tooltip" data-content="{{$.locale.Tr "repo.branch.download" ($.DefaultBranch)}}" data-position="top right">
3131
{{svg "octicon-download"}}
3232
<div class="menu">

templates/repo/home.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
{{if eq $n 0}}
125125
<div class="ui action tiny input" id="clone-panel">
126126
{{template "repo/clone_buttons" .}}
127-
{{if not .DisabledDownloadSource}}
127+
{{if not .DisabledDownloadSourceArchives}}
128128
<button id="download-btn" class="ui basic jump dropdown icon button tooltip" data-content="{{.locale.Tr "repo.download_archive"}}" data-position="top right">
129129
{{svg "octicon-download"}}
130130
<div class="menu">

templates/repo/release/list.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<div class="download df ac">
3838
{{if $.Permission.CanRead $.UnitTypeCode}}
3939
<a class="mr-3 mono" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "mr-2"}}{{ShortSha .Sha1}}</a>
40-
{{if not $.DisabledDownloadSource}}
40+
{{if not $.DisabledDownloadSourceArchives}}
4141
<a class="archive-link mr-3" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-2"}}ZIP</a>
4242
<a class="archive-link mr-3" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-2"}}TAR.GZ</a>
4343
{{end}}
@@ -106,7 +106,7 @@
106106
<div class="download">
107107
{{if $.Permission.CanRead $.UnitTypeCode}}
108108
<a class="mono" href="{{$.RepoLink}}/src/commit/{{.Sha1}}" rel="nofollow">{{svg "octicon-git-commit" 16 "mr-2"}}{{ShortSha .Sha1}}</a>
109-
{{if not $.DisabledDownloadSource}}
109+
{{if not $.DisabledDownloadSourceArchives}}
110110
<a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;ZIP</a>
111111
<a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}}&nbsp;TAR.GZ</a>
112112
{{end}}
@@ -150,7 +150,7 @@
150150
{{$.locale.Tr "repo.release.downloads"}}
151151
</summary>
152152
<ul class="list">
153-
{{if and (not $.DisabledDownloadSource) (not .IsDraft) ($.Permission.CanRead $.UnitTypeCode)}}
153+
{{if and (not $.DisabledDownloadSourceArchives) (not .IsDraft) ($.Permission.CanRead $.UnitTypeCode)}}
154154
<li>
155155
<a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow"><strong>{{svg "octicon-file-zip" 16 "mr-2"}}{{$.locale.Tr "repo.release.source_code"}} (ZIP)</strong></a>
156156
</li>

0 commit comments

Comments
 (0)