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

Lukas Fleischer's avatar
Lukas Fleischer committed
4
1) Clone the AUR project:
canyonknight's avatar
canyonknight committed
5

Lukas Fleischer's avatar
Lukas Fleischer committed
6
   $ cd /srv/http/
7
   $ git clone git://projects.archlinux.org/aurweb.git
canyonknight's avatar
canyonknight committed
8

Lukas Fleischer's avatar
Lukas Fleischer committed
9
10
11
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:

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    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
31
    }
canyonknight's avatar
canyonknight committed
32

33
34
3) Copy conf/config.proto to conf/config and adjust the configuration (pay
   attention to disable_http_login, enable_maintenance and aur_location).
canyonknight's avatar
canyonknight committed
35

Lukas Fleischer's avatar
Lukas Fleischer committed
36
4) Create a new MySQL database and a user and import the AUR SQL schema:
canyonknight's avatar
canyonknight committed
37

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

40
5) Create a new user:
41

42
    # useradd -U -d /srv/http/aurweb -c 'AUR user' aur
43

44
6) Initialize the Git repository:
canyonknight's avatar
canyonknight committed
45

46
47
48
    # mkdir /srv/http/aurweb/aur.git/
    # cd /srv/http/aurweb/aur.git/
    # git init --bare
49
50
    # git config --local transfer.hideRefs '^refs/'
    # git config --local transfer.hideRefs '!refs/'
Lukas Fleischer's avatar
Lukas Fleischer committed
51
    # ln -s ../../git-interface/git-update.py hooks/update
52
    # chown -R aur .
canyonknight's avatar
canyonknight committed
53

54
55
7) Install needed Python modules:

56
    # pacman -S python-mysql-connector python-pygit2 python-srcinfo
57
58

8) Install the git-auth wrapper script:
canyonknight's avatar
canyonknight committed
59

Lukas Fleischer's avatar
Lukas Fleischer committed
60
    # cd /srv/http/aurweb/git-interface/
61
    # make && make install
canyonknight's avatar
canyonknight committed
62

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

Lukas Fleischer's avatar
Lukas Fleischer committed
67
68
69
70
    Match User aur
        PasswordAuthentication no
        AuthorizedKeysCommand /usr/local/bin/aur-git-auth "%t" "%k"
        AuthorizedKeysCommandUser aur
Marcel Korpel's avatar
Marcel Korpel committed
71

72
73
10) If you want to enable smart HTTP support with nginx and fcgiwrap, you can
    use the following directives:
74

75
    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))$" {
76
77
78
79
80
81
82
        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/;
83
84
    }

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