Commit graph

3333 commits

Author SHA1 Message Date
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
6986d1bb1e
fix: update rpc documentation
- we no longer prefer the use of trailing slashes on the AUR
  website.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-04 21:27:01 -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
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
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
2f8e2288ad
poetry: bump version to 6.0.5
... I need to stop missing this. We need to centralize version
setting into a single file and source it.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-04 16:18:44 -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
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
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
c39a648bf2
pyproject.toml: set version to current (v6.0.4)
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-03 19:24:57 -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
Kevin Morris
16bdbee520
poetry: lock email-validator to 1.1.3, update the rest
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-03 17:12:30 -08:00
Kevin Morris
85012bb100
feat: support language direction switching
changes can be found in 82972d28e2
contributed by Yaron Shahrabani.

- the 'hu' (hebrew) language toggles the `dir="rtl"` attr on
- the 'ar' (arabic) language toggles the `dir="rtl"` attr on
- other languages, including the default, omit the `dir="rtl"` attr

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-26 11:19:35 -08:00
Yaron Shahrabani
82972d28e2 All the RTL related changes 2022-01-26 17:19:39 +02:00
Kevin Morris
ba6ba4c367
Merge branch 'cron-compose-fix' into pu 2022-01-25 14:36:01 -08:00
Kevin Morris
f7c81ce855
Revert "docker: simplify keyring update"
This reverts commit 2f294480a9.
2022-01-24 14:54:11 -08:00
Kevin Morris
2f294480a9
docker: simplify keyring update
- this wasn't using .pkg-cache before; we should, in case we already
  have the updated package downloaded.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-23 15:47:31 -08:00
Kevin Morris
8cca03a3f6
gitlab-ci: add lint job (stage: .pre)
- directories to be linted can be configured in .gitlab-ci.yml's
  `REQUIRES_LINT` variable
- removed linting from the test job

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-23 15:47:26 -08:00
Hunter Wittenborn
34c2692193
Added missing immutable config flag to Compose file 2022-01-20 15:50:22 -06: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
05e3e4bda7
Merge branch 'fix-package-comaintainers' into pu 2022-01-20 11:04:09 -08:00
Kevin Morris
5fade479a3
fix(routers.html): show comaintained packages which have been flagged
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-20 10:57:48 -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
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
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
a2dfb97b6b
fix: add dependency step to docker.md
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-19 08:15:28 -08:00
Kevin Morris
5e52bafb5c
add doc/docker.md & update README.md
Changes to README.md:
- Added Documentation links to various documents in the repository.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-19 08:13:35 -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
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
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
d3d4424bc5
merge: updated translations
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-18 10:15:47 -08:00
Kevin Morris
621f030977
Merge branch 'html-escape-agenda' into pu 2022-01-18 09:17:09 -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
Kevin Morris
12f74fc40a
fix: docker cron config timing and doc
This wasn't matching up with what's suggested in doc/maintenance.
This patch resolves that inconsistency.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-18 09:05:47 -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
7f6c23d4cb
housekeep: centralize datetime generation
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-18 07:31:04 -08:00
Kevin Morris
7bcc8d7ce7
feat: support LOG_CONFIG environment variable
This variable allows users to override the logging.conf used
for Python logging configuration. By default, this is set
to logging.conf, which is a production config. LOG_CONFIG
is treated relative to [options] aurwebdir.

This patch allows us to specify the logging config as opposed
to copying over logging.conf in our test docker and gitlab
test scripts, as well as ease-of-testing as a developer.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-18 07:27:36 -08:00
Kevin Morris
7f1de72e08
fix(docker): remove logging setup in run-tests.sh
This was left in when we removed logging.prod.conf in a
previous patch. `test-mysql-entrypoint.sh` takes care of
test logging for us now, so this section is unnecessary.

Closes #261

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-01-18 05:22:00 -08:00