Skip to content

Commit 82dc871

Browse files
committed
Merge remote-tracking branch 'origin/main' into localized-readme
2 parents e97bb89 + 6554d51 commit 82dc871

File tree

7 files changed

+22
-6
lines changed

7 files changed

+22
-6
lines changed

cmd/dump.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (o outputType) String() string {
9292
}
9393

9494
var outputTypeEnum = &outputType{
95-
Enum: []string{"zip", "tar", "tar.sz", "tar.gz", "tar.xz", "tar.bz2", "tar.br", "tar.lz4"},
95+
Enum: []string{"zip", "tar", "tar.sz", "tar.gz", "tar.xz", "tar.bz2", "tar.br", "tar.lz4", "tar.zst"},
9696
Default: "zip",
9797
}
9898

docs/content/doc/installation/with-docker.en-us.md

+2
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ To set required TOKEN and SECRET values, consider using Gitea's built-in [genera
309309

310310
Since SSH is running inside the container, SSH needs to be passed through from the host to the container if SSH support is desired. One option would be to run the container SSH on a non-standard port (or moving the host port to a non-standard port). Another option which might be more straightforward is for Gitea users to ssh to a Gitea user on the host which will then relay those connections to the docker.
311311

312+
### Understanding SSH access to Gitea (without passthrough)
313+
312314
To understand what needs to happen, you first need to understand what happens without passthrough. So we will try to explain this:
313315

314316
1. The client adds their SSH public key to Gitea using the webpage.

options/locale/locale_en-US.ini

+1
Original file line numberDiff line numberDiff line change
@@ -3044,6 +3044,7 @@ title = Packages
30443044
desc = Manage repository packages.
30453045
empty = There are no packages yet.
30463046
empty.documentation = For more information on the package registry, see <a target="_blank" rel="noopener noreferrer" href="https://docs.gitea.io/en-us/packages/overview">the documentation</a>.
3047+
empty.repo = Did you upload a package, but it's not shown here? Go to <a href="%[1]s">package settings</a> and link it to this repo.
30473048
filter.type = Type
30483049
filter.type.all = All
30493050
filter.no_result = Your filter produced no results.

routers/web/repo/packages.go

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99

1010
"code.gitea.io/gitea/models/db"
1111
"code.gitea.io/gitea/models/packages"
12+
"code.gitea.io/gitea/models/unit"
1213
"code.gitea.io/gitea/modules/base"
1314
"code.gitea.io/gitea/modules/context"
1415
"code.gitea.io/gitea/modules/setting"
@@ -62,6 +63,9 @@ func Packages(ctx *context.Context) {
6263
ctx.Data["Query"] = query
6364
ctx.Data["PackageType"] = packageType
6465
ctx.Data["HasPackages"] = hasPackages
66+
if ctx.Repo != nil {
67+
ctx.Data["CanWritePackages"] = ctx.IsUserRepoWriter([]unit.Type{unit.TypePackages}) || ctx.IsUserSiteAdmin()
68+
}
6569
ctx.Data["PackageDescriptors"] = pds
6670
ctx.Data["Total"] = total
6771
ctx.Data["RepositoryAccessMap"] = map[int64]bool{ctx.Repo.Repository.ID: true} // There is only the current repository

routers/web/repo/view.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -917,10 +917,14 @@ func renderCode(ctx *context.Context) {
917917
ctx.Data["PageIsViewCode"] = true
918918

919919
if ctx.Repo.Repository.IsEmpty {
920-
reallyEmpty, err := ctx.Repo.GitRepo.IsEmpty()
921-
if err != nil {
922-
ctx.ServerError("GitRepo.IsEmpty", err)
923-
return
920+
reallyEmpty := true
921+
var err error
922+
if ctx.Repo.GitRepo != nil {
923+
reallyEmpty, err = ctx.Repo.GitRepo.IsEmpty()
924+
if err != nil {
925+
ctx.ServerError("GitRepo.IsEmpty", err)
926+
return
927+
}
924928
}
925929
if reallyEmpty {
926930
ctx.HTML(http.StatusOK, tplRepoEMPTY)

templates/package/shared/list.tmpl

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
<div class="empty center">
4848
{{svg "octicon-package" 32}}
4949
<h2>{{.locale.Tr "packages.empty"}}</h2>
50+
{{if and .Repository .CanWritePackages}}
51+
{{$packagesUrl := URLJoin .Owner.HTMLURL "-" "packages" }}
52+
<p>{{.locale.Tr "packages.empty.repo" $packagesUrl | Safe}}</p>
53+
{{end}}
5054
<p>{{.locale.Tr "packages.empty.documentation" | Safe}}</p>
5155
</div>
5256
{{else}}

web_src/js/features/common-global.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,8 @@ export function initGlobalButtons() {
389389
*/
390390
export function checkAppUrl() {
391391
const curUrl = window.location.href;
392-
if (curUrl.startsWith(appUrl)) {
392+
// some users visit "https://domain/gitea" while appUrl is "https://domain/gitea/", there should be no warning
393+
if (curUrl.startsWith(appUrl) || `${curUrl}/` === appUrl) {
393394
return;
394395
}
395396
if (document.querySelector('.page-content.install')) {

0 commit comments

Comments
 (0)