Production deploy (systemd)
Behaviour
On every service start (clean midnight restart, crash, or power loss recovery):
1. git fetch + git reset --hard origin/<branch> 2. git pull --ff-only 3. npm install --omit=dev — skipped when package.json + package-lock.json match the stamp written under node_modules/.questward-npm-stamp after the last successful install (node_modules survives hard-reset because it is gitignored) 4. git submodule update --init --recursive 5. npm run build:client (concatenates FrameworkV3 → client/frameworkv3/js/framework.js) 6. start node --experimental-sqlite server/src/index.js
Pull-on-crash is intentional so a fixed commit on origin can recover a bad build.
Player-facing midnight schedule (3-hour countdown toast) still lives in the Node process: it detects that origin is ahead, warns players, then exits cleanly so systemd runs the update script above.
Install on the host
cd /srv/questward/current # or your clone
sudo ./deploy/install-service.sh
Optional env overrides:
| Variable | Default |
|---|---|
QUESTWARD_REPO | parent of deploy/ |
QUESTWARD_USER | questward |
QUESTWARD_GIT_BRANCH | master |
QUESTWARD_AUTH_CLIENT_SECRET | (unset — stub auth) |
Production secrets: /etc/questward/env (loaded by the unit). Example:
sudo mkdir -p /etc/questward
sudo nano /etc/questward/env
# QUESTWARD_AUTH_CLIENT_SECRET=...
# QUESTWARD_AUTH_REDIRECT_URI=http://questward.timfalken.com:1234/auth/callback
sudo chmod 600 /etc/questward/env
See root README.md for OAuth / auth.timfalken.com setup.
TILE_MMO_* env vars are still accepted as fallbacks for older installs.
Manual ops
sudo systemctl restart questward
journalctl -u questward -f
Disable the in-process schedule locally with QUESTWARD_DEPLOY_SCHEDULER=0.
Source
| 1 | # Production deploy (systemd) |
| 2 | |
| 3 | ## Behaviour |
| 4 | |
| 5 | On **every** service start (clean midnight restart, crash, or power loss recovery): |
| 6 | |
| 7 | 1. `git fetch` + `git reset --hard origin/<branch>` |
| 8 | 2. `git pull --ff-only` |
| 9 | 3. `npm install --omit=dev` — **skipped** when `package.json` + `package-lock.json` |
| 10 | match the stamp written under `node_modules/.questward-npm-stamp` after the last |
| 11 | successful install (node_modules survives hard-reset because it is gitignored) |
| 12 | 4. `git submodule update --init --recursive` |
| 13 | 5. `npm run build:client` (concatenates FrameworkV3 → `client/frameworkv3/js/framework.js`) |
| 14 | 6. start `node --experimental-sqlite server/src/index.js` |
| 15 | |
| 16 | Pull-on-crash is intentional so a fixed commit on origin can recover a bad build. |
| 17 | |
| 18 | Player-facing midnight schedule (3-hour countdown toast) still lives in the Node |
| 19 | process: it detects that origin is ahead, warns players, then exits cleanly so |
| 20 | systemd runs the update script above. |
| 21 | |
| 22 | ## Install on the host |
| 23 | |
| 24 | ```bash |
| 25 | cd /srv/questward/current # or your clone |
| 26 | sudo ./deploy/install-service.sh |
| 27 | ``` |
| 28 | |
| 29 | Optional env overrides: |
| 30 | |
| 31 | | Variable | Default | |
| 32 | |----------|---------| |
| 33 | | `QUESTWARD_REPO` | parent of `deploy/` | |
| 34 | | `QUESTWARD_USER` | `questward` | |
| 35 | | `QUESTWARD_GIT_BRANCH` | `master` | |
| 36 | | `QUESTWARD_AUTH_CLIENT_SECRET` | (unset — stub auth) | |
| 37 | |
| 38 | Production secrets: **`/etc/questward/env`** (loaded by the unit). Example: |
| 39 | |
| 40 | ```bash |
| 41 | sudo mkdir -p /etc/questward |
| 42 | sudo nano /etc/questward/env |
| 43 | # QUESTWARD_AUTH_CLIENT_SECRET=... |
| 44 | # QUESTWARD_AUTH_REDIRECT_URI=http://questward.timfalken.com:1234/auth/callback |
| 45 | sudo chmod 600 /etc/questward/env |
| 46 | ``` |
| 47 | |
| 48 | See root `README.md` for OAuth / auth.timfalken.com setup. |
| 49 | |
| 50 | `TILE_MMO_*` env vars are still accepted as fallbacks for older installs. |
| 51 | |
| 52 | ## Manual ops |
| 53 | |
| 54 | ```bash |
| 55 | sudo systemctl restart questward |
| 56 | journalctl -u questward -f |
| 57 | ``` |
| 58 | |
| 59 | Disable the in-process schedule locally with `QUESTWARD_DEPLOY_SCHEDULER=0`. |