Skip to content

Commit a6b983f

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: When dumping trim the standard suffices instead of a random suffix (go-gitea#19440) Add uploadpack.allowAnySHA1InWant to allow --filter=blob:none with older git clients (go-gitea#19430) Don't allow merging PR's which are being conflict checked (go-gitea#19357) doc: add brief intro on using traefik as reverse-proxy (go-gitea#19432) Fix panic in team repos API (go-gitea#19431) When updating mirror repo intervals by API reschedule next update too (go-gitea#19429) Fix nil error when some pages are rendered outside request context (go-gitea#19427) Add Helm Chart registry (go-gitea#19406)
2 parents 6c13a25 + 1e319ba commit a6b983f

File tree

36 files changed

+787
-55
lines changed

36 files changed

+787
-55
lines changed

cmd/dump.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (o outputType) String() string {
8686
}
8787

8888
var outputTypeEnum = &outputType{
89-
Enum: []string{"zip", "rar", "tar", "sz", "tar.gz", "tar.xz", "tar.bz2", "tar.br", "tar.lz4"},
89+
Enum: []string{"zip", "tar", "tar.sz", "tar.gz", "tar.xz", "tar.bz2", "tar.br", "tar.lz4"},
9090
Default: "zip",
9191
}
9292

@@ -160,7 +160,12 @@ func runDump(ctx *cli.Context) error {
160160
fatal("Deleting default logger failed. Can not write to stdout: %v", err)
161161
}
162162
} else {
163-
fileName = strings.TrimSuffix(fileName, path.Ext(fileName))
163+
for _, suffix := range outputTypeEnum.Enum {
164+
if strings.HasSuffix(fileName, "."+suffix) {
165+
fileName = strings.TrimSuffix(fileName, "."+suffix)
166+
break
167+
}
168+
}
164169
fileName += "." + outType
165170
}
166171
setting.LoadFromExisting()
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
date: "2022-04-14T00:00:00+00:00"
3+
title: "Helm Chart Registry"
4+
slug: "packages/helm"
5+
draft: false
6+
toc: false
7+
menu:
8+
sidebar:
9+
parent: "packages"
10+
name: "Helm"
11+
weight: 50
12+
identifier: "helm"
13+
---
14+
15+
# Helm Chart Registry
16+
17+
Publish [Helm](https://helm.sh/) charts for your user or organization.
18+
19+
**Table of Contents**
20+
21+
{{< toc >}}
22+
23+
## Requirements
24+
25+
To work with the Helm Chart registry use a simple HTTP client like `curl` or the [`helm cm-push`](https://github.com/chartmuseum/helm-push/) plugin.
26+
27+
## Publish a package
28+
29+
Publish a package by running the following command:
30+
31+
```shell
32+
curl --user {username}:{password} -X POST --upload-file ./{chart_file}.tgz https://gitea.example.com/api/packages/{owner}/helm/api/charts
33+
```
34+
35+
or with the `helm cm-push` plugin:
36+
37+
```shell
38+
helm repo add --username {username} --password {password} {repo} https://gitea.example.com/api/packages/{owner}/helm
39+
helm cm-push ./{chart_file}.tgz {repo}
40+
```
41+
42+
| Parameter | Description |
43+
| ------------ | ----------- |
44+
| `username` | Your Gitea username. |
45+
| `password` | Your Gitea password or a personal access token. |
46+
| `repo` | The name for the repository. |
47+
| `chart_file` | The Helm Chart archive. |
48+
| `owner` | The owner of the package. |
49+
50+
## Install a package
51+
52+
To install a Helm char from the registry, execute the following command:
53+
54+
```shell
55+
helm repo add --username {username} --password {password} {repo} https://gitea.example.com/api/packages/{owner}/helm
56+
helm repo update
57+
helm install {name} {repo}/{chart}
58+
```
59+
60+
| Parameter | Description |
61+
| ---------- | ----------- |
62+
| `username` | Your Gitea username. |
63+
| `password` | Your Gitea password or a personal access token. |
64+
| `repo` | The name for the repository. |
65+
| `owner` | The owner of the package. |
66+
| `name` | The local name. |
67+
| `chart` | The name Helm Chart. |

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ menu:
88
sidebar:
99
parent: "packages"
1010
name: "Maven"
11-
weight: 50
11+
weight: 60
1212
identifier: "maven"
1313
---
1414

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ menu:
88
sidebar:
99
parent: "packages"
1010
name: "npm"
11-
weight: 60
11+
weight: 70
1212
identifier: "npm"
1313
---
1414

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ menu:
88
sidebar:
99
parent: "packages"
1010
name: "NuGet"
11-
weight: 70
11+
weight: 80
1212
identifier: "nuget"
1313
---
1414

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ The following package managers are currently supported:
3030
| [Conan]({{< relref "doc/packages/conan.en-us.md" >}}) | C++ | `conan` |
3131
| [Container]({{< relref "doc/packages/container.en-us.md" >}}) | - | any OCI compliant client |
3232
| [Generic]({{< relref "doc/packages/generic.en-us.md" >}}) | - | any HTTP client |
33+
| [Helm]({{< relref "doc/packages/helm.en-us.md" >}}) | - | any HTTP client, `cm-push` |
3334
| [Maven]({{< relref "doc/packages/maven.en-us.md" >}}) | Java | `mvn`, `gradle` |
3435
| [npm]({{< relref "doc/packages/npm.en-us.md" >}}) | JavaScript | `npm`, `yarn` |
3536
| [NuGet]({{< relref "doc/packages/nuget.en-us.md" >}}) | .NET | `nuget` |

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ menu:
88
sidebar:
99
parent: "packages"
1010
name: "PyPI"
11-
weight: 80
11+
weight: 90
1212
identifier: "pypi"
1313
---
1414

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ menu:
88
sidebar:
99
parent: "packages"
1010
name: "RubyGems"
11-
weight: 90
11+
weight: 100
1212
identifier: "rubygems"
1313
---
1414

docs/content/doc/usage/reverse-proxies.en-us.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,3 +348,18 @@ The added http-request will automatically add a trailing slash if needed and int
348348

349349
Then you **MUST** set something like `[server] ROOT_URL = http://example.com/gitea/` correctly in your configuration.
350350

351+
## Traefik
352+
353+
If you want traefik to serve your Gitea instance, you can add the following label section to your `docker-compose.yaml` (Assuming the provider is docker).
354+
355+
```yaml
356+
gitea:
357+
image: gitea/gitea
358+
...
359+
labels:
360+
- "traefik.enable=true"
361+
- "traefik.http.routers.gitea.rule=Host(`example.com`)"
362+
- "traefik.http.services.gitea-websecure.loadbalancer.server.port=3000"
363+
```
364+
365+
This config assumes that you are handling HTTPS on the traefik side and using HTTP between Gitea and traefik.

docs/content/doc/usage/reverse-proxies.zh-cn.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,19 @@ git.example.com {
106106
```
107107

108108
然后您**必须**在 Gitea 的配置文件中正确的添加类似 `[server] ROOT_URL = http://git.example.com/git/` 的配置项。
109+
110+
## 使用 Traefik 作为反向代理服务
111+
112+
如果您想使用 traefik 作为 Gitea 的反向代理服务,您可以在 `docker-compose.yaml` 中添加 label 部分(假设使用 docker 作为 traefik 的 provider):
113+
114+
```yaml
115+
gitea:
116+
image: gitea/gitea
117+
...
118+
labels:
119+
- "traefik.enable=true"
120+
- "traefik.http.routers.gitea.rule=Host(`example.com`)"
121+
- "traefik.http.services.gitea-websecure.loadbalancer.server.port=3000"
122+
```
123+
124+
这份配置假设您使用 traefik 来处理 HTTPS 服务,并在其和 Gitea 之间使用 HTTP 进行通信。

0 commit comments

Comments
 (0)