Commit graph

694 commits

Author SHA1 Message Date
moson-mo
7a9448a3e5
perf: improve packages search-query
Improves performance for queries with large result sets.

The "group by" clause can be removed for all search types but the keywords.

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-01-05 22:00:32 +01:00
moson-mo
d8e91d058c
fix(rpc): provides search should return name match
We need to return packages matching on the name as well.
(A package always provides itself)

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-01-03 15:58:45 +01:00
Leonidas Spyropoulos
c74772cb36
chore: bump to v6.1.9
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-11-27 10:34:07 +00:00
moson-mo
d5e102e3f4
feat: add "Submitter" field to /rpc info request
Signed-off-by: moson-mo <mo-son@mailbox.org>
2022-11-22 18:46:57 +01:00
Leonidas Spyropoulos
ff92e95f7a
fix: delete associated ssh public keys with account deletion
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-11-22 16:51:09 +00:00
Leonidas Spyropoulos
bce5b81acd
feat: allow filtering requests from maintainers
These are usually easy to handle from TUs so allow to filter for them

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-11-22 16:39:11 +00:00
Leonidas Spyropoulos
500d6b403b
feat: add co-maintainers to RPC
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-11-22 16:32:51 +00:00
moson-mo
bcd808ddc1
feat(rpc): add "by" parameter - comaintainers
Add "by" parameter: comaintainers

Signed-off-by: moson-mo <mo-son@mailbox.org>
2022-11-11 11:32:39 +01:00
moson-mo
efd20ed2c7
feat(rpc): add "by" parameter - keywords
Add "by" parameter: keywords

Signed-off-by: moson-mo <mo-son@mailbox.org>
2022-11-11 11:32:31 +01:00
moson-mo
5484e68b42
feat(rpc): add "by" parameter - submitter
Add "by" parameter: submitter

Signed-off-by: moson-mo <mo-son@mailbox.org>
2022-11-11 11:32:19 +01:00
moson-mo
0583f30a53
feat(rpc): add "by" parameter - groups
Adding "by" parameter to search by "groups"

Signed-off-by: moson-mo <mo-son@mailbox.org>
2022-11-11 11:32:01 +01:00
moson-mo
50287cb066
feat(rpc): add "by" parameters - package relations
This adds new "by" search-parameters: provides, conflicts and replaces

Signed-off-by: moson-mo <mo-son@mailbox.org>
2022-11-11 11:30:44 +01:00
Leonidas Spyropoulos
73f0bddf0b
fix: handle default requests when using pages
The default page shows the pending requests which were working OK if one
used the Filters button. This fixes the case when someone submits by
using the pager (Next, Last etc).

Closes: #405

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-11-08 13:14:42 +00:00
Leonidas Spyropoulos
c0e806072e
chore: bump to v6.1.8
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-11-01 18:31:37 +00:00
Leonidas Spyropoulos
f10c1a0505
perf: add PackageKeywords.PackageBaseID index
This is used on the export for package-meta.v1.gz generation

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-11-01 17:24:13 +00:00
moson-mo
5669821b29
perf: tweak some queries in mkpkglists
We can omit the "distinct" from some queries
because constraints in the DB ensure uniqueness:

* Groups sub-query
PackageGroup: Primary key makes "PackageID" + "GroupID" unique
Groups: Unique index on "Name" column
-> Technically we can't have a package with the same group-name twice

* Licenses sub-query:
PackageLicense -> Primary key makes "PackageID" + "LicenseID" unique
Licenses -> Unique index on "Name" column
-> Technically we can't have a package with the same license-name twice

* Keywords sub-query:
PackageKeywords -> Primary key makes "PackageBaseID" + "KeywordID" unique
(And a Package can only have one PackageBase)
Keywords -> Unique index on "Name" column
-> Technically we can't have a package with the same Keyword twice

* Packages main-query:
We join PackageBases and Users on their primary key columns
(which are guaranteed to be unique)
-> There is no way we could end up with more than one record for a Package

Signed-off-by: moson-mo <mo-son@mailbox.org>
2022-11-01 18:18:06 +01:00
Leonidas Spyropoulos
286834bab1
fix: regression on gzipped filenames from 3dcbee5a
With the 3dcbee5a the filenames inside the .gz archives contained .tmp
at the end. This fixes those by using Gzip Class constructor instead of
the gzip.open method.

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-10-31 14:43:31 +00:00
Mario Oenning
6ee34ab3cb feat: add field "CoMaintainers" to metadata-archives 2022-10-31 09:42:56 +00:00
Mario Oenning
333051ab1f feat: add field "Submitter" to metadata-archives 2022-10-28 16:55:16 +00:00
Leonidas Spyropoulos
48e5dc6763
feat: remove empty lines from ssh_keys text area, and show helpful message
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-10-28 13:43:32 +01:00
Leonidas Spyropoulos
7e06823e58
refactor: remove redundand parenthesis when return tuple
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-10-28 13:43:32 +01:00
Mario Oenning
3dcbee5a4f fix: make overwriting of archive files atomic 2022-10-28 12:42:50 +00:00
Leonidas Spyropoulos
9c0f8f053e
chore: rename logging.py and redis.py to avoid circular imports
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-10-22 18:51:38 +01:00
Leonidas Spyropoulos
b757e66997 feature: add filters and stats for requests
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-10-15 15:26:53 +03:00
Kevin Morris
da5a646a73
upgrade: bump to v6.1.7
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-10-11 15:04:25 -07:00
Kevin Morris
18f5e142b9
fix: include orphaned packages in metadata output
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-10-11 14:50:09 -07:00
Kevin Morris
3ae6323a7c
upgrade: bump to v6.1.6
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-30 05:19:58 -07:00
Kevin Morris
8657fd336e
feat: GET|POST /account/{name}/delete
Closes #348

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-30 05:08:50 -07:00
Kevin Morris
eb0c5605e4
upgrade: bump version to v6.1.5
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-26 01:28:38 -07:00
Leonidas Spyropoulos
0dddaeeb98
fix: remove sessions of suspended users
Fixes: #394

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-09-26 08:59:44 +01:00
Kevin Morris
30e72d2db5 feat: archive git repository (experimental)
See doc/git-archive.md for general Git archive specifications
See doc/repos/metadata-repo.md for info and direction related to the new Git metadata archive
2022-09-24 16:51:25 +00:00
Kevin Morris
ec3152014b
fix: retry transactions who fail due to deadlocks
In my opinion, this kind of handling of transactions is pretty ugly.
The being said, we have issues with running into deadlocks on aur.al,
so this commit works against that immediate bug.

