Skip to content

Configuration

Synqed reads two kinds of configuration:

  1. Environment variables — set at process start, required for secrets and bootstrap
  2. Runtime settings — stored in the settings table, editable through the dashboard without restarting the bot

Environment variables

Required

VariableDescriptionExample
DISCORD_TOKENDiscord bot tokenMTIz...
DISCORD_GUILD_IDServer ID123456789012345678
DATABASE_URLPostgreSQL connection stringpostgresql://user:pass@localhost:5432/db
ADMIN_USERNAMEDashboard admin usernameadmin
ADMIN_PASSWORD_HASHbcrypt hash of the admin password$2b$10$...
JWT_SECRETJWT signing secret (32+ chars)a_long_random_string

Optional

VariableDescriptionDefault
DISCORD_CLIENT_IDDiscord OAuth client ID
DISCORD_CLIENT_SECRETDiscord OAuth client secret
DISCORD_REDIRECT_URIOAuth redirect URLhttp://localhost:3000/auth/callback
DASHBOARD_URLFrontend origin (CORS)http://localhost:3000
PORTAPI server port3001
BOT_API_URLAPI URL (server-side, used by Next.js)http://localhost:3001
NEXT_PUBLIC_BOT_API_URLAPI URL (client-side, used by the browser)http://localhost:3001

Generating the admin password hash

bash
node dist/generateHash.js

The script prompts for a plaintext password and prints a bcrypt hash to paste into ADMIN_PASSWORD_HASH.

Runtime settings

All settings live in the settings table as flat dot-notation key/value strings. They are loaded into a cached object at startup, refreshed when reloadConfig() runs, and mirrored into a runtime config object that the bot reads.

Discord

KeyDescriptionExample
discord.channelIdChannel that hosts the daily post and pinned weekly overview123456789012345678
discord.pingRoleIdRole mentioned in daily and weekly posts (optional)123456789012345678
discord.allowDiscordAuthAllow Discord OAuth sign-in on the dashboardtrue
discord.pinnedWeekMessageIdInternal — message ID of the pinned weekly overview(managed by the bot)
discord.pinnedWeekStartDateInternal — Monday of the pinned week(managed by the bot)

Bot-managed keys

pinnedWeekMessageId and pinnedWeekStartDate are written by the bot whenever the weekly overview rolls over. Do not edit them manually.

Scheduling

KeyDescriptionDefault
scheduling.dailyPostTimeTime of day for the daily schedule post (HH:MM)18:00
scheduling.timezoneIANA timezone applied to every cronEurope/Berlin
scheduling.reminderHoursBeforeHours before the daily post for the first reminder3
scheduling.duplicateReminderEnabledToggle the second reminder passfalse
scheduling.duplicateReminderHoursBeforeHours before the daily post for the second reminder1
scheduling.trainingStartPollEnabledAuto-create a training-start poll after the daily postfalse
scheduling.pollDurationMinutesTraining-start poll lifetime (1–10080)60
scheduling.cleanChannelBeforePostWipe non-pinned channel messages before the daily postfalse
scheduling.changeNotificationsEnabledRe-post the embed when today's roster status changestrue
scheduling.weeklyPingEnabledMaster toggle for the weekly planning DMtrue
scheduling.weeklyPingTimeTime of day for the weekly planning DM (HH:MM)12:00
scheduling.weeklyPingDaysWeekdays the planning DM runs on (0=Sun..6=Sat)[0, 1]

See Scheduler & Cron Jobs for how these knobs combine.

Branding

KeyDescriptionDefault
branding.teamNameTeam name shown in the dashboardSynqed
branding.taglineTagline under the team nameSchedule Manager
branding.logoUrlExternal image URL for the sidebar logo

Stratbook

KeyDescriptionDefault
stratbook.editPermissionWho can edit strategiesadmin

Values: admin or all

  • admin — only admins can edit strategies
  • all — any registered player can edit

Changing settings

Dashboard

  1. Open /admin
  2. Go to Settings
  3. Edit and save — reloadConfig() and restartScheduler() run automatically

REST API

bash
curl -X POST http://localhost:3001/api/settings \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "scheduling": {
      "dailyPostTime": "19:00",
      "timezone": "Europe/Berlin",
      "weeklyPingDays": [0, 1, 4]
    }
  }'

The endpoint accepts the full settings shape; partial updates are merged server-side. See Settings API for the request schema.

Manual reload

bash
curl -X POST http://localhost:3001/api/settings/reload-config \
  -H "Authorization: Bearer YOUR_JWT"

Useful when you edited the settings table directly (e.g. via Prisma Studio) and need the running bot to pick up the change.

MIT License