1 One may want to provide ikiwiki hosting with [[rcs/git]]+ssh access and web
2 server located at different hosts. Here's a description for such
3 a setup, using password-less SSH as a way of communication between
6 [[!img separate-webserver.svg size=490x align=right]]
11 Let's create a user called `ikiwiki_example`. This user gets SSH
12 access restricted to GIT pull/push, using `git-shell` as a shell.
14 The root (bare) repository:
16 - is stored in `~ikiwki_example/ikiwiki_example.git`
17 - is owned by `ikiwiki_example:ikiwiki_example`
18 - has permissions 0700
20 The master repository's post-update hook connects via SSH to
21 `webserver` as user `ikiwiki_example`, in order to run
22 `~/bin/ikiwiki.update` on `webserver`; this post-update hook, located
23 in `~ikiwki_example/ikiwiki_example.git/hooks/post-update`, is
24 executable and contains:
27 /usr/bin/ssh ikiwiki_example@webserver bin/ikiwiki.update
29 Password-less SSH must be setup to make this possible; one can
30 restrict `gitserver:ikiwiki_example` to be able to run only the needed
31 command on the web server, using such a line in
32 `webserver:~ikiwiki_example/.ssh/authorized_keys`:
34 command="bin/ikiwiki.update",from="gitserver.example.com",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa ...
39 Let's create a user called `ikiwiki_example` on `webserver`. She needs
40 to have write permission to the destination directory.
42 The working tree repository (`srcdir`):
44 - is stored in `~ikiwki_example/src`
45 - is owned by `ikiwiki_example:ikiwiki_example`
46 - has permissions 0700
47 - has the following origin: `ikiwiki_example@gitserver:ikiwiki_example.git`
49 The CGI wrapper is generated with ownership set to
50 `ikiwiki_example:ikiwiki_example` and permissions `06755`.
52 Password-less SSH must be setup so that `ikiwiki_example@webserver` is
53 allowed to push to the master repository. As told earlier, SSH access
54 to `ikiwiki_example@gitserver` is restricted to GIT pull/push, which
57 The Git wrapper is generated in `~ikiwiki_example/bin/ikiwiki.update`:
59 git_wrapper => '/home/ikiwiki_example/bin/ikiwiki.update'
61 As previously explained, this wrapper is run over SSH by the master
62 repository's post-update hook; it pulls updates from the master
63 repository and triggers a wiki refresh.