Move AUR_OVERWRITE privilege check from git/auth to git/update
[aur.git] / INSTALL
blobba24a450ac988e7eb1117d32a4a1ee7ba9c21fcd
1 Setup on Arch Linux
2 ===================
4 For testing aurweb patches before submission, you can use the instructions in
5 TESTING for testing the web interface only.
7 Note that you can only do limited testing using the PHP built-in web server.
8 In particular, the cgit interface will be unusable as well as the ssh+git
9 interface. For a detailed description on how to setup a full aurweb server,
10 read the instructions below.
12 1) Clone the aurweb project:
14    $ cd /srv/http/
15    $ git clone git://git.archlinux.org/aurweb.git
17 2) Setup a web server with PHP and MySQL. Configure the web server to redirect
18    all URLs to /index.php/foo/bar/. The following block can be used with nginx:
20     server {
21         listen       80;
22         server_name  aur.local aur;
24         root   /srv/http/aurweb/web/html;
25         index  index.php;
27         location ~ ^/[^/]+\.php($|/) {
28             fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
29             fastcgi_index  index.php;
30             fastcgi_split_path_info ^(/[^/]+\.php)(/.*)$;
31             fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
32             fastcgi_param  PATH_INFO        $fastcgi_path_info;
33             include        fastcgi_params;
34         }
36         location ~ .* {
37             rewrite ^/(.*)$ /index.php/$1 last;
38         }
39     }
41 3) Copy conf/config.proto to /etc/aurweb/config and adjust the configuration
42    (pay attention to disable_http_login, enable_maintenance and aur_location).
44 4) Create a new MySQL database and a user and import the aurweb SQL schema:
46     $ mysql -uaur -p AUR </srv/http/aurweb/schema/aur-schema.sql
48 5) Install Python modules and dependencies:
50     # pacman -S python-mysql-connector python-pygit2 python-srcinfo
51     # pacman -S python-bleach python-markdown
52     # python3 setup.py install
54 6) Create a new user:
56     # useradd -U -d /srv/http/aurweb -c 'AUR user' aur
58 7) Initialize the Git repository:
60     # mkdir /srv/http/aurweb/aur.git/
61     # cd /srv/http/aurweb/aur.git/
62     # git init --bare
63     # git config --local transfer.hideRefs '^refs/'
64     # git config --local --add transfer.hideRefs '!refs/'
65     # git config --local --add transfer.hideRefs '!HEAD'
66     # ln -s /usr/local/bin/aurweb-git-update hooks/update
67     # chown -R aur .
69    It is recommended to read doc/git-interface.txt for more information on the
70    administration of the package Git repository.
72 8) Configure sshd(8) for the AUR. Add the following lines at the end of your
73    sshd_config(5) and restart the sshd. Note that OpenSSH 6.9 or newer is
74    needed!
76     Match User aur
77         PasswordAuthentication no
78         AuthorizedKeysCommand /usr/local/bin/aurweb-git-auth "%t" "%k"
79         AuthorizedKeysCommandUser aur
80         AcceptEnv AUR_OVERWRITE
82 9) If you want to enable smart HTTP support with nginx and fcgiwrap, you can
83    use the following directives:
85     location ~ "^/([a-z0-9][a-z0-9.+_-]*?)(\.git)?/(git-(receive|upload)-pack|HEAD|info/refs|objects/(info/(http-)?alternates|packs)|[0-9a-f]{2}/[0-9a-f]{38}|pack/pack-[0-9a-f]{40}\.(pack|idx))$" {
86         fastcgi_pass   unix:/run/fcgiwrap.sock;
87         include        fastcgi_params;
88         fastcgi_param  SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
89         fastcgi_param  PATH_INFO /aur.git/$3;
90         fastcgi_param  GIT_HTTP_EXPORT_ALL "";
91         fastcgi_param  GIT_NAMESPACE $1;
92         fastcgi_param  GIT_PROJECT_ROOT /srv/http/aurweb/;
93     }
95    Sample systemd unit files for fcgiwrap can be found under conf/.