Documentation menu

Data Store

Citadel uses a JSON file-based data store — no database required. All data lives in the data/ directory.

Files

FileContentsDescription
servers.jsonServer profilesServer configurations, connection details, provider settings
users.jsonUser accountsUsernames, hashed passwords, roles, MFA settings
audit.jsonAudit trailAction log with who, what, when, result
webhooks.jsonWebhook configsDiscord and HTTP webhook configurations
leaderboard.jsonLeaderboard cachePlayer stats leaderboard data
bans.jsonGlobal ban databaseCentralized ban list with UUID IDs, synced to all server ban.txt files
setup_complete.jsonSetup stateTracks whether initial setup has been completed

Backup & Restore

Manual Backup

Copy the entire data/ directory:

Copy-Item -Recurse data\ data-backup-$(Get-Date -Format yyyyMMdd)\

API Backup

Download individual config files via the REST API:

# Download server configs
curl -H "Authorization: Bearer $TOKEN" \
  http://localhost:3001/api/backup/servers > servers-backup.json

# Restore
curl -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d @servers-backup.json \
  http://localhost:3001/api/restore/servers

Available backup types: servers, users, roles, webhooks

Ban Database Export/Import

The global ban database can be exported and imported via dedicated API endpoints:

# Export bans
curl -H "Authorization: Bearer $TOKEN" \
  http://localhost:3001/api/bans/export > bans-backup.json

# Import bans (merges with existing, deduplicates by Steam ID)
curl -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d @bans-backup.json \
  http://localhost:3001/api/bans/import

Each ban has a UUID that can be shared with other server owners for cross-community ban sharing.

Data Safety

  • The data store uses atomic writes to prevent corruption during crashes
  • If a JSON file becomes corrupted, restore from a backup or delete it to reset to defaults
  • The data/ directory is created automatically on first startup