Browse documentation

VIRCON

Bot host ops

Operations guide

Bot host operations

This page summarizes deployment, migration, and operational checks for the VIRCON bot host.

Prerequisites

  • Node.js v18+
  • PM2 process manager
  • Discord bot token
  • VRChat account credentials
  • Server with 1GB RAM recommended

Environment keys

DISCORD_TOKEN
VRCHAT_USERNAME
VRCHAT_PASSWORD
ERROR_LOG_CHANNEL_ID
BOT_OWNER_ID
COMMAND_PREFIX
HUB_TICKET_STAFF_ROLE_ID
PUBLIC_SITE_URL

Support ticket transcripts

Closing a ticket saves an HTML copy in the hub transcript channel and ticket post. The View transcript on website button opens the saved conversation in Support, with images, media and file attachments alongside their original messages. Requesters can see only their own tickets without internal notes; VIRCON hub staff and the bot owner can see the staff transcript. Discord sign-in returns viewers to the linked ticket. Larger saved attachments load in chunks to fit website response limits.

Keep the main bot database and data/tickets directory together when backing up or moving the bot. PUBLIC_SITE_URL controls the Discord buttons and defaults to https://www.virconlogger.com.

PM2 services

vrchat-logger-bot (main bot)
database-backup (hourly backups)
bot-watchdog (health monitor)

Migration steps

  1. Stop the bot and create a final database backup.
  2. Transfer source, .env, and data/backups to the server.
  3. Install dependencies and run database checks.
  4. Start services with PM2 and save the config.
  5. Verify registrations and command responses.

Verification checklist

  • Bot shows online in Discord.
  • pm2 list shows all services online.
  • node check-db.js returns correct registration count.
  • Error log channel receives alerts.
  • Hourly backups appear in data/backups.

Stage lock controls

Stage 2-7 commands remain locked unless explicitly enabled.

  • Stage 2-7 commands are locked by default.
  • Use feature-lock-control.js unlock to enable later stages.
  • Re-lock anytime with feature-lock-control.js lock.
node feature-lock-control.js status
node feature-lock-control.js unlock
node feature-lock-control.js lock
pm2 restart vrchat-logger-bot

Rollback plan

  1. Stop all bot services on the server.
  2. Restart the previous host or restore the last known good backup.
  3. Verify registrations and command responses.
  4. Notify staff that rollback is complete.

Security checklist

  • Keep .env files out of git and restrict file permissions.
  • Rotate VRChat credentials after migrations.
  • Confirm the bot token has not been regenerated.
  • Allow outbound Discord and VRChat traffic on the host.
  • Validate backups before deleting older snapshots.

Monitoring commands

Use these during deploys and incident response.

pm2 list
pm2 logs vrchat-logger-bot --lines 50
pm2 logs bot-watchdog --lines 50
node check-db.js