aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2024-01-19 12:37:10 +0100
committerGitHub <noreply@github.com>2024-01-19 11:37:10 +0000
commit461d8b53c2e51a8a6a1715ba40ac61d7e9f93971 (patch)
tree2bad0b2908f9f3e76d9a195c4fe1c66016b8bcbf /docs
parent075c4c89ee28590bd4ab8f6cf7338d723c4696eb (diff)
downloadgitea-461d8b53c2e51a8a6a1715ba40ac61d7e9f93971.tar.gz
gitea-461d8b53c2e51a8a6a1715ba40ac61d7e9f93971.zip
Fix some RPM registry flaws (#28782)
Related #26984 (https://github.com/go-gitea/gitea/pull/26984#issuecomment-1889588912) Fix admin cleanup message. Fix models `Get` not respecting default values. Rebuild RPM repository files after cleanup. Do not add RPM group to package version name. Force stable sorting of Alpine/Debian/RPM repository data. Fix missing deferred `Close`. Add tests for multiple RPM groups. Removed non-cached `ReplaceAllStringRegex`. If there are multiple groups available, it's stated in the package installation screen: ![grafik](https://github.com/go-gitea/gitea/assets/1666336/8f132760-882c-4ab8-9678-77e47dfc4415)
Diffstat (limited to 'docs')
-rw-r--r--docs/content/usage/packages/rpm.en-us.md49
1 files changed, 35 insertions, 14 deletions
diff --git a/docs/content/usage/packages/rpm.en-us.md b/docs/content/usage/packages/rpm.en-us.md
index 586e48d47f..1f93376b7b 100644
--- a/docs/content/usage/packages/rpm.en-us.md
+++ b/docs/content/usage/packages/rpm.en-us.md
@@ -24,16 +24,26 @@ The following examples use `dnf`.
## Configuring the package registry
-To register the RPM registry add the url to the list of known apt sources:
+To register the RPM registry add the url to the list of known sources:
```shell
dnf config-manager --add-repo https://gitea.example.com/api/packages/{owner}/rpm/{group}.repo
```
-| Placeholder | Description |
-| ----------- |----------------------------------------------------|
-| `owner` | The owner of the package. |
-| `group` | Everything, e.g. `el7`, `rocky/el9` , `test/fc38`.|
+| Placeholder | Description |
+| ----------- | ----------- |
+| `owner` | The owner of the package. |
+| `group` | Optional: Everything, e.g. empty, `el7`, `rocky/el9`, `test/fc38`. |
+
+Example:
+
+```shell
+# without a group
+dnf config-manager --add-repo https://gitea.example.com/api/packages/testuser/rpm.repo
+
+# with the group 'centos/el7'
+dnf config-manager --add-repo https://gitea.example.com/api/packages/testuser/rpm/centos/el7.repo
+```
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):
@@ -41,7 +51,7 @@ If the registry is private, provide credentials in the url. You can use a passwo
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.
+You have to add the credentials to the urls in the created `.repo` file in `/etc/yum.repos.d` too.
## Publish a package
@@ -54,11 +64,17 @@ 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`.|
+| `group` | Optional: Everything, e.g. empty, `el7`, `rocky/el9`, `test/fc38`. |
Example request using HTTP Basic authentication:
```shell
+# without a group
+curl --user your_username:your_password_or_token \
+ --upload-file path/to/file.rpm \
+ https://gitea.example.com/api/packages/testuser/rpm/upload
+
+# with the group 'centos/el7'
curl --user your_username:your_password_or_token \
--upload-file path/to/file.rpm \
https://gitea.example.com/api/packages/testuser/rpm/centos/el7/upload
@@ -83,17 +99,22 @@ To delete an RPM package perform a HTTP DELETE operation. This will delete the p
DELETE https://gitea.example.com/api/packages/{owner}/rpm/{group}/package/{package_name}/{package_version}/{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. |
+| Parameter | Description |
+| ----------------- | ----------- |
+| `owner` | The owner of the package. |
+| `group` | Optional: The package group. |
+| `package_name` | The package name. |
+| `package_version` | The package version. |
+| `architecture` | The package architecture. |
Example request using HTTP Basic authentication:
```shell
+# without a group
+curl --user your_username:your_token_or_password -X DELETE \
+ https://gitea.example.com/api/packages/testuser/rpm/package/test-package/1.0.0/x86_64
+
+# with the group 'centos/el7'
curl --user your_username:your_token_or_password -X DELETE \
https://gitea.example.com/api/packages/testuser/rpm/centos/el7/package/test-package/1.0.0/x86_64
```