Skip to content

Commit 89132e1

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Add support for `npm unpublish` (go-gitea#20688) Allow multiple files in generic packages (go-gitea#20661) Refactor legacy git init (go-gitea#20376) Fix typo in source (go-gitea#20723) [skip ci] Updated translations via Crowdin Add issue filter for Author (go-gitea#20578) Fix init mail render logic (go-gitea#20704) Frontport changelog v1.17.0 (go-gitea#20712) Fix disable download button (go-gitea#20701) docs: move search input to navbar (go-gitea#20551) Fix SecToTime edge-cases (go-gitea#20610)
2 parents cd6cea5 + fba2055 commit 89132e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1058
-364
lines changed

CHANGELOG.md

Lines changed: 309 additions & 1 deletion
Large diffs are not rendered by default.

cmd/doctor.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"code.gitea.io/gitea/models/db"
1515
"code.gitea.io/gitea/models/migrations"
1616
"code.gitea.io/gitea/modules/doctor"
17+
"code.gitea.io/gitea/modules/git"
1718
"code.gitea.io/gitea/modules/log"
1819
"code.gitea.io/gitea/modules/setting"
1920

@@ -124,13 +125,18 @@ func runRecreateTable(ctx *cli.Context) error {
124125
}
125126

126127
func runDoctor(ctx *cli.Context) error {
128+
stdCtx, cancel := installSignals()
129+
defer cancel()
130+
131+
// some doctor sub-commands need to use git command
132+
if err := git.InitFull(stdCtx); err != nil {
133+
return err
134+
}
135+
127136
// Silence the default loggers
128137
log.DelNamedLogger("console")
129138
log.DelNamedLogger(log.DEFAULT)
130139

131-
stdCtx, cancel := installSignals()
132-
defer cancel()
133-
134140
// Now setup our own
135141
logFile := ctx.String("log-file")
136142
if !ctx.IsSet("log-file") {

contrib/pr/checkout.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ func runPR() {
8080
setting.RunUser = curUser.Username
8181

8282
log.Printf("[PR] Loading fixtures data ...\n")
83-
gitea_git.CheckLFSVersion()
8483
//models.LoadConfigs()
8584
/*
8685
setting.Database.Type = "sqlite3"

docs/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ params:
2222
minGoVersion: 1.18
2323
goVersion: 1.19
2424
minNodeVersion: 14
25+
search: nav
2526

2627
outputs:
2728
home:

docs/content/doc/help/search.de-de.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
date: "2019-11-12T16:00:00+02:00"
3+
title: "Search"
4+
slug: "search"
5+
weight: 4
6+
toc: false
7+
draft: false
8+
sitemap:
9+
priority : 0.1
10+
layout: "search"
11+
---
12+
13+
14+
This file exists solely to respond to /search URL with the related `search` layout template.
15+
16+
No content shown here is rendered, all content is based in the template layouts/doc/search.html
17+
18+
Setting a very low sitemap priority will tell search engines this is not important content.

docs/content/doc/help/search.en-us.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ slug: "search"
55
weight: 4
66
toc: false
77
draft: false
8-
menu:
9-
sidebar:
10-
parent: "help"
11-
name: "Search"
12-
weight: 4
13-
identifier: "search"
148
sitemap:
159
priority : 0.1
1610
layout: "search"

docs/content/doc/help/search.fr-fr.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ slug: "search"
55
weight: 4
66
toc: false
77
draft: false
8-
menu:
9-
sidebar:
10-
parent: "help"
11-
name: "Chercher"
12-
weight: 4
13-
identifier: "search"
148
sitemap:
159
priority : 0.1
1610
layout: "search"

docs/content/doc/help/search.nl-nl.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
date: "2019-11-12T16:00:00+02:00"
3+
title: "Search"
4+
slug: "search"
5+
weight: 4
6+
toc: false
7+
draft: false
8+
sitemap:
9+
priority : 0.1
10+
layout: "search"
11+
---
12+
13+
14+
This file exists solely to respond to /search URL with the related `search` layout template.
15+
16+
No content shown here is rendered, all content is based in the template layouts/doc/search.html
17+
18+
Setting a very low sitemap priority will tell search engines this is not important content.

docs/content/doc/help/search.pt-br.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
date: "2019-11-12T16:00:00+02:00"
3+
title: "Search"
4+
slug: "search"
5+
weight: 4
6+
toc: false
7+
draft: false
8+
sitemap:
9+
priority : 0.1
10+
layout: "search"
11+
---
12+
13+
14+
This file exists solely to respond to /search URL with the related `search` layout template.
15+
16+
No content shown here is rendered, all content is based in the template layouts/doc/search.html
17+
18+
Setting a very low sitemap priority will tell search engines this is not important content.

docs/content/doc/help/search.zh-cn.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ slug: "search"
55
weight: 4
66
toc: false
77
draft: false
8-
menu:
9-
sidebar:
10-
parent: "help"
11-
name: "搜索"
12-
weight: 4
13-
identifier: "search"
148
sitemap:
159
priority : 0.1
1610
layout: "search"

docs/content/doc/help/search.zh-tw.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ slug: "search"
55
weight: 4
66
toc: false
77
draft: false
8-
menu:
9-
sidebar:
10-
parent: "help"
11-
name: "搜尋"
12-
weight: 4
13-
identifier: "search"
148
sitemap:
159
priority : 0.1
1610
layout: "search"

docs/content/doc/packages/generic.en-us.md

Lines changed: 70 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ To authenticate to the Package Registry, you need to provide [custom HTTP header
2727
## Publish a package
2828

2929
To publish a generic package perform a HTTP PUT operation with the package content in the request body.
30-
You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first.
30+
You cannot publish a file with the same name twice to a package. You must delete the existing package version first.
3131

3232
```
3333
PUT https://gitea.example.com/api/packages/{owner}/generic/{package_name}/{package_version}/{file_name}
@@ -36,9 +36,9 @@ PUT https://gitea.example.com/api/packages/{owner}/generic/{package_name}/{packa
3636
| Parameter | Description |
3737
| ----------------- | ----------- |
3838
| `owner` | The owner of the package. |
39-
| `package_name` | The package name. It can contain only lowercase letters (`a-z`), uppercase letter (`A-Z`), numbers (`0-9`), dots (`.`), hyphens (`-`), or underscores (`_`). |
40-
| `package_version` | The package version, a non-empty string. |
41-
| `file_name` | The filename. It can contain only lowercase letters (`a-z`), uppercase letter (`A-Z`), numbers (`0-9`), dots (`.`), hyphens (`-`), or underscores (`_`). |
39+
| `package_name` | The package name. It can contain only lowercase letters (`a-z`), uppercase letter (`A-Z`), numbers (`0-9`), dots (`.`), hyphens (`-`), pluses (`+`), or underscores (`_`). |
40+
| `package_version` | The package version, a non-empty string without trailing or leading whitespaces. |
41+
| `file_name` | The filename. It can contain only lowercase letters (`a-z`), uppercase letter (`A-Z`), numbers (`0-9`), dots (`.`), hyphens (`-`), pluses (`+`), or underscores (`_`). |
4242

4343
Example request using HTTP Basic authentication:
4444

@@ -55,7 +55,8 @@ The server reponds with the following HTTP Status codes.
5555
| HTTP Status Code | Meaning |
5656
| ----------------- | ------- |
5757
| `201 Created` | The package has been published. |
58-
| `400 Bad Request` | The package name and/or version are invalid or a package with the same name and version already exist. |
58+
| `400 Bad Request` | The package name and/or version and/or file name are invalid. |
59+
| `409 Conflict` | A file with the same name exist already in the package. |
5960

6061
## Download a package
6162

@@ -80,3 +81,67 @@ Example request using HTTP Basic authentication:
8081
curl --user your_username:your_token_or_password \
8182
https://gitea.example.com/api/packages/testuser/generic/test_package/1.0.0/file.bin
8283
```
84+
85+
The server reponds with the following HTTP Status codes.
86+
87+
| HTTP Status Code | Meaning |
88+
| ----------------- | ------- |
89+
| `200 OK` | Success |
90+
| `404 Not Found` | The package or file was not found. |
91+
92+
## Delete a package
93+
94+
To delete a generic package perform a HTTP DELETE operation. This will delete all files of this version.
95+
96+
```
97+
DELETE https://gitea.example.com/api/packages/{owner}/generic/{package_name}/{package_version}
98+
```
99+
100+
| Parameter | Description |
101+
| ----------------- | ----------- |
102+
| `owner` | The owner of the package. |
103+
| `package_name` | The package name. |
104+
| `package_version` | The package version. |
105+
106+
Example request using HTTP Basic authentication:
107+
108+
```shell
109+
curl --user your_username:your_token_or_password -X DELETE \
110+
https://gitea.example.com/api/packages/testuser/generic/test_package/1.0.0
111+
```
112+
113+
The server reponds with the following HTTP Status codes.
114+
115+
| HTTP Status Code | Meaning |
116+
| ----------------- | ------- |
117+
| `204 No Content` | Success |
118+
| `404 Not Found` | The package was not found. |
119+
120+
## Delete a package file
121+
122+
To delete a file of a generic package perform a HTTP DELETE operation. This will delete the package version too if there is no file left.
123+
124+
```
125+
DELETE https://gitea.example.com/api/packages/{owner}/generic/{package_name}/{package_version}/{filename}
126+
```
127+
128+
| Parameter | Description |
129+
| ----------------- | ----------- |
130+
| `owner` | The owner of the package. |
131+
| `package_name` | The package name. |
132+
| `package_version` | The package version. |
133+
| `filename` | The filename. |
134+
135+
Example request using HTTP Basic authentication:
136+
137+
```shell
138+
curl --user your_username:your_token_or_password -X DELETE \
139+
https://gitea.example.com/api/packages/testuser/generic/test_package/1.0.0/file.bin
140+
```
141+
142+
The server reponds with the following HTTP Status codes.
143+
144+
| HTTP Status Code | Meaning |
145+
| ----------------- | ------- |
146+
| `204 No Content` | Success |
147+
| `404 Not Found` | The package or file was not found. |

docs/content/doc/packages/npm.en-us.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,26 @@ npm publish
6767

6868
You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first.
6969

70+
## Unpublish a package
71+
72+
Delete a package by running the following command:
73+
74+
```shell
75+
npm unpublish {package_name}[@{package_version}]
76+
```
77+
78+
| Parameter | Description |
79+
| ----------------- | ----------- |
80+
| `package_name` | The package name. |
81+
| `package_version` | The package version. |
82+
83+
For example:
84+
85+
```shell
86+
npm unpublish @test/test_package
87+
npm unpublish @test/test_package@1.0.0
88+
```
89+
7090
## Install a package
7191

7292
To install a package from the package registry, execute the following command:
@@ -113,6 +133,7 @@ The tag name must not be a valid version. All tag names which are parsable as a
113133
npm install
114134
npm ci
115135
npm publish
136+
npm unpublish
116137
npm dist-tag
117138
npm view
118139
```

docs/layouts/doc/search.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
<div class=" content">
1212
<section class="resume-section p-3 p-lg-5 d-flex flex-column">
1313
<div class="my-auto" >
14-
<form action="{{ "search" | absLangURL }}">
15-
<label>Search:
16-
<input id="search-query" name="s"/>
17-
</label>
18-
</form>
19-
<br/>
2014
<div id="search-results"></div>
2115
</div>
2216
</section>

0 commit comments

Comments
 (0)