Personal Wikis – A How-To Including Better Icons

Inspired by Mike Caulfield’s tireless evangelism for personal wikis, I decided to set up an instance of Smallest Federated Wiki and not rely on someone else’s farms. Mike has been kind to set up sandboxes for us to play in, but much of the point is to have your own instance that you control.

The first and biggest hurdle is that Smallest Federated Wiki (SFW) won’t run in shared hosting, and some sort of dedicated server is required. A VPS isn’t that hard to find, but I’m thrifty, and have a computer that’s on most of the time in my house. I proceeded to download NodeJS and install a local wiki, which seemed to work fine, but it was only partly federated. I could fork pages in, but it wasn’t on the public web so nobody else could fork from it.

I had, in my explorations of the IndieWeb movement, discovered pagekite, which uses a python script to reverse tunnel from your computer to a subdomain.pagekite.me address. The service is pay what you want, but less expensive than most VPS’s. In order to do this more safely, I decided to run the SFW instance inside a debian Virtualbox VM.

Once the VM is up and running, install nodejs and npm

apt-get install npm

Then use npm to install wiki and pm2

npm install wiki -g -f
 npm install pm2 -g

. For some reason I can’t get wiki to start from the shell so I had to use pm2 to launch it. Find the wiki index.js. On my VM it was /usr/local/lib/node_modules/wiki/index.js . I then typed

pm2 start ./index.js

and a simple web connection to localhost:3000 gave me a live SFW node.

After downloading the pagekite script and establishing your account
pagekite.py --signup
 you launch with
pagekite.py 3000 http://yoursubdomain.pagekite.me
The 3000 is there because that is SFW’s default port.

I could now see my VM instance through the pagekite URL and fork from it, but there was still one problem. SFW uses Mozilla Persona to handle editing privileges. I could claim the wiki and login when I was on localhost, but trying to connect via the pagekite URL generated a login error. So my wiki was viewable from anywhere but editable only from the console. I submitted an issue to the SFW Github repository, and the helpful folk there explained that Persona expects certain ports and urls. To make my wiki editable from everywhere required:

pm2 stop [id of wiki process]
pm2 delete [id of wiki process]
pm2 start ./index.js -- -p 3000 --url http://mysubdomain.pagekite.me

You apparently have to tell SFW what URL and port you are running on for Persona to work.
Also note the — between the script path and the arguments that will be passed to the script.

One of the frustrating things about SFW is that individual instances are distinguished by a color gradient favicon,  It’s often hard to remember which gradient belongs to whom.  Once you have a local instance, you can fix this.  SFW stores your files in /home/username/.wiki . The favicon.png is stored in a status subdirectory of .wiki. Just replace that .png with a square PNG file of your choice with the same name (favicon.png). I’m not sure what the maximum size is, but 64 X 64 worked.