#wikimedia-rust Matrix to IRC bridge is back

tl;dr: You can now chat in #wikimedia-rust:matrix.org and reach folks on IRC

Nearly a year ago, the official Libera.Chat <-> Matrix bridge was shut down. There's a lot that went wrong in the technical and social operation of the bridge that the Libera.Chat staff have helpfully documented, but from a community management perspective the bridge, when it worked, was fantastic.

But, we now have a bridge back in place! Bridgebot is a deployment of matterbridge, which is primarily used in Wikimedia spaces for bridging IRC and Telegram, but it also speaks Matrix reasonably well.

Thanks to Bryan Davis for starting/maintaining the bridgebot project and Lucas Werkmeister for deploying the change; we now have a bot that relays comments between IRC and Matrix.

12:12:50 <wm-bb> [matrix] <legoktm> ooh, I think the Matrix bridging is working now
12:12:58 <legoktm> o/

And if you look at the view.matrix.org logs, those messages are there too.

So if you're interested in or working on Wikimedia-related things that are in Rust, please join us, in either IRC or Matrix or both :)


Implementing search for my blog in WebAssembly

If you visit my blog (most likely what you're reading now) and have JavaScript enabled, you should see a magnifying glass in the top right, next to the feed icon. Clicking it should open up a search box that lets you perform a very rudimentary full-text search of all of my blog posts.

It's implemented fully client-side using Rust compiled to WebAssembly (WASM), here's all the code I added to implement it.

At a high level, it:

  1. Splits all blog posts into individual words, counts them, and dumps it into a search index that is a JSON blob.
  2. Installs a click handler (using JavaScript) that displays the search bar and lazy-loads the rest of the WASM code and search index.
  3. Installs an input handler (using WASM) that takes the user's input, searches through the index, and returns up to 10 matching articles.

The search algorithm is pretty basic, it gives one point per word-occurence in the blog post, and 5 points if the word is in the title or a tag. Then it sorts by score, and if there's a tie, by most recently published.

There's no stemming or language processing, the only normalization that happens is treating everything as lowercase.

I've played with WASM before but this is the first time I've actually deployed something using it. As much as I enjoyed writing it in Rust, the experience left something to be desired. I had to use a separate tool (wasm-bindgen) and load a pre-built JavaScript file first that then let me initialize the WASM code.

The payload is also ...heavy:

  • search.js: 5.53kB (23.63kB before gzip)
  • search_bg.wasm: 53.78kB (122.82kB before gzip)
  • search_index.json: 323.13kB (322.76kB before gzip)

I'm not sure why the index compresses so poorly with Apache, locally it goes down to 100kB. (I had briefly considered using a binary encoding like MessagePack but thought it wouldn't be more efficient than JSON after compression.) And of course, the more I write, the bigger the index gets, so it'll need to be addressed sooner rather than later. I think any pure-JavaScript code would be much much smaller than the WASM bundle.


Wiki burnout

Yeah, I burned out from wiki things. I flew too close to the sun, tried to take on too many projects and cool ideas and then crashed and let people down. I'm sorry.

I participate in wiki communities because, aside from believing in free knowledge, etc., it's really fun. And then it stopped being fun, so I just...stopped. In some aspects it was nice, I spent my time doing a lot of other IRL things (I bought a bike), but I also missed doing wiki things.

And so I'm slowly starting to get back into things. I'll try to get back to everyone...eventually. I'm not really sure what's next in my queue. I'm trying to not jump back into what I was doing previously because that doesn't really solve the burnout problem but also I owe people some work.

I'll be at the "All-Day Hacking Sunday" this weekend in New York City, it should be fun and hope to hang out with people there.


Updates to my blog

It's been nearly 10 years since I created this blog and for that entire time it's been using the Pelican static site generator. It's been pretty good, but lately I've wanted to improve and change some things, so I've taken the opportunity to rewrite it from mostly scratch.

b2 is a Rust program that takes an input folder of markdown files and spits out a complete HTML directory of the blog. The templates and theme are taken from my fork of pelican-sober. For the most part nothing has changed, I've just taken the opportunity to adjust the CSS and improve some of the HTML output.

b2 is pretty specific for my usecase, I'm not planning to turn it into a general purpose static site generator, though you're more than welcome to fork it for your own needs.


Consolidating SecureDrop Workstation’s Git repositories to make development easier

Originally posted on securedrop.org.

As the SecureDrop team previously announced, we’re shifting our focus in order to graduate SecureDrop Workstation from its pilot phase. One of the first steps we’ve taken in this direction is to reorganize and consolidate the project's Git repositories to make development and releases easier and faster.

In summary:

Read the full post on the SecureDrop blog.


"Skip Mobile Wikipedia" add-on available on Android (again)

In 2018 I announced the creation of my "Skip Mobile Wikipedia" Firefox add-on, which automatically redirects you to the desktop version of the site. At the time it worked on both standard desktop Firefox and in Firefox for Android, life was great.

Unfortunately at some point, Firefox stopped allowing arbitrary add-ons on Android and it was disabled. It was still usable in the "Nightly" edition, but that wasn't very user friendly.

Anyways, fast-forward to earlier this month, Firefox has re-enabled general add-on support, so "Skip Mobile Wikipedia" is installable and works again on Android. The source code is the same, I haven't had any need to update it since 2020.

I personally use the responsive Timeless skin, which I think provides a nicer viewing and editing experience from my phone. Happy browsing!