mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Specifically check for URIs git-http-backend(1) can handle. This also allows us to make the ".git" suffix optional. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
68 lines
2 KiB
Text
68 lines
2 KiB
Text
Setup on Arch Linux
|
|
===================
|
|
|
|
1) Clone the AUR project:
|
|
|
|
$ cd /srv/http/
|
|
$ git clone git://projects.archlinux.org/aurweb.git
|
|
|
|
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:
|
|
|
|
location ~ .* {
|
|
rewrite ^/(.*)$ /index.php/$1 last;
|
|
}
|
|
|
|
3) Copy conf/config.proto to conf/config and adjust the configuration.
|
|
|
|
4) Create a new MySQL database and a user and import the AUR SQL schema:
|
|
|
|
$ mysql -uaur -p AUR </srv/http/aurweb/schema/aur-schema.sql
|
|
|
|
5) Create a new user:
|
|
|
|
# useradd -U -d /srv/http/aurweb -c 'AUR user' aur
|
|
|
|
6) Initialize the Git repository:
|
|
|
|
# mkdir /srv/http/aurweb/aur.git/
|
|
# cd /srv/http/aurweb/aur.git/
|
|
# git init --bare
|
|
# ln -s ../../git-interface/git-update.py hooks/update
|
|
# chown -R aur .
|
|
|
|
7) Install the git-auth wrapper script:
|
|
|
|
# cd /srv/http/aurweb/git-interface/
|
|
# make && make install
|
|
|
|
8) Configure sshd(8) for the AUR. Add the following lines at the end of your
|
|
sshd_config(5) and restart the sshd. Note that OpenSSH 6.9 or newer is
|
|
needed!
|
|
|
|
Match User aur
|
|
PasswordAuthentication no
|
|
AuthorizedKeysCommand /usr/local/bin/aur-git-auth "%t" "%k"
|
|
AuthorizedKeysCommandUser aur
|
|
|
|
9) If you want to enable smart HTTP support with nginx and uWSGI, you can use
|
|
the following directives:
|
|
|
|
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))$" {
|
|
include uwsgi_params;
|
|
uwsgi_modifier1 9;
|
|
uwsgi_param PATH_INFO /aur.git/$2;
|
|
uwsgi_param GIT_NAMESPACE $1;
|
|
uwsgi_pass unix:/run/uwsgi/smarthttp/aurweb.sock;
|
|
}
|
|
|
|
For the uWSGI configuration, the following template can be used:
|
|
|
|
[uwsgi]
|
|
plugins = cgi
|
|
uid = aur
|
|
processes = 1
|
|
threads = 8
|
|
env = GIT_HTTP_EXPORT_ALL=
|
|
env = GIT_PROJECT_ROOT=/srv/http/aurweb
|
|
cgi = /usr/lib/git-core/git-http-backend
|