Ikiwiki is a nice wiki and a nice idea. Git (with its friend Cogito) is a nice source code management system. However, after spending many, many hours trying to figure out how to get them to work right together, it took Jamey coaching me to finally get the combination going. Since this seems to be due to the combination of a bizarre model with a strong insufficiency of documentation, I thought I should leave a record here…
My setup makes a ikiwiki master directory we'll call /ikiwiki, and a subdirectory per wiki, e.g. /ikiwiki/mywiki. In /ikiwiki/mywiki is the ikiwiki setup file mywiki.setup and the $srcdir mywiki-master. The $srcdir is in group mywiki and is mode 02775. Sitting in $srcdir is the index file index.mdwn with group mywiki and mode 0664. I also create directory .ikiwiki with group mywiki and mode 02775: this avoids permission problems later.
If you are using a vhost-style setup for your wiki, you can use suexec to get around some of the permission problems; no need to go there now, though.
ikiwiki --setup mywiki.setup
from /ikiwiki/mywiki and/or set up /etc/ikiwiki/wikilist and run ikiwiki-mass-rebuild (which may be Debian-specific, I guess). I'm set up to build into the $destdir /var/www/mywiki. At this point I'll check that my browser will let me hit the site, and fix any problems I find.
mv .git ../mywiki.git cd .. mv mywiki-master mywiki-master.bak git-clone -l -s mywiki.git mywiki-master
Finally, I move .ikiwiki back to mywiki-master.
This is the right structure. The ikiwiki.cgi script will make changes to mywiki-master, git-commit them, git-push them back to mywiki.git then propagate them back to $destdir.
chgrp -R mywiki $dir find $dir -perm -0400 -print0 | xargs -0 chmod g+w find $dir -type d -print0 | xargs -0 chmod g+s
Then I poke around to see where it all went horribly wrong.
ikiwiki --setup mywiki.setup
to propagate the changes.
This will allow folks pushing to origin to do the right thing; ikiwiki will install a post-update hook that will pull $srcdir (mywiki-master) from origin (mywiki.git) and then propagate the result into $destdir (/var/www/mywiki).
And there you have it! As easy painful as falling off a log.
Obviously, I should script this. It looks like it's time to resurrect the wiki farm stuff. These notes should help me do so. (B)