Commit graph

626 commits

Author SHA1 Message Date
Kevin Morris
7485cc231e
change: report unhandled tracebacks to a repository
As repeats of these traceback notifications were annoying some of
the devops staff, and it took coordination to share tracebacks with
developers, this commit removes that responsibility off of devops
by reporting tracebacks to Gitlab repositories in the form of issues.

- removed ServerErrorNotification
- removed notifications.postmaster configuration option
- added notifications.gitlab-instance option
- added notifications.error-project option
- added notifications.error-token option
- added aurweb.exceptions.handle_form_exceptions, a POST route decorator

Issues are filed confidentially. This change will need updates
in infrastructure's ansible configuration before this can be
applied to aur.archlinux.org.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-10 13:44:10 -08:00
Kevin Morris
3af66cafbe
fix(rpc): restore "Too Many Package Results" error
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-10 01:04:25 -08:00
Kevin Morris
86caee74c5
fix(rpc): use max_rpc_results for type=multiinfo result limit
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-10 00:32:35 -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
Kevin Morris
c883c71053
upgrade: bump to v6.0.9
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-08 20:14:52 -08:00
Kevin Morris
2cb53411c0
change: remove comaintainers when fulfilling orphan request
Closes FS#50079

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-08 20:03:38 -08:00
Kevin Morris
4ae72af4b5
fix: address missing coverage from previous changes
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-08 17:58:43 -08:00
Kevin Morris
b6321bbdc5
Merge branch 'mr440' 2022-02-08 17:49:50 -08:00
Awal Garg
b119db251b fixup: feat(archives): add .sha256 and construct archives in tmpdir 2022-02-09 07:03:12 +05:30
Kevin Morris
40a0e866e7
feat(archives): add {archive}.sha256 and construct archives in tmpdir
This change brings some new additions to our archives:
- SHA-256 .sha256 hexdigests
- We construct our archives in a tmpdir now and move them to the
archive destination when all are completed. This removes some
corrupted downloading when archiving is in-process.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-08 13:28:39 -08:00
Kevin Morris
95bbdfc3bb
upgrade: bump to v6.0.8
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-08 09:13:47 -08: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
660d57340a
fix: TUVote inner join TUVoteInfo for "Last Votes by TU" listing
By implicitly joining, sqlalchemy joined on
`TUVote.UsersID = TUVoteInfo.SubmitterID`. This should be joining on
`TUVote.VoteID = TUVoteInfo.ID` instead to include all TUVote instances
found in the database.

Closes #266

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-07 18:16:15 -08:00
Kevin Morris
957803a70b
fix: M/c search with multiple keywords
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-07 16:22:21 -08:00
Kevin Morris
33cddb36ff
fix: restore URL field in mkpkglists meta archives
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-07 01:20:42 -08:00
Kevin Morris
2dfa41c9a5
feat(rpc): support POST method
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-07 00:49:34 -08:00
Kevin Morris
26f0b014f9
fix: /packages search by keywords
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-06 23:29:09 -08:00
Kevin Morris
83f5d9e460
fix: RSS aurlogo.png url
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-06 21:32:48 -08:00
Kevin Morris
750653361f
fix: remove /packages search count limit
...took this opportunity to use the new options.max_search_results
tunable for a PP upper-bound.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-06 16:21:56 -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
e777b7052e
fix: send out a FlagNotification when a package is flagged
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-05 04:40:25 -08:00
Kevin Morris
2d6c09bec5
fix: handling of user registration HideEmail
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-05 04:28:50 -08:00
Kevin Morris
d5a1c16458
upgrade: bump to v6.0.7
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-05 03:48:58 -08:00
Kevin Morris
39d6f927e6
fix: Maintainer, Co-maintainer /package search
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-05 03:47:16 -08:00
Kevin Morris
7618101b1b
fix: depend on OutOfDateTS for flag state
It was found in the aur.al database that some records have
a non-null flagger, but are not flagged. Using the flagger
relationship, we were false redirecting away from the flag
page.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-05 03:47:16 -08:00
Kevin Morris
28549b47bb
fix: /packages search by co-maintainer
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-05 03:47:15 -08:00
Kevin Morris
c80a16c254
fix: allow users to login using their email
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-05 03:47:14 -08:00
Kevin Morris
f3360d1249
fix: eradicate spaces from pgp key fingerprint input
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-05 03:47:14 -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
3cb106bc9d
upgrade: bump to v6.0.6
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-04 20:23:28 -08:00
Kevin Morris
b7bf83c5f0
fix: prioritize local db record in pkgname_link
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-04 20:13:24 -08:00
Kevin Morris
c783ce17be
fix: remove erroneous official pkg check
This causes an issue that should have been obvious from the get-go:
if a package request is up in the AUR, but the package has already
been picked up by an official repository, we would end up returning
a 404 here, leading a TU to not be able to perform an action for
a request's target.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-04 19:57:59 -08:00
Kevin Morris
101de8e7b1
temporarily support /rpc.php/?
We'll leave these routes in for one month. On 02/04, they'll be
removed. This gives some time for aur helpers to update their
method.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-04 19:26:36 -08:00
Kevin Morris
0c1bd982ea
fix(rpc): remove trailing slash redirection
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-04 19:08:25 -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
2c08672f15
fix: participation display generation should check voteinfo.ActiveTUs
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-04 16:50:27 -08:00
Kevin Morris
164037da43
upgrade: bump to v6.0.5
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-04 15:55:33 -08:00
Kevin Morris
bfe48a7d76
fix: dashboard's My Packages should not have comaintained packages
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-04 14:24:30 -08:00
Kevin Morris
9111f645b7
fix: require passreset's target user is unsuspended
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-03 19:05:01 -08:00
Kevin Morris
ef0285bc7c
upgrade: bump to v6.0.4
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-03 17:47:31 -08:00
Kevin Morris
4659b5f941
upgrade: bump to v6.0.3
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-03 17:43:39 -08:00
Kevin Morris
ad1d5a1217
fix: don't check email deliverability when verifying input
For tests, we only care about emails having a valid syntax.
I don't think we should verify this at all, as aurweb.scripts.notify
will timeout if it cant deliver via sendmail/smtp.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-03 17:13:48 -08:00
Yaron Shahrabani
82972d28e2 All the RTL related changes 2022-01-26 17:19:39 +02:00
Kevin Morris
01a0c286c9
upgrade: bump to v6.0.2
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-20 11:56:14 -08: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
fee7e41ae4
fix(routers.html): show comaintained packages which have been flagged
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-20 09:04:55 -08:00
Kevin Morris
8c665d1651
upgrade: bump to v6.0.1
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-18 11:04:07 -08:00
Kevin Morris
d7c19ee6ce
upgrade: bump to v6.0.0
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-18 10:42:33 -08:00
Kevin Morris
a467b18474
Merge branch 'pu': pre-v6.0.0
Release v6.0.0 - Python

This documents UX and functional changes for the v6.0.0 aurweb release.
Following this release, we'll be working on a few very nice features
noted at the end of this article in Upcoming Work.

Preface
-------

This v6.0.0 release makes the long-awaited Python port official.

Along with the development of the python port, we have modified a
number of features. There have been some integral changes to how
package requests are dealt with, so _Trusted Users_ should read
the entirety of this document.

Legend
------

There are a few terms which I'd like to define to increase
understanding of these changes as they are listed:

- _self_
    - Refers to a user viewing or doing something regarding their own account
- _/pkgbase/{name}/{action}_
    - Refers to a POST action which can be triggered via the relevent package
      page at `/{pkgbase,packages}/{name}`.

Grouped changes explained in multiple items will always be prefixed with
the same letter surrounded by braces. Example:

- [A] Some feature that does something
- [A] The same feature where another thing has changed

Infrastructure
--------------

- Python packaging is now done with poetry.
- SQLite support has been removed. This was done because even though
  SQLAlchemy is an ORM, SQLite has quite a few SQL-server-like features
  missing both out of the box and integrally which force us to account
  for the different database types. We now only support mysql, and should
  be able to support postgresql without much effort in the future.
  Note: Users wishing to easily spin up a database quickly can use
  `docker-compose up -d mariadb` for a Docker-hosted mariadb service.
