Commit graph

168 commits

Author SHA1 Message Date
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
Kevin Morris
c3d962a0d0
fix(templates): add some comments
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-09 11:06:19 -08:00
Kevin Morris
50d6a9b5c8
Merge branch 'fix-unlinked-pkgname' into pu 2021-12-07 13:57:14 -08:00
Kevin Morris
1b203f0d30
fix(requests): show unlinked pkgname when PackageBase has been deleted
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-07 13:51:38 -08:00
Kevin Morris
31d82fb1af
fix(templates): correct Closed link display
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-07 13:49:57 -08:00
Kevin Morris
27f8603dc5
fix(python): fix ordering of fields in partials/account_form.html
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-04 17:56:02 -08:00
Kevin Morris
224a0de784
fix(python): add logged in date field to account/show.html
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-04 01:16:14 -08:00
Kevin Morris
2ea4559b60
fix(python): use correct Status field in account/show.html
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-04 00:54:03 -08:00
Kevin Morris
f8bef16d32
Merge branch 'fix-account-links' into pu 2021-12-04 00:25:57 -08:00