Skip to main content

Django Gitolite

A basic Django app for using Gitolite

Configuration

By default the Gitolite rc file is ~/.gitolite.rc. Follow these steps:

  1. Add LOCAL_CODE => "$ENV{HOME}/local", to the rc file.
  2. Create ~/local/triggers/post-compile/django, it should be executable and call the gitolitetrigger management command.
  3. Create ~/local/hooks/common/post-receive, it should be executable and call the gitolitehook management command.
  4. Add POST_COMPILE => ['post-compile/django'], to the rc file.
  5. Add POST_CREATE => ['post-compile/django'], to the rc file.
  6. Add SSH_AUTHKEYS => ['post-compile/ssh-authkeys'], to the rc file.

This is an example post-compile/django script:

#!/bin/bash
source ~/virtualenv/bin/activate
export PYTHONPATH=~/site
export DJANGO_SETTINGS_MODULE=settings
python ~/site/manage.py gitolitetrigger $@

This is an example post-receive script:

#!/bin/bash
source ~/virtualenv/bin/activate
export PYTHONPATH=~/site
export DJANGO_SETTINGS_MODULE=settings
python ~/site/manage.py gitolitehook $@

Running as another user

This configuration requires sudo and the current user to be in the same group as the gitolite user's default group.

As the gitolite user, open ~/.gitolite.rc and add UMASK => 0027,. This is required to be able to read gl-creator and gl-forked-from files in the repositories. Next, ensure that the key directory, ~/.gitolite/keydir exists and is writable by the current user. Files in this directory need to be readable by the gitolite user, to ensure that files are created belong to the gitolite user's default group use chmod g+rwxs ~/.gitolite/keydir.

Next, you need to setup sudo so the gitolite user can use it to run Gitolite triggers. Insert the following line into /etc/sudoers:

%git ALL=(git)NOPASSWD:/usr/bin/gitolite trigger SSH_AUTHKEYS

Below is the following I use on my server:

Defaults: site-eyl env_keep += "GL_USER"
%git ALL=(git)NOPASSWD:/usr/bin/gitolite trigger SSH_AUTHKEYS,/usr/bin/gitolite list-phy-repos,/usr/bin/gitolite access *,/usr/bin/gitolite D *

Defaults:git env_keep += "GL_REPO GL_USER GL_BYPASS_ACCESS_CHECKS"
git ALL=(site-eyl) NOPASSWD: /srv/site-eyl/bin/manage gitolitehook,/srv/site-eyl/bin/manage gitolitetrigger *

License

All code is licensed under GPL v3.

Metadata

Release files for django-gitolite 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-gitolite 0.2.2
File Size Uploaded
django-gitolite-0.2.2.tar.gz 8.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-gitolite 0.2.2
File Interpreter ABI Platform
django_gitolite-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 33.5 kB

Release files / django-gitolite-0.2.2.tar.gz

Download URL django-gitolite-0.2.2.tar.gz
Size 8.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1d456ddccb8904cb7b92423be46058b2b4b7cf01e2e82c05a662ecae3fc9a727
BLAKE2b-256 checksum
How to use checksums
877c144adf379f9255f824de1325f18cc619990d969562dbede23ffd063b55cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release files / django_gitolite-0.2.2-py3-none-any.whl

Download URL django_gitolite-0.2.2-py3-none-any.whl
Size 24.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
587d2e9059fea40708eedaee39eac3c8f38cde7df9503266776be4bae03891a4
BLAKE2b-256 checksum
How to use checksums
249c85e25d7e6abbf02891dde9636137b10922cd2a46beeb719ce7c98a9fe331
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/54.1.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

1 release file

0.1.10

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page