Commit graph

694 commits

Author SHA1 Message Date
Leon Möller
33bf5df236 fix: show unflag link to flagger
While the flagger is allowed to unflag a package, the link to do so is
hidden from them. Fix by adding the flagger to the unflag list.

Fix #380
2022-08-16 13:19:15 +00:00
Kevin Morris
15d016eb70
fix: secure access to comment edits to user who owns the comment
Found along with the previous commit to be a security hole in our
implementation. This commit resolves an issue regarding comment editing.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-15 23:30:34 -07:00
Kevin Morris
7a52da5587
fix: guard POST keywords & allow co-maintainers to see keyword form
This addresses a severe security issue, which is omitted from this
git message for obscurity purposes.

Otherwise, it allows co-maintainers to see the keyword form when
viewing a package they co-maintain.

Closes #378

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-15 23:30:15 -07:00
Kevin Morris
7b047578fd
fix: correct kwarg name for approved users of creds.has_credential
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-15 19:34:18 -07:00
Kevin Morris
801df832e5
fix(rpc): correct URLPath in package results
This was incorrectly using the particular Package record's name
to format options.snapshot_uri in order to produce URLPath.

It should, instead, use the PackageBase record's name, which
this commit resolves.

Bug reported by thomy2000

Closes #382

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-15 10:06:44 -07:00
Kevin Morris
edacde48e5
Merge branch 'paginate-comments' 2022-08-14 19:50:21 -07:00
Jelle van der Waa
9497f6e671
fix(aurweb): resolve exception in ratelimit
Redis's get() method can return None which makes an RPC request error
out:

  File "/srv/http/aurweb/aurweb/ratelimit.py", line 103, in check_ratelimit
    requests = int(requests.decode())
AttributeError: 'NoneType' object has no attribute 'decode'
2022-08-14 15:43:13 +02:00
Kevin Morris
6f7ac33166
Revert "feat(db): add an index for SSHPubKeys.PubKey (#2)"
This reverts commit 6c7e274968.

