[#8378] keep ApacheAccessHandler.py for repos working on py2 for now
diff --git a/scm_config/git-http/Dockerfile b/scm_config/git-http/Dockerfile
index f2da2d2..7fbfbaf 100644
--- a/scm_config/git-http/Dockerfile
+++ b/scm_config/git-http/Dockerfile
@@ -22,9 +22,13 @@
# match main allura Dockerfile, for shared base
FROM ubuntu:18.04
+# libapache2-mod-python is for py2 (both ubuntu:18.04 and ubuntu:20.04)
+# to match that, python-requests is also py2 on ubuntu:18.04 (probably python2-requests on ubuntu:20.04)
+# https://forge-allura.apache.org/p/allura/tickets/8352/ is to switch to mod_wsgi & py3 instead
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
apache2 \
libapache2-mod-python \
+ python-requests \
git \
curl \
sudo \
diff --git a/scm_config/git-http/git-http.conf b/scm_config/git-http/git-http.conf
index 7ac0acf..bee3882 100644
--- a/scm_config/git-http/git-http.conf
+++ b/scm_config/git-http/git-http.conf
@@ -52,8 +52,8 @@
AuthBasicAuthoritative off
PythonOption ALLURA_PERM_URL http://web:8088/auth/repo_permissions
PythonOption ALLURA_AUTH_URL http://web:8088/auth/do_login
- # for 'requests' lib only, doesn't have to be full allura venv
- PythonOption ALLURA_VIRTUALENV /allura-data/virtualenv
+ # need python 'requests' lib only, doesn't have to be full allura venv
+ # PythonOption ALLURA_VIRTUALENV /some/venv/if/needed
</Location>
# declare what is being handled here
diff --git a/scripts/ApacheAccessHandler.py b/scripts/ApacheAccessHandler.py
index 4632541..afe928a 100644
--- a/scripts/ApacheAccessHandler.py
+++ b/scripts/ApacheAccessHandler.py
@@ -48,7 +48,10 @@
virtualenv_path = req.get_options().get(str('ALLURA_VIRTUALENV'), None)
if virtualenv_path:
activate_this = '%s/bin/activate_this.py' % virtualenv_path
- exec(compile(open(activate_this, "rb").read(), activate_this, 'exec'), {'__file__': activate_this})
+ try:
+ exec(compile(open(activate_this, "rb").read(), activate_this, 'exec'), {'__file__': activate_this})
+ except Exception as e:
+ log(req, "Couldn't activate venv via %s: %s" % (activate_this, repr(e)))
global requests
import requests as requests_lib
requests = requests_lib