Commit Graph
4 Commits
Author SHA1 Message Date
SnipzilandClaude Opus 5.5 3b53c8dab8 fix(staff): a Discord sign-in asks for the 2FA code, and the bot needs one too
Since 7dee290 a Discord account linked to a staff member opened the
moderator panel for 12 hours on Discord's word alone, with no password and
no 2FA code, though the normal sign-in asks for both every time; and since
b11ae1d the bot took /moderate and /burrow commands from that Discord
account alone. The link outlives a new password and "sign out
everywhere", so a taken-over Discord account was enough to act as the
staff member. The admin dashboard's Discord sign-in (adminDashboardAccess)
skipped its password the same way.

- /mod/discord/callback and /admin/discord/callback no longer sign in:
  they keep a pending sign-in for 5 minutes (a Strict cookie) and the page
  asks for the linked account's 2FA code (POST .../api/discord/code). Five
  wrong codes and it must start again at Discord. The admin one also needs
  the account to have 2FA on and not be locked.
- the bot's commands and buttons count only for a staff member with a
  panel session that took a code (modpanel.discordBot.commandActor): the
  password sign-in, or Discord and a code; not the game's token sign-in. A
  new password, signing out everywhere or 2FA turned off end those
  sessions (forget), and so the bot's use. Whose Discord it is still keeps
  linked staff out of /discord moderation, and lets them close tickets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 22:54:26 -04:00
SnipzilandClaude Opus 5.5 8839f86e6c feat(discord-bot): a public status card with a banner, and log cards with fields
- The status card is the players' card now: a title, "Online" and the
  admin's message, players and rooms, uptime and memory, an optional banner
  image and a "Play Burrow" button. The open report count is staff data and
  is no longer on it.
- The admin page's Discord tab takes a banner image URL (http(s), at most 500
  characters, blank for none), saved as discordBotStatusBanner and named in
  the mod log. GET /burrow-status-banner.png serves a banner of our own.
- The game activity, moderation, bot audit and security logs are one card
  shape (logCard): a summary line, a list of fields and when it was logged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 22:42:10 -04:00
BurrowdevandClaude Opus 5.5 a8ab031616 fix(discord-bot): start the server without discord.js installed
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]>
2026-10-21 12:16:57 +03:00
Snipzil b11ae1dfa8 feat: add unified Discord bot and dashboard 2026-10-20 22:13:50 -04:00