Commit d4fe77ac authored by Lukas Fleischer's avatar Lukas Fleischer
Browse files

Reorganize Git interface scripts



Move the Git interface scripts from git-interface/ to aurweb/git/. Use
setuptools to automatically create wrappers which can be installed using
`python3 setup.py install`. Update the configuration files, the test
suite as well as the INSTALL and README files to reflect these changes.
Signed-off-by: Lukas Fleischer's avatarLukas Fleischer <lfleischer@archlinux.org>
parent e182ba0c
......@@ -37,11 +37,16 @@ Setup on Arch Linux
$ mysql -uaur -p AUR </srv/http/aurweb/schema/aur-schema.sql
5) Create a new user:
5) Install Python modules and dependencies:
# pacman -S python-mysql-connector python-pygit2 python-srcinfo
# python3 setup.py install
6) Create a new user:
# useradd -U -d /srv/http/aurweb -c 'AUR user' aur
6) Initialize the Git repository:
7) Initialize the Git repository:
# mkdir /srv/http/aurweb/aur.git/
# cd /srv/http/aurweb/aur.git/
......@@ -49,29 +54,20 @@ Setup on Arch Linux
# git config --local transfer.hideRefs '^refs/'
# git config --local --add transfer.hideRefs '!refs/'
# git config --local --add transfer.hideRefs '!HEAD'
# ln -s ../../git-interface/git-update.py hooks/update
# ln -s /usr/local/bin/aurweb-git-update hooks/update
# chown -R aur .
7) Install needed Python modules:
# pacman -S python-mysql-connector python-pygit2 python-srcinfo
8) Install the git-auth wrapper script:
# cd /srv/http/aurweb/git-interface/
# make && make install
9) Configure sshd(8) for the AUR. Add the following lines at the end of your
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"
AuthorizedKeysCommand /usr/local/bin/aurweb-git-auth "%t" "%k"
AuthorizedKeysCommandUser aur
10) If you want to enable smart HTTP support with nginx and fcgiwrap, you can
use the following directives:
9) If you want to enable smart HTTP support with nginx and fcgiwrap, 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))$" {
fastcgi_pass unix:/run/fcgiwrap.sock;
......
......@@ -18,7 +18,7 @@ Directory Layout
----------------
aurweb::
Shared aurweb Python modules.
aurweb Python modules.
conf::
Configuration and configuration templates.
......@@ -26,9 +26,6 @@ conf::
doc::
Project documentation.
git-interface::
Scripts that make up the Git and SSH interface.
po::
Translation files for strings in the aurweb interface.
......
......@@ -46,14 +46,14 @@ RSA = SHA256:Ju+yWiMb/2O+gKQ9RJCDqvRg7l+Q95KFAeqM5sr6l2s
[auth]
valid-keytypes = ssh-rsa ssh-dss ecdsa-sha2-nistp256 ecdsa-sha2-nistp384 ecdsa-sha2-nistp521 ssh-ed25519
username-regex = [a-zA-Z0-9]+[.\-_]?[a-zA-Z0-9]+$
git-serve-cmd = /srv/http/aurweb/git-interface/git-serve.py
git-serve-cmd = /usr/local/bin/aurweb-git-serve
ssh-options = restrict
[serve]
repo-path = /srv/http/aurweb/aur.git/
repo-regex = [a-z0-9][a-z0-9.+_-]*$
git-shell-cmd = /usr/bin/git-shell
git-update-cmd = /srv/http/aurweb/git-interface/git-update.py
git-update-cmd = /usr/local/bin/aurweb-git-update
ssh-cmdline = ssh aur@aur.archlinux.org
[update]
......
GIT_INTERFACE_DIR := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
include config.mk
git-auth.sh:
sed 's#%GIT_INTERFACE_DIR%#$(GIT_INTERFACE_DIR)#' <git-auth.sh.in >git-auth.sh
chmod +x git-auth.sh
install: git-auth.sh
install -Dm0755 git-auth.sh "$(DESTDIR)$(PREFIX)/bin/aur-git-auth"
uninstall:
rm -f "$(DESTDIR)$(PREFIX)/bin/aur-git-auth"
clean:
rm -f git-auth.sh
.PHONY: install uninstall clean
#!/bin/sh
%GIT_INTERFACE_DIR%/git-auth.py "$1" "$2"
......@@ -17,4 +17,11 @@ setup(
name="aurweb",
version=version,
packages=find_packages(),
entry_points={
'console_scripts': [
'aurweb-git-auth = aurweb.git.auth:main',
'aurweb-git-serve = aurweb.git.serve:main',
'aurweb-git-update = aurweb.git.update:main',
],
},
)
......@@ -8,9 +8,9 @@ PYTHONPATH="$TOPLEVEL"
export PYTHONPATH
# Configure paths to the Git interface scripts.
GIT_AUTH="$TOPLEVEL/git-interface/git-auth.py"
GIT_SERVE="$TOPLEVEL/git-interface/git-serve.py"
GIT_UPDATE="$TOPLEVEL/git-interface/git-update.py"
GIT_AUTH="$TOPLEVEL/aurweb/git/auth.py"
GIT_SERVE="$TOPLEVEL/aurweb/git/serve.py"
GIT_UPDATE="$TOPLEVEL/aurweb/git/update.py"
MKPKGLISTS="$TOPLEVEL/scripts/mkpkglists.py"
TUVOTEREMINDER="$TOPLEVEL/scripts/tuvotereminder.py"
PKGMAINT="$TOPLEVEL/scripts/pkgmaint.py"
......@@ -38,7 +38,7 @@ reply-to = noreply@aur.archlinux.org
[auth]
valid-keytypes = ssh-rsa ssh-dss ecdsa-sha2-nistp256 ecdsa-sha2-nistp384 ecdsa-sha2-nistp521 ssh-ed25519
username-regex = [a-zA-Z0-9]+[.\-_]?[a-zA-Z0-9]+$
git-serve-cmd = /srv/http/aurweb/git-interface/git-serve.py
git-serve-cmd = $GIT_SERVE
ssh-options = restrict
[serve]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment