INSTALL 3.4 KB
Newer Older
Lukas Fleischer's avatar
Lukas Fleischer committed
1
2
Setup on Arch Linux
===================
canyonknight's avatar
canyonknight committed
3

4
5
6
7
8
9
10
11
For testing aurweb patches before submission, you can use the instructions in
TESTING for testing the web interface only.

Note that you can only do limited testing using the PHP built-in web server.
In particular, the cgit interface will be unusable as well as the ssh+git
interface. For a detailed description on how to setup a full aurweb server,
read the instructions below.

12
1) Clone the aurweb project:
canyonknight's avatar
canyonknight committed
13

Lukas Fleischer's avatar
Lukas Fleischer committed
14
   $ cd /srv/http/
15
   $ git clone git://git.archlinux.org/aurweb.git
canyonknight's avatar
canyonknight committed
16

Lukas Fleischer's avatar
Lukas Fleischer committed
17
18
19
2) Setup a web server with PHP and MySQL. Configure the web server to redirect
   all URLs to /index.php/foo/bar/. The following block can be used with nginx:

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
    server {
        listen       80;
        server_name  aur.local aur;

        root   /srv/http/aurweb/web/html;
        index  index.php;

        location ~ ^/[^/]+\.php($|/) {
            fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
            fastcgi_index  index.php;
            fastcgi_split_path_info ^(/[^/]+\.php)(/.*)$;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_param  PATH_INFO        $fastcgi_path_info;
            include        fastcgi_params;
        }

        location ~ .* {
            rewrite ^/(.*)$ /index.php/$1 last;
        }
Lukas Fleischer's avatar
Lukas Fleischer committed
39
    }
canyonknight's avatar
canyonknight committed
40

41
42
3) Copy conf/config.proto to /etc/aurweb/config and adjust the configuration
   (pay attention to disable_http_login, enable_maintenance and aur_location).
canyonknight's avatar
canyonknight committed
43

44
4) Create a new MySQL database and a user and import the aurweb SQL schema:
canyonknight's avatar
canyonknight committed
45

Lukas Fleischer's avatar
Lukas Fleischer committed
46
    $ mysql -uaur -p AUR </srv/http/aurweb/schema/aur-schema.sql
canyonknight's avatar
canyonknight committed
47

48
49
50
5) Install Python modules and dependencies:

    # pacman -S python-mysql-connector python-pygit2 python-srcinfo
51
    # pacman -S python-bleach python-markdown
52
53
54
    # python3 setup.py install

6) Create a new user:
55

56
    # useradd -U -d /srv/http/aurweb -c 'AUR user' aur
57

58
7) Initialize the Git repository:
canyonknight's avatar
canyonknight committed
59

60
61
62
    # mkdir /srv/http/aurweb/aur.git/
    # cd /srv/http/aurweb/aur.git/
    # git init --bare
63
    # git config --local transfer.hideRefs '^refs/'
64
65
    # git config --local --add transfer.hideRefs '!refs/'
    # git config --local --add transfer.hideRefs '!HEAD'
66
    # ln -s /usr/local/bin/aurweb-git-update hooks/update
67
    # chown -R aur .
canyonknight's avatar
canyonknight committed
68

69
70
71
   It is recommended to read doc/git-interface.txt for more information on the
   administration of the package Git repository.

72
8) Configure sshd(8) for the AUR. Add the following lines at the end of your
Lukas Fleischer's avatar
Lukas Fleischer committed
73
74
   sshd_config(5) and restart the sshd. Note that OpenSSH 6.9 or newer is
   needed!
canyonknight's avatar
canyonknight committed
75

Lukas Fleischer's avatar
Lukas Fleischer committed
76
77
    Match User aur
        PasswordAuthentication no
78
        AuthorizedKeysCommand /usr/local/bin/aurweb-git-auth "%t" "%k"
Lukas Fleischer's avatar
Lukas Fleischer committed
79
        AuthorizedKeysCommandUser aur
80
        AcceptEnv AUR_OVERWRITE
Marcel Korpel's avatar
Marcel Korpel committed
81

82
83
9) If you want to enable smart HTTP support with nginx and fcgiwrap, you can
   use the following directives:
84

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
87
88
89
90
91
92
        fastcgi_pass   unix:/run/fcgiwrap.sock;
        include        fastcgi_params;
        fastcgi_param  SCRIPT_FILENAME /usr/lib/git-core/git-http-backend;
        fastcgi_param  PATH_INFO /aur.git/$3;
        fastcgi_param  GIT_HTTP_EXPORT_ALL "";
        fastcgi_param  GIT_NAMESPACE $1;
        fastcgi_param  GIT_PROJECT_ROOT /srv/http/aurweb/;
93
94
    }

95
   Sample systemd unit files for fcgiwrap can be found under conf/.