summaryrefslogtreecommitdiffstats
path: root/git-interface
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2015-06-11 14:41:06 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2015-06-11 14:48:01 +0200
commit078f7256e3424c3fad304a3c90f735c88060d277 (patch)
tree56a7499eb38c01a070ec4ce5e7ea104f44a2515e /git-interface
parenta45b5073cac989da084f1bdb44cac71b6c6a61a8 (diff)
downloadaurweb-078f7256e3424c3fad304a3c90f735c88060d277.tar.xz
Support exceptions in the maintenance mode
Allow for excluding certain IP addresses from the maintenance mode. This allows administrators to view the web page while the site is still under maintenance for the rest of the world. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'git-interface')
-rwxr-xr-xgit-interface/git-serve.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/git-interface/git-serve.py b/git-interface/git-serve.py
index 21b130c..a6dee13 100755
--- a/git-interface/git-serve.py
+++ b/git-interface/git-serve.py
@@ -22,6 +22,7 @@ git_shell_cmd = config.get('serve', 'git-shell-cmd')
ssh_cmdline = config.get('serve', 'ssh-cmdline')
enable_maintenance = config.getboolean('options', 'enable-maintenance')
+maintenance_exc = config.get('options', 'maintenance-exceptions').split()
def pkgbase_exists(pkgbase):
db = mysql.connector.connect(host=aur_db_host, user=aur_db_user,
@@ -113,7 +114,9 @@ cmdargv = shlex.split(cmd)
action = cmdargv[0]
if enable_maintenance:
- die("The AUR is down due to maintenance. We will be back soon.")
+ remote_addr = os.environ["SSH_CLIENT"].split(" ")[0]
+ if not remote_addr in maintenance_exc:
+ die("The AUR is down due to maintenance. We will be back soon.")
if action == 'git-upload-pack' or action == 'git-receive-pack':
if len(cmdargv) < 2: