一键导入
server-access
SSH access to AMC servers and debugging amc-backend services
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
SSH access to AMC servers and debugging amc-backend services
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Building, packaging, and deploying MTDediMod releases (server and client mods)
Debugging crash dumps, PDB symbols, and UE4SS Lua GC issues in MTDediMod
Managing ragenix-encrypted secrets in the AMC monorepo
| name | server-access |
| description | SSH access to AMC servers and debugging amc-backend services |
Both servers require Tailscale for SSH.
ssh root@asean-mt-server # Main server (game + backend)
ssh root@amc-peripheral # Peripheral server (radio, bots)
The amc-backend runs directly on asean-mt-server as host-level systemd services.
systemctl status amc-worker
systemctl status amc-backend
systemctl status postgresql
journalctl -u amc-worker -n 100 --no-pager
journalctl -u amc-worker --since '1 hour ago' --no-pager
systemctl restart amc-worker
systemctl restart amc-backend
Use the amcm wrapper (available to root):
amcm <command>
For example:
amcm shell
amcm migrate
amcm backfill_vehicle_stats --sleep 0.1
Or manually:
su -s /bin/sh amc -c \
'DJANGO_SETTINGS_MODULE=amc_backend.settings amc-manage <command>'
For shell queries:
su -s /bin/sh amc -c \
'DJANGO_SETTINGS_MODULE=amc_backend.settings amc-manage shell -c "<python code>"'
[!IMPORTANT] Django commands must run as the
amcuser and requireDJANGO_SETTINGS_MODULE=amc_backend.settings.
su -s /bin/sh amc -c 'psql'
| Service | systemd unit | Description |
|---|---|---|
| Django API | amc-backend | uvicorn ASGI server |
| Worker + Discord Bot | amc-worker | arq worker with Discord bot in a ThreadPoolExecutor |
| Dummy Server | dummy-server | Test/dummy server |
| PostgreSQL | postgresql | Database with PostGIS, TimescaleDB, pg_partman |
| Redis | redis-amc-backend | Task queue and caching |
| Log Listener | rsyslogd | RELP log ingestion from game servers |
The amc-worker process runs arq which:
aiohttp session pool and starts the Discord bot in a ThreadPoolExecutormonitor_jobs, monitor_webhook, monitor_locations, send_event_embeds, etc.process_log_line tasks from RedisJobsCog, EventsCog, RoleplayCog, etc.) with their own tasks.loop schedules[!CAUTION] The Discord bot runs in a separate thread inside the arq worker. If the bot crashes or a cog's
tasks.loopdies from an unhandled exception, the arq worker process will continue running normally — only the bot/cog functionality stops silently. Check for both arq cron output AND Discord-specific logs when debugging.
motortown-server — Main Motor Town game servermotortown-server-containers-test — Test game server containermotortown-server-containers-event — Event game server containeramc-worker is running: systemctl status amc-workerjournalctl -u amc-worker --since '1 hour ago' | grep -i "<loop_name>"journalctl -u amc-worker --since '3 days ago' | grep -i "discord.*error\|DiscordServerError\|Traceback"tasks.loop died, restart the worker: systemctl restart amc-worker[!NOTE] The pre-push git hook only runs ruff (fast linting). Pytest must be run manually before pushing.
Tests require a local PostgreSQL instance. The .envrc in amc-backend/ starts one automatically via layout_postgres.
cd amc-server/amc-backend
direnv exec . python -m pytest <path-to-test-file> -x -q
Key points:
direnv exec . — it loads PGHOST, PGDATA, and DJANGO_SETTINGS_MODULE from .envrc + the Nix dev shell. Running pytest directly (without direnv) will fail with "settings not configured" or "cannot connect to database".--ds=amc_backend.settings manually; DJANGO_SETTINGS_MODULE is already set by .envrc..direnv/postgres/. Tests create and tear down their own schema.Example:
direnv exec . python -m pytest src/amc/test_auction_api.py src/amc/test_auction_escrow.py -x -q
Tests use SQLite in-memory — no database required:
cd amc-server/amc-peripheral
direnv exec . pytest tests/ -q