Require TUs to explicitly request to overwrite a pkgbase
[aur.git] / INSTALL
blob369e1e3f92c5a2f5fb7513d6a9de00a047542a36
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     # python3 setup.py install
53 6) Create a new user:
55     # useradd -U -d /srv/http/aurweb -c 'AUR user' aur
57 7) Initialize the Git repository:
59     # mkdir /srv/http/aurweb/aur.git/
60     # cd /srv/http/aurweb/aur.git/
61     # git init --bare
62     # git config --local transfer.hideRefs '^refs/'
63     # git config --local --add transfer.hideRefs '!refs/'
64     # git config --local --add transfer.hideRefs '!HEAD'
65     # ln -s /usr/local/bin/aurweb-git-update hooks/update
66     # chown -R aur .
68    It is recommended to read doc/git-interface.txt for more information on the
69    administration of the package Git repository.
71 8) Configure sshd(8) for the AUR. Add the following lines at the end of your
72    sshd_config(5) and restart the sshd. Note that OpenSSH 6.9 or newer is
73    needed!
75     Match User aur
76         PasswordAuthentication no
77         AuthorizedKeysCommand /usr/local/bin/aurweb-git-auth "%t" "%k"
78         AuthorizedKeysCommandUser aur
79         AcceptEnv AUR_OVERWRITE
81 9) If you want to enable smart HTTP support with nginx and fcgiwrap, you can
82    use the following directives:
84     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))$" {
85         fastcgi_pass   unix:/run/fcgiwrap.sock;
86         include        fastcgi_params;
87         fastcgi_param  SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
88         fastcgi_param  PATH_INFO /aur.git/$3;
89         fastcgi_param  GIT_HTTP_EXPORT_ALL "";
90         fastcgi_param  GIT_NAMESPACE $1;
91         fastcgi_param  GIT_PROJECT_ROOT /srv/http/aurweb/;
92     }
94    Sample systemd unit files for fcgiwrap can be found under conf/.