Bits and knowledge for running WriteFreely on FreeBSD

sungo 34a75848d3 writefreely 0.7.1 1 week ago
README.md e895b3b46d init 3 weeks ago
VERSION.md 34a75848d3 writefreely 0.7.1 1 week ago
writefreely.freebsd 34a75848d3 writefreely 0.7.1 1 week ago
writefreely.rcd e895b3b46d init 3 weeks ago

README.md

What?

Bits to run WriteFreely on FreeBSD

Why?

WriteFreely does not (as of 2018-12-29) offer a pre-built binary for FreeBSD. And it turns out to be a bit more complicated than just checking out the code and hitting make

The trick is that their ActivityPub implementation is a beast to build. I've never had the go complier get hit by the OOM killer before so that was special.

I tried cross-compiling the app on my Linux laptop but the app requires cgo. Go's usual cross-compilation magic doesn't apply. WriteFreely's release process builds binaries for Linux, Windows, and Mac via xgo. xgo, in turn, requires docker and a huge docker image. Fuck that.

I ended up throwing it into my beefy HardenedBSD server. The build process chewed 3GB of RAM and most of 8 cores.

So, to maybe save some folks some pain, I'm publishing the binary and the startup script I wrote to make this fly.

Part of my brain is nudging me to build a port for it but that part of my brain hasn't seen my todo list.

Compatibility

Built on HardenedBSD 11. Confirmed functionality on FreeBSD 12.

Using

Grab one of the release tarballs from https://github.com/writeas/writefreely/releases [ The binary was built against the sources for 0.6 ]. I used the linux release. This will get you the compiled UI sources which are platform independent afaik. It will also save you the trouble of needing to install node and a bunch of build tools.

Create a user named 'writefreely'.

Unpack the tarball into ~writefreely, which will create ~/writefreely/writefreely.

Overwrite the included binary with the one from this repository.

Copy the writefreely.rcd file to /usr/local/etc/rc.d/writefreely.

Add enable_writefreely=YES to /etc/rc.conf.

Inside ~writefreely/writefreely, follow the setup instructions at https://github.com/writeas/writefreely

Run service writefreely start

Support

I did this for me and I'm publishing it on the notion that it might save someone time and drama. So, there's no support or contribution process.

License

The binary is not mine and I claim no rights to it. WriteFreely itself is licensed under the AGPL.

The rc.d file as written by me but I'm putting it into the public domain. Kinda silly to make everyone cart around a license file for 61 lines of sh.