Commit graph

176 commits

Author SHA1 Message Date
Leonidas Spyropoulos
02d114d575
fix: hide email when account's email hidden is set
Fixes: 362
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-05-12 22:51:22 +01:00
Kevin Morris
ed41a4fe19
feat: add paging to package depends & required by
This patch does not include a javascript implementating, but
provides a pure HTML/HTTP method of paging through these lists.

Also fixes erroneous limiting. We now use a hardcoded limit of 20
by default.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-03-30 17:07:40 -07:00
Kevin Morris
49c5a3facf
feat: display stats about total & active TUs on proposals
This patch brings in two new features:
- when viewing proposal listings, there is a new Statistics section,
  containing the total and active number of Trusted Users found in the
  database.
- when viewing a proposal directly, the number of active trusted users
  assigned when the proposal was added is now displayed in the details
  section.

Closes #323

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-03-08 20:28:09 -08:00
Kevin Morris
5045f0f3e4
fix: copy.js javascript initialization
Not sure where this works, but it doesn't seem to work on my
browser. Achieved the same by forEaching through the array
returned by querySelectorAll instead.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-03-07 23:53:57 -08:00
Kevin Morris
bfd592299c
change: display default package search parameter values in its form
The previous behavior was carried over from PHP. It has been requested
that we use the true defaults when rendering the default form, making
search a bit more sensible.

Closes #269

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-17 17:54:57 -08:00
Kevin Morris
361163098f
fix: /packages search ordering links
This was not including other parameters that should be persisted for
users.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-17 15:49:41 -08:00
Kevin Morris
1671868956
fix: links to cgit should be url encoded
Closes #283

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-13 17:44:40 -08:00
Kevin Morris
708ade4dbf
fix: allow co-maintainers to [un]pin comments on a package
Closes #279

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-11 16:24:42 -08:00
Kevin Morris
e2eb3a7ded
fix: restore missing typeahead js on authenticated dashboard
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-10 13:32:37 -08:00
Kevin Morris
3f95ac7db3
fix: correct redirects for package actions & requests
For requests, we always pass a `next` of /requests, leading us
back to the requests page. For a standard package, we get redirected
to the involved pkgbase, or target pkgbase if a merge action was taken.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-08 22:59:01 -08:00
Leonidas Spyropoulos
d79d7bdd1e
docs: update issues url to gitlab
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-02-08 17:57:50 +00:00
Kevin Morris
4c14a10b91
fix: support multiple SSHPubKey records per user
There was one blazing issue with the previous implementation regardless
of the multiple records: we were generating fingerprints by storing
the key into a file and reading it with ssh-keygen. This is absolutely
terrible and was not meant to be left around (it was forgotten, my bad).

Took this opportunity to clean up a few things:
- simplify pubkey validation
- centralize things a bit better

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-08 07:50:41 -08:00
Kevin Morris
828847cfcd
fix: OutOfDateTS db fetch for pkgbase action display
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-07 12:23:35 -08:00
Kevin Morris
1545eab81d
feat: add timezone to datetime display across the board
- the "Flagged Out-of-date on ..." link in the package action panel does
  not contain a timezone specifier.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-05 18:35:50 -08:00
