Skip to content

Commit

Permalink
Merge remote-tracking branch 'giteaofficial/main'
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
zjjhot committed Aug 9, 2022
2 parents cd6cea5 + fba2055 commit 89132e1
Show file tree
Hide file tree
Showing 55 changed files with 1,058 additions and 364 deletions.
310 changes: 309 additions & 1 deletion CHANGELOG.md

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions cmd/doctor.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/migrations"
"code.gitea.io/gitea/modules/doctor"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"

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

func runDoctor(ctx *cli.Context) error {
stdCtx, cancel := installSignals()
defer cancel()

// some doctor sub-commands need to use git command
if err := git.InitFull(stdCtx); err != nil {
return err
}

// Silence the default loggers
log.DelNamedLogger("console")
log.DelNamedLogger(log.DEFAULT)

stdCtx, cancel := installSignals()
defer cancel()

// Now setup our own
logFile := ctx.String("log-file")
if !ctx.IsSet("log-file") {
Expand Down
1 change: 0 additions & 1 deletion contrib/pr/checkout.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ func runPR() {
setting.RunUser = curUser.Username

log.Printf("[PR] Loading fixtures data ...\n")
gitea_git.CheckLFSVersion()
//models.LoadConfigs()
/*
setting.Database.Type = "sqlite3"
Expand Down
1 change: 1 addition & 0 deletions docs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ params:
minGoVersion: 1.18
goVersion: 1.19
minNodeVersion: 14
search: nav

outputs:
home:
Expand Down
18 changes: 18 additions & 0 deletions docs/content/doc/help/search.de-de.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
date: "2019-11-12T16:00:00+02:00"
title: "Search"
slug: "search"
weight: 4
toc: false
draft: false
sitemap:
priority : 0.1
layout: "search"
---


This file exists solely to respond to /search URL with the related `search` layout template.

No content shown here is rendered, all content is based in the template layouts/doc/search.html

Setting a very low sitemap priority will tell search engines this is not important content.
6 changes: 0 additions & 6 deletions docs/content/doc/help/search.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ slug: "search"
weight: 4
toc: false
draft: false
menu:
sidebar:
parent: "help"
name: "Search"
weight: 4
identifier: "search"
sitemap:
priority : 0.1
layout: "search"
Expand Down
6 changes: 0 additions & 6 deletions docs/content/doc/help/search.fr-fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ slug: "search"
weight: 4
toc: false
draft: false
menu:
sidebar:
parent: "help"
name: "Chercher"
weight: 4
identifier: "search"
sitemap:
priority : 0.1
layout: "search"
Expand Down
18 changes: 18 additions & 0 deletions docs/content/doc/help/search.nl-nl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
date: "2019-11-12T16:00:00+02:00"
title: "Search"
slug: "search"
weight: 4
toc: false
draft: false
sitemap:
priority : 0.1
layout: "search"
---


This file exists solely to respond to /search URL with the related `search` layout template.

No content shown here is rendered, all content is based in the template layouts/doc/search.html

Setting a very low sitemap priority will tell search engines this is not important content.
18 changes: 18 additions & 0 deletions docs/content/doc/help/search.pt-br.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
date: "2019-11-12T16:00:00+02:00"
title: "Search"
slug: "search"
weight: 4
toc: false
draft: false
sitemap:
priority : 0.1
layout: "search"
---


This file exists solely to respond to /search URL with the related `search` layout template.

No content shown here is rendered, all content is based in the template layouts/doc/search.html

Setting a very low sitemap priority will tell search engines this is not important content.
6 changes: 0 additions & 6 deletions docs/content/doc/help/search.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ slug: "search"
weight: 4
toc: false
draft: false
menu:
sidebar:
parent: "help"
name: "搜索"
weight: 4
identifier: "search"
sitemap:
priority : 0.1
layout: "search"
Expand Down
6 changes: 0 additions & 6 deletions docs/content/doc/help/search.zh-tw.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ slug: "search"
weight: 4
toc: false
draft: false
menu:
sidebar:
parent: "help"
name: "搜尋"
weight: 4
identifier: "search"
sitemap:
priority : 0.1
layout: "search"
Expand Down
75 changes: 70 additions & 5 deletions docs/content/doc/packages/generic.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To authenticate to the Package Registry, you need to provide [custom HTTP header
## Publish a package

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

```
PUT https://gitea.example.com/api/packages/{owner}/generic/{package_name}/{package_version}/{file_name}
Expand All @@ -36,9 +36,9 @@ PUT https://gitea.example.com/api/packages/{owner}/generic/{package_name}/{packa
| Parameter | Description |
| ----------------- | ----------- |
| `owner` | The owner of the package. |
| `package_name` | The package name. It can contain only lowercase letters (`a-z`), uppercase letter (`A-Z`), numbers (`0-9`), dots (`.`), hyphens (`-`), or underscores (`_`). |
| `package_version` | The package version, a non-empty string. |
| `file_name` | The filename. It can contain only lowercase letters (`a-z`), uppercase letter (`A-Z`), numbers (`0-9`), dots (`.`), hyphens (`-`), or underscores (`_`). |
| `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 (`_`). |
| `package_version` | The package version, a non-empty string without trailing or leading whitespaces. |
| `file_name` | The filename. It can contain only lowercase letters (`a-z`), uppercase letter (`A-Z`), numbers (`0-9`), dots (`.`), hyphens (`-`), pluses (`+`), or underscores (`_`). |

Example request using HTTP Basic authentication:

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

## Download a package

Expand All @@ -80,3 +81,67 @@ Example request using HTTP Basic authentication:
curl --user your_username:your_token_or_password \
https://gitea.example.com/api/packages/testuser/generic/test_package/1.0.0/file.bin
```

The server reponds with the following HTTP Status codes.

| HTTP Status Code | Meaning |
| ----------------- | ------- |
| `200 OK` | Success |
| `404 Not Found` | The package or file was not found. |

## Delete a package

To delete a generic package perform a HTTP DELETE operation. This will delete all files of this version.

```
DELETE https://gitea.example.com/api/packages/{owner}/generic/{package_name}/{package_version}
```

| Parameter | Description |
| ----------------- | ----------- |
| `owner` | The owner of the package. |
| `package_name` | The package name. |
| `package_version` | The package version. |

Example request using HTTP Basic authentication:

```shell
curl --user your_username:your_token_or_password -X DELETE \
https://gitea.example.com/api/packages/testuser/generic/test_package/1.0.0
```

The server reponds with the following HTTP Status codes.

| HTTP Status Code | Meaning |
| ----------------- | ------- |
| `204 No Content` | Success |
| `404 Not Found` | The package was not found. |

## Delete a package file

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.

```
DELETE https://gitea.example.com/api/packages/{owner}/generic/{package_name}/{package_version}/{filename}
```

| Parameter | Description |
| ----------------- | ----------- |
| `owner` | The owner of the package. |
| `package_name` | The package name. |
| `package_version` | The package version. |
| `filename` | The filename. |

Example request using HTTP Basic authentication:

```shell
curl --user your_username:your_token_or_password -X DELETE \
https://gitea.example.com/api/packages/testuser/generic/test_package/1.0.0/file.bin
```

The server reponds with the following HTTP Status codes.

| HTTP Status Code | Meaning |
| ----------------- | ------- |
| `204 No Content` | Success |
| `404 Not Found` | The package or file was not found. |
21 changes: 21 additions & 0 deletions docs/content/doc/packages/npm.en-us.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,26 @@ npm publish

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

## Unpublish a package

Delete a package by running the following command:

```shell
npm unpublish {package_name}[@{package_version}]
```

| Parameter | Description |
| ----------------- | ----------- |
| `package_name` | The package name. |
| `package_version` | The package version. |

For example:

```shell
npm unpublish @test/test_package
npm unpublish @test/test_package@1.0.0
```

## Install a package

To install a package from the package registry, execute the following command:
Expand Down Expand Up @@ -113,6 +133,7 @@ The tag name must not be a valid version. All tag names which are parsable as a
npm install
npm ci
npm publish
npm unpublish
npm dist-tag
npm view
```
6 changes: 0 additions & 6 deletions docs/layouts/doc/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
<div class=" content">
<section class="resume-section p-3 p-lg-5 d-flex flex-column">
<div class="my-auto" >
<form action="{{ "search" | absLangURL }}">
<label>Search:
<input id="search-query" name="s"/>
</label>
</form>
<br/>
<div id="search-results"></div>
</div>
</section>
Expand Down
Loading

0 comments on commit 89132e1

Please sign in to comment.