Hi, this is one of the trickier areas of setting up allura :) Thanks for sharing your config. Comparing it to the docs and to what we have running forge-allura.apache.org itself, the only real difference is the DocumentRoot and <Directory "/srv/git"> section. I don't think either of those are needed, and it may be causing requests to go through without prompting for a username/password - which would make them None in the handler code. Can you try without those parts? Also, are you getting prompted at all for a password when you try to access the git repo?
-Dave On 11/18/15 8:38 PM, 1one.w01f wrote: > Dear Allura developers, > > I am currently having troubles setting up Auth with Apache with the provided > ApacheAccessHandler.py. > > I have checked and tried that the configuration without authentication works > (both pull and push), however, with auth (following the last section of > https://forge-allura.apache.org/docs/getting_started/scm_host.html), we keep > getting ERROR 500. > > After inspecting the Apache error log, as well as playing with > ApacheAccessHandler.py, I noticed that "req.user" is always None, even though > in > git config the url is set to > "https://<username>@<our-url>/git/p/testgit/code", > where "testgit" is a project created using Allura's web front end (and both > git > push and git pull worked previously without the auth setup). > > In ApacheAccessHandler.py, the line > "password = req.get_basic_auth_pw()" precedes the line > "username = req.user" > but then both "password" and "username" turn out to be None. > > Did I overlook anything? Attached below is our sites-enabled/000-default.conf: > > <VirtualHost *:<port>> > DocumentRoot /srv/git > > SSLEngine On > SSLCertificateFile <cert-file> > SSLCertificateKeyFile <key-file> > > <Directory "/srv/git"> > Allow from all > Options +ExecCGI > AllowOverride none > Require all granted > </Directory> > > SetEnv GIT_PROJECT_ROOT /srv/git > SetEnv GIT_HTTP_EXPORT_ALL > ProxyPass /git/ ! > ScriptAlias /git /usr/lib/git-core/git-http-backend/ > > SetEnv REMOTE_USER=git-allura > > <LocationMatch "^/(git)/"> > > AuthType Basic > AuthName "SCM Access" > AuthBasicAuthoritative off > > AddHandler mod_python .py > > PythonDebug On > > PythonOption ALLURA_VIRTUALENV /path/to/env-allura > > PythonOption ALLURA_PERM_URL > https://localhost:<allura-port>/auth/repo_permissions > PythonOption ALLURA_AUTH_URL > https://localhost:<allura-port>/auth/do_login > > PythonAccessHandler /path/to/ApacheAccessHandler.py > </LocationMatch> > > </VirtualHost> > > Thanks, > -1one.w01f > -- Dave Brondsema : [email protected] http://www.brondsema.net : personal http://www.splike.com : programming <><
