Skip to content

Set up the host

As root, unpack the verified tarball and run the setup with the host name and the registry the releases come from:

mkdir /tmp/fp && tar -xzf flyingport-<version>_openbsd-8.0_arm64.tar.gz -C /tmp/fp
/tmp/fp/openbsd/setup.sh flyingport.example.com https://gitlab.pallach.de/api/v4/projects/140/packages/generic/flyingport

It does only what is not done yet, so it can run again; existing settings are kept:

  1. The user _flyingport, and /home/flyingport/ with releases/, backups/, db/ and tmp/.
  2. /etc/flyingport.env: the server's settings, with a new random SECRET_KEY_BASE.
  3. /etc/flyingport-update.conf: the registry the updates come from (public: no token).
  4. /etc/rc.d/flyingport, /usr/local/sbin/flyingport-update and the release key /etc/signify/flyingport.pub.
  5. The service enabled, and flyingport-update in root's crontab, every minute.

Then, by hand:

relayd

Forward the host name to FlyingPort, beside the other hosts in /etc/relayd.conf:

table <flyingport_service> { 127.0.0.1 }
pass request quick header "Host" value "flyingport.example.com" forward to <flyingport_service>
pass request quick header "Host" value "flyingport.example.com:443" forward to <flyingport_service>
forward to <flyingport_service> port 8090 check http "/health" code 200

!!! note "Both Host rules" Some clients send the port in the Host header: without the second rule their requests reach relayd's first table instead.

The pages talk to the server over a WebSocket, which relayd refuses unless its http protocol allows it -- without this line the pages load, but no form works:

http protocol "https" {
        http websockets
        # The client's address, for FlyingPort: before every pass quick rule, set (not append).
        match request header set "X-Forwarded-For" value "$REMOTE_ADDR"
        # ... its other options
}

FlyingPort sees every request come from relayd (127.0.0.1); it takes the client's address from X-Forwarded-For -- for the login throttle, the history's "From" and an update without myip. Without the rule every client is 127.0.0.1: one guessing attacker slows down everyone's logins. With append instead of set, relayd added nothing on OpenBSD 8.0 and a client's own X-Forwarded-For was believed. Check it from outside -- both must answer your own address:

curl https://flyingport.example.com/api/v1/ip
curl -H 'X-Forwarded-For: 6.6.6.6' https://flyingport.example.com/api/v1/ip

acme-client

Add the host name as an alternative name in /etc/acme-client.conf, then:

acme-client <domain> && rcctl reload relayd

The first install

Afterwards cron does it – the first time, by hand:

/usr/local/sbin/flyingport-update

The first admin

Its password is printed once:

cd /home/flyingport && su -s /bin/sh _flyingport -c 'set -a; . /etc/flyingport.env; set +a;
  /home/flyingport/current/bin/flying_port eval "FlyingPort.Release.create_user(\"admin\", \"admin\")"'

Log in at https://flyingport.example.com/ and change the password on the profile page. There is no default login.