Commit graph

3173 commits

Author SHA1 Message Date
Lukas Fleischer
1492444ecb Make URL columns 8000 characters wide
According to RFC 7230, URLs can be up too 8000 characters long. Resize
all URL fields accordingly.

Also, add a test to verify that URLs with more than 8000 characters are
rejected by the update hook.

Reported-by: Andreas Linz <klingt.net@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-11 08:36:40 +02:00
Lukas Fleischer
0dce4c4bca Update message catalog
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-08 14:59:33 +02:00
Lukas Fleischer
fdccd272f0 Update .gitignore
Remove obsolete files. Add byte-compiled Python files and test results.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-08 14:35:37 +02:00
Lukas Fleischer
d4fe77ac57 Reorganize Git interface scripts
Move the Git interface scripts from git-interface/ to aurweb/git/. Use
setuptools to automatically create wrappers which can be installed using
`python3 setup.py install`. Update the configuration files, the test
suite as well as the INSTALL and README files to reflect these changes.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-08 14:25:43 +02:00
Lukas Fleischer
e182ba0c42 Add clone hints to 404 error pages
When clicking on the linked Git clone URL of a package base, users are
faced with a 404 error page since the URL is not supposed to be opened
in a web browser. Add some notes to 404 error pages corresponding to Git
clone URLs that explain how to use them instead.

Fixes FS#51266.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-08 14:13:51 +02:00
Lukas Fleischer
df6bb72807 git-serve: Support git {receive,upload}-pack
Add support for the `git receive-pack` and `git upload-pack` commands
which are aliases for git-receive-pack and git-upload-pack,
respectively.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-01 21:50:52 +02:00
Lukas Fleischer
5766a37e4a Update message catalog
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-30 17:48:49 +02:00
Lukas Fleischer
bc3a4f348d t2200: Check that only non-voters get reminders
Add a test to make sure that Trusted Users, who already voted on a
proposal, do not receive any reminders.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:53 +02:00
Lukas Fleischer
eb367d97e2 Use the notify script in tests
Instead of only checking whether the notification script is called with
the correct parameters, actually invoke the real notify script and check
whether proper notifications are generated.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Lukas Fleischer
e1709e98ce tuvotereminder: Wait for notify processes
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Lukas Fleischer
c8c3747786 Add tests for aurblup
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Lukas Fleischer
cc66259d33 aurblup: Drop support for multiple servers
Support for multiple servers has never been used by the official aurweb
setup and the current implementation makes it impossible to use server
URIs that contain spaces. For simplicity, change the implementation such
that only a single server is supported.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Lukas Fleischer
d00f4c5197 Add tests for pkgmaint
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Lukas Fleischer
91f649f5ed scripts: Do not use UNIX_TIMESTAMP
Avoid using UNIX_TIMESTAMP which is not part of the SQL standard.

See f2a6bd2 (git-interface: Do not use UNIX_TIMESTAMP, 2016-08-05) for
related changes.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Lukas Fleischer
cd2d90612b Add tests for tuvotereminder
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Lukas Fleischer
a48f8ccb13 Add tests for mkpkglists
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Lukas Fleischer
ec5779c824 mkpkglists: Make output files configurable
Instead of writing the output to hardcoded files (relative to the
document root), make the output paths of mkpkglists configurable.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Lukas Fleischer
dd59eea368 Update README
Add information on the new directory layout. Shared Python modules and
tests now have their own subdirectories.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Lukas Fleischer
49c7e53572 Reorganize tests
Move and rename the existing git-interface tests such that tests for
other scripts can be added easily.

In particular, the following changes are made:

* Move the existing tests from git-interface/test/ to test/.
* Rename t0001-auth.sh to t1100-git-auth.sh.
* Rename t0002-serve.sh to t1200-git-serve.sh.
* Rename t0003-update.sh to t1300-git-update.sh.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Lukas Fleischer
1a999810e3 Make test suite paths top-level directory relative
Determine the top-level directory before running tests and make all
script paths relative to that directory.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Lukas Fleischer
8c99184f6d Use config and db in scripts
Instead of using configparser and mysql.connector directly, change all
Python scripts to use the config and db Python modules which are now
accessible from a common location.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:23 +02:00
Lukas Fleischer
dc3fd60715 Use setuptools to install Python modules
Instead of using relative imports, add support for installing the config
and db Python modules to a proper location using setuptools. Change all
git-interface scripts to access those modules from the search path.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:06 +02:00
Lukas Fleischer
1946486a67 git-update: Move entry point to a main() method
Move the main program logic of git-update to a main() method such that
it can be used as a module and easily be invoked by setuptools wrapper
scripts.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:06 +02:00
Lukas Fleischer
8468b6be4b git-serve: Move entry point to a main() method
Move the main program logic of git-serve to a main() method such that it
can be used as a module and easily be invoked by setuptools wrapper
scripts.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:06 +02:00
Lukas Fleischer
b8318d2587 git-serve: Pass user and privileges as parameters
Move the main program logic of git-server to a main() method such that
it can be used as a module and easily be invoked by setuptools wrapper
scripts.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:06 +02:00
Lukas Fleischer
3a352435e9 git-auth: Move entry point to a main() method
Move the main program logic of git-auth to a main() method such that it
can be used as a module and easily be invoked by setuptools wrapper
scripts.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:06 +02:00
Lukas Fleischer
603b5b5db9 Add a main() method to all Python scripts
Move the main program logic of all scripts to main() methods such that
they can be used as modules and easily be invoked by setuptools wrapper
scripts.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:06 +02:00
Lukas Fleischer
f3fb614f19 Send reminders before the TU voting period ends
Add a new script that checks for TU votes ending within the next 48
hours and sends reminder emails to all Trusted Users who did not cast
their votes yet.

The script is designed to be executed as a cron job, such that the check
is performed periodically. Since the script does not remember users it
already sent emails to, the interval should not be chosen too small to
avoid spamming.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:05 +02:00
Lukas Fleischer
5f43e2aaa9 t0002: Add tests for adopt/disown/set-comaintainers
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-18 14:01:08 +02:00
Lukas Fleischer
94ac084d9d git-serve: Add support for setting co-maintainers
Add support for changing co-maintainers from the SSH interface. The
syntax is `set-comaintainers <pkgbase> <user1> <user2>...`.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-18 14:01:08 +02:00
Lukas Fleischer
9b983ac03e git-serve: Add support for disowning package bases
Add support for disowning packages from the SSH interface. The syntax is
`disown <pkgbase>`.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-18 14:01:08 +02:00
Lukas Fleischer
ce12e3b82d git-serve: Add support for adopting package bases
Add support for adopting packages from the SSH interface. The syntax is
`adopt <pkgbase>`.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-17 20:17:39 +02:00
Lukas Fleischer
e045069421 git-serve: Format usage text automatically
Remove the formatting of the usage text and add code to columnize it
automatically instead.

Also, add more strict tests for the usage output. These new tests ensure
that the usage header is printed, commands are indented properly and no
overly long lines are produced.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-17 20:17:11 +02:00
Lukas Fleischer
ab228fd3c3 git-serve: Mark setup-repo as deprecated
Since 0c1187c (git-serve: Deprecate setup-repo, 2016-07-24), it is no
longer recommended to use setup-repo. Mark the command as deprecated in
the usage/help text.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-12 08:45:38 +02:00
Lukas Fleischer
e3bcf83feb git-update: Do not overwrite the repo variable
The repo variable is already used to store the pygit2.Repository.

Fixes a regression introduced in d273ee5 (Use the official provider list
to detect duplicates, 2016-05-17).

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-22 08:25:51 +02:00
Lukas Fleischer
29625e0744 git-update: Close cursor before closing database
When using SQLite as backend, we need to close the cursor before closing
the database to avoid the following error:

    sqlite3.OperationalError: unable to close due to unfinalized statements or unfinished backups

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-22 08:16:26 +02:00
Lukas Fleischer
c761631181 t0003: Make tests more strict
Instead of testing the exit code only, also check the error output.

This reveals two bugs. The corresponding tests are marked as known
breakages.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-22 08:10:35 +02:00
Lukas Fleischer
2c36c17a18 db.py: Support pyformat paramstyle
This is used by the MySQL database backend.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-14 21:56:45 +02:00
Johannes Löthberg
4a355c71cb Add details link from account edit form
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-14 08:00:13 +02:00
Johannes Löthberg
573e0c662b Display registration date on account details page
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-14 08:00:13 +02:00
Lukas Fleischer
f3b65e59f7 Release 4.3.0
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-14 08:00:06 +02:00
Lukas Fleischer
d43f8478b4 Translation updates from Transifex
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-14 07:59:32 +02:00
Lukas Fleischer
435b5fc902 t0003: Do not initialize package bases explicitly
Package bases are created by git-update automatically when the
repository receives a ref update for the first time.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-10 20:14:22 +02:00
Lukas Fleischer
936ee66f1e Lazy-add new package bases
Create new package bases just before saving package metadata. This
protects from stray package bases left behind when new packages are
rejected, e.g. when the user tries to push a package that is available
from the official repositories already.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-10 20:14:17 +02:00
Lukas Fleischer
ac6b091724 Update message catalog
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-06 11:44:40 +02:00
Lukas Fleischer
83df9808b4 Add tests for the restore command
Test the restore mode of git-serve and git-update.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-06 01:50:17 +02:00
Lukas Fleischer
dd9c6f3ddc t0003: Add more git-update tests
Add tests for common scenarios that should be detected/handled by the
update hook.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05 21:23:20 +02:00
Lukas Fleischer
9a03c7fbdd t0002: Add more git-serve tests
Add tests for common scenarios that should be detected/handled by the
git-serve script.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05 21:23:20 +02:00
Lukas Fleischer
008eace8db t0001: Add more git-auth tests
Test the authentication script with an invalid key type and with a key
that does not exist in the database.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05 21:02:21 +02:00
Lukas Fleischer
3a41f8d564 git-update: Remove package details before updating
Explicitly remove all package sources, dependencies, relations, licenses
and groups before inserting new ones.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05 19:38:42 +02:00