silverwind
672b00b542
Merge branch 'main' into pacman-packages
2023-07-25 00:02:26 +02:00
KN4CK3R
6aa30af724
Fix handling of Debian files with trailing slash ( #26087 )
...
Fixes #26022
- Fix handling of files with trailing slash
- Fix handling of duplicate package file errors
- Added test for both
2023-07-24 16:19:44 +02:00
Danila Fominykh
23f1ba193d
replaced base domain variable in metadata with registry host variable in similarly with container registry
2023-07-24 13:33:45 +03:00
Danila Fominykh
0093004d0f
removed distro field from arch package metadata, corrected related UI
2023-07-23 20:18:26 +03:00
Danila Fominykh
1a082903d7
Merge branch 'main' into pacman-packages
2023-07-16 13:09:54 +03:00
KN4CK3R
bd82d8974e
Add support for different Maven POM encoding ( #25873 )
...
Fixes #25853
- Maven POM files aren't always UTF-8 encoded.
- Reject the upload of unparsable POM files
2023-07-14 09:39:15 +00:00
dancheg97
c4f3fb302b
markdown and code documentation lint corrections
2023-07-12 13:32:38 +03:00
dancheg97
8195185607
lint corrections
2023-07-10 20:50:44 +03:00
dancheg97
364c33b0ad
fixed pacman database creation error for case with multiple architectures and distributions
2023-07-09 11:48:46 +03:00
silverwind
b5db5b89e8
Merge branch 'main' into pacman-packages
2023-07-04 20:43:36 +02:00
silverwind
88f835192d
Replace interface{}
with any
( #25686 )
...
Result of running `perl -p -i -e 's#interface\{\}#any#g' **/*` and `make fmt`.
Basically the same [as golang did](2580d0e08d
).
2023-07-04 18:36:08 +00:00
KN4CK3R
c890454769
Add direct serving of package content ( #25543 )
...
Fixes #24723
Direct serving of content aka HTTP redirect is not mentioned in any of
the package registry specs but lots of official registries do that so it
should be supported by the usual clients.
2023-07-03 15:33:28 +02:00
dancheg97
56772de730
corrected package blob structure, pacman database is created on get request automatically from package metadata in database
2023-07-02 23:03:34 +03:00
dancheg97
39e42f7c2b
fixed dependencies appended to wrong field in metadata
2023-06-26 17:10:04 +03:00
dancheg97
f1fae9ada6
changed procedure of package metadata ejection, removed unnecessary fields and unnecessary string conversions
2023-06-26 12:28:14 +03:00
dancheg97
1d1a5a312f
added function removing old package entries from pacman database to avoid duplication error
2023-06-25 23:05:02 +03:00
dancheg97
5beeb24684
added method to remove package verified with user's GPG key, removed unnecessary directory creation
2023-06-25 13:15:29 +03:00
dancheg97
c37231189b
corrected package database connection description and documentation reference in UI
2023-06-24 18:08:18 +03:00
dancheg97
e2b12f2db7
fixed error when attempting to read empty database
2023-06-24 17:27:39 +03:00
dancheg97
e399ce8452
opdated operation pacman database craetion to form or update database file in memory, added download counter related to pkg.tar.zst files
2023-06-24 13:37:33 +03:00
dancheg97
b354f027ff
code refactoring and package version publisher id correction
2023-06-21 23:30:07 +03:00
dancheg97
808a7aed67
replaced zstd with archiver and limit reader to speed up metadata ejection and remove windows incompatible dependency
2023-06-21 14:05:25 +03:00
dancheg97
ec18d9b535
added arch packages implementation
2023-06-20 23:08:48 +03:00
KN4CK3R
cdb088cec2
Add CRAN package registry ( #22331 )
...
This PR adds a [CRAN](https://cran.r-project.org/ ) package registry.

2023-05-22 10:57:49 +08:00
KN4CK3R
5968c63a11
Add Go package registry ( #24687 )
...
Fixes #7608
This PR adds a Go package registry usable with the Go proxy protocol.

2023-05-14 23:38:40 +08:00
KN4CK3R
9173e079ae
Add Alpine package registry ( #23714 )
...
This PR adds an Alpine package registry. You can follow [this
tutorial](https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package )
to build a *.apk package for testing.
This functionality is similar to the Debian registry (#22854 ) and
therefore shares some methods. I marked this PR as blocked because it
should be merged after #22854 .

---------
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-05-12 17:27:50 +00:00
KN4CK3R
05209f0d1d
Add RPM registry ( #23380 )
...
Fixes #20751
This PR adds a RPM package registry. You can follow [this
tutorial](https://opensource.com/article/18/9/how-build-rpm-packages ) to
build a *.rpm package for testing.
This functionality is similar to the Debian registry (#22854 ) and
therefore shares some methods. I marked this PR as blocked because it
should be merged after #22854 .

2023-05-05 20:33:37 +00:00
KN4CK3R
bf999e4069
Add Debian package registry ( #24426 )
...
Co-authored-by: @awkwardbunny
This PR adds a Debian package registry.
You can follow [this
tutorial](https://www.baeldung.com/linux/create-debian-package ) to build
a *.deb package for testing.
Source packages are not supported at the moment and I did not find
documentation of the architecture "all" and how these packages should be
treated.

Part of #20751 .
Revised copy of #22854 .
---------
Co-authored-by: Brian Hong <brian@hongs.me>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-05-02 12:31:35 -04:00
Yarden Shoham
c0ddec8a2a
Revert "Add Debian package registry" ( #24412 )
...
Reverts go-gitea/gitea#22854
2023-04-28 18:06:41 -04:00
KN4CK3R
bf77e2163b
Add Debian package registry ( #22854 )
...
Co-authored-by: @awkwardbunny
This PR adds a Debian package registry. You can follow [this
tutorial](https://www.baeldung.com/linux/create-debian-package ) to build
a *.deb package for testing. Source packages are not supported at the
moment and I did not find documentation of the architecture "all" and
how these packages should be treated.
---------
Co-authored-by: Brian Hong <brian@hongs.me>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2023-04-28 17:51:36 -04:00
KN4CK3R
f1173d6879
Use more specific test methods ( #24265 )
...
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-04-22 17:56:27 -04:00
KN4CK3R
fbd4eaceed
Display image size for multiarch container images ( #23821 )
...
Fixes #23771
Changes the display of different architectures for multiarch images to
show the image size:

2023-04-02 17:53:37 +08:00
Zettat123
46addc1f93
Return repository
in npm package metadata endpoint ( #23539 )
...
Close #23444
Add `Repository` to npm package `Metadata` struct so the `repository` in
`package.json` can be stored and be returned in the endpoint.
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2023-03-17 14:39:19 -04:00
KN4CK3R
c709fa17a7
Add Swift package registry ( #22404 )
...
This PR adds a [Swift](https://www.swift.org/ ) package registry.

2023-03-13 15:28:39 -05:00
KN4CK3R
f8c1e14a13
Use import of OCI structs ( #22765 )
...
Fixes #22758
Otherwise we would need to rewrite the structs in `oci.go`.
2023-02-06 10:07:09 +00:00
KN4CK3R
d987ac6bf1
Add Chef package registry ( #22554 )
...
This PR implements a [Chef registry](https://chef.io/ ) to manage
cookbooks. This package type was a bit complicated because Chef uses RSA
signed requests as authentication with the registry.


Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-02-06 09:49:21 +08:00
KN4CK3R
df789d962b
Add Cargo package registry ( #21888 )
...
This PR implements a [Cargo registry](https://doc.rust-lang.org/cargo/ )
to manage Rust packages. This package type was a little bit more
complicated because Cargo needs an additional Git repository to store
its package index.
Screenshots:



---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2023-02-05 18:12:31 +08:00
KN4CK3R
6ba9ff7b48
Add Conda package registry ( #22262 )
...
This PR adds a [Conda](https://conda.io/ ) package registry.
2023-02-01 12:30:39 -06:00
KN4CK3R
3fef47b41c
Use ErrInvalidArgument in packages ( #22268 )
...
Related to
https://github.com/go-gitea/gitea/pull/22262#discussion_r1059010774
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
2022-12-31 12:49:37 +01:00
KN4CK3R
86ace4b5c2
Normalize NuGet package version on upload ( #22186 )
...
Fixes #22178
After this change upload versions with different semver metadata are
treated as the same version and trigger a duplicated version error.
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-12-20 22:20:23 -05:00
Jason Song
9607750b5e
Replace fmt.Sprintf with hex.EncodeToString ( #21960 )
...
`hex.EncodeToString` has better performance than `fmt.Sprintf("%x",
[]byte)`, we should use it as much as possible.
I'm not an extreme fan of performance, so I think there are some
exceptions:
- `fmt.Sprintf("%x", func(...)[N]byte())`
- We can't slice the function return value directly, and it's not worth
adding lines.
```diff
func A()[20]byte { ... }
- a := fmt.Sprintf("%x", A())
- a := hex.EncodeToString(A()[:]) // invalid
+ tmp := A()
+ a := hex.EncodeToString(tmp[:])
```
- `fmt.Sprintf("%X", []byte)`
- `strings.ToUpper(hex.EncodeToString(bytes))` has even worse
performance.
2022-11-28 11:19:18 +00:00
flynnnnnnnnnn
e81ccc406b
Implement FSFE REUSE for golang files ( #21840 )
...
Change all license headers to comply with REUSE specification.
Fix #16132
Co-authored-by: flynnnnnnnnnn <flynnnnnnnnnn@github>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
2022-11-27 18:20:29 +00:00
KN4CK3R
a1ae83f36e
Workaround for container registry push/pull errors ( #21862 )
...
This PR addresses #19586
I added a mutex to the upload version creation which will prevent the
push errors when two requests try to create these database entries. I'm
not sure if this should be the final solution for this problem.
I added a workaround to allow a reupload of missing blobs. Normally a
reupload is skipped because the database knows the blob is already
present. The workaround checks if the blob exists on the file system.
This should not be needed anymore with the above fix so I marked this
code to be removed with Gitea v1.20.
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-11-25 13:47:46 +08:00
Jason Song
e4eaa68a2b
Replace yaml.v2 with yaml.v3 ( #21832 )
...
I don't see why we have to use two versions of yaml. The difference
between the two versions has nothing to do with our usage.
2022-11-21 16:36:59 +08:00
zeripath
c772934ff6
Adjust gitea doctor --run storages to check all storage types ( #21785 )
...
The doctor check `storages` currently only checks the attachment
storage. This PR adds some basic garbage collection functionality for
the other types of storage.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-11-15 16:08:59 +08:00
delvh
0ebb45cfe7
Replace all instances of fmt.Errorf(%v) with fmt.Errorf(%w) ( #21551 )
...
Found using
`find . -type f -name '*.go' -print -exec vim {} -c
':%s/fmt\.Errorf(\(.*\)%v\(.*\)err/fmt.Errorf(\1%w\2err/g' -c ':wq' \;`
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2022-10-24 20:29:17 +01:00
KN4CK3R
0e58201d1a
Add support for Chocolatey/NuGet v2 API ( #21393 )
...
Fixes #21294
This PR adds support for NuGet v2 API.
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2022-10-13 18:19:39 +08:00
eleith
bbbf9a4b93
npm package registry support for bin
( #21372 )
...
Fix #21303
npm package.json supports binary packaging:
https://docs.npmjs.com/cli/v8/configuring-npm/package-json#bin
the npm registry documents that the binary references will be attached
to the abbreviated version object:
https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-version-object
unfortunately their api documentation leaves this out:
https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-version-objectdoc
which is likely to be the reason this was left out in gitea's initial
implementation
this response is critical for npm to install the binary in the `.bin`
folder so as to be included on the users default bin path, resulting in
immediate access to any binaries provided by the package
2022-10-08 13:24:44 +08:00
KN4CK3R
904b324716
Fix empty container layer history and UI ( #21251 )
...
Fixes #21248
2022-09-27 15:03:24 +02:00
Jack Vine
83680c97a7
NPM Package Registry search API endpoint ( #20280 )
...
Close #20098 , in the NPM registry API, implemented to match what's described by https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md#get-v1search
Currently have only implemented the bare minimum to work with the [Unity Package Manager](https://docs.unity3d.com/Manual/upm-ui.html ).
Co-authored-by: Jack Vine <jackv@jack-lemur-suse.cat-prometheus.ts.net>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2022-09-24 19:24:33 +08:00