Skip to content

Instantly share code, notes, and snippets.

@justinkelly
Created October 11, 2010 01:47
Show Gist options
  • Save justinkelly/619841 to your computer and use it in GitHub Desktop.
Save justinkelly/619841 to your computer and use it in GitHub Desktop.
<Directory />
Options FollowSymLinks
AllowOverride All
Options -Indexes
</Directory>
Alias /code /var/bzr/repo/
WSGIScriptAliasMatch ^/code/.*/\.bzr/smart$ /var/bzr/repo/bzr_serve.wsgi
#The three next lines allow regular GETs to work too
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/code/.*/\.bzr/smart$
RewriteRule ^/code/(.*/\.bzr/.*)$ /var/bzr/repo/$1 [L]
<Directory /var/bzr/repo>
WSGIApplicationGroup %{GLOBAL}
</Directory>
<Location /code>
AuthType Basic
AuthName "Trac Source Access"
AuthUserFile /path/to/trac/.htpasswd
<LimitExcept GET>
Require valid-user
</LimitExcept>
</Location>
from bzrlib.transport.http import wsgi
def application(environ, start_response):
app = wsgi.make_app(
root="/var/bzr/repo/",
prefix="/code",
readonly=False,
enable_logging=False)
return app(environ, start_response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment