File tree Expand file tree Collapse file tree 9 files changed +16
-15
lines changed
docs/content/doc/advanced Expand file tree Collapse file tree 9 files changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -878,8 +878,8 @@ ROUTER = console
878
878
; ; Allow deletion of unadopted repositories
879
879
; ALLOW_DELETION_OF_UNADOPTED_REPOSITORIES = false
880
880
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
883
883
884
884
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
885
885
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
78
78
- ` DEFAULT_BRANCH ` : ** main** : Default branch name of all repositories.
79
79
- ` ALLOW_ADOPTION_OF_UNADOPTED_REPOSITORIES ` : ** false** : Allow non-admin users to adopt unadopted repositories
80
80
- ` 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
81
82
82
83
### Repository - Editor (` repository.editor ` )
83
84
Original file line number Diff line number Diff line change 48
48
DefaultBranch string
49
49
AllowAdoptionOfUnadoptedRepositories bool
50
50
AllowDeleteOfUnadoptedRepositories bool
51
- DisabledDownloadSource bool
51
+ DisabledDownloadSourceArchives bool
52
52
53
53
// Repository editor settings
54
54
Editor struct {
Original file line number Diff line number Diff line change @@ -35,11 +35,11 @@ func BaseVars() Vars {
35
35
"IsLandingPageExplore" : setting .LandingPageURL == setting .LandingPageExplore ,
36
36
"IsLandingPageOrganizations" : setting .LandingPageURL == setting .LandingPageOrganizations ,
37
37
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 ,
43
43
44
44
"EnableSwagger" : setting .API .EnableSwagger ,
45
45
"EnableOpenIDSignIn" : setting .Service .EnableOpenIDSignIn ,
Original file line number Diff line number Diff line change @@ -290,7 +290,7 @@ func RegisterRoutes(m *web.Route) {
290
290
}
291
291
292
292
dlSourceEnabled := func (ctx * context.Context ) {
293
- if setting .Repository .DisabledDownloadSource {
293
+ if setting .Repository .DisabledDownloadSourceArchives {
294
294
ctx .Error (http .StatusNotFound )
295
295
return
296
296
}
Original file line number Diff line number Diff line change 31
31
<br>
32
32
{{.locale.Tr "mail.release.downloads"}}
33
33
<ul>
34
- {{if not .DisabledDownloadSource }}
34
+ {{if not .DisabledDownloadSourceArchives }}
35
35
<li>
36
36
<a href="{{.Release.Repo.Link}}/archive/{{.Release.TagName | PathEscapeSegments}}.zip" rel="nofollow"><strong>{{.locale.Tr "mail.release.download.zip"}}</strong></a>
37
37
</li>
Original file line number Diff line number Diff line change 26
26
{{svg "octicon-git-branch"}}
27
27
</div>
28
28
{{end}}
29
- {{if not .DisabledDownloadSource }}
29
+ {{if not $.DisabledDownloadSourceArchives }}
30
30
<div class="ui basic jump dropdown icon button tooltip" data-content="{{$.locale.Tr "repo.branch.download" ($.DefaultBranch)}}" data-position="top right">
31
31
{{svg "octicon-download"}}
32
32
<div class="menu">
Original file line number Diff line number Diff line change 124
124
{{if eq $n 0}}
125
125
<div class="ui action tiny input" id="clone-panel">
126
126
{{template "repo/clone_buttons" .}}
127
- {{if not .DisabledDownloadSource }}
127
+ {{if not .DisabledDownloadSourceArchives }}
128
128
<button id="download-btn" class="ui basic jump dropdown icon button tooltip" data-content="{{.locale.Tr "repo.download_archive"}}" data-position="top right">
129
129
{{svg "octicon-download"}}
130
130
<div class="menu">
Original file line number Diff line number Diff line change 37
37
<div class="download df ac">
38
38
{{if $.Permission.CanRead $.UnitTypeCode}}
39
39
<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 }}
41
41
<a class="archive-link mr-3" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip" 16 "mr-2"}}ZIP</a>
42
42
<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>
43
43
{{end}}
106
106
<div class="download">
107
107
{{if $.Permission.CanRead $.UnitTypeCode}}
108
108
<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 }}
110
110
<a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.zip" rel="nofollow">{{svg "octicon-file-zip"}} ZIP</a>
111
111
<a class="archive-link" href="{{$.RepoLink}}/archive/{{.TagName | PathEscapeSegments}}.tar.gz" rel="nofollow">{{svg "octicon-file-zip"}} TAR.GZ</a>
112
112
{{end}}
150
150
{{$.locale.Tr "repo.release.downloads"}}
151
151
</summary>
152
152
<ul class="list">
153
- {{if and (not $.DisabledDownloadSource ) (not .IsDraft) ($.Permission.CanRead $.UnitTypeCode)}}
153
+ {{if and (not $.DisabledDownloadSourceArchives ) (not .IsDraft) ($.Permission.CanRead $.UnitTypeCode)}}
154
154
<li>
155
155
<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>
156
156
</li>
You can’t perform that action at this time.
0 commit comments