summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2016-09-29Use setuptools to install Python modulesLukas Fleischer10-42/+66
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-29git-update: Move entry point to a main() methodLukas Fleischer1-140/+154
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-29git-serve: Move entry point to a main() methodLukas Fleischer1-108/+114
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-29git-serve: Pass user and privileges as parametersLukas Fleischer1-7/+7
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-29git-auth: Move entry point to a main() methodLukas Fleischer1-25/+29
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-29Add a main() method to all Python scriptsLukas Fleischer6-94/+132
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-29Send reminders before the TU voting period endsLukas Fleischer2-0/+55
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-18t0002: Add tests for adopt/disown/set-comaintainersLukas Fleischer2-0/+211
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-18git-serve: Add support for setting co-maintainersLukas Fleischer1-0/+8
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-18git-serve: Add support for disowning package basesLukas Fleischer1-0/+136
Add support for disowning packages from the SSH interface. The syntax is `disown <pkgbase>`. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-17git-serve: Add support for adopting package basesLukas Fleischer1-0/+46
Add support for adopting packages from the SSH interface. The syntax is `adopt <pkgbase>`. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-17git-serve: Format usage text automaticallyLukas Fleischer2-9/+27
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-12git-serve: Mark setup-repo as deprecatedLukas Fleischer1-1/+1
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-08-22git-update: Do not overwrite the repo variableLukas Fleischer2-3/+2
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-22git-update: Close cursor before closing databaseLukas Fleischer2-1/+2
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-22t0003: Make tests more strictLukas Fleischer1-23/+68
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-14db.py: Support pyformat paramstyleLukas Fleischer1-1/+1
This is used by the MySQL database backend. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-14Add details link from account edit formJohannes Löthberg1-0/+1
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-14Display registration date on account details pageJohannes Löthberg1-0/+4
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-14Release 4.3.0v4.3.0Lukas Fleischer1-1/+1
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-14Translation updates from TransifexLukas Fleischer29-816/+1952
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-10t0003: Do not initialize package bases explicitlyLukas Fleischer1-6/+0
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-10Lazy-add new package basesLukas Fleischer2-4/+24
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-06Update message catalogLukas Fleischer1-4/+7
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-06Add tests for the restore commandLukas Fleischer2-0/+46
Test the restore mode of git-serve and git-update. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05t0003: Add more git-update testsLukas Fleischer2-14/+404
Add tests for common scenarios that should be detected/handled by the update hook. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05t0002: Add more git-serve testsLukas Fleischer2-2/+79
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-05t0001: Add more git-auth testsLukas Fleischer2-0/+13
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-05git-update: Remove package details before updatingLukas Fleischer1-2/+7
Explicitly remove all package sources, dependencies, relations, licenses and groups before inserting new ones. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05git-interface: Add test suite and basic testsLukas Fleischer6-0/+1048
Add basic tests for the Git interface. The test suite is based on sharness. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05Cleanup database schemaLukas Fleischer1-37/+30
* 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-05git-interface: Support SQLite as database backendLukas Fleischer2-14/+30
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-05git-interface: Do not use UNIX_TIMESTAMPLukas Fleischer2-4/+7
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-05git-interface: Do not use rowcountLukas Fleischer2-7/+11
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-05git-interface: Add AUR_CONFIG environment variableLukas Fleischer1-1/+5
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-05git-interface: Factor out configuration file parsingLukas Fleischer5-18/+32
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-05git-interface: Add database abstraction layerLukas Fleischer4-146/+150
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-05git-update: Make maximum blob size configurableLukas Fleischer2-2/+18
Support setting the maximum blob size in the configuration file. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-05git-update: Use AUR_PRIVILEGED for forced pushesLukas Fleischer1-5/+2
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-05git-update: Fix some issues reported by pyflakesLukas Fleischer1-2/+5
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-08-04Change default SSH options to "restrict"Lukas Fleischer1-1/+1
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-04git-serve: Deprecate setup-repoLukas Fleischer1-0/+5
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-04git-update: Notify privileged users of forced uploadsLukas Fleischer1-4/+5
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-04git-serve: Refactor environment variable accessLukas Fleischer1-10/+10
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-07-24Fix plural stringSafa AlFulaij1-1/+1
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-24Make LangPreference DB field wide enough to fit es_419Johannes Löthberg2-1/+7
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-23Remove wearout factor from translatable stringLukas Fleischer1-1/+1
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-11Update the Git/SSH interface documentationLukas Fleischer1-19/+20
Add information on the new set-keywords command and slightly reword some paragraphs. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-06-30Distinguish auto-accepted requestsLukas Fleischer2-7/+14
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-26Add hard limit for the length of dependency listsLukas Fleischer3-6/+10
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>