Admin Guide

First Admin User

The first registered user should be promoted to admin. Using the database:

docker compose exec db psql -U conquer
UPDATE users SET is_admin = true WHERE username = 'yourname';
\q

Once logged in with an admin account, an Admin button appears in the top-right of the game browser.

Admin Panel

The admin panel (at /admin) provides:

Creating a New Game

  1. Click + New World and enter a name
  2. Click Initialize Map on the new world (optionally set a seed for reproducibility)
  3. The map and 8 NPC nations are generated. Players can now join.
  4. Once enough players have joined, turns begin processing automatically every 6 hours (or trigger manually)

Map Configuration

ParameterDefaultDescription
mapx79Map width in hex columns
mapy49Map height in hex rows
pwater35% of map that becomes ocean
pmount20% of land that becomes mountains
npc_count8Number of NPC nations to spawn
seedrandomFixed seed for reproducible maps

REST API Admin Endpoints

All admin endpoints require a valid JWT from an admin user (Bearer token).

EndpointMethodAction
/admin/worlds/{id}/initializePOSTGenerate map + NPCs
/admin/worlds/{id}/process-turnPOSTProcess one turn
/admin/worlds/{id}/maintenancePOSTToggle maintenance mode
/worlds/POSTCreate a new world (admin only)

Maintenance Mode

Toggle maintenance mode to block player logins while you make administrative changes. Active worlds in maintenance mode are skipped by the Celery turn scheduler. Mirrors the original conqrun -T flag.

API Documentation

Full interactive API documentation is available at http://localhost:8001/docs (Swagger UI) when the backend is running.

Celery Worker Management

# View worker status
docker compose exec worker celery -A app.tasks.celery_app:celery_app inspect active

# View scheduled tasks
docker compose exec beat celery -A app.tasks.celery_app:celery_app inspect scheduled

# Process a specific world manually (from host)
docker compose exec backend python3 -c "
from app.tasks.turn_tasks import process_world_turn
process_world_turn.delay('<world-uuid>')
"

Backing Up Game Data

# Dump the database
docker compose exec db pg_dump -U conquer conquer > backup.sql

# Restore
cat backup.sql | docker compose exec -T db psql -U conquer conquer