6 Running the Server
InactiveImmortal edited this page 2026-09-18 09:04:15 -05:00

Running the server

This page covers the everyday tasks. The README has the full reference, including every .env setting, Discord sign-in, and building releases.

Install

HvZ Map runs as a Docker container. On the server:

git clone https://code.inactiveimmortal.com/Inactiveimmortal/hvz-map.git
cd hvz-map
cp .env.example .env    # set ADMIN_PASSCODE, HUMAN_PASSCODE and PUBLIC_URL
echo "HVZ_IMAGE=code.inactiveimmortal.com/inactiveimmortal/hvz-map:1.1.4" >> .env
docker login code.inactiveimmortal.com -u <your-forgejo-user>
docker compose up -d

Serve it over HTTPS. Phones only allow location, installing to the home screen, and offline use on a secure site.

Update to a new version

sed -i 's|^HVZ_IMAGE=.*|HVZ_IMAGE=code.inactiveimmortal.com/inactiveimmortal/hvz-map:1.1.4|' .env
docker compose pull && docker compose up -d

Players pick up the new version the next time they open the map with signal. To roll back, use an older version number.

Change a setting in .env

Most game settings can be changed live on the Admin page. For anything set in .env (passcodes, Discord, notifications), edit the file and then run:

docker compose up -d

docker restart is not enough: Docker only reads .env when the container is created, so a restart keeps the old values.

Keep comments on their own lines in .env. A comment after a value, like PUSHOVER_APP_TOKEN=abc123 # my app, becomes part of the value.

Admin notifications

Admins can get push notifications through Pushover when a player asks to clear a report or reports a big horde.

  1. Create an application at https://pushover.net/apps/build. Put its token in PUSHOVER_APP_TOKEN.
  2. Put each admin's user key in PUSHOVER_USER_KEYS, separated by commas. A Pushover group key works too.
  3. Set PUBLIC_URL, so notifications include a one-tap review link.
  4. Run docker compose up -d.
  5. On the Admin page, open Settings, then Admin notifications, and tap Send test notification.

Your own actions as staff never send notifications, since they take effect straight away. To see a real one, test with a player account.

Discord alerts channel

To post player alerts to a Discord channel:

  1. In Discord, open the channel's settings, then Integrations, Webhooks, New Webhook, and Copy Webhook URL.
  2. Put it in .env as DISCORD_WEBHOOK_URL.
  3. Run docker compose up -d.
  4. On the Admin page, open Settings, then Discord alerts channel. Pick what the channel hears and tap Send test to Discord.

Players' phone alerts need no server setup. See Alerts.

PUBLIC_URL

PUBLIC_URL in .env must be the exact address players open, like https://hvz.inactiveimmortal.com, with no trailing slash. Discord sign-in, notification links and phone alerts all use it.

If it's wrong, Discord sign-in fails with Invalid OAuth2 redirect_uri. The server warns in its logs, and at the top of the Admin page's Settings, when PUBLIC_URL is missing, still the example address from .env.example, or different from the address the page was opened at.

Backups

All data is in one SQLite file, hvz.sqlite, in the hvz-data Docker volume. Copy that file to back it up.

Logs

docker compose logs -f

Every request is logged, along with notification attempts ([pushover]) and any passcodes the server generated because none was set.