An ideal solution would be to deal with retrying transactions through
the `db.begin()` scope, so we wouldn't have to explicitly annotate
functions as "retry functions," which is what this commit does.

Closes #376

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-13 12:54:08 -07:00
Kevin Morris
f450b5dfc7
upgrade: bump to version v6.1.4
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-12 12:29:57 -07:00
Kevin Morris
adc3a21863
fix: add 'unsafe-inline' to script-src CSP
swagger-ui uses inline javascript to bootstrap itself, so we need to
allow unsafe inline because we can't give swagger-ui a nonce to embed.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-12 12:28:42 -07:00
Kevin Morris
37c7dee099
fix: produce DeleteNotification a line before handle_request
With this on a single line, the argument ordering and class/func
execution was a bit too RNG causing exceptions to be thrown when
producing a notification based off of a deleted pkgbase object.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-12 10:36:50 -07:00
Kevin Morris
624954042b
doc(rpc): include route doc at the top of aurweb.routers.rpc
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-12 06:59:52 -07:00
Kevin Morris
17f2c05fd3
feat(rpc): add GET /rpc/v5/suggest/{arg} openapi route
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-12 06:50:26 -07:00
Kevin Morris
8e8b746a5b
feat(rpc): add GET /rpc/v5/search/{arg} openapi route
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-12 06:50:19 -07:00
Kevin Morris
5e75a00c17
upgrade: bump to version v6.1.3
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-11 19:59:16 -07:00
Kevin Morris
9faa7b801d
feat: add cdn.jsdelivr.net to script/style CSP
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-11 19:56:29 -07:00
Kevin Morris
df0a4a2be2
feat(rpc): add /rpc/v5/{type} openapi-compatible routes
We will be modeling future RPC implementations on an OpenAPI spec.
While this commit does not completely cohere to OpenAPI in terms
of response data, this is a good start and will allow us to cleanly
document these openapi routes in the current and future.

This commit brings in the new RPC routes:
- GET /rpc/v5/info/{pkgname}
- GET /rpc/v5/info?arg[]=pkg1&arg[]=pkg2
- POST /rpc/v5/info with JSON data `{"arg": ["pkg1", "pkg2"]}`
- GET /rpc/v5/search?arg=keywords&by=valid-by-value
- POST /rpc/v5/search with JSON data `{"by": "valid-by-value", "arg": "keywords"}`

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-11 19:11:18 -07:00
Kevin Morris
7fed5742b8
fix: display requests for TUs which no longer have an associated User
Closes #387

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-05 02:43:23 -07:00
Kevin Morris
6435c2b1f1
upgrade: bump to version v6.1.2
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-02 15:28:02 -07:00
Kevin Morris
b8a4ce4ceb
fix: include maint/comaint state in pkgbase post's error context
Closes #386

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-02 15:12:41 -07:00
Kevin Morris
8a3a7e31ac
upgrade: bump version to v6.1.1
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-31 22:01:54 -07:00
Joakim Saario
9c6c13b78a
style: Run pre-commit 2022-08-22 22:40:45 +02:00
Kevin Morris
08d485206c
feature: allow co-maintainers to disown their pkg
Derived off of original work done by Leonidas Spyropoulos
at https://gitlab.archlinux.org/archlinux/aurweb/-/merge_requests/503

This revision of that original work finishes off the inconsistencies
mentioned in the original MR and adds a small bit of testing for more
regression checks.

Fixes: #360

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-19 18:00:29 -07:00
Kevin Morris
93b4cec932
Merge branch 'show-unflag-link-to-flagger' 2022-08-18 16:01:38 -07:00
Kevin Morris
fd4aaed208
fix: use max-age for all cookie expirations
in addition, remove cookie expiration for AURREMEMBER --
we don't really care about a session time for this cookie, it merely
acts as a flag given out on login to remember what the user selected

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-18 15:15:40 -07:00
Joakim Saario
f10732960c
fix: Use SameSite=Lax on cookies 2022-08-18 23:42:33 +02:00