- An example systemd service has been included at `examples/aurweb.service`.
- Example wrappers to `aurweb-git-(auth|serve|update)` have been included
  at `examples/aurweb-git-(auth|serve|update).sh` and should be used to
  call these scripts when aurweb is installed into a poetry virtualenv.

HTML
----

- Pagers have all been modified. They still serve the same purpose, but
  they have slightly different display.
- Some markup and methods around the website has been changed for
  post requests, and some forms have been completely reworked.

Package Requests
----------------

- Normal users can now view and close their own requests
- [A] Requests can no longer be accepted through manual closures
- [A] Requests are now closed via their relevent actions
    - Deletion
        - Through `/packages` bulk delete action
        - Through `/pkgbase/{name}/delete`
    - Merge
        - Through `/pkgbase/{name}/merge`
    - Orphan
        - Through `/packages` bulk disown action
        - Through `/pkgbase/{name}/disown`
- Deletion and merge requests (and their closures) are now autogenerated
  if no pre-existing request exists. This was done to increase tracking of
  package modifications performed by those with access to do so (TUs).
- Deletion, merge and orphan request actions now close all (1 or more)
  requests pertaining to the action performed. This comes with the downside
  of multiple notifications sent out about a closure if more than one
  request (or no request) exists for them
- Merge actions now automatically reject other pre-existing merge requests
  with a mismatched `MergeBaseName` column when a merge action is performed
- The last `/requests` page no longer goes nowhere

Package Bulk Actions: /packages
-------------------------------

- The `Merge into` field has been removed. Merges now require being
  performed via the `/pkgbase/{name}/merge` action.

Package View
------------

- Some cached metadata is no longer cached (pkginfo). Previously,
  this was defaulted to a one day cache for some package information.
  If we need to bring this back, we can.

TU Proposals
------------

- A valid username is now required for any addition or removal of a TU.

RPC
---

- `type=get-comment-form` has been removed and is now located at
  `/pkgbase/{name}/comments/{id}/form`.
- Support for versions 1-4 have been removed.
- JSON key ordering is different than PHP's JSON.
- `type=search` performance is overall slightly worse than PHP's. This
  should not heavily affect users, as a 3,000 record query is returned
  in roughly 0.20ms from a local standpoint. We will be working on this
  in aim to push it over PHP.

Archives
--------

- Added metadata archive `packages-meta-v1.json.gz`.
- Added metadata archive `packages-meta-ext-v1.json.gz`.
    - Enable this by passing `--extended` to `aurweb-mkpkglists`.

Performance Changes
-------------------

As is expected from a complete rewrite of the website, performance
has changed across the board. In most places, Python's implementation
now performs better than the pre-existing PHP implementation, with the
exception of a few routes. Notably:

- `/` loads much quicker as it is now persistently cached forcibly
  for five minutes at a time.
- `/packages` search is much quicker.
- `/packages/{name}` view is slightly slower; we are no longer caching
  various pieces of package info for `cache_pkginfo_ttl`, which is
  defaulted to 86400 seconds, or one day.
- Request actions are slower due to the removal of the `via` parameter.
  We now query the database for requests related to the action based on
  the current state of the DB.
- `/rpc?type=info` queries are slightly quicker.
- `/rpc?type=search` queries of low result counts are quicker.
- `/rpc?type=search` queries of large result counts (> 2500) are slower.
    - We are not satisfied with this. We'll be working on pushing this
      over the edge along with the rest of the DB-intensive routes.
      However, the speed degredation is quite negligible for users'
      experience: 0.12ms PHP vs 0.15ms Python on a 3,000 record query
      on my local 4-core 8-thread system.

Upcoming Work
-------------

This release is the first major release of the Python implementation.
We have multiple tasks up for work immediately, which will bring us
a few more minor versions forward as they are completed.

- Update request and tu vote pagers
- Archive differentials
- Archive mimetypes
- (a) Git scripts to ORM conversion
- (a) Sharness removal
- Restriction of number of requests users can submit
2022-01-18 10:39:59 -08:00
Kevin Morris
8d8f7954e9
fix(routers.trusted_user): html.escape agenda
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-18 09:10:28 -08:00