-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add Package Registry #16510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add Package Registry #16510
Changes from all commits
Commits
Show all changes
184 commits
Select commit
Hold shift + click to select a range
51bc02e
Added package store settings.
KN4CK3R 48c2faf
Added models.
KN4CK3R 3e801f9
Added generic package registry.
KN4CK3R 3c86d2b
Added tests.
KN4CK3R 8d922ff
Added NuGet package registry.
KN4CK3R 2b9d96a
Moved service index to api file.
KN4CK3R 99298b7
Added NPM package registry.
KN4CK3R c7fb932
Added Maven package registry.
KN4CK3R 8aaf412
Added PyPI package registry.
KN4CK3R 06790f9
Summary is deprecated.
KN4CK3R 338dee3
Changed npm name.
KN4CK3R 0544b22
Sanitize project url.
KN4CK3R 5a3c561
Allow only scoped packages.
KN4CK3R ea36a75
Added user interface.
KN4CK3R 8c6715b
Changed method name.
KN4CK3R ec05929
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 4a57e22
Added missing migration file.
KN4CK3R b8ac3e3
Set page info.
KN4CK3R 1386b27
Added documentation.
KN4CK3R 9e5b2c0
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 8ba72d7
Added documentation links.
KN4CK3R cab94bb
Fixed wrong error message.
KN4CK3R f16296c
Lint template files.
KN4CK3R 9edf241
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 814a942
Fixed merge errors.
KN4CK3R 9417754
Fixed unit test storage path.
KN4CK3R 02708f8
Switch to json module.
KN4CK3R cb360c0
Added suggestions.
KN4CK3R 7264b7e
Added package webhook.
KN4CK3R 7625900
Add package api.
KN4CK3R 2351df1
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 53a47de
Fixed swagger file.
KN4CK3R e6075ab
Fixed enum and comments.
KN4CK3R 068b1b1
Fixed NuGet pagination.
KN4CK3R c515aa6
Print test names.
KN4CK3R 55c6b2b
Added api tests.
KN4CK3R b856141
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 6fadfe9
Fixed access level.
KN4CK3R c5a85b1
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R e60969b
Fix User unmarshal.
KN4CK3R 4ced953
Added RubyGems package registry.
KN4CK3R 291cbf5
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R c060e4a
Fix lint.
KN4CK3R cd1bc10
Implemented io.Writer.
KN4CK3R 12ca06f
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 2c9fa64
Added support for sha256/sha512 checksum files.
KN4CK3R 41efc7c
Improved maven-metadata.xml support.
KN4CK3R 1b666dc
Added support for symbol package uploads.
KN4CK3R baf7074
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 3e462af
Added tests.
KN4CK3R 39a4115
Added overview docs.
KN4CK3R fb4f039
Added npm dependencies and keywords.
KN4CK3R 08e6f82
Added no-packages information.
KN4CK3R fe02ca2
Display file size.
KN4CK3R 1cf894b
Display asset count.
KN4CK3R 03b7122
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R faf5518
Fixed filter alignment.
KN4CK3R f30b09f
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 33045a1
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 4f1ffa6
Added package icons.
KN4CK3R b1c8554
Formatted instructions.
KN4CK3R 3c5c54f
Allow anonymous package downloads.
KN4CK3R c0e542c
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 2b9574e
Fixed comments.
KN4CK3R 42aa098
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R b9e6fb1
Fixed postgres test.
KN4CK3R d186342
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 2c04814
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R cb16fe8
Moved file.
KN4CK3R af0ea8c
Moved models to models/packages.
KN4CK3R b24c033
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 7756689
Use correct error response format per client.
KN4CK3R 483d8e5
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R dacf577
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 88aa66f
Use simpler search form.
KN4CK3R fa518b6
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 3f89e67
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R c444d4b
Fixed IsProd.
KN4CK3R f3b0d77
Restructured data model.
KN4CK3R 1cef19a
Prevent empty filename.
KN4CK3R a91f780
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 4162676
Fix swagger.
KN4CK3R 86af611
Implemented user/org registry.
KN4CK3R df1ceb5
Implemented UI.
KN4CK3R 5dc9a9a
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 77485e3
Use GetUserByIDCtx.
KN4CK3R e01b8a7
Use table for dependencies.
KN4CK3R 82147e6
make svg
KN4CK3R 4d883cb
Added support for unscoped npm packages.
KN4CK3R 6335e68
Add support for npm dist tags.
KN4CK3R d16c894
Added tests for npm tags.
KN4CK3R 9e1c5c1
Unlink packages if repository gets deleted.
KN4CK3R bd9a516
Prevent user/org delete if a packages exist.
KN4CK3R b7ebbaa
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R a54cf5c
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 28b1658
Use package unlink in repository service.
KN4CK3R e12f3fc
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 1bf7106
Added support for composer packages.
KN4CK3R 1addc8e
Restructured package docs.
KN4CK3R 9c13368
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R f7d2484
Added missing tests.
KN4CK3R 3cb36d5
Fixed generic content page.
KN4CK3R 2892782
Fixed docs.
KN4CK3R 7d41635
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R e84812c
Fixed swagger.
KN4CK3R 87ac836
Added missing type.
KN4CK3R 8934214
Fixed ambiguous column.
KN4CK3R c910dd8
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R a86fd67
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R e0f9085
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R abf508f
Organize content store by sha256 hash.
KN4CK3R b01d240
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 1239f82
Added admin package management.
KN4CK3R ea24bfd
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 14179c5
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 16edc81
Added support for sorting.
KN4CK3R 2b3dd59
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 842308c
Add support for multiple identical versions/files.
KN4CK3R da48b2e
Added missing repository unlink.
KN4CK3R df81183
Added file properties.
KN4CK3R ec9f89e
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R b4bf28e
make fmt
KN4CK3R ac23797
lint
KN4CK3R 80a69aa
Added Conan package registry.
KN4CK3R ba7f050
Updated docs.
KN4CK3R b10ef75
Unify package names.
KN4CK3R 168e32a
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 83148f2
Added swagger enum.
KN4CK3R c6eca22
Use longer TEXT column type.
KN4CK3R 417308d
Removed version composite key.
KN4CK3R 6e12833
Merged package and container registry.
KN4CK3R bfae746
Removed index.
KN4CK3R c6a45ff
Use dedicated package router.
KN4CK3R 1b4854c
Moved files to new location.
KN4CK3R c209e68
Updated docs.
KN4CK3R 04b3aae
Fixed JOIN order.
KN4CK3R ff51ca9
Fixed GROUP BY statement.
KN4CK3R fa0c89c
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R f596b58
Fixed GROUP BY #2.
KN4CK3R 6bdf396
Added symbol server support.
KN4CK3R e70ec8e
Added more tests.
KN4CK3R 0aa6069
Set NOT NULL.
KN4CK3R a5216a0
Added setting to disable package registries.
KN4CK3R 779c5d9
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 7ba602c
Moved auth into service.
KN4CK3R 0293e77
refactor
KN4CK3R 9af3259
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 35c04f0
Use ctx everywhere.
KN4CK3R 118770f
Added package cleanup task.
KN4CK3R abf3a1e
Changed packages path.
KN4CK3R 5a4128a
Added container registry.
KN4CK3R 3b8b071
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R f41cbf0
Refactoring
KN4CK3R 17b949e
Updated comparison.
KN4CK3R dd953f2
Fix swagger.
KN4CK3R 6804517
Fixed table order.
KN4CK3R 15246c2
Use token auth for npm routes.
KN4CK3R 250443d
Enabled ReverseProxy auth.
KN4CK3R 00dbfe2
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 5f8e6b2
Added packages link for orgs.
KN4CK3R d8b1c69
Fixed anonymous org access.
KN4CK3R cb59cbd
Enable copy button for setup instructions.
KN4CK3R d87c42b
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 6e24f6f
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 70c3825
Merge error
KN4CK3R af95307
Added suggestions.
KN4CK3R 8af95ef
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 1bf5b5f
Fixed merge.
KN4CK3R c05f9fa
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 4aab760
Merge branch 'main' into feature-packages
wxiaoguang 431ba7c
Merge branch 'main' into feature-packages
wxiaoguang be74e4d
Handle "generic".
KN4CK3R 3cb84ef
Added link for TODO.
KN4CK3R 20facab
Added suggestions.
KN4CK3R 64d02e3
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R 3a51b83
Merge branch 'feature-packages' of https://github.com/KN4CK3R/gitea i…
KN4CK3R 10c5f03
Changed temporary buffer filename.
KN4CK3R 5d08e80
Merge branch 'main' into feature-packages
wxiaoguang dbbbfa4
Added suggestions.
KN4CK3R 7efd245
Merge branch 'main' of https://github.com/go-gitea/gitea into feature…
KN4CK3R f55dcbf
Merge branch 'main' into feature-packages
wxiaoguang 1d4ce1a
Apply suggestions from code review
wxiaoguang 84ff7b0
Update docs/content/doc/packages/nuget.en-us.md
wxiaoguang 16f8940
Merge branch 'main' into feature-packages
wxiaoguang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,6 @@ draft: false | |
menu: | ||
sidebar: | ||
name: "Developers" | ||
weight: 50 | ||
weight: 55 | ||
identifier: "developers" | ||
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,6 @@ draft: false | |
menu: | ||
sidebar: | ||
name: "開發人員" | ||
weight: 50 | ||
weight: 55 | ||
identifier: "developers" | ||
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
date: "2021-07-20T00:00:00+00:00" | ||
title: "Package Registry" | ||
slug: "packages" | ||
toc: false | ||
draft: false | ||
menu: | ||
sidebar: | ||
name: "Package Registry" | ||
weight: 45 | ||
identifier: "packages" | ||
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
--- | ||
date: "2021-07-20T00:00:00+00:00" | ||
title: "Composer Packages Repository" | ||
slug: "packages/composer" | ||
draft: false | ||
toc: false | ||
menu: | ||
sidebar: | ||
parent: "packages" | ||
name: "Composer" | ||
weight: 10 | ||
identifier: "composer" | ||
--- | ||
|
||
# Composer Packages Repository | ||
|
||
Publish [Composer](https://getcomposer.org/) packages for your user or organization. | ||
|
||
**Table of Contents** | ||
|
||
{{< toc >}} | ||
|
||
## Requirements | ||
|
||
To work with the Composer package registry, you can use [Composer](https://getcomposer.org/download/) to consume and a HTTP upload client like `curl` to publish packages. | ||
|
||
## Publish a package | ||
|
||
To publish a Composer package perform a HTTP PUT operation with the package content in the request body. | ||
The package content must be the zipped PHP project with the `composer.json` file. | ||
You cannot publish a package if a package of the same name and version already exists. You must delete the existing package first. | ||
|
||
``` | ||
PUT https://gitea.example.com/api/packages/{owner}/composer | ||
``` | ||
|
||
| Parameter | Description | | ||
| ---------- | ----------- | | ||
| `owner` | The owner of the package. | | ||
|
||
If the `composer.json` file does not contain a `version` property, you must provide it as a query parameter: | ||
|
||
``` | ||
PUT https://gitea.example.com/api/packages/{owner}/composer?version={x.y.z} | ||
``` | ||
|
||
Example request using HTTP Basic authentication: | ||
|
||
```shell | ||
curl --user your_username:your_password_or_token \ | ||
--upload-file path/to/project.zip \ | ||
https://gitea.example.com/api/packages/testuser/composer | ||
``` | ||
|
||
Or specify the package version as query parameter: | ||
|
||
```shell | ||
curl --user your_username:your_password_or_token \ | ||
--upload-file path/to/project.zip \ | ||
https://gitea.example.com/api/packages/testuser/composer?version=1.0.3 | ||
``` | ||
|
||
The server responds 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. | | ||
wxiaoguang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Configuring the package registry | ||
|
||
To register the package registry you need to add it to the Composer `config.json` file (which can usually be found under `<user-home-dir>/.composer/config.json`): | ||
|
||
```json | ||
{ | ||
"repositories": [{ | ||
"type": "composer", | ||
"url": "https://gitea.example.com/api/packages/{owner}/composer" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
To access the package registry using credentials, you must specify them in the `auth.json` file as follows: | ||
|
||
```json | ||
{ | ||
"http-basic": { | ||
"gitea.example.com": { | ||
"username": "{username}", | ||
"password": "{password}" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
| Parameter | Description | | ||
| ---------- | ----------- | | ||
| `owner` | The owner of the package. | | ||
| `username` | Your Gitea username. | | ||
| `password` | Your Gitea password or a personal access token. | | ||
|
||
## Install a package | ||
|
||
To install a package from the package registry, execute the following command: | ||
|
||
```shell | ||
composer require {package_name} | ||
``` | ||
|
||
Optional you can specify the package version: | ||
|
||
```shell | ||
composer require {package_name}:{package_version} | ||
``` | ||
|
||
| Parameter | Description | | ||
| ----------------- | ----------- | | ||
| `package_name` | The package name. | | ||
| `package_version` | The package version. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
--- | ||
date: "2021-07-20T00:00:00+00:00" | ||
title: "Conan Packages Repository" | ||
slug: "packages/conan" | ||
draft: false | ||
toc: false | ||
menu: | ||
sidebar: | ||
parent: "packages" | ||
name: "Conan" | ||
weight: 20 | ||
identifier: "conan" | ||
--- | ||
|
||
# Conan Packages Repository | ||
|
||
Publish [Conan](https://conan.io/) packages for your user or organization. | ||
|
||
**Table of Contents** | ||
|
||
{{< toc >}} | ||
|
||
## Requirements | ||
|
||
To work with the Conan package registry, you need to use the [conan](https://conan.io/downloads.html) command line tool to consume and publish packages. | ||
|
||
## Configuring the package registry | ||
|
||
To register the package registry you need to configure a new Conan remote: | ||
|
||
```shell | ||
conan remote add {remote} https://gitea.example.com/api/packages/{owner}/conan | ||
conan user --remote {remote} --password {password} {username} | ||
``` | ||
|
||
| Parameter | Description | | ||
| -----------| ----------- | | ||
| `remote` | The remote name. | | ||
| `username` | Your Gitea username. | | ||
| `password` | Your Gitea password or a personal access token. | | ||
| `owner` | The owner of the package. | | ||
|
||
For example: | ||
|
||
```shell | ||
conan remote add gitea https://gitea.example.com/api/packages/testuser/conan | ||
conan user --remote gitea --password password123 testuser | ||
``` | ||
|
||
## Publish a package | ||
|
||
Publish a Conan package by running the following command: | ||
|
||
```shell | ||
conan upload --remote={remote} {recipe} | ||
``` | ||
|
||
| Parameter | Description | | ||
| ----------| ----------- | | ||
| `remote` | The remote name. | | ||
| `recipe` | The recipe to upload. | | ||
|
||
For example: | ||
|
||
```shell | ||
conan upload --remote=gitea ConanPackage/1.2@gitea/final | ||
``` | ||
|
||
The Gitea Conan package registry has full [revision](https://docs.conan.io/en/latest/versioning/revisions.html) support. | ||
|
||
## Install a package | ||
|
||
To install a Conan package from the package registry, execute the following command: | ||
|
||
```shell | ||
conan install --remote={remote} {recipe} | ||
``` | ||
|
||
| Parameter | Description | | ||
| ----------| ----------- | | ||
| `remote` | The remote name. | | ||
| `recipe` | The recipe to download. | | ||
|
||
For example: | ||
|
||
```shell | ||
conan install --remote=gitea ConanPackage/1.2@gitea/final | ||
``` | ||
|
||
## Supported commands | ||
|
||
``` | ||
conan install | ||
conan get | ||
conan info | ||
conan search | ||
conan upload | ||
conan user | ||
conan download | ||
conan remove | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.