I’ve been looking at integrating Tiddlywiki into my daily routine.
The latest incarnation of Tiddlywiki can be run in server mode on top of node. (What, you’ve never tried Tiddlywiki? It’s worth trying just to marvel in its existence – it’s like Emacs and a wiki decided to get together and have a Javascript baby). Anyway, server mode ends up being ideal: since the individual tiddlers are stored in separate text files, it is much easier to track in git and search with Emacs.
Installation is straightforward.
I wanted to have it sit behind a running nginx process – that way it
would be easily accessible from any device secured via HTTPS and basic
auth. To attach it to a directory (say, /tw
) off your Nginx
instance, you’ll add this to one of your server blocks.
location /tw/ {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Note that the trailing URI on the proxy_pass is important!
I put this in my server block for HTTPS and a redirect off HTTP so that I wouldn’t accidentally use TW off an unencrypted channel.
You’ll need to add a special tiddler to redirect requests to the
correct path. In the tiddlers
directory for your site, add a file
named $__config_tiddlyweb_host.tid
, with contents looking like:
title: $:/config/tiddlyweb/host
$protocol$//$host$/tw/
Finally, you’ll invoke the server:
./node_modules/.bin/tiddlywiki test --server 8080 $:/core/save/all text/plain text/html user pass 127.0.0.1
… and now you have a Tiddlywiki that you can read anywhere, with backend storage accessible easily.
Set up a daily cron to check all your tiddlers into git.
Also, I took the del.icio.us bookmarklet and changed it a little bit to point to my site:
and then just added a little PHP snippet to update the bookmark
tiddler:
Now, just click on a button and it’s automatically added to the bookmarks
tiddler. (Actually, there should be a TW extension that does this, but I’m not finding it. Also, you could probably do the whole thing in the bookmarklet, but that is more pain than I am willing to endure at this point.)
Put up all files in this gist to hopefully make it clearer.
Comments are moderated whenever I remember that I have a blog.