Commit Graph

84 Commits

Author SHA1 Message Date
Danila Fominykh
54fd84d83f
function to get package file property by composite key, refactoring function creating pacman database 2023-09-24 13:32:53 -03:00
Danila Fominykh
a9a5b7a2cf
service method to get package file stream 2023-09-23 20:26:51 -03:00
Danila Fominykh
a4d878c670
Merge branch 'go-gitea:main' into pacman-packages 2023-09-17 22:31:30 -03:00
JakobDev
c548dde205
More refactoring of db.DefaultContext (#27083)
Next step of #27065
2023-09-15 06:13:19 +00:00
Danila Fominykh
429477e3e1
Merge branch 'main' into pacman-packages 2023-09-12 10:02:36 -03:00
Lunny Xiao
4f32abaf94
move repository deletion to service layer (#26948)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-09-08 04:51:15 +00:00
Danila Fominykh
7c2d1b3ca3
fixed package key when getting any architecture 2023-09-07 15:23:13 -03:00
Danila Fominykh
934d1197b9
Merge branch 'go-gitea:main' into pacman-packages 2023-09-06 16:07:59 -03:00
Lunny Xiao
b9df9fa2e2
Move createrepository from module to service layer (#26927)
Repository creation depends on many models, so moving it to service
layer is better.
2023-09-06 12:08:51 +00:00
Danila Fominykh
70effa24a1
Merge branch 'go-gitea:main' into pacman-packages 2023-09-05 15:50:13 -03:00
Lunny Xiao
540bf9fa6d
Move notification interface to services layer (#26915)
Extract from #22266
2023-09-05 18:37:47 +00:00
Danila Fominykh
431dabfc5c
fixed procedure of retrieving package properties for signatures and pacman database file 2023-09-05 14:51:29 -03:00
Danila Fominykh
93b1f854c4
Merge branch 'main' into pacman-packages 2023-08-30 19:41:38 -03:00
Chongyi Zheng
ac2f8c9ac6
Reduce some allocations in type conversion (#26772) 2023-08-29 00:43:16 +08:00
merlleu
a587d25261
Add auth-required to config.json for Cargo http registry (#26729)
Cargo registry-auth feature requires config.json to have a property
auth-required set to true in order to send token to all registry
requests.
This is ok for git index because you can manually edit the config.json
file to add the auth-required, but when using sparse
(setting index url to
"sparse+https://git.example.com/api/packages/{owner}/cargo/"), the
config.json is dynamically rendered, and does not reflect changes to the
config.json file in the repo.

I see two approaches:
- Serve the real config.json file when fetching the config.json on the
cargo service.
- Automatically detect if the registry requires authorization. (This is
what I implemented in this PR).

What the PR does:
- When a cargo index repository is created, on the config.json, set
auth-required to wether or not the repository is private.
- When the cargo/config.json endpoint is called, set auth-required to
wether or not the request was authorized using an API token.
2023-08-28 07:05:39 +00:00
Danila Fominykh
27fa8158ef
fixed database creation procedure for packages with any architecture 2023-08-08 19:46:58 +03:00
Danila Fominykh
0d08eaa556
reduced amount of logic, removed unnecessary fields 2023-08-08 19:40:54 +03:00
Danila Fominykh
e86bdfcb0e
metadata and signature are stored in package properties instead of object storage 2023-08-08 16:21:17 +03:00
Danila Fominykh
2548414865
Merge branch 'main' into pacman-packages 2023-08-08 16:00:19 +03:00
KN4CK3R
0c6ae61229
Allow package cleanup from admin page (#25307)
Until now expired package data gets deleted daily by a cronjob. The
admin page shows the size of all packages and the size of unreferenced
data. The users (#25035, #20631) expect the deletion of this data if
they run the cronjob from the admin page but the job only deletes data
older than 24h.

This PR adds a new button which deletes all expired data.

![grafik](https://github.com/go-gitea/gitea/assets/1666336/b3e35d73-9496-4fa7-a20c-e5d30b1f6850)

---------

Co-authored-by: silverwind <me@silverwind.io>
2023-08-08 00:46:10 +00:00
Danila Fominykh
a3cb45cf3b
Merge branch 'main' into pacman-packages 2023-08-05 12:00:07 +03:00
KN4CK3R
2d3924d0e7
Prevent newline errors with Debian packages (#26332)
Fixes #26313
2023-08-05 10:59:52 +02:00
Danila Fominykh
28712bc91e
refactoring 2023-08-04 14:52:36 +03:00
Danila Fominykh
0c7aa7f63e
refactoring 2023-08-03 20:43:13 +03:00
Danila Fominykh
ebaa5436ad
lint corrections 2023-08-03 17:36:48 +03:00
Danila Fominykh
d069303825
fixed pacman database creation algorithm, arch UI template 2023-08-02 00:23:12 +03:00
Danila Fominykh
f422942a7a
fixed mechanics of pacman database creation 2023-07-31 12:18:18 +03:00
Danila Fominykh
3df8d52fb8
changed pacman database creation mechanics, storing package desc as file in object storage, metadata structure update 2023-07-28 16:32:01 +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
597a948e33
replaced custom auth with existing methods 2023-07-23 15:42:52 +03:00
Danila Fominykh
245a54532f
Merge branch 'main' into pacman-packages 2023-07-22 20:34:30 +03:00
Peter Verraedt
48cd82b759
Fix version in rpm repodata/primary.xml.gz (#26009)
The version listed in rpm repodata should only contain the rpm version
(1.0.0) and not the combination of version and release (1.0.0-2). We
correct this behaviour in primary.xml.gz, filelists.xml.gz and
others.xml.gz.

Signed-off-by: Peter Verraedt <peter@verraedt.be>
2023-07-21 19:41:38 +00:00
harryzcy
0f9f6567bb
Bump github.com/golang-jwt/jwt to v5 (#25975)
Bumping `github.com/golang-jwt/jwt` from v4 to v5.

`github.com/golang-jwt/jwt` v5 is bringing some breaking changes:

- standard `Valid()` method on claims is removed. It's replaced by
`ClaimsValidator` interface implementing `Validator()` method instead,
which is called after standard validation. Gitea doesn't seem to be
using this logic.
- `jwt.Token` has a field `Valid`, so it's checked in `ParseToken`
function in `services/auth/source/oauth2/token.go`

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2023-07-19 09:57:10 +00:00
Danila Fominykh
faff9d9c57 getting storage object instead of reading bytes 2023-07-17 20:30:36 +03:00
Danila Fominykh
9e7c6ef5e9 updated documentation about metadata update function 2023-07-17 00:03:24 +03:00
Danila Fominykh
e24db36962 fixed version order when creating pacman database for package with multiple versions 2023-07-16 21:15:06 +03: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
1df0a1d252 fixed file size for mock and scope of time patch 2023-07-09 18:26:01 +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
04a3ddd11a changed function retrieving package version when deleting package version and related files 2023-06-25 17:41:00 +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
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
41667b2dd1 changed signature verification library to reuse existing dependency 2023-06-23 03:59:28 +03:00
dancheg97
e75ddfd1db reused existing services/packages functions for package and signature files/blobs creation 2023-06-22 10:33:23 +03:00