Commit graph

2155 commits

Author SHA1 Message Date
Lukas Fleischer
70db022aa8 Store banned IP addresses as plain text
Inspired by commit 32c8d0c (Store last login address as plain text,
2016-03-13).

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-25 18:42:34 +01:00
Lukas Fleischer
f8916d7e9b git-serve: Save last SSH login date and IP address
In addition to logging the last login date and IP address on the web
interface, store the time stamp and IP address of the last SSH login in
the database.

This simplifies user banning if one of the new SSH interface features,
such as the voting mechanism implemented in 7ee2fdd (git-serve: Add
support for (un-)voting, 2017-01-23), is abused.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-25 18:42:34 +01:00
Lukas Fleischer
b8df10e227 config.proto: Update path to the notification script
As of commit 3718860 (Make maintenance scripts installable, 2016-10-17),
the notification script is installed as aurweb-notify. Update the
sample configuration file accordingly.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-25 18:42:34 +01:00
Mark Weiman
1ed8471182 Show co-maintainers SSH clone URL on package base page
On package base pages, if a co-maintainer visits, only the read-only URL
is displayed which is inconsistent with how the individual packages of a
package base's pages displays them. This adds the SSH clone URL to the
package base's page for co-maintainers to see.

Implements FS#52675.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-23 09:29:50 +01:00
Lukas Fleischer
0b09f200c5 t1200: Add tests for vote/unvote
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-23 09:10:29 +01:00
Lukas Fleischer
7ee2fddcca git-serve: Add support for (un-)voting
Add support for voting for packages and removing votes from the SSH
interface. The syntax is `vote <pkgbase>` resp. `unvote <pkgbase>`.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-23 09:10:28 +01:00
Mark Weiman
fc2ecff949 account.php: Reformat process_account_form() call
Modify the call to process_account_form() to only having one parameter per
line.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-20 23:20:51 +01:00
Mark Weiman
7ff5070190 Update cookie for language setting when editing user information
Currently, when a user edits their language setting from the edit user form,
the changes aren't reflected until the user either lets the original cookie
expire, deletes the cookie manually, or changes the language a second time via
the dropdown menu on the top of the page. This patch makes the language cookie
get updated when it is changed from the edit user form.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-20 23:20:51 +01:00
Mark Weiman
608c483090 Add user set timezones
Currently, aurweb displays all dates and times in UTC time. This patch
adds a capability for each logged in user to set their preferred
timezone.

Implements FS#48729.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-20 23:20:40 +01:00
Lukas Fleischer
087b539cbc Document garbage collection settings for Git
Add a note to the Git/SSH interface documentation that we recommend to
disable automatic garbage collection and use a maintenance script to
cleanup and optimize the Git repository instead.

Also, add a reference to the Git/SSH interface documentation to the Git
repository setup instructions in INSTALL.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-17 08:50:21 +01:00
Lukas Fleischer
ecfa54e492 INSTALL: Refer to the AUR backend as aurweb
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-12 08:35:15 +01:00
Alex Muller
eb4ba5cfdb Increase minimum password length to 8 characters
There are 95 printable ASCII characters which with a minimum length of 4
gives 95^4 or 81 million possible passwords. Increasing the minimum
length to 8 increases the number of possible passwords by a factor of
about 10^7.

Relates to FS#52297.

Signed-off-by: Alex Muller <alex@mullr.net>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-07 17:38:38 +01:00
Lukas Fleischer
8914a41db9 git-serve: Use Python exceptions for error handling
Make it easier to reuse the helper functions provided by git-serve from
another Python script by throwing exceptions instead of terminating the
program on errors.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-12-23 20:05:05 +01:00
Lukas Fleischer
6d8edafe77 t1200: Add tests for flag/unflag
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-12-20 18:04:46 +01:00
Lukas Fleischer
e0d94f54c3 git-serve: Add support for (un-)flagging packages
Add support for flagging or unflagging packages from the SSH interface.
The syntax is `flag <pkgbase> <comment>` resp. `unflag <pkgbase>`.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-12-20 18:04:46 +01:00
Lukas Fleischer
ba89ad9b9f t1200: Test maintenance mode
Add a test case to ensure that enabling the maintenance mode disables
the SSH interface.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-12-20 18:04:46 +01:00
Lukas Fleischer
fd36125a21 notify: Avoid EXCEPT in SQL statement
Do not use the EXCEPT clause which is unsupported in MySQL. Instead, use
a subquery which is standard-compliant and makes the query easier to
read at the same time.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-12-20 18:04:46 +01:00
Lukas Fleischer
9dd0d92d61 Add tests for out-of-date notifications
Make sure that out-of-date notifications are sent to package base
maintainers as well as co-maintainers.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-11-13 15:40:34 +01:00
Lukas Fleischer
e9ac4b9b9e Send out-of-date notifications to co-maintainers
Currently, only package maintainers receive out-of-date notifications
for their packages. Add package base co-maintainers to the list of
recipients for out-of-date notifications.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-11-13 15:38:44 +01:00
Lukas Fleischer
d987d756b0 test/setup.sh: Fix script paths
The scripts were moved to aurweb/scripts/ in commit 3718860 (Make
maintenance scripts installable, 2016-10-17). Update the paths in the
test suite accordingly.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-11-13 15:33:02 +01:00
Mark Weiman
ddbffcc4d5 Remove extraneous quote in translator.inc.php
The quote is a leftover of legacy code and was meant to be removed by
commit e171f6f (Migrate all DB code to use PDO, 2012-08-08).

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-11-10 18:31:20 +01:00
Mark Weiman
6502518d4e Fix DB.class.php to match config and include SQLite support
In commit baf8a22 (git-interface: Support SQLite as database backend,
2016-08-03), conf/config.proto was changed so that dsn_prefix was
changed to backend and this fixes this in web/lib/DB.class.php.

Since SQLite's dsn is different, this adds a check of which backend is
desired and will quit if MySQL or SQLite are not the backend selected.
SQLite2 may be supported, but is untested and will trigger an error if
used.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-11-10 18:31:20 +01:00
Mark Weiman
3e442a0f7d Remove all usage of UNIX_TIMESTAMP in web interface
UNIX_TIMESTAMP is not part of the SQL standard. Instead, all usage in
the web interface is changed to use PHP's time() function.

Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-11-10 18:31:20 +01:00
Lukas Fleischer
c3f464f50f Release 4.4.1
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-17 15:32:06 +02:00
Lukas Fleischer
37188603b5 Make maintenance scripts installable
Add wrappers for the maintenance scripts to the setuptools
configuration.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-17 15:23:13 +02:00
Lukas Fleischer
85866796a4 Move configuration to /etc/aurweb/config
Since d4fe77a (Reorganize Git interface scripts, 2016-10-08), the key
components of the aurweb SSH interface are installed system-wide. Update
the default configuration path to point to a central location.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-17 15:13:05 +02:00
Lukas Fleischer
9581069f49 aurweb/git: Add missing __init__.py file
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-17 15:13:05 +02:00
Lukas Fleischer
1e9735972a Do not show current day if registration date is unknown
The registration date field on the account details page currently
defaults to the current day if the user's registration date is unknown.
To avoid confusion, show "unknown" in these cases instead.

Fixes FS#51405.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-17 14:58:37 +02:00
Lukas Fleischer
fb07307638 Release 4.4.0
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-15 19:46:51 +02:00
Lukas Fleischer
3f5bf62285 Translation updates from Transifex
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-15 19:45:48 +02:00
Lukas Fleischer
fc6dc44295 git-serve: Close orphan requests upon disown
When disowning a package base via the SSH interface, auto-accept all
pending orphan requests for the affected package.

Also, add a test case that checks whether (only) orphan requests
belonging to disowned packages are closed correctly.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-11 22:14:41 +02:00
Lukas Fleischer
51101d21b9 upgrading/4.4.0.txt: Warn about new scripts
The location of the Git interface wrapper scripts was changed by commit
d4fe77a (Reorganize Git interface scripts, 2016-10-08). Add a note to
the upgrade instructions to remind users to update their configuration
files.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-11 08:45:45 +02:00
Lukas Fleischer
29a5f94dab git-update: Catch long source URLs
Bail out early if the source array contains an entry with more than 8000
characters.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-11 08:36:40 +02:00
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