We try to find packages when a user enters a URL like /somepkg
or accidentally opens /somepkg.git in the browser.
However, it currently also does this for URL's like /pkgbase/doesnotexist
and falsely interprets "pkgbase" part as a package or pkgbase name.
This in combination with a pkgbase that is named "pkgbase" generates
some misleading 404 message for URL's like /pkgbase/doesnotexist.
That being said, we should probably add pkgbase to the blacklist check
as well (we do this for pkgname already) and add things like
"pkgbase" to the blacklist -> Will be picked up in another commit.
Signed-off-by: moson <moson@archlinux.org>
By default, markdown within an HTML block element is not parsed.
Add markdown extension to support markdown text within block
elements.
With this we can annotate our element with a "markdown" attribute:
E.g. <details markdown>*Markdown*</details>
And thus indicate that the content should be parsed.
Signed-off-by: moson <moson@archlinux.org>
We can set the "reply-to" header to the "to" address for any mails
that go out to the aur-requests mailing list.
Signed-off-by: moson <moson@archlinux.org>
Disable prometheus multiprocess mode in tests to avoid global state:
Depending on the workers which are processing a testfile,
we might run into race issues where tests might influence each other.
We also need to make sure to clear any previously collected values
in case the same worker/process is executing different tests which
evaluate prometheus values.
Signed-off-by: moson <moson@archlinux.org>
Support setting the timezone as well as the language via query params:
The timezone parameter previously only worked on certain pages.
While we're at it, let's also add the language as a param.
Refactor code for timezone and language functions.
Remove unused AURTZ cookie.
Signed-off-by: moson <moson@archlinux.org>
Users can (accidentally) override context vars with query params.
This may lead to issues when rendering templates (e.g. "comments=").
Signed-off-by: moson <moson@archlinux.org>
Avoid using special characters and use '<sup>' HTML tag instead.
To not rely on user's fonts Unicode coverage.
Closes: #490
Signed-off-by: Hanabishi <1722-hanabishi@users.noreply.gitlab.archlinux.org>
When setting up a context with user provided variables,
we should not override any existing values previously set.
Signed-off-by: moson <moson@archlinux.org>
Wrong config option was used to display the minimum length error msg.
(username_min_len instead of passwd_min_len)
Signed-off-by: moson <moson@archlinux.org>
Renaming of symbols. Functions, variables, values, DB values, etc.
Basically everything that is not user-facing.
This only covers "Trusted User" things:
tests, comments, etc. will covered in a following commit.
Dependencies might reside in the AUR or official repositories.
Add "AUR" as superscript letters to indicate if a package/provider
is present in the AUR.
Signed-off-by: moson <moson@archlinux.org>
It could happen that test data is already generated by a previous test.
(running in the same worker)
Make sure we clear everything before performing our checks.
Signed-off-by: moson <moson@archlinux.org>
All tests within a file run in the same worker and out test DB names
are unique per file as well. We don't really need a locking
mechanism here.
Same is valid for the test-emails. The only potential issue is that it
might try to create the same directory multiple times and thus run
into an error. However, that can be covered by specifying
"exist_ok=True" with os.makedirs such that those errors are ignored.
Signed-off-by: moson <moson@archlinux.org>
Also removed the logic for deploying to the long gone aur-dev box.
Ansible will be added in a upcoming commit for configurating and
deploying aurweb on the VM.
[1] https://docs.gitlab.com/ee/ci/review_apps/
We should check if a user (target) exists before validating permissions.
Otherwise things crash when a TU is trying to edit an account that
does not exist.
Fixes: aurweb-errors#529
Signed-off-by: moson <moson@archlinux.org>