Commit graph

2038 commits

Author SHA1 Message Date
Lukas Fleischer
15ee85b456 Show package popularity in search results
Display the popularity score (weighted votes) in the package search
results.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11 19:15:44 +02:00
Lukas Fleischer
824744f1d2 Add a field for package base popularity
Create a new field Popularity in the PackageBases table. The field is
updated by the popupdate script and reflects the popularity of a
package. Popularity is the sum of all votes with each vote being
weighted with a factor of 0.98 per day since its creation.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11 18:59:52 +02:00
Lukas Fleischer
0345914c5c Add popupdate script
This adds a simple script that can be used to recalculate the number of
votes per package. It can be used in a cronjob.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11 18:59:46 +02:00
Lukas Fleischer
5225dfef48 git-update: Allow non-fast-forwards for TUs
Although we theoretically never want to lose history, there may be rare
occasions when a forced push is required (e.g. if illegal data is
pushed). Allow Trusted Users and Developers to perform non-fast-forward
pushes.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11 17:56:51 +02:00
Lukas Fleischer
a0f3060f23 git-update: Deny non-fast-forwards
To make sure we never lose any history, non-fast-forwards are forbidden.
Instead of relying on receive.denyNonFastForwards, add a simple check to
the update hook. This has the added benefit of more flexibility.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11 17:56:26 +02:00
Lukas Fleischer
e254a31544 Update message catalog
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11 15:31:28 +02:00
Lukas Fleischer
078f7256e3 Support exceptions in the maintenance mode
Allow for excluding certain IP addresses from the maintenance mode. This
allows administrators to view the web page while the site is still under
maintenance for the rest of the world.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11 14:48:01 +02:00
Lukas Fleischer
a45b5073ca Implement a maintenance mode
Add support for a maintenance mode that disables both the website and
the SSH interface and can be enabled easily using a configuration
option.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11 14:32:21 +02:00
Lukas Fleischer
2164750f1e Do not use symrefs for manually created Git refs
When creating the refs for the package base branch and the HEAD ref
workaround, directly use commit IDs instead of symrefs. It looks like
Git cannot pack symrefs, so this is expected to improve space
efficiency. Also, since the refs are now only created (or updated) when
new objects are actually received, this fixes a problem with dangling
refs that were created when a user initialized a repository but did not
push anything.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11 14:03:56 +02:00
Lukas Fleischer
bd9af5f893 Reintroduce the URLPath field
In commit 74edb6f (Use Git repositories to store packages, 2014-06-06),
the URLPath field was dropped from RPC package results. Reintroduce the
field for backwards compatibility, even though it is no longer
recommended to use snapshot tarballs.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11 13:44:53 +02:00
Lukas Fleischer
d1fd6f4897 Make URIs to the individual cgit pages configurable
Make the locations of the PKGBUILD preview, the log and the snapshot
tarball configurable. This increases flexibility and simplifies the code
a bit.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-11 13:36:27 +02:00
Lukas Fleischer
ef142b2312 pkgbase.php: Escape error messages
Fixes FS#45284.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-10 08:54:51 +02:00
Lukas Fleischer
b870c0b682 Release 4.0.0-rc3
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09 15:44:00 +02:00
Lukas Fleischer
631d7bdff9 Encode cgit URIs properly
Fixes FS#45276 and FS#45277.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09 13:50:39 +02:00
Lukas Fleischer
f4e5ea5f57 INSTALL: Add note on disabling non-fast-forwards
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09 12:32:27 +02:00
Lukas Fleischer
dc86f6cc82 pkgbase_details.php: Fix cgit links
We forgot to amend those when switching to gitnamespaces-based storage
in b44411f (Use gitnamespaces for efficient storage, 2015-06-01).

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09 10:53:28 +02:00
Lukas Fleischer
08cdc5ca64 Invert order when sorting packages by age
Fixes FS#44195.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09 09:22:46 +02:00
Lukas Fleischer
6ce4433b88 Add a confirmation check box below search results
Always show the confirmation check box next to the package actions
drop-down on the package search results page. This allows regular users
to confirm disown commands.

Fixes FS#45264.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09 09:12:51 +02:00
Lukas Fleischer
5c64ae1a0e Drop suffixes from confirm parameters
Remove the _delete and _disown suffixes from HTTP POST confirmation
parameters.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09 09:05:05 +02:00
Lukas Fleischer
9b19f7595e Add Spanish (Latin America) and Asturian translations
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09 08:52:08 +02:00
Lukas Fleischer
87df56e30b Fix official language name of Czech
Reported-by: Pablo Lezaeta Reyes <prflr88@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09 08:49:21 +02:00
Lukas Fleischer
2be78f42ac aurjson.class.php: Exclude hidden package bases
Do not return packages belonging to hidden package bases in RPC results.

Fixes FS#45271.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-09 08:43:24 +02:00
Lukas Fleischer
e2b040b7ce Release 4.0.0-rc2
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08 21:58:04 +02:00
Lukas Fleischer
c7ff97a6a8 git-update: Avoid duplicate notifications
Fixes FS#45254.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08 21:52:59 +02:00
Lukas Fleischer
8aa4c51dfb Fix searching for an empty string
Return all packages when an empty search term is used with keyword
search.

Reported-by: G. Schlisio <g.schlisio@dukun.de>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08 21:35:52 +02:00
Johannes Löthberg
3b9cb66a1e pkg_details: Use correct clone URL
The clone URLs should use the pkgbase name, not the pkgname itself

Reported-by: Jonathan Steel <jsteel@archlinux.org>
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08 21:24:46 +02:00
Johannes Löthberg
fcbfaf6a37 git-update: Drop writing git description file
All PKGBUILDs are stored in a single repository now, so there is no use
for writing out a description file for the repo anymore.

This fixes a bug where pkgdescs containing UTF-8 characters are rejected
due to it trying to write the file out using ASCII.

Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08 15:04:13 +02:00
Lukas Fleischer
cb00a66855 Fix package statistics
Exclude hidden package bases from the package statistics.

Reported-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08 14:42:20 +02:00
Lukas Fleischer
c08c384e9a Show official language names in the drop-down list
We already store the native language names. Display them in the
drop-down list instead of using language codes.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08 14:26:26 +02:00
Lukas Fleischer
f13160f5cf Add Chinese (Taiwan) translations
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08 14:26:26 +02:00
Lukas Fleischer
ed72af6378 git-update: Improve error message for non-blob objects
When a repository contains a directory, a user is currently faced with
the following error message:

    remote: Traceback (most recent call last):
    remote:   File "hooks/update", line 194, in <module>
    remote:     if repo[treeobj.id].size > 250000:
    remote: AttributeError: '_pygit2.Tree' object has no attribute 'size'
    remote: error: hook declined to update refs/heads/master

Explicitly check for directories and other non-blob objects and display
a more intuitive message.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08 14:26:26 +02:00
Johannes Löthberg
6e52439e6f Use extract_arch_fields when checking for source files
This fixes a bug where pushes are rejected in split PKGBUILDs if there
are no arch-independent source array.

Fixes FS#45253

Reported-by: Marti <marti@juffo.org>
Reported-by: Maxime Gauduin <alucryd@archlinux.org>
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08 14:26:26 +02:00
Lukas Fleischer
debe76299d git-update: Increase maximum blob size to 250kB
Large blobs are needed in some packages, such as customized Linux
kernels including kernel configurations.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08 13:15:23 +02:00
Wieland Hoffmann
d5beada7c3 git-serve: Use pkgbase for errors about invalid names
`repo` is not defined at the point it's used, so you would get errors
like

> Traceback (most recent call last):
>   File "/srv/http/vhosts/aur-dev.archlinux.org/public/git-interface/git-serve.py", line 138, in <module>
>     die('%s: invalid repository name: %s' % (action, repo))
> NameError: name 'repo' is not defined

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08 12:43:58 +02:00
Lukas Fleischer
608d4aaf57 Release 4.0.0-rc1
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08 09:21:08 +02:00
Lukas Fleischer
1fa9d4218b Translation updates from Transifex
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-08 09:16:43 +02:00
Lukas Fleischer
cc5871c56f Update message catalog
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-04 13:48:45 +02:00
Lukas Fleischer
4c7ec61363 cgitrc.proto: Fix clone prefix
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-04 13:31:55 +02:00
Lukas Fleischer
58db164732 git-update: Prevent from overwriting packages
Make sure we do not overwrite a package belonging to another package
base. We forgot to add this check to git-update when porting the package
submission script to Python in commit 74edb6f (Use Git repositories to
store packages, 2014-06-06).

Reported-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-04 11:35:46 +02:00
Lukas Fleischer
c4870a95fc git-update: Only check HEAD for blacklisted packages
When a part of a package base is moved to the official repositories, it
needs to be dropped from the AUR package. However, we want to allow that
the moved packages still appear in the history.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-04 11:25:01 +02:00
Lukas Fleischer
18292e7114 aurblup: Fix path to configuration file
Fixes a regression introduced in commit 10ecd39 (Restructure scripts,
2015-06-01).

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-04 11:25:01 +02:00
Lukas Fleischer
50c0ee9ec4 git-update: Only check HEAD for matching pkgbase
When renaming a package base, we want to keep commits of the former
package. Move the check that compares the package base name with the
repository name such that only HEAD is validated.

Fixes FS#45065.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-04 11:25:01 +02:00
Lukas Fleischer
643dae80eb pkgfuncs.inc.php: Remove a conflict marker
Remove a Git conflict marker that was added accidentally in 74edb6f (Use
Git repositories to store packages, 2014-06-06).

Reported-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-04 11:24:56 +02:00
Lukas Fleischer
c38f95f632 config.proto: Cleanup
Remove the template-path and git-update-hook options which are no longer
used. Update the git_clone_uri_anon default value.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-02 15:16:24 +02:00
Lukas Fleischer
6fe8792508 Setup Git repositories even if package base exists
Sometimes, we need to initialize the Git repository even if the package
base already exists (e.g. when using a non-empty package database with
empty repositories during the AUR 4.0.0 migration period). Make sure
that the package branch and the namespaced HEAD ref is always created.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-02 15:12:00 +02:00
Lukas Fleischer
124ad00997 Add a Makefile for the git-auth wrapper
Avoid manual editing of the wrapper script when a non-standard path is
used.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-02 10:49:33 +02:00
Lukas Fleischer
10ecd3982d Restructure scripts
* Move scripts/git-integration/ to git-interface/.
* Move scripts/aurblup/aurblup.py to scripts/aurblup.py.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-02 10:34:34 +02:00
Lukas Fleischer
451e60d91d git-update: Check for missing install and source files
Suggested-by: Marcel Korpel <marcel.korpel@gmail.com>
Suggested-by: carstene1ns <arch@carsten-teibes.de>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-01 23:25:59 +02:00
Lukas Fleischer
b44411fb53 Use gitnamespaces for efficient storage
Instead of using one Git repository per package, use a single large
object storage for space efficiency. The refs of the individual package
bases are divided using gitnamespaces(7) which allows for exposing each
namespace as an independent repository easily. Also, git-serve is
modified to create a branch for each package, allowing to browse the
large repository with cgit.

Helped-by: Florian Pritz <bluewind@xinu.at>
Helped-by: Johannes Löthberg <johannes@kyriasis.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-06-01 23:24:52 +02:00
Lukas Fleischer
ecfa27e406 Do not show the activity check box when registering
Creating an inactive account does not make sense. Hide the activity
check box from the registration page.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2015-05-31 19:33:13 +02:00