Kevin Morris
a445a40bea
fix: Maintainer's comaintainer annotation display
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-05 03:47:16 -08:00
Kevin Morris
ac68f74c69
fix: Hide Email Address checkbox markup
also:
- support empty strings in util.strtobool

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-05 02:16:52 -08:00
Kevin Morris
987f9eab3b
fix: link to user account in last votes by tu listing
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-04 18:36:29 -08:00
Kevin Morris
ab1479925b
fix: tu last votes listing vote id
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-04 18:02:33 -08:00
Kevin Morris
8310357029
fix: only display registration time when RegistrationTS is valid
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-04 15:49:45 -08:00
Yaron Shahrabani
82972d28e2 All the RTL related changes 2022-01-26 17:19:39 +02:00
Kevin Morris
62388b4161
fix(package/pkgbase view): include comaintainers in Maintainer field
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-20 09:43:14 -08:00
Kevin Morris
2c4f4155d6
fix(templates): Maintainer field does not require auth
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-20 09:14:30 -08:00
Kevin Morris
18b18bf667
fix: remove trailing slash from package search form action
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-18 11:01:12 -08:00
Kevin Morris
57bc9b6b73
fix(footer.html): update version git log link to gitlab
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-18 10:55:52 -08:00
Kevin Morris
2feb9b90b2
housekeep: move templates/partials/widgets/* to templates/partials/
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-18 08:33:00 -08:00
Kevin Morris
dbbae97038
housekeep: move templates/packages/widgets/* to templates/packages/
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-18 08:27:19 -08:00
Kevin Morris
e1a87c3407
housekeep: move pkgbase templates to their own dir
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-18 08:15:59 -08:00
Kevin Morris
c07c40bcb6
fix: clean up package action templates (merge, delete, disown)
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-17 11:53:05 -08:00
Kevin Morris
d675c0dc26
feat(python): catch all exceptions thrown through fastapi route paths
This commit does quite a bit:
- Catches unhandled exceptions raised in the route handler and
  produces a 500 Internal Server Error Arch-themed response.
- Each unhandled exception causes a notification to be sent to new
  `notifications.postmaster` email with a "Traceback ID."
- Traceback ID is logged to the server along with the traceback which
  caused the 500: `docker-compose logs fastapi | grep '<traceback_id>'`
- If `options.traceback` is set to `1`, traceback is displayed in
  the new 500.html template.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-09 23:10:02 -08:00
Kevin Morris
059733cb8c
fix(routers.trusted_user): use creds to determine authorization
Closes #237

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-05 22:09:49 -08:00
Kevin Morris
0df57debb8
fix(routers.trusted_user): only display Voters on ended proposals
In addition, we display the Voters partial regardless of them existing
or not; with no voters, an empty Voters list is displayed.

Closes #236

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-05 17:51:57 -08:00
Kevin Morris
ae7621fb54
fix(routers.trusted_user): fix missing submitter link on /tu/{id}
Closes #235

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-05 17:18:19 -08:00
Steven Guikal
e126d431d7
fix(FastAPI): add custom error templates for certain exceptions
Signed-off-by: Steven Guikal <void@fluix.one>
2022-01-03 18:22:03 -08:00
Kevin Morris
53fabdfaea
fix(templates): require valid User relationships for <a> usage
Previously, when the relationship was None, an <a> would still
wrap the None value erroneously. This addresses that for all
three user fields.

In addition, this commit adds direct testing for the
`templates/partials/packages/details.html` template.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-31 18:31:48 -08:00
Kevin Morris
8f8929f324
fix(routers.packages): handle package source display
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-30 23:10:00 -08:00
Kevin Morris
be7a96076e
fix: handle broken packages which have valid provides
Closes #226

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-30 19:49:49 -08:00
Kevin Morris
34cb8ec268
fix(routers.packages): all authenticated users can see sshd clone uri
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-28 13:13:46 -08:00
Kevin Morris
d55dab93da
revert account type permission changes
While this does make more sense to me personally, there is no need
to change how the AUR treats its users; it has been accepted for
ages and not found to be ridden with flaws. Stay with the tried
and true method.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-27 22:41:18 -08:00
Kevin Morris
80ee7f3d4b
fix(routers.accounts): use User.can_edit_user across the board
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-27 16:05:01 -08:00
Kevin Morris
b27dab99d8
fix(routers.accounts): correct disable decision for More button
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-26 18:35:38 -08:00
Kevin Morris
56bd60559c
fix(packages.search): fix default ordering & improve performance
- Use queries more closely aligned to PHP's implementation; removes
  the need for separate vote/notification queries.
- Default sort by popularity

Closes #214

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-25 11:15:20 -08:00
Kevin Morris
50eec96dd0
fix(routers.packages): fix related package metadata
Closes #218

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-21 18:02:37 -08:00
Kevin Morris
5142447b7e
fix(models.package_source): fix primary key constraints
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-21 16:00:10 -08:00
Kevin Morris
22093c5c38
fix(routers.packages): restrict /pkgbase/{name}/voters to those with creds
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-19 17:15:47 -08:00
Kevin Morris
d6d41cdbad
fix(templates): add missing empty package results text
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-16 22:01:14 -08:00
Kevin Morris
94e8d34948
fix(routers.accounts): use target user's account type for autofill
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-16 16:10:01 -08:00
Kevin Morris
f273cfc87d
change(templates): omit page count in pager partial if pages <= 0
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-15 17:46:15 -08:00
Kevin Morris
3b878da59a
fix(templates): a user can set Inactive on themselves
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-14 16:46:33 -08:00
Kevin Morris
f357615bfb
change(users.validate): users can't edit their own account types
This commit also decouples testing regarding this feature
into several test functions.

Signed-off-by: Kevin Morris <kevr@0cost.org>

bump

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-14 16:45:40 -08:00
Kevin Morris
26b1674c9e
fix(requests): rework handling of requests
This commit changes several things about how we were handling
package requests.

Modifications (requests):
-------------
- `/requests/{id}/close` no longer provides an Accepted selection.
  All manual request closures will cause a rejection.
- Relevent `pkgbase` actions now trigger request closures:
  `/pkgbase/{name}/delete` (deletion), `/pkgbase/{name}/merge` (merge)
  and `/pkgbase/{name}/disown` (orphan).
- Comment fields have been added to
  `/pkgbase/{name}/{delete,merge,disown}`, which is used to set the
  `PackageRequest.ClosureComment` on pending requests. If the comment
  field is left blank, a closure comment is autogenerated.
- Autogenerated request notifications are only sent out once
  as a closure notification.
- Some markup has been fixed.

Modifications (disown/orphan):
-----------------------------
- Orphan requests are now handled through the same path as
  deletion/merge.
- We now check for due date when disowning as non-maintainer;
  previously, this was only done for display and not functionally.
  This check applies to Trusted Users' disowning of a package.

This style of notification flow does reduce our visibility, but
accounting can still be done via the close request; it includes
the action, pkgbase name and the user who accepted it.

Closes #204

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-09 19:09:51 -08:00