WIP: Fossil chat transport
(1.1) By absc on 2024-04-21 15:56:28 edited from 1.0 [source]
What this is all about.
One of the IRCTk features, is the ability to run separate programs as transports (essentially, fake IRC servers).
To test this ability, we wrote a transport for the fossil chat, in order to use the (nice) chat feature of our repository from our favourite IRC client.
The effort lives in the fossil-transport branch, where the program resides.
It works reasonably well at this point in time, letting us understand what's the effort to, potentially, write bridges for other protocols in the future.
Caveats:
- For now, it's OpenBSD only (due to pledge(2), unveil(2) and libapi.
- It only handle text messages in raw form (no markdown or HTML).
- It does not handle file attachments.
- Only PRIVMSG and PING commands are supported.
The nice thing of working on this in a non-portable fashion, was the ability to completely sandbox the program, both at the system call and the filesystem level. A portable version may come in the future, where initially the sandbox code is a no-op. Given that I have no experience with landlock and such, it's hard for me to port this code by keeping the sandbox itself.
If I'll find the time, or if somebody else offers itself for the task, I'll happily accept the work.
How to have it work:
You need to install libapi, of course, given that the polling code depends on it. Once compiled, put the binary somewhere and configure a new connection in IRCTk for your repository. A nice man page is provided but, in general, in the configuration form put the username in the "nick" field and the password in the password field for those to be used to authenticate with the fossil chat repository.
If the authentication is ok, you will be automatically joined to a channel called "#chat", where you'll receive the messages and where you will be able to write those.
If I see that it works fine in a week or two, I'll merge it to trunk.
(2) By absc on 2024-05-01 14:03:59 in reply to 1.1 [link] [source]
Good news for all.
The transport is now, also, portable. It was successfully tested on Alpine Linux (musl libc) and Debian (GNU libc).
Unfortunately, I couldn't test it on FreeBSD and NetBSD, but it should work there without issues, too.