Get started
Color

Setting up the office server

Install the Pop Dispatch server on an office computer, create your account, keep it running and protect its data.

For
OwnerAdministrator
Hosting
Office server
Devices
Server
Business
All businesses

Checked against Pop Dispatch 0.1.0

In office hosting, one computer in your office runs the Pop Dispatch server and everyone connects to it. You will be able to start the server, create your account, point it at your license and keep its data safe.

Before you start #

  • A computer that stays on during business hours, with a disk you back up.
  • Your license key from your supplier. The license service's verification key is built into the server program.
  • The server program, dispatch-server. On a Mac or Windows computer it travels inside the app (see "Installing on a Mac" and "Installing on Windows"). The steps below are for a Linux computer or a rented server, where you run dispatch-server yourself from the Linux archive.
  • A network where your office computers and phones can reach the server's address.

Steps #

  1. Choose a data folder, for example /var/dispatch or C:\Dispatch\data. The server makes it if it is missing. It holds the database, the keys, backups, uploaded photos and crash logs.
  2. Start the server (step 4 below). It starts with no license setting. The setup wizard at /setup asks for the license key. A server that is set up from a command window can still be given the key in PSD_LICENCE_KEY.
  3. Create your business account and its owner:
    dispatch-server init --tenant youbusiness --owner you@example.com --name "Your Business" --data-dir /var/dispatch
    The command prints a one-time password and, for a new data folder, the recovery key. Each appears once. Copy both.
  4. Start the server: dispatch-server serve --data-dir /var/dispatch --bind 0.0.0.0:8480. The default bind address is 127.0.0.1:8480, which accepts connections from the same computer only. Use the computer's network address, or 0.0.0.0, to accept connections from the office.
  5. Open http://<server address>:8480/health. The answer should say ok: true.
  6. Sign in as the owner and finish set-up. See "Getting started as the owner".
  7. Keep the server running. Run it as a service of your operating system so it starts after a reboot.

Settings #

SettingEnvironment valueCommand lineDefault
Listen addressPSD_BIND--bind127.0.0.1:8480
Data folderPSD_DATA_DIR--data-dir./data
License checksPSD_LICENCE_CHECK (on or off)--licence-checkon
License keyPSD_LICENCE_KEYnonenone
License public keysPSD_LICENCE_PUBLIC_KEYSnonethe keys built into the server; the setting replaces them
Data keyPSD_MASTER_KEY_HEX (64 hex characters)nonemade on first start and kept in the keys folder
Help folderPSD_HELP_DIRnonehelp inside the data folder, otherwise the folder shipped with the server

The command line wins over the environment, and the environment wins over the default.

Protect your server #

  1. Back up the whole data folder on a second disk every night. The server also makes its own nightly backups in backups. See "Backups and restore".
  2. Turn on the disk's own encryption (FileVault or BitLocker). The keys folder holds the data key.
  3. Put the server on the office network only, or behind a gateway you control. Version 0.1.0 of the server listens for plain HTTP, so use a trusted network or a gateway that adds TLS. The server sends Strict-Transport-Security: max-age=31536000; includeSubDomains on every answer, so a browser that reaches it over HTTPS keeps using HTTPS.
  4. Behind a gateway, every request reaches the server from the gateway's address, so the per-address rate limits are shared by all callers. See "API rate limits".
  5. Keep the recovery key somewhere safe. init prints it once for a new data folder. See "The vault and your recovery key".
  6. Watch /health with a monitor.
Technical details
  • The database is a single SQLite file, dispatch.db, in WAL mode. Builds with the sqlcipher option encrypt it, and other builds leave it unencrypted and warn in the log at start.
  • The license's last answer and the server's device id sit in licence-state.json.
  • Photos and signatures sit under files/<account id>/.
  • A background worker sends webhooks every 15 seconds. A scheduler takes a nightly backup when none exists from the last 24 hours.
  • Stop with Ctrl+C. The server finishes open requests, then exits and marks the run as clean.
  • Other commands: reset-password and restore. See "Backups and restore". Builds for the public have no self-test command; it exists only in check builds.

If something goes wrong #

  • The message about the data folder: check that the folder's parent exists and that you can write to it.
  • The log says the program holds no license public key: this is a development build. Install the build from your supplier.
  • "--bind must look like 127.0.0.1:8480": use an address and port.
  • The message about listening on an address: another program uses the port. Choose another port or stop the other program.
  • Phones fail to connect: the server is bound to 127.0.0.1, or a firewall closes port 8480.