I keep all my wikis on a virtual private server ( I use a frantech paid server and I am experimenting and am so far very happy with oracle cloud’s free tier ) and I recently discovered that the nginx web server has a webdav plugin. This allows me to specify a directory as a webdav server to put tiddlywikis in which then auto save because of tw’s default webdav behavior.
For a full length explanation I wrote a blog post, but here is the tldr if you’re familiar with nginx :
install nginx and modules: sudo apt update && sudo apt install sudo apt -y install nginx nginx-extras libnginx-mod-http-dav-ext apache2-utils
(this includes the apache utils for basic authorization). Then add block to server config
location /private {
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS;
dav_access user:rw group:rw;
client_max_body_size 0;
create_full_put_path on;
client_body_temp_path /tmp/;
autoindex on;
auth_basic "Enter Credentials Fool";
auth_basic_user_file /etc/nginx/.htpasswd;
}
Add yourself to the www-data
group: sudo adduser -aG www-data <user>
and verify permissions and ownership of the directories: sudo chown -R <user>:www-data wikidirectory/
and sudo chmod -R 775 wikidirectory/
( thank you to @pmario for pointing out these security issues! ).
Now you can log into that directory and your wikis will autosave! Also you have an easy way to upload files via a webdav client.
Finally for a public facing version just create a symlink: sudo ln -sn /var/www/html/private/wiki1.html /var/www/html/public/wiki1.html
I have been using the tw-reciever plugin for a while now but given the added convenience of having a webdav client connection I’m transitioning to this for all my single file wikis.
update: changes to address security issues as pointed out by @pmario