Skip to content
Kevin Holzer edited this page Feb 20, 2016 · 7 revisions

What is Smart HTTP mode?

When Smart HTTP mode is enabled, you can pull from and push to a repository using its usual HTTP URL. For example, if you host your klaus installation at http://yourdomain.org/git/ and have a repository named demo, you can use http://yourdomain.org/git/demo for push and pull:

git clone http://yourdomain.org/git/demo
git push http://yourdomain.org/git/demo master

How to enable Smart HTTP mode

  1. Using the integrated web server: klaus ... --smarthttp ...
  2. Using a "real" web server": Either set the KLAUS_USE_SMARTHTTP environment variable or roll your own version of the klaus/contrib/wsgi.py script.

Note: Repositories are always world-readable when Smart HTTP mode is enabled, i.e. they may be cloned/pulled from without any sort of authentication. This can be prevented by passing the argument require_browser_auth=True to klaus.make_app. Alternatively, authentication for read access may be implemented on a different level (nginx/Apache/...).

Apache support: See mod_wsgi article

How to enable push

For security reasons, git push-ing to your Smart HTTP klaus installation works only with authentication. This requires that you specify credentials in a htdigest file. The file may be generated with the htdigest command line tool:

htdigest -c klaus-push-credentials.htdigest youdomain.org yourusername

To enable push support:

  1. Using the integrated web server: klaus ... --smarthttp --htdigest /path/to/your/klaus-push-credentials.htdigest ...
  2. Using a "real" web server": Either set the KLAUS_HTDIGEST_FILE environment variable to the path where your credentials file is located, or roll your own version of the klaus/contrib/wsgi.py script.