Commit graph

2094 commits

Author SHA1 Message Date
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
Lukas Fleischer
6e38309c19 git-interface: Add test suite and basic tests
Add basic tests for the Git interface. The test suite is based on
sharness.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05 12:12:09 +02:00
Lukas Fleischer
5014b74868 Cleanup database schema
* Remove test accounts.
* Create indices using CREATE INDEX.
* Always use INTEGER UNSIGNED for IDs.
* Always use BIGINT UNSIGNED for timestamps.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05 12:05:22 +02:00
Lukas Fleischer
baf8a220ab git-interface: Support SQLite as database backend
In addition to MySQL, add support for SQLite to the database abstraction
layer. Also, add a new configuration option to select the DBMS.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05 12:05:22 +02:00
Lukas Fleischer
f2a6bd207d git-interface: Do not use UNIX_TIMESTAMP
Avoid using UNIX_TIMESTAMP which is not part of the SQL standard.
Retrieve the current UNIX time in Python and substitute it into the SQL
queries instead.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05 12:05:22 +02:00
Lukas Fleischer
27631f1157 git-interface: Do not use rowcount
Avoid using Cursor.rowcount to obtain the number of rows returned by a
SELECT statement as this is not guaranteed to be supported by every
database engine.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05 12:05:22 +02:00
Lukas Fleischer
ecbf32f0cc git-interface: Add AUR_CONFIG environment variable
Introduce a new environment variable that can be used to specify the
path to an aurweb configuration file. If the environment variable is
unset, the default search path is used.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05 12:05:22 +02:00
Lukas Fleischer
2f5f5583be git-interface: Factor out configuration file parsing
Add a new module that automatically locates the configuration file and
provides methods to obtain the values of configuration options.

Use the new module instead of ConfigParser everywhere.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05 12:05:22 +02:00
Lukas Fleischer
2915abb9d3 git-interface: Add database abstraction layer
Add a new class that connects to the database specified in the
configuration file and provides an interface to execute SQL queries.
Prepared statements with qmark ("?") placeholders are supported.

Replace all direct database accesses with calls to the new abstraction
layer.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05 12:05:22 +02:00
Lukas Fleischer
2cd69bf66d git-update: Make maximum blob size configurable
Support setting the maximum blob size in the configuration file.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05 11:25:51 +02:00
Lukas Fleischer
87f5f1b407 git-update: Use AUR_PRIVILEGED for forced pushes
Instead of looking up the account type of the current user again, use
the AUR_PRIVILEGED environment variable to check whether the user is
allowed to perform non-fast-forward ref updates.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05 01:22:52 +02:00
Lukas Fleischer
7a53ded5fe git-update: Fix some issues reported by pyflakes
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05 01:22:51 +02:00
Lukas Fleischer
12ab89b78c Change default SSH options to "restrict"
From the sshd(8) man page:

    Enable all restrictions, i.e. disable port, agent and X11
    forwarding, as well as disabling PTY allocation and execution of
    ~/.ssh/rc. If any future restriction capabilities are added to
    authorized_keys files they will be included in this set.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-04 21:37:52 +02:00
Lukas Fleischer
0c1187caa4 git-serve: Deprecate setup-repo
Since 02dd9c5 (git-serve.py: Automatically create repositories,
2015-01-06), one can create new package bases by running `git push`. It
is no longer necessary to run setup-repo manually.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-04 21:37:52 +02:00
Lukas Fleischer
415a2c836d git-update: Notify privileged users of forced uploads
Show a warning when a Trusted User or a developer creates a package that
is blacklisted or already provided by an official package.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-04 13:04:44 +02:00
Lukas Fleischer
573715afd9 git-serve: Refactor environment variable access
Read all environment variables at the beginning of the script and
immediately pre-process their values.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-04 13:04:44 +02:00
Safa AlFulaij
b089747774 Fix plural string
Even though the singular form never occurs, we need to use _n() here to
obtain the correct behavior for languages with multiple plural forms.

Signed-off-by: Safa AlFulaij <safa1996alfulaij@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-07-24 18:51:12 +02:00
Johannes Löthberg
e55b529813 Make LangPreference DB field wide enough to fit es_419
The language code for Latin American Spanish is es_419, which is longer
than the 5 characters previously allowed.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-07-24 18:51:05 +02:00
Lukas Fleischer
2160678f9b Remove wearout factor from translatable string
Even though that number is hardcoded in the source code, it is better to
make it not appear in the message catalog such that it can be made
configurable easily later.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-07-23 15:02:37 +02:00
Lukas Fleischer
9cab008e15 Update the Git/SSH interface documentation
Add information on the new set-keywords command and slightly reword some
paragraphs.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-07-11 17:45:48 +02:00
Lukas Fleischer
60cdad28ee Distinguish auto-accepted requests
Before commit 9746a65 (Port notification routines to Python,
2015-06-27), notification emails for automatically closed requests
explicitly stated that the action was taken "automatically by the Arch
User Repository package request system". When porting the notification
routines to Python, this feature was overlooked and emails sent by the
new script always reported that the requester triggered the acceptance
or rejection of a request.

This patch reimplements the old behavior such that notifications no
longer look as if the requester had accepted the request himself.

Reported-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-30 22:45:26 +02:00
Lukas Fleischer
fbf3e54057 Add hard limit for the length of dependency lists
Introduce a configuration option max_depends which can be used to
specify a maximum number of (reverse) dependencies to display on the
package details pages.

Fixes FS#49059.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-26 08:53:55 +02:00
Lukas Fleischer
0350de4b42 Update message catalog
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-25 16:10:01 +02:00
Lukas Fleischer
7d42d3fc1c Make request type hints translatable
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-25 16:09:22 +02:00
Johannes Löthberg
16674e4c9d Linkify user homepage URLs
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-25 13:56:23 +02:00
Johannes Löthberg
a2a888625e Add missing database and account fields
Commits 6ec4a35 (Send notifications when changing ownership, 2016-02-21)
and e3670ef (Add a homepage field to accounts, 2016-06-02) forgot to
change some usages of display_account_form() and process_account_form()
to account for the new parameter. The former also forgot to add the new
column to the database schema.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-25 13:55:34 +02:00
Lukas Fleischer
e3670ef188 Add a homepage field to accounts
Allow users to add a link to their homepage to their profile.

Implements FS#22774.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-08 22:23:57 +02:00
Lukas Fleischer
9fec03d655 Update README
Reword most parts of the README file, add information on new features
and update the directory layout.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-08 22:23:57 +02:00
Lukas Fleischer
333596ab4a Update Arch Linux projects subdomain
The projects.archlinux.org subdomain was moved to git.archlinux.org.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-08 22:23:57 +02:00