BlueGit

timfa questward

Files

questward / deploy / README.md

README.md

README.md 1.6 KiB Download Raw

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 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:

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