Hacker News new | past | comments | ask | show | jobs | submit login
Widdler is a single binary that serves up TiddlyWikis (github.com/qbit)
198 points by Tomte on Dec 5, 2021 | hide | past | favorite | 49 comments



Wow, that is just 357 lines of Go code. So much of my work life is using complex systems in AWS and GCP that are beyond my ability to understand “turtles all the way down.” It is refreshing to see something so simple and focused on one thing. In the early days of Ruby on Rails, I had the source code to Ruby and for Ruby on Rails on my laptop and it was all fairly readable. Those days are long gone.


The trick seems to be that all the complexity is in the html file and runs in the browser. The server is just a basic WebDAV server.

It looks like the entire wiki implementation is copied to a new file when you create a new wiki page. It's a 2.3 MB file, which seems like a lot to download when you visit a new page.


Each HTML file is a complete wiki instance. The wiki code and data for all pages within the wiki are bundled in that file. The code let’s the webpage edit itself.


> It's a 2.3 MB file, which seems like a lot to download when you visit a new page.

It is, But I feel it's still better than what ever framework they're using nowadays to generate doc/wiki for APIs which hijacks Ctrl-F with a useless pop-up which rarely gets me what I need[1]. Please bring back plain HTML document pages.

[1] https://stripe.com/docs/api


I don't get it. Why is it making me compile a Go webserver then? There aren't even binaries provided.


So you can save the modified file on the server.


It's a weird phenomenon though since even though ruby on rails was readible in a small code base, it was still building on top of a ton of abstractions that hid lower detail. It makes me think that we're just failing to build clean good abstractions that make coding for cloud as beautiful as it could be.


The difference between Rails and AWS however is that you can inspect the former and understand all its underpinnings whereas AWS is almost entirely proprietary and your experience with their services entirely depends on what services you select.


Like using the command line, its all so flexible, dynamic and powerful while being small and understandable. It was possibly my favourite part of learning to use Linux 20 years ago.


i keep the code for CPython, Go, terraform and the terraform providers i use checked out. It is still useful and educational to read source code. i confess i only rarely check out the kernel or glibc code. kernel code is good but usually not the issue glibc has the tendency to make me mad.


Does that LOC count include dependencies?


If you want to make something from scratch, you must first invent the universe.

Anyway, I wouldn't count the kind of simple, focused libraries dependencies Widdler relies on as additional LOC.

As a rule of thumb, if it's something that wouldn't make me blink an eye if I found it was in the python stdlib, it gets a pass from me. Only the webdav library might not fit this.

This is subjective, of course. If anyone has a better heuristic for this, I'm all ears.


“If you wish to make an apple pie from scratch, you must first invent the universe” - Carl Sagan.


There are only native packages + 1 external packages suah.dev/protect.


Looks like the package in question only has packages from the Go project itself.

The only external dependency is OpenBSD specific and used on that operating system only.


That really seems like a lot of code just to do the job of cp.

Perhaps their time would be better spent thinking up some way to prevent a TiddlyWiki from becoming a wormable nightmare.


Na, cp doesn’t cut it :p - if it was that trivial of a task I wouldn’t have taken the time to write it!

Thanks for your opinion on where my time is better spent though, I don’t know what I was thinking.. building a tool to solve a problem I had and releasing it completely free of charge! I’ll know better next time!


A propos the single binary wiki server. Last time I was looking for something of this kind, I stumbled upon Fossil SCM, which also includes an implementation of Wiki [1].

Editing can be done in Markdown, all version-controlled, there's user support built-in, the whole thing basically resides in a repository, which is a kind of a SQLite db. The wikis can be imported from text files too.

It may be not fancy-looking, but for "note-taking" can be good enough. I guess it may be made to run in Tmux or the likes to have a Wiki served locally to the smartphone.

Wish the Fossil was more templatable, also there's no proper wiki category tagging, but it does work for the purpose.

[1]: https://fossil-scm.org/home/doc/trunk/www/wikitheory.wiki


By the authors of Sqlite. High quality code that is probably going to be around and well maintained for long. Not unimportant when using it as a personal knowledge system.


This is AWESOME! My biggest annoyance with TiddlyWiki has been the ergonomics of saving.

I've been using TiddlyDesktop, but that thing has some questionable privacy because it's based on Chromium. One time, I had it running in the background while working on something completely unrelated, and I got a Chrome-style popup/alert warning me about a network printer being disconnected. I didn't even have Chrome installed on my machine at the time and it took me a while to realize that it came from TiddlyDesktop.

But besides the privacy issues, TiddlyDesktop only serves local wikis. That's annoying when you have multiple devices.

Also, pro-tip if you're on Ubuntu: the latest golang version in the default repos isn't compatible with this. You'll need to use golang 1.16 or later, which can be installed manually from the website, or installed via apt with a custom PPA (https://github.com/golang/go/wiki/Ubuntu)


I find the TiddlyDesktop to be too heavy for what can be done in the browser itself. Have you tried using Timmi [0] with your browser [1, 2]? I had problems initially with the file save workflow till I found Timmi. I use it with Firefox and sync with Dropbox. It hasn't failed me and works smoothly.

>>

Timimi is a web-extension accompanied by a native host that allows you to save and backup your standalone HTML tiddlywiki files anywhere in your hard-drive. Once installed, you can save the tiddlywiki files without any extra steps, like the original Tiddlyfox addon.

Timimi also provides users with 4 backup strategies, viz:

- Create a backup Every nth save

- Create a backup every nth minute

- Customised Tower of Hanoi

- First in First Out [3]

<<

[0] https://ibnishak.github.io/Timimi/

[1] Chrome/Edge/Brave: https://chrome.google.com/webstore/detail/timimi/mnggafnmmhd...

[2] Firefox: https://addons.mozilla.org/en-US/firefox/addon/timimi/

[3] https://tiddlywiki.com/static/Timimi%253A%2520WebExtension%2...


You might be interested in these:

- https://github.com/fiatjaf/tiddlywiki-remotestorage-server

- https://github.com/fiatjaf/tiddlywiki-remotestorage

A TiddlyWiki plugin for saving tiddlers to https://remotestorage.io/ and also a server to fetch them from any public remoteStorage on demand and serve them as HTML to visitors (for sharing).

I think my server at https://tiddly.fiatjaf.com still works. You can just open it and start creating your tiddlywiki with auto-save (it will be saved on localStorage by default).


That's the first I've heard about remotestorage.io, and it looks interesting. I'll definitely be looking into that, thanks!


> My biggest annoyance with TiddlyWiki has been the ergonomics of saving.

I wanted something that just let me open the wiki and save changes to it. Nothing else. No massive dependencies. This is what I wrote: https://github.com/bachmeil/tiddlyd You view you TW and you save changes to it, nothing else.


>> Also, pro-tip if you're on Ubuntu: the latest golang version in the default repos isn't compatible with this. You'll need to use golang 1.16 or later, which can be installed manually from the website, or installed via apt with a custom PPA (https://github.com/golang/go/wiki/Ubuntu)

Thanks! I was about to give up

PD: Couldn't install it either with the new binaries: "package embed: unrecognized import path "embed" (import path does not begin with hostname)"

I think they should revisit this issues if really want widespread adoption.


Run `go version` to see if you're actually running the correct version of go. You need at least go 1.16.

If it's not correct, try `command -v go` to see which go binary your shell is using. If it's not "/usr/bin/go", then your PATH probably points to another one. In that case, try running `/usr/bin/go` directly instead of just `go` (assuming you installed the PPA linked above).

> I think they should revisit this issues if really want widespread adoption.

This isn't the project's fault. It requires a particular version of go, but you have the wrong version on your computer.


> My biggest annoyance with TiddlyWiki has been the ergonomics of saving.

I've tried to address this with https://tiddlyhost.com/ (and in the past with http://tiddlyspot.com/ ).


Very nice, though installing Node.js, cloning the TiddlyWiki repo and then (inside the 'editions' folder) doing ...

node ..\tiddlywiki.js "my new wiki" --init server

cd "my new wiki"

node ..\..\tiddlywiki.js --listen

... is also not THAT difficult :-)

Or alternatively, an AutoHotkey shortcut, which fixes the anachronistic ctrl+s shortcut of the browser (anachronistic = doesn't remember save action for this url)


Author here, if anyone has any issues - let me know! :D


You love to see it! I think this is a reasonable tool for a large set of usecases. Though many will be served just as well with file synchronization and other local saving tools, I like the simplicity in that single binary.

I use my TW every day like a madman (https://philosopher.life/#⧖). I'd like to submit https://github.com/OokTech/TW5-Bob as a powerful (though perhaps not as simple) alternative. That's what most of my household uses (one is aiming to switch over soon).


I had no idea there was this much community effort around TiddlyWiki, but looking around, there are several companion tools for it. I've always thought it was a great piece of software, and obviously others agree.


Used it in a previous ops support gig to build up a mini knowledge base of canned issue responses / topical oneliners - we couldn't install software but could save network drive files; tiddly kept my response system flexible & portable between systems - definitely recommend for this use case


Yes, sensibly designed deployments are single file. It's super important for maintainability of operation.


I know this will be a dumb question but does one sit it up?

I am used to creating "web application" and running it on a web server of some sort: Apache / IIS /Lite.

In this perspective the web server or what not handles a lot of the complexity, thread pools, isolation, restarting, logging etc etc.

I frequently see applications like this that is "one binary" and you run it by starting it on the command line. That is easy , no worries.

But how to handle running it "in production", were I want to ensure that it is up and running all the time?

If I wanted to put this on my VPS and share it with the net, what steps do I need to take?

systemd? (k8s I really hope not)


widdler is meant to be more of a private wiki. if you want to share a specific tiddlywiki with the world it's as easy as copying the html file to a webserver - it will then be static content (users can edit it locally, but the changes won't be sent back up to the server).

My current use case is: running on a vps and exposing a password protected space for me to jot down various things.


How do you handle if it goes down? How are you executing it, or with what?

At the very basic level you can SSH, and type in the command. Bobs your uncle. Then unless you something it shuts down when you end your session.

You can just set it to execute in the background with basic sh or something like tmux.

Or do you set it up in systemd to be watched and restarted if something goes wrong?


Looks good. I adopted https://github.com/sendwheel/tw-receiver a while back which is also pretty nice, but I had to disable most of its safety features as they false triggered too often. (Acceptable for a single-user note-taking situation.)


I have a similar project but it just serves a single wiki via http and doesn't support WebDAV or authentication, and it's in Rust rather than Go. https://github.com/steinuil/twkwk


Huge fan of TiddlyWikis. So glad to see more tools spawn around TiddlyWiki to drive adoption.


cool to see pledge and unveil. as a linux user i'm somewhat jealous.

c.f. OpenBSD's unveil() https://lwn.net/Articles/767137/


> Password protection via HTTP Basic Authentication.

> ...

> Optional TLS support.

I know it's supposed to be pretty minimal, but this is a bad combo. Great that TLS is offered but it should be mandatory if you're using the authentication.


Looks great. I assume this can easily also be integrated with git just by pushing some files from the server after each save/creation?


[flagged]


"Please don't complain about tangential annoyances—things like article or website formats, name collisions, or back-button breakage. They're too common to be interesting."

https://news.ycombinator.com/newsguidelines.html


Can I access that on iPad? Is there WebDAV integration in iOS/iPadOS?


You can run it on a machine and access the wiki over http. The Files app on ipad can do webdav, but it won't help ya much with the tiddlywiki side of things.


There used to be PHP/MySQL TiddlyWikis. It was so much nicer. You can just use .htaccess to password protect it too. I miss that.


Unrelated, but does anyone else feel that there are way too many non-descriptive proper nouns in tech? I had no clue what to expect from the title, or any idea of why I should be interested in it.


That it's a server for some kind of wiki seems fairly clear from the title, and I'm not sure what much more relevant context you could fit in a title - i.e. it can't really explain much more about TiddlyWiki with just a few words?

There's two of the words you complain about in it: the name of the project itself, and TiddlyWiki - which is clear that it's a wiki, and naming it explicitly instead of just referencing a generic wiki is useful for everyone who is aware of it.


I guess you mean the names. Names are almost never descriptive, barbarr, are they?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: