diff options
author | Lukas Fleischer <lfleischer@archlinux.org> | 2016-10-08 14:19:11 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2016-10-08 14:25:43 +0200 |
commit | d4fe77ac572ef0e60c9ffa5f987c9cda448cf9f2 (patch) | |
tree | 509f59c92a2a555a1e743f0ea689c5766c36319a | |
parent | e182ba0c42a9d2b2afecb8da32d00f634999935e (diff) |
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 <lfleischer@archlinux.org>
-rw-r--r-- | INSTALL | 28 | ||||
-rw-r--r-- | README | 5 | ||||
-rwxr-xr-x | aurweb/git/auth.py (renamed from git-interface/git-auth.py) | 0 | ||||
-rwxr-xr-x | aurweb/git/serve.py (renamed from git-interface/git-serve.py) | 0 | ||||
-rwxr-xr-x | aurweb/git/update.py (renamed from git-interface/git-update.py) | 0 | ||||
-rw-r--r-- | conf/config.proto | 4 | ||||
-rw-r--r-- | git-interface/Makefile | 18 | ||||
-rw-r--r-- | git-interface/__init__.py | 0 | ||||
-rw-r--r-- | git-interface/config.mk | 1 | ||||
-rw-r--r-- | git-interface/git-auth.sh.in | 3 | ||||
-rw-r--r-- | setup.py | 7 | ||||
-rw-r--r-- | test/setup.sh | 8 |
12 files changed, 26 insertions, 48 deletions
@@ -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. diff --git a/git-interface/git-auth.py b/aurweb/git/auth.py index 022b0ff..022b0ff 100755 --- a/git-interface/git-auth.py +++ b/aurweb/git/auth.py diff --git a/git-interface/git-serve.py b/aurweb/git/serve.py index ebfef94..ebfef94 100755 --- a/git-interface/git-serve.py +++ b/aurweb/git/serve.py diff --git a/git-interface/git-update.py b/aurweb/git/update.py index 7337341..7337341 100755 --- a/git-interface/git-update.py +++ b/aurweb/git/update.py diff --git a/conf/config.proto b/conf/config.proto index 21441a9..96fad80 100644 --- a/conf/config.proto +++ b/conf/config.proto @@ -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] diff --git a/git-interface/Makefile b/git-interface/Makefile deleted file mode 100644 index 8865790..0000000 --- a/git-interface/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -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 diff --git a/git-interface/__init__.py b/git-interface/__init__.py deleted file mode 100644 index e69de29..0000000 --- a/git-interface/__init__.py +++ /dev/null diff --git a/git-interface/config.mk b/git-interface/config.mk deleted file mode 100644 index 4d794a1..0000000 --- a/git-interface/config.mk +++ /dev/null @@ -1 +0,0 @@ -PREFIX = /usr/local diff --git a/git-interface/git-auth.sh.in b/git-interface/git-auth.sh.in deleted file mode 100644 index 223816a..0000000 --- a/git-interface/git-auth.sh.in +++ /dev/null @@ -1,3 +0,0 @@ -#!/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', + ], + }, ) diff --git a/test/setup.sh b/test/setup.sh index dc9cff2..d02d298 100644 --- a/test/setup.sh +++ b/test/setup.sh @@ -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] |