Commit graph

3694 commits

Author SHA1 Message Date
Kevin Morris
8a3a7e31ac
upgrade: bump version to v6.1.1
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-31 22:01:54 -07:00
Kevin Morris
929bb756a8
ci(lint): add .pre-commit cache for pre-commit
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-23 02:32:35 -07:00
Kevin Morris
fbb3e052fe
ci: use cache/virtualenv for test dependencies
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-23 02:19:16 -07:00
Kevin Morris
57c0409958
style: set flake8's max-line-length=88
In accordance with black's defined style, we now expect a maximum
of 88 columns for any one particular line.

This change fixes remaining violations of 88 columns in the codebase
(not many), and introduces the modified flake8 configuration.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-22 23:44:56 -07:00
Joakim Saario
ce5dbf0eeb
docs(contributing): Update Coding Style 2022-08-22 22:42:10 +02:00
Joakim Saario
de5538a40f
ci(lint): Use pre-commit 2022-08-22 22:42:10 +02:00
Joakim Saario
505eb90479
chore: Add .git-blame-ignore-revs file
The idea is to exclude commits that only contains formatting so that it's
easier to backtrack actual code changes with `git blame`.
2022-08-22 22:41:58 +02:00
Joakim Saario
9c6c13b78a
style: Run pre-commit 2022-08-22 22:40:45 +02:00
Joakim Saario
b47882b114
chore(pre-commit) Use hooks from official repositories
The reason behind this is to make checking and formatting consistent between
contributors and CI. It is also easier to incorporate new hooks, since many
tools already provides pre-commit hooks

In addition this commit also adds `black` and `autoflake` along with a few
other useful hooks from the `pre-commit-hooks` repository.
2022-08-22 22:37:32 +02:00
Kevin Morris
08d485206c
feature: allow co-maintainers to disown their pkg
Derived off of original work done by Leonidas Spyropoulos
at https://gitlab.archlinux.org/archlinux/aurweb/-/merge_requests/503

This revision of that original work finishes off the inconsistencies
mentioned in the original MR and adds a small bit of testing for more
regression checks.

Fixes: #360

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-19 18:00:29 -07:00
Kevin Morris
ab2956eef7
feat: add pytest unit of independent user unflagging
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-18 16:02:03 -07:00
Kevin Morris
93b4cec932
Merge branch 'show-unflag-link-to-flagger' 2022-08-18 16:01:38 -07:00
Kevin Morris
fd4aaed208
fix: use max-age for all cookie expirations
in addition, remove cookie expiration for AURREMEMBER --
we don't really care about a session time for this cookie, it merely
acts as a flag given out on login to remember what the user selected

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-18 15:15:40 -07:00
Kevin Morris
8e43932aa6
fix(doc): re-add Max-Age to list of secure cookie attributes
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-18 14:57:42 -07:00
Kevin Morris
4303086c0e
Merged branch 'sameorigin-lax'
Closes #351

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-18 14:47:24 -07:00
Joakim Saario
f10732960c
fix: Use SameSite=Lax on cookies 2022-08-18 23:42:33 +02:00
Kevin Morris
fb1fb2ef3b
feat: documentation for web authentication (login, verification)
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-17 09:59:56 -07:00
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
Kevin Morris
b4e0aea2b7
Merged bugfixes
Brings in: 9497f6e671
Closes #512

Thanks, jelle!

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-14 19:25:49 -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
4565aa38cf
update: Swedish translations
Pulled from Transifex on 08/12/2022 - 08/13/2022.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-13 23:51:49 -07:00
Kevin Morris
a82d552e1b
update: migrate new transifex client configuration
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-13 23:49:47 -07:00
Kevin Morris
d63615a994
fix(docker): fix ca entrypoint logic and healthcheck
With this commit, it is advised to `rm ./data/root_ca.crt ./data/*.pem`,
as new certificates and a root CA will be generated while utilizing the
step volume.

Closes #367

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-13 23:43:04 -07: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
829a8b4b81
Revert "fix(docker): apply chown each time sshd is started"
This reverts commit 952c24783b.

The issue found was actually:
- If `./aur.git` exists within the aurweb repository locally,
  it also ends up in the destination, stopping the aurweb_git_data
  volume from being mounted properly.
2022-08-13 20:56:43 -07:00
Kevin Morris
952c24783b
fix(docker): apply chown each time sshd is started
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-13 20:13:07 -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
b3d09a4b77
Merge branch 'dummy-data-instructions' 2022-08-13 16:31:47 -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
Jelle van der Waa
0e82916b0a fix(python): don't show maintainer link for non logged in users
Show a plain maintainer text for non logged in users like the submitted,
last packager.

Closes #373
2022-08-10 19:04:59 +00:00
Kevin Morris
9648628a2c
update: requests dependency
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-08-09 16:43:27 -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
Hugo Osvaldo Barrera
d6fa4ec5a8 Explain how to populate dummy data for TESTING
Signed-off-by: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
2022-07-19 18:55:42 +02:00
Leonidas Spyropoulos
28970ccc91
fix: align text on left
Closes: #368

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-07-17 19:41:19 +01: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
Jelle van der Waa
0b03a6871e
fix(docker): document runtime deps 2022-07-04 21:35:41 +02:00
Jelle van der Waa
4a58e1349c
fix(docker): fix typo scheme -> schema 2022-07-04 21:35:06 +02:00
Jelle van der Waa
edef6cc6ac chore(css): drop old vendor prefixes
All of these vendor prefixes are already supported by all browsers for
quite a while.
2022-06-30 21:57:52 +02:00
Jelle van der Waa
ade624c215 doc(README): update contributing guidelines 2022-06-29 10:57:12 +00:00
Jelle van der Waa
98f55879d3 fix(docker): don't run redis with protected mode
For our development setup we run a redis container without a
username/password. Redis recently set protected mode by default which
disallows this, turn it off as it has no security implication.
2022-06-28 22:14:01 +02:00
Jelle van der Waa
8598ea6f74
fix(gitlab-ci): update coverage reporting in CI
Gitlab 14.10 introduced a coverage_report key which obsoletes the old
way of reporting coverage data.
2022-06-27 21:05:05 +02:00