Serving TiddlyWiki via Windows Home Server, IIS and WebDAV

This article covers setting up TiddlyWiki in a way that allows you to serve and edit your wiki on your websites (both with password protection for editing and a publicly available read-only copy) and also make the same wiki available to all PCs on your LAN for editing with TiddlyDesktop.

“Skip the chitter-chatter, fool. Take me to the goods…”

What’s TiddlyWiki? A new teletubby?

No. TiddlyWiki is a great new way of note taking. It transcends the traditional book/chapter/page format of other note-taking apps and introduces new concepts that are more intuitive and favourable to effective information processing. Spend 10 minutes watching introduction videos and then take a demo site for a spin. Once you’ve tried it – you’ll get that “aha!” moment where you think – “why on earth have we been doing it the other way!”

It’s also incredibly versatile and has an active, supportive community. Don’t be put off by the way it appears – the minimalist theme + design really works. You can theme it – there’s a dark theme out there somewhere. The technology behind it is interesting. Each wiki is a single html file. There’s some voodoo magic going on in there – with functionality and design matching apps with thousands of files! However, therein lies the rub. It’s an amazing bit of kit, but if you’re looking for functionality beyond a personal copy on your LAN, you’re going to have to do a bit of work.

Goodbye cloud…

My situation is that I have a Windows Home Server and I’m trying to slowly trying to retrieve my soul from the cloud. After suffering at the hands of Dropbox (really – so you’re pulling a decades worth of hotlinks, thus ruining forums all over the internet, for why??) and Evernote (you got me free, now you’re going to charge me to keep notes?) I’m on a bit of a mission to be the owner of my own means to production and more importantly, data.

One of my tasks is to implement a web-hosted project design/development/management system. As part of this I was looking for an open-source mind-mapping app for my software sites and found TiddlyMaps. Watching the videos – it lloked like a great tool for capturing and structuring ideas and it runs on TiddlyWiki. The two complement each other perfectly.

This led to the added bonus of also replacing OneNote as my go-to note taking app. Don’t get me wrong, out of all the big guns, I think Microsoft get the balance right between profit and contribution (Visual Studio being free!) and OneNote is an excellent app. However, my data is still stored on their servers, right?

In search of the illusive save….

So – you download a single html file from TiddlyWiki and you’re done. That’s it. You open it in a browser and you can do all your editing there and the file will update itself. But this is where things get challenging. there needs to be some method to allow the file to be updated, essentially via being overwritten. Browsers and servers don’t generally like doing that. It’s straight forward if you want a LAN based system, but if you are wanting to do something more complicated, you have to use other means.

My aim was to add TiddlyWikis to my websites so they can be added to anywhere, on the fly. Thus, I had to find a way to get it working with Windows Server and IIS (my method of serving sites). There is a really helpful guide here which shows you how to get things up and running on different systems. As you can see – many roads lead to Rome.

I tried a number and by far the most successful was the IIS/WebDAV method. It took me 2 days to master, mind as it’s a very pedantic and little trodden process, but I finally nailed it. My original aim was to just get a web-editable version up and running, but with some considered file placement, I discovered two additional bonuses. With the method outlined below, you can access your wiki in 3 ways:

  1. Via a password protected area of a website – just like login into your favourite note taking app as it stands at the moment. Once you’ve logged in once – your browser remembers you.
  2. Via the TiddlyWiki Desktop client on any computer on your LAN. Straightforward – no fuss.
  3. Website users can also browse to a read-only copy of your wiki – no passwords.

So overall, it was worth 2 day’s graft and the loss of a little more hair. The results justify the swearing….

(See here for Mago’s initial notepad…)


Enough of the small-talk, show me the money..

So, how’s it done? Well one way you find yourself exhilarated and exulted (and hopefully not exhausted) is by flowing my video guide below:

There’s also a brief step-by-step below, although I’d really recommend the video.

Ensure your Windows Server has the right Roles + Features enabled:

Mainly, these center around IIS and WebDav. You might have to seek some ohter tutorials if you’re looking to know how to set these up. The main prerequisites:

IIS>Web Management setup>IIS Management Console

IIS>World Wide Web Service>Security>Windows/Basic Authentication

IIS>World Wide Web Service>Common HTTP Features>[Default Document/HTTP Errors/Static Content/WebDAV Publishing]

IIS>World Wide Web Service>Performance Features>[Dynamic/Static Content Compression]

Create a Windows User:

In my example, I created windows user called “TiddlyWikiAdmin” via ServerManager>Tools>ActiveDirectoryUsersAndComputers:

Install SSL certificate on site:

Your site needs to be SSL secure to use WebDAV. Thus, you need to install a SSL certificate. FDortunately, you can get these free and there’s a great app to automate the process. What is more, the task schedules tasks to ensure that the certificates never expire! Download the app hereIt’s very simple to use, so no need for explanations of this one.

Setup WebDav on the SiteRoot:

Click on your site root and select “WebDAV authoring rules” Then Enable WebDAV and in WebDAV Settings, Allow Locks>True.

Lastly, you need to add your new TidlyWikiAdmin user to the WebDAV authors. As below:

Make a directory for Virtual Folder on file system:

This is where your TiddlyWiki thml file will be stored. A Virtual Diretcory is an IIS term for a ‘pointer’ to a file on another folder not necessarily in the website’s folder structure. Choose a directory in a location where other PCs on your LAN network can access it (shared locations etc). Then download empty.html from the TiddlyWiki site here. Place it in your folder. Rename it to something meaningful (it’ll show in your URL). Then set permissions on the paretn folder for the folowing:

User Permissions
IUSR Read and Execute, List Folder Contents, Read
IIS_IUSRS Read and Execute, List Folder Contents, Read
TiddlyWikiAdmin Full Control

You’ll have something like this:

Setup the site’s Virtual Directory:

Right Click on the Site Root and Choose Create Virtual Directory. Choose a simple slug as your virtual directory name (e.g. “DevWiki”). Select the parent directory of your TiddlyWiki html. You’ll see something like this:

Next, left click the virtual directory and then select Authentication in the panel to the right. Disable Anonymous Authentication and enable Windows Authentication.

Next, left click on the virtual directory again, and this time select Compression. Ensure both options are unchecked. This is just during the setup phase.

Left click on the virtual directory again and select SSL Settings. Set Require SSL to checked and Client certificates to Ignore.

Adding a plugin to help with saving:

Click on your site root and then select Restart from the right hand panel.

Construct the URL of your TiddlyWiki file and type it into your browser. For example, with my setup below:

my site root is https://MagoArcade.org

coupled with the Virtual Directory slug: https://MagoArcade.org/DevWiki/

and with the html file: https://MagoArcade.org/DevWiki/MagoTiddlyWiki.html

This is important: DO NOT start messing about saving when you load the document. You get one save after a Site restart at this point, so if you waste this – you’ll have to go into your server and restart your site again. You need to reserve that save for something important!

Go to this address and then enter the credentials for the user you created.

You need to install a plugin. Go to this site and then drag and drop the plugin onto your TiddlyWiki. See the video here for this in action. Then use you one shot save to save the plugin and refresh the page.

Once you have it all working, go back into your site in IIS and re-enable compression (SiteRoot>Compression).

Congratulations! You now have TiddlyWiki set up on your site!! You can save away to your heart’s content.


Updates since original publication:

18.07.19 Mario Pietsch has relayed a couple of things:

  • You can re-enable compression once things are up and working. This will increase your wiki’s performance
  • You don’t need File Locking enabled.

Desktop and Publicly accessible versions:

You can watch the video from this point forward to find out about these.

Troubleshooting:

If you get into a mess with permissions within your site’s IIS manager, you might sometimes get an error message in IIS. Don’t panic, most of this can be sorted by checking the linked config file. I strongly recommend making a backup of this file first though:

C:\Windows\System32\inetsrv\config\applicationHost.config

Links:

Win-acme: https://github.com/PKISharp/win-acme

Save Plugin: https://wikilabs.github.io/editions/webdav-lm/

Mario’s original Video:  https://www.youtube.com/playlist?list=PLuiC_HFhI4OwoVDb-B-VK0ydj-mBPNn-1

Thread discussing WebDav:  https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/tiddlywiki/8HB0R_ADYac/hw0inHgMEAAJ

Credits:

Mario Pietsch – for the original guide and troubleshooting on the forums.

Jeremy Ruston – original author of RiddlyWiki

Be the first to comment

Leave a Reply

Your email address will not be published.


*