diff --git a/CLAUDE.md b/CLAUDE.md index 49769e0..f42e0b8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -31,7 +31,7 @@ pip install -r requirements.txt # Install dependencies - **Path**: `/home/cal/container-data/paper-dynasty` - **Container**: `paper-dynasty_discord-app_1` - **Image**: `manticorum67/paper-dynasty-discordapp` -- **Health**: `GET http://localhost:8080/health` (HTTP server in `health_server.py`) +- **Health**: `GET http://localhost:8081/health` (HTTP server in `health_server.py`) - **Versioning**: CalVer (`YYYY.M.BUILD`) — manually tagged when ready to release ### Logs @@ -46,7 +46,7 @@ pip install -r requirements.txt # Install dependencies - Bot not responding → check `docker logs`, verify `BOT_TOKEN` and `GUILD_ID` - API errors → verify `DATABASE` is set to `Prod` or `Dev`, check `API_TOKEN` matches the database API - Game engine errors → check `/usr/src/app/logs/discord.log` for detailed tracebacks -- Health endpoint not responding → `health_server.py` runs on port 8080 inside the container +- Health endpoint not responding → `health_server.py` runs on port 8081 inside the container ### CI/CD Ruff lint on PRs. Docker image built on CalVer tag push only. diff --git a/health_server.py b/health_server.py index b4ccbf2..67b9e06 100644 --- a/health_server.py +++ b/health_server.py @@ -17,14 +17,14 @@ logger = logging.getLogger("discord_app.health") class HealthServer: """HTTP server for health checks and metrics.""" - def __init__(self, bot: commands.Bot, host: str = "0.0.0.0", port: int = 8080): + def __init__(self, bot: commands.Bot, host: str = "0.0.0.0", port: int = 8081): """ Initialize health server. Args: bot: Discord bot instance to monitor host: Host to bind to (default: 0.0.0.0 for container access) - port: Port to listen on (default: 8080) + port: Port to listen on (default: 8081) """ self.bot = bot self.host = host @@ -148,7 +148,7 @@ class HealthServer: logger.info("Health check server stopped") -async def run_health_server(bot: commands.Bot, host: str = "0.0.0.0", port: int = 8080): +async def run_health_server(bot: commands.Bot, host: str = "0.0.0.0", port: int = 8081): """ Run health server as a background task. diff --git a/tests/refractor-integration-test-plan.md b/tests/refractor-integration-test-plan.md index d9bd5d4..b355f50 100644 --- a/tests/refractor-integration-test-plan.md +++ b/tests/refractor-integration-test-plan.md @@ -32,7 +32,7 @@ the expected bot response, and pass/fail criteria. Before running these tests, ensure the following state exists: ### Bot State -- [ ] Bot is online and healthy: `GET http://sba-bots:8080/health` returns 200 +- [ ] Bot is online and healthy: `GET http://sba-bots:8081/health` returns 200 - [ ] Refractor cog is loaded: check bot logs for `Loaded extension 'cogs.refractor'` - [ ] Test user has the `PD Players` role on the dev server @@ -72,7 +72,7 @@ API layer is functional. Execute via shell or Playwright network interception. ### REF-API-01: Bot health endpoint | Field | Value | |---|---| -| **Command** | `curl -sf http://sba-bots:8080/health` | +| **Command** | `curl -sf http://sba-bots:8081/health` | | **Expected** | HTTP 200, body contains health status | | **Pass criteria** | Non-empty 200 response | diff --git a/tests/refractor-preflight.sh b/tests/refractor-preflight.sh index 940b452..f191555 100755 --- a/tests/refractor-preflight.sh +++ b/tests/refractor-preflight.sh @@ -14,7 +14,7 @@ STATUS=$(curl -s -o /dev/null -w "%{http_code}" "https://pddev.manticorum.com/ap echo "" echo "=== Discord Bot ===" # Health check -curl -sf http://sba-bots:8080/health >/dev/null 2>&1 && echo "PASS: bot health OK" || echo "FAIL: bot health endpoint" +curl -sf http://sba-bots:8081/health >/dev/null 2>&1 && echo "PASS: bot health OK" || echo "FAIL: bot health endpoint" # Recent refractor activity in logs echo ""