Saturday, May 28, 2011

a portable, offline, distributed wiki setup

I’ve found recently, that I keep having need of somewhere to write stuff down and that works off line, with updates from different computers.

As I’ve been using git for this for code, and it works fine, thought I would see if I could apply it to a wiki. Turns out, it’s easy. Dokuwiki is a wiki that is packaged with Mandriva and happens to store it’s data in plain text files. It also does not store history in these files, so they stay nice, clean and easy to read with a text editor. They are also conveniently in just one standard place. So, with a minimal amount of work, I turned /var/lib/dokuwiki/pages/ into a git repository, added the pages to the repo, and volla. Now, I can push my wiki up to any remote git repo I want, or pull it from another computer. In my case, I have a main remote repo for git, so push it up to that main repo when I am online, then pull it down to all the computers I use.

Keeping my wiki up to date is now quite simple and easy, with git pull/push and the odd git commit. Merges will happen if I end up editing a page on two different computers before they both get to sync with my master git, but that should be fine as the wiki format is clean and simple text.