Skip to content

GatewaySet up

Install

Create the gateway's Postgres database and install the service packages on an Ubuntu server.

Database and packages

  1. Install the system packages

    $sudo apt install nginx postgresql git
  2. Create the database and its owner

    The setup script uses the owner to create a restricted role for each service, which takes a superuser. Keep the password for Configure.

    $sudo -u postgres createuser --superuser --pwprompt chan sudo -u postgres createdb --owner=chan --template=template0 --locale=C.UTF-8 chan_gateway
  3. Install the gateway packages

    Download this release's packages from the install page or with the GitHub CLI, and install the five services. On an ARM server, use arm64 in place of amd64.

    $gh release download v0.133.0 --repo fiorix/chan --pattern 'chan-gateway-*_amd64.deb' sudo apt install ./chan-gateway-profile_*.deb ./chan-gateway-identity_*.deb \ ./chan-gateway-devserver-control_*.deb ./chan-gateway-devserver-proxy_*.deb \ ./chan-gateway-admin_*.deb

Each service gets its own system user and a systemd unit, installed but not started. All gateway services run the same release: the profile package requires the identity package of its own version.

Details and limits
  • The database needs a UTF-8 locale: profile folds email addresses with PostgreSQL's lower(), which folds only ASCII under a C or POSIX locale.
  • Each package ships its own env file under /etc/chan-gateway/, which the setup script fills in.
  • The identity package also installs chan-gateway-migrate, the one-shot unit that applies the database schema.
  • The sixth package, chan-gateway-wireguard-agent, goes on each proxy node that offers WireGuard. See WireGuard.

Next