b11ae1d made the server load discord.js at start, through lib/discordbot.js,
even with the bot off. update.sh installs no npm packages, so prod had none,
and every start failed with "Cannot find module 'discord.js'".
- lib/discordbot.js loads discord.js when the bot starts (a token and guild
id set), not with the server. without the package the bot stays off, with
a line in the log, and the panel's Start says to run npm ci. the two
message flags cards use are written as numbers, and the slash commands
are made when they are synchronized.
- deploy/update.sh runs npm ci --omit=dev when package-lock.json changed or
node_modules is missing. a failed install leaves the bot off; the game
needs no package.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Deployment helpers
update.sh fetches the configured branch, fast-forwards only, validates changed
JavaScript, and restarts the server only when a loaded server file changed. It
runs as root, but uses BURROW_USER for Git operations.
systemd
The existing burrow-update.service and burrow-update.timer check for an
update every two minutes.
OpenRC
The OpenRC service keeps a small foreground loop alive and runs the same updater every two minutes. It does not require cron.
install -m 755 deploy/burrow-update.openrc /etc/init.d/burrow-update
install -m 644 deploy/burrow-update.conf /etc/conf.d/burrow-update
rc-update add burrow-update default
rc-service burrow-update start
Uncomment and change values in /etc/conf.d/burrow-update when the server is
not installed at /home/aj/ajc-private-server, runs as a different user, or
uses a differently named OpenRC service. BURROW_UPDATE_INTERVAL is a positive
number of seconds and defaults to 120.
update.sh selects OpenRC automatically when run by OpenRC. Set
BURROW_INIT=openrc when running it manually or from another supervisor. Set
BURROW_INIT=systemd to force systemd.