diff options
Diffstat (limited to 'SETUP.md')
-rw-r--r-- | SETUP.md | 78 |
1 files changed, 64 insertions, 14 deletions
@@ -1,3 +1,5 @@ +# Setting up source hosting + NB! Some system-specific strings are used which you may need to adapt depending on your local setup: @@ -12,35 +14,83 @@ 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 +**On your local host**, +print your SSH public key +e.g. with 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 + cat ~/.ssh/id_ed25519.pub -Then preconfigure git user, +**On the server**, +preconfigure git user +with above public key (the whole line without newline) as $YOURKEY, and install needed packages: + echo gitolite3 gitolite3/adminkey select "$YOURKEY" | sudo debconf-set-selections echo gitolite3 gitolite3/gituser select git | sudo debconf-set-selections - sudo apt install gitolite3 git-daemon-sysvinit cgit cmark highlight + sudo apt install gitolite3 myrepos git-daemon-sysvinit cgit cmark highlight ## Configure git access -FIXME +**On your local host**, +Clone the gitolite3 settings repository: + + git clone git@{{githost}}:gitolite-admin + +**On your local host**, +edit the file gitolite.conf, +e.g. add these likes to add repository "foobar": + + FIXME + + +## Enable hook + +**On the server**, +clone the redpill feature project for source-hosting +and register with myrepos (to ease later update): + + mkdir --parents /usr/local/share/redpill + cd /usr/local/share/redpill + git clone https://source.redpill.dk/source-hosting.git + mr reg + +Edit the file `/etc/gitolite3/gitolite.rc` +to have `LOCAL_CODE` point into the project cloned above, +i.e. the line should look like this: + + LOCAL_CODE => "/usr/local/share/redpill/source-hosting/lib/gitolite3", + +Refresh gitolite setup +by running this command: + + sudo -u git gitolite setup + + +## Web export + +FIXME: move to separate feature + +**On the server**, +grant access for gitolite to write below /var/www +with this command: + + FIXME + +**On your local host**, +edit the file gitolite.conf +to add FIXME to repos that should be exported for web publishing, +e.g. add these likes to add repository "foobar": + + FIXME ## Configure web access -Adapt the file `/etc/default/git-daemon`: +**On the server**, +adapt the file `/etc/default/git-daemon`: GIT_DAEMON_ENABLE=true GIT_DAEMON_USER=gitdaemon |