summaryrefslogtreecommitdiff
path: root/SETUP.md
blob: 25b7508a0fe2374c9af88fd6df80fd480a5a84ba (plain)

NB! Some system-specific strings are used which you may need to adapt depending on your local setup:

featureroot: /usr/local/share/feature/source-hosting

githost: {{githost}}

Prerequisites

Gitolite service need to know the public SSH key of its administrator. You can let it ask during install, but it may be more convenient to preconfigure that information instead.

One way to preconfigure the needed SSH public key is to run this command from your personal system which then logs into the server system using ssh (adapt to replace ed25519 if your SSH keypair use a different algorithm):

printf 'gitolite3 gitolite3/adminkey select "%q"' $(cat ~/.ssh/id_ed25519.pub) | ssh {{githost}} sudo debconf-set-selections

Another way is to somehow locate your public SSH key and run this command (adapt to replace $YOURKEY with your actual key):

echo gitolite3 gitolite3/adminkey select "$YOURKEY" | sudo debconf-set-selections

Then preconfigure git user, and install needed packages:

echo gitolite3 gitolite3/gituser select git | sudo debconf-set-selections
sudo apt install gitolite3 git-daemon-sysvinit cgit cmark highlight

Configure git access

FIXME

Configure web access

Adapt the file /etc/default/git-daemon:

GIT_DAEMON_ENABLE=true
GIT_DAEMON_USER=gitdaemon
GIT_DAEMON_BASE_PATH=/srv/git
GIT_DAEMON_DIRECTORY=/srv/git/{{githost}}

# Additional options that are passed to the Daemon.
GIT_DAEMON_OPTIONS="--interpolated-path=/srv/git/%H/%D --user-path=public_git --export-all"

Adapt the file /etc/cgitrc:

css=/cgit-css/cgit.css
logo=/cgit-css/cgit.png

include=/usr/local/share/feature/source-hosting/source-hosting/etc/cgitrc