-
Notifications
You must be signed in to change notification settings - Fork 8
Gitolite integration for Debian
-
install
gitolite3
as well aspython3-pip
andbind9utils
packages. -
edit
/etc/gitolite3/gitolite.rc
:- set
UMASK
to0007
or0002
to allow group members modifying the checked out directory - set
GIT_CONFIG_KEYS
todzonegit\..*
to allow per repository config - uncomment
LOCAL_CODE => "$ENV{HOME}/local"
to allow hook instalation - uncomment
repo-specific-hooks
feature
- set
-
Add user
bind
to thegit
group (to be able to write journal files into the checked out repository) as well segit
user to thebind
group (to be able to userndc
command)# gpasswd -a bind git # gpasswd -a git bind
-
install
dzonegit
system-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
$UNIXTIME
directive, 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.conf
to include the config file/var/lib/dzonegit/dns-masters-bind.conf
-
commit and push the
gitolite-admin
repository -
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