-
Notifications
You must be signed in to change notification settings - Fork 102
Smart HTTP
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
- Using the integrated web server:
klaus ... --smarthttp ...
- Using a "real" web server": Either set the
KLAUS_USE_SMARTHTTP
environment variable or roll your own version of theklaus/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
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:
- Using the integrated web server:
klaus ... --smarthttp --htdigest /path/to/your/klaus-push-credentials.htdigest ...
- 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 theklaus/contrib/wsgi.py
script.