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:
- Create World — name a new game instance
- Initialize Map — generate the hex map and NPC nations for a world
- Process Turn — manually trigger one turn for a world
- Activity Log — real-time feedback on admin actions
Creating a New Game
- Click + New World and enter a name
- Click Initialize Map on the new world (optionally set a seed for reproducibility)
- The map and 8 NPC nations are generated. Players can now join.
- Once enough players have joined, turns begin processing automatically every 6 hours (or trigger manually)
Map Configuration
| Parameter | Default | Description |
|---|---|---|
| mapx | 79 | Map width in hex columns |
| mapy | 49 | Map height in hex rows |
| pwater | 35 | % of map that becomes ocean |
| pmount | 20 | % of land that becomes mountains |
| npc_count | 8 | Number of NPC nations to spawn |
| seed | random | Fixed seed for reproducible maps |
REST API Admin Endpoints
All admin endpoints require a valid JWT from an admin user (Bearer token).
| Endpoint | Method | Action |
|---|---|---|
/admin/worlds/{id}/initialize | POST | Generate map + NPCs |
/admin/worlds/{id}/process-turn | POST | Process one turn |
/admin/worlds/{id}/maintenance | POST | Toggle maintenance mode |
/worlds/ | POST | Create 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