aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorExploding Dragon <explodingfkl@gmail.com>2024-01-12 11:16:05 +0800
committerGitHub <noreply@github.com>2024-01-12 03:16:05 +0000
commitba4d0b8ffbd78473273800f586ae8bde55cda6c5 (patch)
treed828fd0f24bf6ddb38b2b4993b152f225c778c0a /docs
parent7c2f093e856395cc118dcaa390b7a2234b8363f3 (diff)
downloadgitea-ba4d0b8ffbd78473273800f586ae8bde55cda6c5.tar.gz
gitea-ba4d0b8ffbd78473273800f586ae8bde55cda6c5.zip
Support for grouping RPMs using paths (#26984)
The current rpm repository places all packages in the same repository, and different systems (el7,f34) may hit packages that do not belong to this distribution ( #25304 ) , which now supports grouping of rpm. ![图片](https://github.com/go-gitea/gitea/assets/33776693/d1e1d99f-7799-4b2b-a19b-cb2a5c692914) Fixes #25304 . Fixes #27056 . Refactor: [#25866](https://github.com/go-gitea/gitea/pull/25866)
Diffstat (limited to 'docs')
-rw-r--r--docs/content/usage/packages/rpm.en-us.md33
-rw-r--r--docs/content/usage/packages/rpm.zh-cn.md25
2 files changed, 32 insertions, 26 deletions
diff --git a/docs/content/usage/packages/rpm.en-us.md b/docs/content/usage/packages/rpm.en-us.md
index 5a4a31ee39..586e48d47f 100644
--- a/docs/content/usage/packages/rpm.en-us.md
+++ b/docs/content/usage/packages/rpm.en-us.md
@@ -27,17 +27,18 @@ The following examples use `dnf`.
To register the RPM registry add the url to the list of known apt sources:
```shell
-dnf config-manager --add-repo https://gitea.example.com/api/packages/{owner}/rpm.repo
+dnf config-manager --add-repo https://gitea.example.com/api/packages/{owner}/rpm/{group}.repo
```
-| Placeholder | Description |
-| ----------- | ----------- |
-| `owner` | The owner of the package. |
+| Placeholder | Description |
+| ----------- |----------------------------------------------------|
+| `owner` | The owner of the package. |
+| `group` | Everything, e.g. `el7`, `rocky/el9` , `test/fc38`.|
If the registry is private, provide credentials in the url. You can use a password or a [personal access token](development/api-usage.md#authentication):
```shell
-dnf config-manager --add-repo https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/rpm.repo
+dnf config-manager --add-repo https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/rpm/{group}.repo
```
You have to add the credentials to the urls in the `rpm.repo` file in `/etc/yum.repos.d` too.
@@ -47,19 +48,20 @@ You have to add the credentials to the urls in the `rpm.repo` file in `/etc/yum.
To publish a RPM package (`*.rpm`), perform a HTTP PUT operation with the package content in the request body.
```
-PUT https://gitea.example.com/api/packages/{owner}/rpm/upload
+PUT https://gitea.example.com/api/packages/{owner}/rpm/{group}/upload
```
| Parameter | Description |
| --------- | ----------- |
| `owner` | The owner of the package. |
+| `group` | Everything, e.g. `el7`, `rocky/el9` , `test/fc38`.|
Example request using HTTP Basic authentication:
```shell
curl --user your_username:your_password_or_token \
--upload-file path/to/file.rpm \
- https://gitea.example.com/api/packages/testuser/rpm/upload
+ https://gitea.example.com/api/packages/testuser/rpm/centos/el7/upload
```
If you are using 2FA or OAuth use a [personal access token](development/api-usage.md#authentication) instead of the password.
@@ -78,21 +80,22 @@ The server responds with the following HTTP Status codes.
To delete an RPM 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}/rpm/{package_name}/{package_version}/{architecture}
+DELETE https://gitea.example.com/api/packages/{owner}/rpm/{group}/package/{package_name}/{package_version}/{architecture}
```
-| Parameter | Description |
-| ----------------- | ----------- |
-| `owner` | The owner of the package. |
-| `package_name` | The package name. |
-| `package_version` | The package version. |
-| `architecture` | The package architecture. |
+| Parameter | Description |
+|-------------------|----------------------------|
+| `owner` | The owner of the package. |
+| `group` | The package group . |
+| `package_name` | The package name. |
+| `package_version` | The package version. |
+| `architecture` | The package architecture. |
Example request using HTTP Basic authentication:
```shell
curl --user your_username:your_token_or_password -X DELETE \
- https://gitea.example.com/api/packages/testuser/rpm/test-package/1.0.0/x86_64
+ https://gitea.example.com/api/packages/testuser/rpm/centos/el7/package/test-package/1.0.0/x86_64
```
The server responds with the following HTTP Status codes.
diff --git a/docs/content/usage/packages/rpm.zh-cn.md b/docs/content/usage/packages/rpm.zh-cn.md
index 3cc7dca8ff..cbe74bfee2 100644
--- a/docs/content/usage/packages/rpm.zh-cn.md
+++ b/docs/content/usage/packages/rpm.zh-cn.md
@@ -27,17 +27,18 @@ menu:
要注册RPM注册表,请将 URL 添加到已知 `apt` 源列表中:
```shell
-dnf config-manager --add-repo https://gitea.example.com/api/packages/{owner}/rpm.repo
+dnf config-manager --add-repo https://gitea.example.com/api/packages/{owner}/rpm/{group}.repo
```
-| 占位符 | 描述 |
-| ------- | -------------- |
-| `owner` | 软件包的所有者 |
+| 占位符 | 描述 |
+| ------- |--------------------------------------|
+| `owner` | 软件包的所有者 |
+| `group` | 任何名称,例如 `centos/7`、`el-7`、`fc38` |
如果注册表是私有的,请在URL中提供凭据。您可以使用密码或[个人访问令牌](development/api-usage.md#通过-api-认证):
```shell
-dnf config-manager --add-repo https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/rpm.repo
+dnf config-manager --add-repo https://{username}:{your_password_or_token}@gitea.example.com/api/packages/{owner}/rpm/{group}.repo
```
您还必须将凭据添加到 `/etc/yum.repos.d` 中的 `rpm.repo` 文件中的URL中。
@@ -47,19 +48,20 @@ dnf config-manager --add-repo https://{username}:{your_password_or_token}@gitea.
要发布RPM软件包(`*.rpm`),请执行带有软件包内容的 HTTP `PUT` 操作。
```
-PUT https://gitea.example.com/api/packages/{owner}/rpm/upload
+PUT https://gitea.example.com/api/packages/{owner}/rpm/{group}/upload
```
| 参数 | 描述 |
-| ------- | -------------- |
-| `owner` | 软件包的所有者 |
+| ------- |--------------|
+| `owner` | 软件包的所有者 |
+| `group` | 软件包自定义分组名称 |
使用HTTP基本身份验证的示例请求:
```shell
curl --user your_username:your_password_or_token \
--upload-file path/to/file.rpm \
- https://gitea.example.com/api/packages/testuser/rpm/upload
+ https://gitea.example.com/api/packages/testuser/rpm/centos/el7/version/upload
```
如果您使用 2FA 或 OAuth,请使用[个人访问令牌](development/api-usage.md#通过-api-认证)替代密码。您无法将具有相同名称的文件两次发布到软件包中。您必须先删除现有的软件包版本。
@@ -77,12 +79,13 @@ curl --user your_username:your_password_or_token \
要删除 RPM 软件包,请执行 HTTP `DELETE` 操作。如果没有文件剩余,这也将删除软件包版本。
```
-DELETE https://gitea.example.com/api/packages/{owner}/rpm/{package_name}/{package_version}/{architecture}
+DELETE https://gitea.example.com/api/packages/{owner}/rpm/{group}/package/{package_name}/{package_version}/{architecture}
```
| 参数 | 描述 |
| ----------------- | -------------- |
| `owner` | 软件包的所有者 |
+| `group` | 软件包自定义分组 |
| `package_name` | 软件包名称 |
| `package_version` | 软件包版本 |
| `architecture` | 软件包架构 |
@@ -91,7 +94,7 @@ DELETE https://gitea.example.com/api/packages/{owner}/rpm/{package_name}/{packag
```shell
curl --user your_username:your_token_or_password -X DELETE \
- https://gitea.example.com/api/packages/testuser/rpm/test-package/1.0.0/x86_64
+ https://gitea.example.com/api/packages/testuser/rpm/centos/el7/package/test-package/1.0.0/x86_64
```
服务器将以以下HTTP状态码响应: