Update wiki links to the new short URL
[aur.git] / doc / maintenance.txt
blobd60945451a9c9c1609cb174726462505d2b684be
1 aurweb Maintenance
2 ==================
4 Components
5 ----------
7 aurweb has three user-facing components.
9 The Git/SSH interface can be used to update package repositories and for basic
10 package maintenance from the command-line. More details can be found in
11 `doc/git-interface.txt`.
13 The web interface can be used to browse packages, view package details, manage
14 aurweb accounts, add comments, vote for packages, flag packages, and submit
15 requests. Trusted Users can update package maintainers and delete/merge
16 packages. The web interface also includes an area for Trusted Users to post
17 AUR-related proposals and vote on them.
19 The RPC interface can be used to query package information via HTTP.
21 Installation
22 ------------
24 The web backend requires a web server with PHP and an SQL database. The Git/SSH
25 interface requires Python, several Python modules and an up-to-date version of
26 Git. APCu or memcached can be used to reduce load on the database server.
28 All dependencies and the full installation process are described in `INSTALL`.
30 Updates
31 -------
33 The `enable-maintenance` option (in the configuration file, usually located at
34 `/etc/aurweb/config`) can be used to switch aurweb into maintenance mode. This
35 disables both the Git/SSH interface and the web interface. The
36 `maintenance-exceptions` variable can be used to reactivate access for certain
37 IP addresses. Since changes to the database schema might temporarily break
38 parts of the backend, it is recommended to always enable maintenance mode
39 before performing an upgrade.
41 To simplify the upgrade process, changes in the database schema (and other
42 changes that require manual interaction) are documented in `upgrading/`. An
43 exception are additions to the configuration file. It is recommended to always
44 compare `/etc/aurweb/config` to `conf/config.defaults` when upgrading to a new
45 release.
47 Moreover, the aurweb Python modules and translations need to be reinstalled
48 with every upgrade. To this end, run `python3 setup.py install` from the aurweb
49 source tree and run `make install` in the `po/` subdirectory.
51 Don't forget to always test all basic features first, then disable maintenance
52 mode after performing an upgrade.
54 Maintenance Scripts
55 -------------------
57 aurweb includes scheduled maintenance routines to perform expensive
58 computations and clean up the database:
60 * aurweb-aurblup parses binary repositories and updates the `OfficialProviders`
61   table. This table is used to identify AUR packages that depend on packages in
62   the official repositories. It is also used to prevent users from uploading
63   packages that are in the official repositories already.
65 * aurweb-tuvotereminder sends out reminders to TUs if the voting period for a
66   TU proposal ends soon.
68 * aurweb-popupdate is used to recompute the popularity score of packages.
70 * aurweb-pkgmaint automatically removes empty repositories that were created
71   within the last 24 hours but never populated.
73 * aurweb-mkpkglists generates the package list files.
75 * aurweb-usermaint removes the last login IP address of all users that did not
76   login within the past seven days.
78 These scripts can be installed by running `python3 setup.py install` and are
79 usually scheduled using Cron. The current setup is:
81 ----
82 */5 * * * * aurweb-mkpkglists
83 1 */2 * * * aurweb-popupdate
84 2 */2 * * * aurweb-aurblup
85 3 */2 * * * aurweb-pkgmaint
86 4 */2 * * * aurweb-usermaint
87 5 */12 * * * aurweb-tuvotereminder
88 ----
90 Advanced Administrative Features
91 --------------------------------
93 Trusted Users can set the AUR_OVERWRITE environment variable to enable
94 non-fast-forward pushes to the Git repositories. This feature is documented in
95 `doc/git-interface.txt`.
97 Rate limiting is used to prevent users from hammering the RPC interface. The
98 `request_limit` and `window_length` options in the `ratelimit` section of the
99 configuration file can be used to configure this feature. Recent accesses are
100 stored in the `ApiRateLimit` table in the database. See commit 27654af (Add
101 rate limit support to API, 2018-02-01) for details.
103 The database contains a `PackageBlacklist` table. Package names added to this
104 table will be rejected by the SSH/Git interface. This table can only be edited
105 by a database administrator.
107 The `Bans` table can be used to ban certain IP addresses from both the web and
108 Git/SSH interface. This table can only be accessed by a database administrator.