Skip to content

Run your own server ​

After this page you have a wavelane recording server running and your phone paired with it, so time shift has something to play.

What you need ​

  • The wavelane server image. This manual writes <image> where its name goes: use the name of the image you have.
  • Docker, on a machine your phone can reach: at home, or a server of yours on the internet.
  • Disk for what it keeps: about 58 MB per station and hour at 128 kb/s, 144 MB at 320 kb/s, for the hours you keep (What your server records).

The image holds the server, the ffmpeg it records with, and this manual. It listens on port 8080, keeps everything in /data, and runs as an unprivileged user.

Who may use your server ​

Your server lets in a list of Google accounts, the holders of a token, or both.

A list of Google accounts. WAVELANE_GOOGLE_ACCOUNTS holds the accounts' addresses, separated by commas. Riders then pair by signing in with Google.

Signing in works only for the Google accounts wavelane's own Google project lets in: Google refuses any other account before your server is asked. A rider whose account it refuses pairs with a token, so give your server a token as well if you want such riders in.

If your server is reachable from the internet, also set WAVELANE_PUBLIC_ADDRESS to the address your riders type, such as wavelane.example: it ties every sign-in to that address, so another server a rider pairs with cannot pass the rider's sign-in on to yours, and a rider who types another name for your server is refused.

A token. The token is the one secret between your server and your phone: 32 characters or more. One way to make one:

sh
$ openssl rand -hex 24
<token>

Keep it: the phone needs it to pair.

Both. A phone then pairs either way, and you keep the token for your own curl: asking the server what it records, /v1/status, needs it (Troubleshoot your server).

Run it ​

sh
$ docker run -d --name wavelane --restart unless-stopped -p 8080:8080 -v wavelane-data:/data -e WAVELANE_TOKEN=<token> -e WAVELANE_TIMEZONE=<zone> <image>
9c81e285f8e3

<zone> is your zone id, such as Europe/Rome; Configure your server lists every other setting. Check that it answers. The address in these examples is the manual's: put your server's in its place, or localhost on the machine itself.

sh
$ curl -s http://wavelane.example:8080/healthz
ok

The same with compose ​

This is instead of the docker run above, not beside it: both publish port 8080, and their volumes differ (wavelane-data for docker run, wavelane_wavelane-data for compose, as the recorded output shows).

In a directory named wavelane, a compose.yaml:

yaml
services:
  wavelane:
    image: <image>
    restart: unless-stopped
    ports:
      - "8080:8080"
    volumes:
      - wavelane-data:/data
    environment:
      WAVELANE_TOKEN: <token>
      WAVELANE_TIMEZONE: <zone>
volumes:
  wavelane-data:
sh
$ docker compose up -d
 Volume wavelane_wavelane-data Creating
 Volume wavelane_wavelane-data Creating
 Network wavelane_default Creating
 Network wavelane_default Creating
 Volume wavelane_wavelane-data Created
 Volume wavelane_wavelane-data Created
 Network wavelane_default Created
 Network wavelane_default Created
 Container wavelane-wavelane-1 Creating
 Container wavelane-wavelane-1 Created
 Container wavelane-wavelane-1 Starting
 Container wavelane-wavelane-1 Started

Compose repeats some of these lines when its output is not a terminal, as in this recording; in a terminal it draws the same steps as one list.

To let Google accounts in, add WAVELANE_GOOGLE_ACCOUNTS beside (or instead of) WAVELANE_TOKEN: under environment in compose.yaml, and in docker run as -e WAVELANE_GOOGLE_ACCOUNTS=<your account>. A rider's account must also be one that Google accepts for wavelane (Who may use your server); for any other, keep WAVELANE_TOKEN, since instead of it that rider has no way in.

Pair your phone ​

In wavelane, tap the gear on Home, then "Server": the address, in "Address", is http:// with your server's name or address and :8080. Then tap "Sign in with Google" and choose an account your server lists and Google accepts for wavelane, or type your token in "Token" and tap "Pair with token". Pair with your server walks through it.

HTTPS ​

The server speaks plain http, so over the network the token travels unencrypted, and so does a Google sign-in. On a network you do not trust, put a reverse proxy of your own with a certificate in front of the server; the phone then pairs with the bare name, since wavelane assumes https when you type no scheme.

Upgrades ​

To run a newer image, remove the container and start the new image with the same volume: the recordings, the station list, the lists the devices share and the phones' Google sign-ins are in the volume, and the server picks them up when it starts. A server that holds no shared lists yet makes them from its station list the first time it starts (What is recorded).

This manual ​

Every server serves this manual at /docs/, without the token: open http://wavelane.example:8080/docs/ with your server's address.

How the maintainer runs it ​

wavelane's maintainer runs the server on Kubernetes with a Helm chart, https://gitlab.reportix.com/fcavalieri/wavelane-chart, which takes the token as auth.token, kept in a secret, and the Google accounts as auth.googleAccounts, sets WAVELANE_PUBLIC_ADDRESS from the ingress host, and keeps the recordings on a persistent volume; its values live in https://gitlab.reportix.com/fcavalieri/deployments. Both repositories are private: they are named here for whoever has access.