Once again, this does actually cause issues with foreign keys.
Removing it for now and will revisit this.
2022-08-13 23:28:31 -07:00
Kevin Morris
6c7e274968
feat(db): add an index for SSHPubKeys.PubKey (#2)
Speeds up SSHPubKeys.PubKey searches in a larger database.

Fixed form of the original commit which was reverted,
1a7f6e1fa9

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-13 19:52:50 -07:00
Kevin Morris
5abd5db313
Revert "feat(db): add an index for SSHPubKeys.PubKey"
This reverts commit 1a7f6e1fa9.

This commit broke account creation in some way. We'd still like to
do this, but we need to ensure it does not intrude on other facets.

Extra: We should really work out how this even passed tests; it
should not have.
2022-08-13 19:23:19 -07:00
Kevin Morris
1a7f6e1fa9
feat(db): add an index for SSHPubKeys.PubKey
Speeds up SSHPubKeys.PubKey searches in a larger database.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-12 22:26:26 -07:00
Kevin Morris
913ce8a4f0
fix(performance): lazily load expensive modules within aurweb.db
Closes #374

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-12 22:26:26 -07:00
Leonidas Spyropoulos
2c080b2ea9
feature: add pagination on comments
Fixes: #354

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-08-02 20:27:47 +03:00
Leonidas Spyropoulos
1d6335363c fix: strip whitespace when parsing package keywords
Remove all extra whitespace when parsing Keywords to ensure we don't add
empty keywords in the DB.

Closes: #332

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-08-02 17:06:36 +03:00
Jelle van der Waa
a509e40474 fix(python): use standard dict/list type annotation
Since Python 3.9 list/dict can be used as type hint.
2022-08-02 12:06:58 +00:00
Leonidas Spyropoulos
034e47bc28
fix: hide Unflag package from non-maintainers
Closes: #364
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-07-17 19:37:00 +01:00
Kristian Klausen
4ddd1dec9c
upgrade: bump to v6.0.28 2022-05-13 00:41:22 +02:00
Kevin Morris
a553d5d95a
fix: replace distutils.util.strtobool with our own
Reference from
github.com/PostHog/posthog/pull/4631/commits/341c28da0f6d33d6fb12fe443766a2d822ff0097

This fixes a deprecation warning regarding distutil's strtobool.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-03-31 20:59:05 -07:00
Kevin Morris
cf4295a13e
upgrade: bump to v6.0.27
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-03-31 17:45:39 -07: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
d8564e446b
upgrade: bump to v6.0.26
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-03-30 12:30:21 -07:00
Kevin Morris
afd25c248f
fix: remove HEAD and OPTIONS handling from metrics
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-03-14 06:26:37 -07:00
Kevin Morris
c149afb1f1
Merge remote-tracking branch 'fosskers/colin/prework-reformatting' 2022-03-14 05:14:59 -07:00
Kevin Morris
d7cb04b93d
upgrade: bump to v6.0.25
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-03-08 20:35:21 -08: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
0afa07ed3b
upgrade: bump to v6.0.24
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-03-08 19:16:02 -08:00
Kevin Morris
a1a88ea872
fix(rpc): suggestions should only suggest based on <keyword>%
Previously, Python code was looking for suggestions based on
`%<keyword>%`. This was inconsistent with PHP's suggestion
implementation and cause more records to be bundled with a suggestion,
along with supplying misleading suggestions.

Closes #343

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-03-08 19:00:19 -08:00
Kevin Morris
9791704632
Merge branch 'fix-none-path' 2022-03-08 18:34:38 -08:00
Kevin Morris
2a393f95fa
upgrade: bump to v6.0.23
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-03-08 17:59:00 -08:00
Kevin Morris
e00cf5f124
test: use smtplib.SMTP[_SSL] timeout = notifications.smtp-timeout
A new option has been added for configuration of SMTP timeout:
- notifications.smtp-timeout

During tests, we can change this timeout to be small, so we aren't
depending on hardware-based RNG to pass the timeout.

Without a timeout, users can run into a long-running test for no
particular reason.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-03-08 17:53:31 -08:00
Kevin Morris
13217be939
fix: don't check suspension for ownership changes
People can change comaintainer ownership to suspended users if they
want to.

Suspended users cannot login, so there is no breach of security
here. It does make sense to allow ownership to be changed, imo.

Closes #339

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-03-08 17:51:25 -08:00
Kevin Morris
e2a17fef95
upgrade: bump to v6.0.22
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-03-07 23:57:54 -08:00
Kevin Morris
f11e8de251
upgrade: bump to v6.0.21
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-03-07 23:32:14 -08:00
Kevin Morris
6a243e90db
fix: only reject addvote for users with running proposals
This was incorrectly indiscriminately targetting _any_ proposal
for a particular user.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-03-07 23:23:49 -08:00
Kevin Morris
c7c79a152b
upgrade: bump to v6.0.20
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-25 19:44:10 -08:00
Kevin Morris
9204b76110
fix: ...do not add to ActiveTUs when voting on a proposal
Straight up bug.

Closes #324

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-25 19:28:03 -08:00
Kevin Morris
07e479ab50
upgrade: bump to v6.0.19
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-23 14:37:41 -08:00
Kevin Morris
51d4b7f993
fix(rpc): limit Package results, not relationships
...This was an obvious bug in hindsight. Apologies :(

Closes #314

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-23 14:17:41 -08:00
Colin Woodbury
3aa8d523f5
change(rpc): search module reformatting 2022-02-21 16:56:10 -08:00
Leonidas Spyropoulos
6e837e0c02
fix: always provide a path
891efcd142
2022-02-21 10:25:01 +00:00
Kevin Morris
1e31db47ab
upgrade: bump to v6.0.18
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-19 16:32:49 -08:00
Kevin Morris
80622cc966
fix: suspend check should check Suspended...
This was causing some false negative errors in the update process,
and it clearly not correct -- oops :(

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-19 16:26:31 -08:00
Kevin Morris
4a4fd01563
fix: blanking out particular fields when editing accounts
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-19 16:01:06 -08:00
Kevin Morris
c83c5cdc42
change: log out details about PROMETHEUS_MULTIPROC_DIR
Additionally, respond with a 503 if the var is not set when
/metrics is requested.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-19 12:08:55 -08:00
Kevin Morris
388e64d0af
upgrade: bump to v6.0.17
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-18 17:54:36 -08:00
Kevin Morris
7cc20cd9a4
fix: suspended users should not be able to login
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-18 17:50:35 -08:00
Kevin Morris
e43e1c6d20
upgrade: bump to v6.0.16
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-18 17:17:14 -08:00
Kevin Morris
14347232fd
fix: treat all keywords as lowercase when updating
In addition, treat package search by keywords as lowercase.

Closes #296, #297, #298, #301

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-18 16:58:02 -08:00
Kevin Morris
8387f325f6
fix: resolve null VoteTS columns via migration
Somehow, many aur.al records of PackageVotes do not have a valid VoteTS
value. This migration fixes that issue by setting all null VoteTS
columns to the epoch timestamp.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-18 16:16:07 -08:00
Kevin Morris
1d86b3e210
fix: use a transaction for package query; remove refresh
Closes #284

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-02-18 15:58:42 -08:00