-
Notifications
You must be signed in to change notification settings - Fork 8
Gitolite integration for Debian
-
install
gitolite3as well aspython3-pipandbind9utilspackages. -
edit
/etc/gitolite3/gitolite.rc:- set
UMASKto0007or0002to allow group members modifying the checked out directory - set
GIT_CONFIG_KEYStodzonegit\..*to allow per repository config - uncomment
LOCAL_CODE => "$ENV{HOME}/local"to allow hook instalation - uncomment
repo-specific-hooksfeature
- set
-
Add user
bindto thegitgroup (to be able to write journal files into the checked out repository) as well segituser to thebindgroup (to be able to userndccommand)# gpasswd -a bind git # gpasswd -a git bind -
install
dzonegitsystem-wide using pip3# pip3 install dzonegit -
symlink hooks to the gitolite directory:
# cd /var/lib/gitolite3/ # mkdir -p local/hooks/repo-specific/ # for h in dzonegit-pre-receive dzonegit-post-receive; do ln -s $(which $h) local/hooks/repo-specific/$h; done -
to be able to use
$UNIXTIMEdirective, setup a global Git smudge filter:$ cat >/var/lib/gitolite3/.gitconfig <<EOF [filter "dzonegit"] smudge = /usr/local/bin/dzonegit-smudge-serial EOF -
clone the admin repository, setup users, keys and repositories as usual. Add per repo config variables like this:
repo dns-masters RW+ = @masters option hook.pre-receive = dzonegit-pre-receive option hook.post-receive = dzonegit-post-receive config dzonegit.checkoutpath = /var/lib/dzonegit/dns-masters/ config dzonegit.conffiletemplate = /etc/dzonegit/conftemplate-bind.json config dzonegit.conffilepath = /var/lib/dzonegit/dns-masters-bind.conf config dzonegit.reconfigcmd = "/usr/sbin/rndc reconfig" config dzonegit.zonereloadcmd = "/usr/sbin/rndc reload" -
create empty checkout directory
/var/lib/dzonegit/dns-masters/, set proper owner(git) and permissions(077x) -
create JSON template file
/etc/dzonegit/conftemplate-bind.json:{ "header": "# Autogenerated by dzonegit on $datetime. Do not edit.\n", "item": "zone \"$zonename\" { type master; file \"$zonefile\"; };" } -
edit
named.confto include the config file/var/lib/dzonegit/dns-masters-bind.conf -
commit and push the
gitolite-adminrepository -
push zone files to the newly created repository
-
in case you need to regenerate the config snippet:
# su - git $ umask 0007 $ cd repositories/dns-masters.git $ dzonegit-post-receive