Following the previous PeerTube 1.4.1 on OpenBSD 6.6 and Ledeuns’ work, here is a small update to the tutorial. Once again, comments are very welcome.

Snapshot

First of all, we need Node 12 because of the infamous Sharp module. Node 12 is not available in -stable but only in -current or Snapshot. So I will use that.

And Sharp shall indeed get installed alone, via npm, which is not recommended (the rest of PeerTube’s install go with yarn, so it’s not really homogenous).

RC

In order to start the Peertube service, you need to run the command in the /var/www/peertube/peertube_latest/ repository, which means from the current version’s root, inside PeerTube’s global installation.

The solution I found is to position _peertube’s $HOME repository at /var/www/peertube/peertube_latest/.

So…

doas usermod -d /var/www/peertube/peertube_latest/ _peertube

Somewhat ugly, but it works.

Or else I had to launch the whole thing again manually in a tmux in the correct repository. Or I had to write it specifically in /etc/rc.local, so out of RC’s control.

That rc script is far from perfect. I am not at all happy with that solution.

#!/bin/ksh

daemon_user="_peertube"

HOME_DIR="/var/www/peertube"
CONF_DIR="${HOME_DIR}/config/"

daemon="HOME=${HOME_DIR} NODE_CONFIG_DIR=${CONF_DIR} NODE_ENV=production USER=${daemon_user} /usr/local/bin/node ${HOME_DIR}/peertube-latest/dist/server"

. /etc/rc.d/rc.subr

daemon_timeout=60
rc_reload=NO

pexp="-U _peertube node"

rc_cmd $1

But write a « cd /var/www… » in the middle of the command line did not work at all.

So if you have anything better, be my guess.