Mastodon and FreeBSD

Together with updating all other craps and server migrations, I decided to finally update Mastodon install as well which I broke after upgrades and package removals.

Then in usual fashion, one of dependency didn’t install on FreeBSD because it’s missing pre-compiled binary and the build script has too strict settings causing the build to fail.

Did some hackery to figure out how to fix it (following this guide works) but then when I looked around the situation on the official uws module page it says it’s been unmaintained since forever. Googling around a bit it seems like the author is being a dick and ended up ragequitting the module. Mastodon dev was notified but no action is taken.

The good thing is I looked into replacing it with ws a long time ago and posted it to Mastodon issue tracker. As I’m not interested in doing the module-level hackery, I figured it’s easier to do it now. Also I forgot how I fixed it before which didn’t involve such hackery. Or maybe I did. I don’t know.

In the end I reapplied my patch and everything is good again.

Or not, because I switched PostgreSQL authentication to the shiniest Scram-SHA-256 which isn’t supported by node-postgres. The issue has been open forever and I’m not really interested in fixing it.

Thankfully someone tweeted me the existence of node-pg-native. I looked into it and even though it’s not a drop-in replacement for node-postgres, adding pg-native and setting NODE_PG_FORCE_NATIVE=1 environment variable will force the module to use native library which fixed the problem.

Except for node-libpq which for some reason doesn’t link correctly (my postgres is installed in non-standard path). Whoops. I think fixed it and hopefully it gets merged.

With all the fixes in place, everything seems fine.