From 8b2eeff3fd4752d5c349da47a676ddc1893561ad Mon Sep 17 00:00:00 2001 From: Deckard Date: Sat, 4 Oct 2025 20:44:07 -0400 Subject: [PATCH] add module functionality, untested --- .mcp.json | 16 + README.md | 401 ++++++ docker-compose-azerothcore-services.env | 26 +- docker-compose-azerothcore-services.yml | 109 +- docs/module-configuration-requirements.md | 282 ++++ readme-old.md | 0 readme.md | 1456 --------------------- scripts/README.md | 149 ++- scripts/configure-modules.sh | 290 ++++ scripts/setup-eluna.sh | 347 +++++ 10 files changed, 1588 insertions(+), 1488 deletions(-) create mode 100644 README.md create mode 100644 docs/module-configuration-requirements.md create mode 100644 readme-old.md delete mode 100644 readme.md create mode 100755 scripts/configure-modules.sh create mode 100755 scripts/setup-eluna.sh diff --git a/.mcp.json b/.mcp.json index c543903..330590c 100644 --- a/.mcp.json +++ b/.mcp.json @@ -10,6 +10,22 @@ "MYSQL_PASSWORD": "azerothcore123", "MYSQL_DATABASE": "acore_world" } + }, + "playwright": { + "command": "npx", + "args": ["-y", "@playwright/mcp"] + }, + "github": { + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-github"] + }, + "docker": { + "command": "npx", + "args": ["-y", "docker-mcp"] + }, + "memory": { + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-memory"] } } } \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..06c79db --- /dev/null +++ b/README.md @@ -0,0 +1,401 @@ +# AzerothCore Docker/Podman Stack + +A complete containerized deployment of AzerothCore WoW 3.3.5a (Wrath of the Lich King) private server with 13 enhanced modules, automated management, and production-ready features. + +## ๐Ÿš€ Quick Start + +### Prerequisites +- **Docker** or **Podman** with Docker Compose +- **4GB+ RAM** and **20GB+ storage** +- **Linux/macOS/WSL2** (Windows with WSL2 recommended) + +### โšก Automated Setup (Recommended) + +**1. Get the Code** +```bash +git clone https://github.com/uprightbass360/acore-compose.git +cd acore-compose +``` + +**2. Run Interactive Setup** +```bash +./scripts/setup-server.sh +``` + +**3. Deploy Server** +```bash +# Use the generated custom environment files +docker compose --env-file docker-compose-azerothcore-database-custom.env -f docker-compose-azerothcore-database.yml up -d +docker compose --env-file docker-compose-azerothcore-services-custom.env -f docker-compose-azerothcore-services.yml up -d +docker compose --env-file docker-compose-azerothcore-tools-custom.env -f docker-compose-azerothcore-tools.yml up -d +``` + +**4. Create Admin Account** + +Once the worldserver is running: + +```bash +# Attach to worldserver console +docker attach ac-worldserver + +# In the worldserver console, create admin account: +account create admin yourpassword +account set gmlevel admin 3 -1 +server info + +# Detach from console without stopping: Ctrl+P, Ctrl+Q +``` + +**5. Configure Game Client** + +**Client Connection Instructions**: + +1. **Locate your WoW 3.3.5a client directory** +2. **Edit `realmlist.wtf` file** (in your WoW client folder): + ``` + set realmlist SERVER_ADDRESS + ``` + +**Examples based on your server configuration**: +```bash +# Local development +set realmlist 127.0.0.1 + +# LAN server +set realmlist 192.168.1.100 + +# Public server with custom port +set realmlist your-domain.com 8215 +# or for IP with custom port +set realmlist 203.0.113.100 8215 +``` + +**6. Access Your Server** +- **Game Server**: `your-server-ip:8215` (or port you configured) +- **Database Admin**: http://localhost:8081 (phpMyAdmin) +- **Game Content Editor**: http://localhost:4201 (Keira3) + +โœ… **That's it!** Your server is ready with all 13 modules installed and configured. + +--- + +## ๐Ÿ”ง Manual Setup (Advanced Users) + +### Step 1: Clone Repository +```bash +git clone https://github.com/uprightbass360/acore-compose.git +cd acore-compose +``` + +### Step 2: Configure Environment Files +Edit these files to match your setup: +- `docker-compose-azerothcore-database.env` +- `docker-compose-azerothcore-services.env` +- `docker-compose-azerothcore-tools.env` + +Key settings to modify: +```bash +# Server network configuration +SERVER_ADDRESS=your-server-ip +REALM_PORT=8215 +AUTH_EXTERNAL_PORT=3784 + +# Storage location +STORAGE_ROOT=./storage # Local setup +# STORAGE_ROOT=/nfs/containers # NFS/network storage + +# Database settings +MYSQL_ROOT_PASSWORD=your-secure-password +``` + +### Step 3: Deploy Layers in Order +```bash +# 1. Database layer (MySQL + backup system) +docker compose --env-file docker-compose-azerothcore-database.env -f docker-compose-azerothcore-database.yml up -d + +# 2. Services layer (auth/world servers + modules) +docker compose --env-file docker-compose-azerothcore-services.env -f docker-compose-azerothcore-services.yml up -d + +# 3. Tools layer (phpMyAdmin + Keira3) +docker compose --env-file docker-compose-azerothcore-tools.env -f docker-compose-azerothcore-tools.yml up -d +``` + +### Step 4: Monitor Deployment +```bash +# Watch post-install configuration +docker logs ac-post-install -f + +# Check all services are healthy +docker ps +``` + +--- + +## ๐Ÿ“‹ What Gets Installed Automatically + +### โœ… Core Server Components +- **AzerothCore 3.3.5a** - WotLK server application +- **MySQL 8.0** - Database with automated schema import +- **Automated Backup System** - Scheduled database backups +- **phpMyAdmin** - Web-based database administration +- **Keira3** - Game content editor and developer tools + +### โœ… 13 Enhanced Modules (๐Ÿ”ฌ IN TESTING) +All modules are automatically downloaded, configured, and SQL scripts executed: + +| Module | Description | Status | +|--------|-------------|---------| +| **mod-playerbots** | AI companions for solo play | ๐Ÿ”ฌ IN TESTING | +| **mod-aoe-loot** | Streamlined loot collection | ๐Ÿ”ฌ IN TESTING | +| **mod-learn-spells** | Automatic spell learning | ๐Ÿ”ฌ IN TESTING | +| **mod-fireworks** | Level-up celebrations | ๐Ÿ”ฌ IN TESTING | +| **mod-individual-progression** | Personal advancement system | ๐Ÿ”ฌ IN TESTING | +| **mod-transmog** | Appearance customization | ๐Ÿ”ฌ IN TESTING | +| **mod-solo-lfg** | Solo dungeon access | ๐Ÿ”ฌ IN TESTING | +| **mod-eluna** | Lua scripting engine | ๐Ÿ”ฌ IN TESTING | +| **mod-arac** | All races/classes unlocked | ๐Ÿ”ฌ IN TESTING | +| **mod-npc-enchanter** | Enchanting services | ๐Ÿ”ฌ IN TESTING | +| **mod-assistant** | AI automation features | ๐Ÿ”ฌ IN TESTING | +| **mod-reagent-bank** | Reagent storage system | ๐Ÿ”ฌ IN TESTING | +| **mod-black-market** | Rare item auctions | ๐Ÿ”ฌ IN TESTING | + +### โœ… Automated Configuration +- **Database Setup** - Complete schema import and user creation +- **Realmlist Configuration** - Server address and port setup +- **Module Integration** - SQL scripts execution and config deployment +- **Service Restart** - Automatic restart to apply configurations +- **Health Monitoring** - Container health checks and restart policies + +### โœ… Lua Scripting Environment +- **Example Scripts** - Welcome messages, level rewards, server info commands +- **Volume Mounting** - Scripts automatically loaded from `storage/lua_scripts/` +- **Development Tools** - Script reloading with `.reload eluna` command + +--- + +## โš ๏ธ Manual Configuration Required + +While most setup is automated, some modules require manual configuration: + +### ๐Ÿšจ Critical Issues to Resolve + +**mod-playerbots Compatibility** +- **Issue**: Requires custom AzerothCore branch +- **Current**: Standard AzerothCore (incompatible) +- **Resolution**: Switch to Playerbot branch OR disable module + +### ๐Ÿ“ฆ Client-Side Patches Required + +**mod-individual-progression** +- **Required**: `patch-V.mpq` (Vanilla crafting/recipes) +- **Optional**: `patch-J.mpq`, `patch-U.mpq` +- **Location**: `storage/azerothcore/modules/mod-individual-progression/optional/` +- **Install**: Copy patches to client `WoW/Data/` directory + +**mod-arac (All Races All Classes)** +- **Required**: `Patch-A.MPQ` +- **Location**: `storage/azerothcore/modules/mod-arac/patch-contents/` +- **Install**: Copy to client `WoW/Data/` directory + +### โš™๏ธ Server Configuration Changes + +**mod-individual-progression** requires worldserver.conf updates: +```ini +# Required settings in storage/azerothcore/config/worldserver.conf +EnablePlayerSettings = 1 +DBC.EnforceItemAttributes = 0 +``` + +**mod-aoe-loot** optimization: +```ini +# Prevent corpse cleanup issues +Rate.Corpse.Decay.Looted = 0.01 +``` + +### ๐Ÿค– NPC Spawning Required + +Several modules need NPCs spawned with GM commands: +```bash +# Transmog NPC +.npc add 190010 + +# Reagent Bank NPC +.npc add 290011 + +# NPC Enchanter (check module docs for ID) +.npc add [enchanter_id] +``` + +### ๐Ÿ“‹ Configuration Analysis Tool + +Check your setup for missing configurations: +```bash +./scripts/configure-modules.sh +``` + +This script analyzes your enabled modules and provides specific guidance for resolving configuration issues. + +--- + +## ๐Ÿ—๏ธ Architecture Overview + +### Container Layers +``` +โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ Tools Layer โ”‚ +โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ +โ”‚ โ”‚ phpMyAdmin โ”‚ โ”‚ Keira3 โ”‚ โ”‚ +โ”‚ โ”‚ :8081 โ”‚ โ”‚ :4201 โ”‚ โ”‚ +โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ +โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ Services Layer โ”‚ +โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ +โ”‚ โ”‚ Auth โ”‚ โ”‚ World โ”‚ โ”‚ Modules โ”‚ โ”‚ +โ”‚ โ”‚ :3784 โ”‚ โ”‚ :8215 โ”‚ โ”‚ Manager โ”‚ โ”‚ +โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ +โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ +โ”‚ โ”‚ Client โ”‚ โ”‚ Eluna โ”‚ โ”‚Post-Inst โ”‚ โ”‚ +โ”‚ โ”‚ Data โ”‚ โ”‚TypeScriptโ”‚ โ”‚ Config โ”‚ โ”‚ +โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ +โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” +โ”‚ Database Layer โ”‚ +โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ +โ”‚ โ”‚ MySQL โ”‚ โ”‚ DB-Init โ”‚ โ”‚ Backup โ”‚ โ”‚ +โ”‚ โ”‚ :64306 โ”‚ โ”‚ (setup) โ”‚ โ”‚ System โ”‚ โ”‚ +โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ +โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ +``` + +### Storage Structure +``` +storage/azerothcore/ +โ”œโ”€โ”€ config/ # Server configuration files +โ”œโ”€โ”€ data/ # Game client data (maps, DBC files) +โ”œโ”€โ”€ logs/ # Server log files +โ”œโ”€โ”€ modules/ # Module source code and configs +โ”œโ”€โ”€ lua_scripts/ # Eluna Lua scripts +โ”œโ”€โ”€ mysql-data/ # Database files +โ””โ”€โ”€ backups/ # Automated database backups +``` + +--- + +## ๐Ÿ› ๏ธ Management Commands + +### Health Monitoring +```bash +# Check all containers +docker ps + +# View service logs +docker logs ac-worldserver -f +docker logs ac-authserver -f +docker logs ac-post-install -f + +# Check module installation +docker logs ac-modules --tail 50 +``` + +### Module Management +```bash +# Analyze module configuration +./scripts/configure-modules.sh + +# Setup Lua scripting environment +./scripts/setup-eluna.sh + +# Test Eluna scripts +docker exec ac-worldserver /bin/bash -c 'echo "reload eluna"' +``` + +### Database Operations +```bash +# Access database via phpMyAdmin +open http://localhost:8081 + +# Direct MySQL access +docker exec -it ac-mysql mysql -u root -p + +# Manual backup +docker exec ac-mysql mysqldump -u root -p --all-databases > backup.sql +``` + +--- + +## ๐Ÿ”ง Troubleshooting + +### Common Issues + +**Containers failing to start** +```bash +# Check container logs +docker logs + +# Verify network connectivity +docker network ls | grep azerothcore + +# Check port conflicts +ss -tulpn | grep -E "(3784|8215|8081|4201)" +``` + +**Module not working** +```bash +# Check if module is enabled +grep MODULE_NAME docker-compose-azerothcore-services.env + +# Verify module installation +ls storage/azerothcore/modules/ + +# Check configuration files +ls storage/azerothcore/config/mod_*.conf* +``` + +**Database connection issues** +```bash +# Verify MySQL is running +docker exec ac-mysql mysql -u root -p -e "SELECT 1;" + +# Check database initialization +docker logs ac-db-import +``` + +### Getting Help + +Run the configuration analysis tool for specific guidance: +```bash +./scripts/configure-modules.sh +``` + +--- + +## ๐Ÿ“š Additional Documentation + +- **[Module Configuration Requirements](docs/module-configuration-requirements.md)** - Detailed manual setup steps +- **[Lua Scripting Guide](storage/azerothcore/lua_scripts/README.md)** - Eluna development +- **[Deployment Scripts](scripts/README.md)** - Automation tools reference + +--- + +## ๐ŸŽฏ Next Steps After Installation + +1. **Test Client Connection** - Connect with WoW 3.3.5a client +2. **Spawn Required NPCs** - Use GM commands for service modules +3. **Apply Client Patches** - For mod-arac and mod-individual-progression +4. **Test Module Functionality** - Verify each module works as expected + +--- + +## ๐Ÿ“„ Implementation Credits + +This project builds upon: +- **[AzerothCore](https://github.com/azerothcore/azerothcore-wotlk)** - Core server application +- **[AzerothCore Docker Setup](https://github.com/coc0nut/AzerothCore-with-Playerbots-Docker-Setup)** - Initial containerization approach + +### Key Improvements +- โœ… **Fully Automated Setup** - Interactive configuration script +- โœ… **13 Enhanced Modules** - Complete gameplay enhancement suite +- โœ… **Production Ready** - Health checks, backups, monitoring +- โœ… **Cross-Platform** - Docker and Podman support +- โœ… **Comprehensive Documentation** - Clear setup and troubleshooting guides \ No newline at end of file diff --git a/docker-compose-azerothcore-services.env b/docker-compose-azerothcore-services.env index a1a2063..3ad813a 100644 --- a/docker-compose-azerothcore-services.env +++ b/docker-compose-azerothcore-services.env @@ -100,24 +100,24 @@ NETWORK_NAME=azerothcore PLAYERBOT_ENABLED=1 PLAYERBOT_MAX_BOTS=40 -# Module configuration (ALL DISABLED for clean baseline) -# Enable modules individually after testing compatibility -MODULE_PLAYERBOTS=0 -MODULE_AOE_LOOT=0 -MODULE_LEARN_SPELLS=0 -MODULE_FIREWORKS=0 -MODULE_INDIVIDUAL_PROGRESSION=0 +# Module configuration - ENABLED MODULES +# Selected modules for enhanced gameplay experience +MODULE_PLAYERBOTS=1 +MODULE_AOE_LOOT=1 +MODULE_LEARN_SPELLS=1 +MODULE_FIREWORKS=1 +MODULE_INDIVIDUAL_PROGRESSION=1 # Quality of Life Modules # NOTE: mod-ahbot has linking issues - undefined reference to 'Addmod_ahbotScripts()' MODULE_AHBOT=0 MODULE_AUTOBALANCE=0 -MODULE_TRANSMOG=0 +MODULE_TRANSMOG=1 MODULE_NPC_BUFFER=0 # Gameplay Enhancement Modules MODULE_DYNAMIC_XP=0 -MODULE_SOLO_LFG=0 +MODULE_SOLO_LFG=1 MODULE_1V1_ARENA=0 MODULE_PHASED_DUELS=0 @@ -129,16 +129,20 @@ MODULE_ACCOUNT_ACHIEVEMENTS=0 # Additional Modules Found in Config MODULE_AUTO_REVIVE=0 MODULE_GAIN_HONOR_GUARD=0 -MODULE_ELUNA=0 +MODULE_ELUNA=1 +MODULE_ARAC=1 MODULE_TIME_IS_TIME=0 MODULE_POCKET_PORTAL=0 MODULE_RANDOM_ENCHANTS=0 MODULE_SOLOCRAFT=0 MODULE_PVP_TITLES=0 MODULE_NPC_BEASTMASTER=0 -MODULE_NPC_ENCHANTER=0 +MODULE_NPC_ENCHANTER=1 MODULE_INSTANCE_RESET=0 MODULE_LEVEL_GRANT=0 +MODULE_ASSISTANT=1 +MODULE_REAGENT_BANK=1 +MODULE_BLACK_MARKET_AUCTION_HOUSE=1 # ============================================== # ADDITIONAL CONTAINER NAMES diff --git a/docker-compose-azerothcore-services.yml b/docker-compose-azerothcore-services.yml index 6ebaf0d..8b54da1 100644 --- a/docker-compose-azerothcore-services.yml +++ b/docker-compose-azerothcore-services.yml @@ -256,6 +256,7 @@ services: - ${STORAGE_PATH}/config:/azerothcore/env/dist/etc - ${STORAGE_PATH}/logs:/azerothcore/logs - ${STORAGE_PATH}/modules:/azerothcore/modules + - ${STORAGE_PATH}/lua_scripts:/azerothcore/lua_scripts restart: unless-stopped networks: - azerothcore @@ -323,6 +324,10 @@ services: - MODULE_NPC_ENCHANTER=${MODULE_NPC_ENCHANTER} - MODULE_INSTANCE_RESET=${MODULE_INSTANCE_RESET} - MODULE_LEVEL_GRANT=${MODULE_LEVEL_GRANT} + - MODULE_ARAC=${MODULE_ARAC} + - MODULE_ASSISTANT=${MODULE_ASSISTANT} + - MODULE_REAGENT_BANK=${MODULE_REAGENT_BANK} + - MODULE_BLACK_MARKET_AUCTION_HOUSE=${MODULE_BLACK_MARKET_AUCTION_HOUSE} # Database connection for SQL execution - CONTAINER_MYSQL=${CONTAINER_MYSQL} - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} @@ -437,6 +442,10 @@ services: echo 'Removing mod-eluna (disabled)...' rm -rf mod-eluna fi + if [ "$MODULE_ARAC" != "1" ] && [ -d "mod-arac" ]; then + echo 'Removing mod-arac (disabled)...' + rm -rf mod-arac + fi if [ "$MODULE_TIME_IS_TIME" != "1" ] && [ -d "mod-TimeIsTime" ]; then echo 'Removing mod-TimeIsTime (disabled)...' @@ -482,6 +491,18 @@ services: echo 'Removing mod-quest-count-level (disabled)...' rm -rf mod-quest-count-level fi + if [ "$MODULE_ASSISTANT" != "1" ] && [ -d "mod-assistant" ]; then + echo 'Removing mod-assistant (disabled)...' + rm -rf mod-assistant + fi + if [ "$MODULE_REAGENT_BANK" != "1" ] && [ -d "mod-reagent-bank" ]; then + echo 'Removing mod-reagent-bank (disabled)...' + rm -rf mod-reagent-bank + fi + if [ "$MODULE_BLACK_MARKET_AUCTION_HOUSE" != "1" ] && [ -d "mod-black-market" ]; then + echo 'Removing mod-black-market (disabled)...' + rm -rf mod-black-market + fi echo 'Installing enabled modules...' @@ -493,6 +514,7 @@ services: echo ' ๐Ÿšจ INCOMPATIBLE with standard AzerothCore - module will not function properly' echo ' ๐Ÿ”ง REBUILD REQUIRED: Container must be rebuilt with source-based compilation' echo ' ๐Ÿ“‹ POST-INSTALL: Requires manual account/character configuration' + echo ' ๐Ÿ”ฌ STATUS: IN TESTING - Currently under verification' git clone https://github.com/liyunfan1223/mod-playerbots.git mod-playerbots fi @@ -502,6 +524,7 @@ services: echo ' ๐Ÿ“– Project: https://github.com/azerothcore/mod-aoe-loot' echo ' โ„น๏ธ Allows looting multiple corpses with one action' echo ' ๐Ÿ”ง REBUILD REQUIRED: Container must be rebuilt with source-based compilation' + echo ' ๐Ÿ”ฌ STATUS: IN TESTING - Currently under verification' git clone https://github.com/azerothcore/mod-aoe-loot.git mod-aoe-loot fi @@ -511,6 +534,7 @@ services: echo ' ๐Ÿ“– Project: https://github.com/azerothcore/mod-learn-spells' echo ' โ„น๏ธ Automatically teaches class spells on level up' echo ' ๐Ÿ”ง REBUILD REQUIRED: Container must be rebuilt with source-based compilation' + echo ' ๐Ÿ”ฌ STATUS: IN TESTING - Currently under verification' git clone https://github.com/azerothcore/mod-learn-spells.git mod-learn-spells fi @@ -520,6 +544,7 @@ services: echo ' ๐Ÿ“– Project: https://github.com/azerothcore/mod-fireworks-on-level' echo ' โ„น๏ธ Displays fireworks when players level up' echo ' ๐Ÿ”ง REBUILD REQUIRED: Container must be rebuilt with source-based compilation' + echo ' ๐Ÿ”ฌ STATUS: IN TESTING - Currently under verification' git clone https://github.com/azerothcore/mod-fireworks-on-level.git mod-fireworks-on-level fi @@ -531,6 +556,7 @@ services: echo ' โœ… AUTO-CONFIG: Automatically sets EnablePlayerSettings=1 and DBC.EnforceItemAttributes=0' echo ' ๐Ÿ”ง REBUILD REQUIRED: Container must be rebuilt with source-based compilation' echo ' ๐Ÿ“ Optional client files available in optional/ directory' + echo ' ๐Ÿ”ฌ STATUS: IN TESTING - Currently under verification' git clone https://github.com/ZhengPeiRu21/mod-individual-progression.git mod-individual-progression fi @@ -553,7 +579,11 @@ services: fi if [ "$MODULE_TRANSMOG" = "1" ] && [ ! -d "mod-transmog" ]; then - echo 'Installing mod-transmog...' + echo '๐ŸŽญ Installing mod-transmog...' + echo ' ๐Ÿ“– Project: https://github.com/azerothcore/mod-transmog' + echo ' โ„น๏ธ Allows appearance customization of equipment' + echo ' ๐Ÿ”ง REBUILD REQUIRED: Container must be rebuilt with source-based compilation' + echo ' ๐Ÿ”ฌ STATUS: IN TESTING - Currently under verification' git clone https://github.com/azerothcore/mod-transmog.git mod-transmog fi @@ -574,6 +604,7 @@ services: echo ' โ„น๏ธ Allows dungeon finder for solo players and small groups' echo ' ๐Ÿ”ง REBUILD REQUIRED: Container must be rebuilt with source-based compilation' echo ' ๐Ÿ’ก Pairs perfectly with mod-solocraft and mod-autobalance' + echo ' ๐Ÿ”ฌ STATUS: IN TESTING - Currently under verification' git clone https://github.com/azerothcore/mod-solo-lfg.git mod-solo-lfg fi @@ -619,9 +650,22 @@ services: fi if [ "$MODULE_ELUNA" = "1" ] && [ ! -d "mod-eluna" ]; then - echo 'Installing mod-eluna...' + echo '๐Ÿ–ฅ๏ธ Installing mod-eluna...' + echo ' ๐Ÿ“– Project: https://github.com/azerothcore/mod-eluna' + echo ' โ„น๏ธ Lua scripting engine for custom server functionality' + echo ' ๐Ÿ”ง REBUILD REQUIRED: Container must be rebuilt with source-based compilation' + echo ' ๐Ÿ”ฌ STATUS: IN TESTING - Currently under verification' git clone https://github.com/azerothcore/mod-eluna.git mod-eluna fi + if [ "$MODULE_ARAC" = "1" ] && [ ! -d "mod-arac" ]; then + echo '๐ŸŒˆ Installing mod-arac...' + echo ' ๐Ÿ“– Project: https://github.com/heyitsbench/mod-arac' + echo ' โ„น๏ธ All Races All Classes - Removes class restrictions' + echo ' ๐Ÿšจ CRITICAL: Requires DBC file updates and client patch!' + echo ' ๐Ÿ“‹ POST-INSTALL: Apply Patch-A.MPQ to client WoW/Data/ directory' + echo ' ๐Ÿ”ฌ STATUS: IN TESTING - Currently under verification' + git clone https://github.com/heyitsbench/mod-arac.git mod-arac + fi if [ "$MODULE_TIME_IS_TIME" = "1" ] && [ ! -d "mod-TimeIsTime" ]; then echo 'Installing mod-TimeIsTime...' @@ -658,7 +702,11 @@ services: fi if [ "$MODULE_NPC_ENCHANTER" = "1" ] && [ ! -d "mod-npc-enchanter" ]; then - echo 'Installing mod-npc-enchanter...' + echo 'โœจ Installing mod-npc-enchanter...' + echo ' ๐Ÿ“– Project: https://github.com/azerothcore/mod-npc-enchanter' + echo ' โ„น๏ธ NPC that provides enchanting services' + echo ' ๐Ÿ”ง REBUILD REQUIRED: Container must be rebuilt with source-based compilation' + echo ' ๐Ÿ”ฌ STATUS: IN TESTING - Currently under verification' git clone https://github.com/azerothcore/mod-npc-enchanter.git mod-npc-enchanter fi @@ -671,6 +719,30 @@ services: echo 'Installing mod-quest-count-level...' git clone https://github.com/michaeldelago/mod-quest-count-level.git mod-quest-count-level fi + if [ "$MODULE_ASSISTANT" = "1" ] && [ ! -d "mod-assistant" ]; then + echo '๐Ÿค– Installing mod-assistant...' + echo ' ๐Ÿ“– Project: https://github.com/azerothcore/mod-assistant' + echo ' โ„น๏ธ Provides AI-powered assistance and automation features' + echo ' ๐Ÿ”ง REBUILD REQUIRED: Container must be rebuilt with source-based compilation' + echo ' ๐Ÿ”ฌ STATUS: IN TESTING - Currently under verification' + git clone https://github.com/azerothcore/mod-assistant.git mod-assistant + fi + if [ "$MODULE_REAGENT_BANK" = "1" ] && [ ! -d "mod-reagent-bank" ]; then + echo '๐Ÿฆ Installing mod-reagent-bank...' + echo ' ๐Ÿ“– Project: https://github.com/azerothcore/mod-reagent-bank' + echo ' โ„น๏ธ Adds reagent bank functionality similar to retail WoW' + echo ' ๐Ÿ”ง REBUILD REQUIRED: Container must be rebuilt with source-based compilation' + echo ' ๐Ÿ”ฌ STATUS: IN TESTING - Currently under verification' + git clone https://github.com/azerothcore/mod-reagent-bank.git mod-reagent-bank + fi + if [ "$MODULE_BLACK_MARKET_AUCTION_HOUSE" = "1" ] && [ ! -d "mod-black-market" ]; then + echo '๐Ÿดโ€โ˜ ๏ธ Installing mod-black-market...' + echo ' ๐Ÿ“– Project: https://github.com/azerothcore/mod-black-market' + echo ' โ„น๏ธ Black Market Auction House for rare and unique items' + echo ' ๐Ÿ”ง REBUILD REQUIRED: Container must be rebuilt with source-based compilation' + echo ' ๐Ÿ”ฌ STATUS: IN TESTING - Currently under verification' + git clone https://github.com/azerothcore/mod-black-market.git mod-black-market + fi echo 'Managing configuration files...' @@ -750,6 +822,9 @@ services: if [ "$MODULE_ELUNA" != "1" ]; then rm -f /azerothcore/env/dist/etc/mod_LuaEngine.conf* fi + if [ "$MODULE_ARAC" != "1" ]; then + rm -f /azerothcore/env/dist/etc/arac.conf* + fi if [ "$MODULE_TIME_IS_TIME" != "1" ]; then rm -f /azerothcore/env/dist/etc/mod-time_is_time.conf* @@ -787,6 +862,18 @@ services: rm -f /azerothcore/env/dist/etc/levelGrant.conf* fi + if [ "$MODULE_ASSISTANT" != "1" ]; then + rm -f /azerothcore/env/dist/etc/mod_assistant.conf* + fi + + if [ "$MODULE_REAGENT_BANK" != "1" ]; then + rm -f /azerothcore/env/dist/etc/mod_reagent_bank.conf* + fi + + if [ "$MODULE_BLACK_MARKET_AUCTION_HOUSE" != "1" ]; then + rm -f /azerothcore/env/dist/etc/mod_black_market.conf* + fi + # Install configuration files for enabled modules for module_dir in mod-*; do if [ -d "$$module_dir" ]; then @@ -942,6 +1029,9 @@ services: if [ "$MODULE_ELUNA" = "1" ] && [ -d "mod-eluna" ]; then execute_module_sql "mod-eluna" "Eluna" fi + if [ "$MODULE_ARAC" = "1" ] && [ -d "mod-arac" ]; then + execute_module_sql "mod-arac" "All Races All Classes" + fi if [ "$MODULE_TIME_IS_TIME" = "1" ] && [ -d "mod-TimeIsTime" ]; then execute_module_sql "mod-TimeIsTime" "Time Is Time" @@ -978,6 +1068,15 @@ services: if [ "$MODULE_LEVEL_GRANT" = "1" ] && [ -d "mod-quest-count-level" ]; then execute_module_sql "mod-quest-count-level" "Level Grant" fi + if [ "$MODULE_ASSISTANT" = "1" ] && [ -d "mod-assistant" ]; then + execute_module_sql "mod-assistant" "Assistant" + fi + if [ "$MODULE_REAGENT_BANK" = "1" ] && [ -d "mod-reagent-bank" ]; then + execute_module_sql "mod-reagent-bank" "Reagent Bank" + fi + if [ "$MODULE_BLACK_MARKET_AUCTION_HOUSE" = "1" ] && [ -d "mod-black-market" ]; then + execute_module_sql "mod-black-market" "Black Market" + fi echo 'SQL execution complete.' @@ -1032,6 +1131,7 @@ services: [ "$MODULE_AUTO_REVIVE" = "1" ] && ENABLED_MODULES="$ENABLED_MODULES mod-auto-revive" [ "$MODULE_GAIN_HONOR_GUARD" = "1" ] && ENABLED_MODULES="$ENABLED_MODULES mod-gain-honor-guard" [ "$MODULE_ELUNA" = "1" ] && ENABLED_MODULES="$ENABLED_MODULES mod-eluna" + [ "$MODULE_ARAC" = "1" ] && ENABLED_MODULES="$ENABLED_MODULES mod-arac" [ "$MODULE_TIME_IS_TIME" = "1" ] && ENABLED_MODULES="$ENABLED_MODULES mod-time-is-time" [ "$MODULE_POCKET_PORTAL" = "1" ] && ENABLED_MODULES="$ENABLED_MODULES mod-pocket-portal" [ "$MODULE_RANDOM_ENCHANTS" = "1" ] && ENABLED_MODULES="$ENABLED_MODULES mod-random-enchants" @@ -1041,6 +1141,9 @@ services: [ "$MODULE_NPC_ENCHANTER" = "1" ] && ENABLED_MODULES="$ENABLED_MODULES mod-npc-enchanter" [ "$MODULE_INSTANCE_RESET" = "1" ] && ENABLED_MODULES="$ENABLED_MODULES mod-instance-reset" [ "$MODULE_LEVEL_GRANT" = "1" ] && ENABLED_MODULES="$ENABLED_MODULES mod-quest-count-level" + [ "$MODULE_ASSISTANT" = "1" ] && ENABLED_MODULES="$ENABLED_MODULES mod-assistant" + [ "$MODULE_REAGENT_BANK" = "1" ] && ENABLED_MODULES="$ENABLED_MODULES mod-reagent-bank" + [ "$MODULE_BLACK_MARKET_AUCTION_HOUSE" = "1" ] && ENABLED_MODULES="$ENABLED_MODULES mod-black-market" if [ -n "$ENABLED_MODULES" ]; then ENABLED_COUNT=$(echo $ENABLED_MODULES | wc -w) diff --git a/docs/module-configuration-requirements.md b/docs/module-configuration-requirements.md new file mode 100644 index 0000000..0d37c0b --- /dev/null +++ b/docs/module-configuration-requirements.md @@ -0,0 +1,282 @@ +# AzerothCore Module Configuration Requirements + +This document outlines all manual configuration steps required for the enabled modules that cannot be automated through Docker container processes. + +## ๐Ÿšจ Critical Compatibility Issues + +### MODULE_PLAYERBOTS - INCOMPATIBLE WITH STANDARD AZEROTHCORE + +**โŒ BREAKING ISSUE**: mod-playerbots requires a completely different AzerothCore branch: +- **Required Branch**: `liyunfan1223/azerothcore-wotlk/tree/Playerbot` +- **Current Setup**: Standard AzerothCore (INCOMPATIBLE) + +**Resolution Options**: +1. **Switch to Playerbot Branch** (Recommended for bot-focused servers) + - Fork the Playerbot branch + - Rebuild entire server stack with Playerbot core + - Note: May be incompatible with some other modules + +2. **Disable Playerbots** (Recommended for standard servers) + - Set `MODULE_PLAYERBOTS=0` in environment file + - Continue with standard AzerothCore + +--- + +## ๐Ÿ“ฆ Client-Side Patch Requirements + +### MODULE_INDIVIDUAL_PROGRESSION + +**Required Client Patches** (stored in: `${STORAGE_PATH}/modules/mod-individual-progression/optional/`): + +| Patch File | Description | Required | +|------------|-------------|----------| +| `patch-V.mpq` | Vanilla crafting and recipe restoration | โœ… Yes | +| `patch-J.mpq` | Vanilla login screen | โŒ Optional | +| `patch-U.mpq` | Vanilla loading screens | โŒ Optional | +| `patch-S.mpq` | Alternative WotLK mana costs | โŒ Don't use with patch-V | + +**Installation**: Players must copy required patches to their `WoW/Data/` directory. + +### MODULE_ARAC (All Races All Classes) + +**Required Client Patch**: +- **File**: `Patch-A.MPQ` +- **Location**: `${STORAGE_PATH}/modules/mod-arac/patch-contents/` +- **Installation**: Players must copy to `WoW/Data/` directory + +**Server-Side**: DBC files are automatically applied during module installation. + +--- + +## โš™๏ธ Critical Server Configuration Changes + +### MODULE_INDIVIDUAL_PROGRESSION + +**Required worldserver.conf Changes**: +```ini +# CRITICAL - Required for progress saving +EnablePlayerSettings = 1 + +# CRITICAL - Required for item stat overrides +DBC.EnforceItemAttributes = 0 +``` + +**File Location**: `${STORAGE_PATH}/config/worldserver.conf` + +### MODULE_AOE_LOOT + +**Required worldserver.conf Optimization**: +```ini +# Prevent corpse cleanup issues with AoE looting +# Default: 0.5, Required: 0.01 or lower +Rate.Corpse.Decay.Looted = 0.01 +``` + +--- + +## ๐Ÿค– Manual NPC Spawning Requirements + +The following modules require manual NPC spawning using GM commands: + +### MODULE_TRANSMOG +``` +.npc add 190010 +``` +**Recommended Locations**: Major cities (Stormwind, Orgrimmar, Ironforge, Undercity) + +### MODULE_NPC_ENCHANTER +``` +.npc add [enchanter_npc_id] +``` +**Note**: Check module documentation for specific NPC ID + +### MODULE_REAGENT_BANK +``` +.npc add 290011 +``` +**Recommended Locations**: Major cities near banks + +### MODULE_ASSISTANT +``` +.npc add [assistant_npc_id] +``` +**Note**: Check module documentation for specific NPC ID + +**Requirements**: +- GM account with level 3+ permissions +- Access to worldserver console or in-game GM commands + +--- + +## ๐Ÿ’พ Database Backup Requirements + +**CRITICAL**: The following modules modify core database tables and require backup: + +- **MODULE_ARAC**: Modifies race/class restrictions +- **MODULE_INDIVIDUAL_PROGRESSION**: Adds progression tracking tables + +**Backup Command**: +```bash +docker exec ac-mysql mysqldump -u root -p${MYSQL_ROOT_PASSWORD} --all-databases > backup-$(date +%Y%m%d-%H%M%S).sql +``` + +--- + +## ๐Ÿ–ฅ๏ธ Eluna Lua Scripting Setup + +### MODULE_ELUNA - Complete Setup + +**Automated Setup Available**: +```bash +./scripts/setup-eluna.sh +``` + +**Manual Configuration Requirements**: +- **Script Directory**: `${STORAGE_PATH}/lua_scripts/` (volume mounted automatically) +- **English DBC Files**: Recommended for full functionality +- **Container Integration**: Scripts loaded automatically on worldserver start + +**Example Scripts Provided**: +- `welcome.lua` - Player login welcome messages +- `server_info.lua` - Custom `.info` and `.serverinfo` commands +- `level_rewards.lua` - Milestone rewards for leveling +- `init.lua` - Script documentation and loader + +**Key Configuration** (`mod_LuaEngine.conf`): +```ini +Eluna.ScriptPath = "lua_scripts" +Eluna.AutoReload = false # Enable only for development +Eluna.BytecodeCache = true # Performance optimization +Eluna.TraceBack = false # Enable for debugging +``` + +**Important Compatibility Notes**: +- โš ๏ธ **AzerothCore mod-eluna is NOT compatible with standard Eluna scripts** +- Scripts must be written specifically for AzerothCore's mod-eluna API +- Standard Eluna community scripts will NOT work + +**Script Management Commands**: +- `.reload eluna` - Reload all Lua scripts +- `.lua [code]` - Execute Lua code directly (if enabled) + +--- + +## ๐Ÿ”ง Module-Specific Configuration Files + +### MODULE_PLAYERBOTS - playerbots.conf +**Key Settings**: +- `MinRandomBots = 500` (Default - reduce for performance) +- `MaxRandomBots = 500` (Default - reduce for performance) +- RandomBot account management settings + +### MODULE_AOE_LOOT - mod_aoe_loot.conf +**Key Settings**: +- Loot range configuration (default: 55.0) +- Group behavior settings + +### MODULE_LEARN_SPELLS - mod_learnspells.conf +**Key Settings**: +- Maximum level limits +- First login behavior + +### MODULE_INDIVIDUAL_PROGRESSION - individual_progression.conf +**Key Settings**: +- Era progression rules +- Content unlock thresholds + +### MODULE_TRANSMOG - transmog.conf +**Key Settings**: +- Transmogrification rules +- Cost settings +- Restriction configurations + +--- + +## ๐ŸŽฏ Performance Considerations + +### MODULE_PLAYERBOTS +- **Impact**: High - Can run thousands of AI bots +- **Recommendation**: Start with low bot counts (50-100) +- **Monitoring**: CPU usage, memory consumption, database load + +### MODULE_ELUNA +- **Impact**: Variable - Depends on Lua script complexity +- **Requirement**: English DBC files for full functionality +- **Script Location**: `${STORAGE_PATH}/lua_scripts/` (automatically mounted) +- **Setup**: Run `./scripts/setup-eluna.sh` to create example scripts +- **Monitoring**: Script execution times +- **Reloading**: Use `.reload eluna` command in worldserver console + +--- + +## ๐Ÿ“‹ Deployment Checklist + +### Pre-Deployment +- [ ] **Critical**: Resolve Playerbots compatibility (switch branch OR disable) +- [ ] Backup database (if using ARAC or INDIVIDUAL_PROGRESSION) +- [ ] Update worldserver.conf with required settings +- [ ] Test configuration in development environment + +### During Deployment +- [ ] Rebuild containers: `./scripts/rebuild-with-modules.sh` +- [ ] Verify module compilation success +- [ ] Apply any remaining SQL scripts manually +- [ ] Create GM account for NPC spawning + +### Post-Deployment +- [ ] Spawn required NPCs using GM commands +- [ ] Test each module's functionality +- [ ] Distribute client patches to players +- [ ] Monitor server performance +- [ ] Adjust module configurations as needed + +--- + +## ๐Ÿšจ Known Compatibility Issues + +### AzerothCore Version Dependencies +- **MODULE_TRANSMOG**: Requires minimum commit `b6cb9247ba96a862ee274c0765004e6d2e66e9e4` +- **MODULE_PLAYERBOTS**: Requires custom Playerbot branch (incompatible with standard) + +### Module Conflicts +- **INDIVIDUAL_PROGRESSION + Standard AzerothCore**: patch-S.mpq conflicts with patch-V.mpq +- **ELUNA Scripts**: AzerothCore mod-eluna is NOT compatible with standard Eluna scripts + +### Database Conflicts +- **MODULE_TRANSMOG**: Must delete conflicting npc_text IDs (50000, 50001) if upgrading + +--- + +## ๐Ÿ“ž Support and Resources + +### Module Documentation +Each module's GitHub repository contains detailed configuration documentation: +- Configuration file examples (`.conf.dist` files) +- SQL requirements +- Client-side patch information + +### Testing Recommendations +1. **Development Environment**: Test all modules in non-production environment first +2. **Staged Rollout**: Enable modules incrementally to identify issues +3. **Player Communication**: Provide clear client patch installation instructions +4. **Rollback Plan**: Maintain database backups for quick rollback if needed + +--- + +## ๐Ÿ”„ Configuration Update Script + +Run the module configuration analysis script to check your current setup: + +```bash +./scripts/configure-modules.sh +``` + +This script will: +- Analyze your enabled modules +- Identify missing configuration requirements +- Provide step-by-step resolution guidance +- Check for compatibility issues + +--- + +*Last Updated: $(date)* \ No newline at end of file diff --git a/readme-old.md b/readme-old.md new file mode 100644 index 0000000..e69de29 diff --git a/readme.md b/readme.md deleted file mode 100644 index 4a5df79..0000000 --- a/readme.md +++ /dev/null @@ -1,1456 +0,0 @@ -# AzerothCore Docker/Podman Stack - -A complete containerized deployment of AzerothCore WoW 3.3.5a (Wrath of the Lich King) private server with Playerbot functionality, Eluna scripting, and automated management features. - -## Implementation Credits - -This project is a Docker/Podman implementation based on: -- **[AzerothCore](https://github.com/azerothcore/azerothcore-wotlk)** - The open-source MMORPG server application for World of Warcraft -- **[AzerothCore with Playerbots Docker Setup](https://github.com/coc0nut/AzerothCore-with-Playerbots-Docker-Setup)** - Docker configuration inspiration and Playerbot integration approach - -### Key Improvements in This Implementation -- **Logger Issue Resolution**: Fixed worldserver startup issues with proper logger configuration -- **Dynamic URL Generation**: Web interfaces automatically detect external URLs for deployment flexibility -- **Port Collision Prevention**: All external ports optimized to avoid common development tool conflicts -- **Enhanced Security**: Comprehensive security settings for all web interfaces (PHPMyAdmin) -- **Full Environment Variable Configuration**: No hardcoded values, everything configurable via .env -- **External Domain Support**: Configurable base URLs for custom domain deployment -- **Multi-Runtime Support**: Works with both Docker and Podman -- **Automated Database Initialization**: Complete schema import and setup automation -- **Comprehensive Health Checks**: Built-in service monitoring and restart policies -- **Automated Service Restart**: Post-install automatically restarts services with Docker/Podman support -- **Automated Backup System**: Scheduled backups with configurable retention -- **Production-Ready Security**: Advanced security configurations and best practices - -## Table of Contents -- [Overview](#overview) -- [Features](#features) -- [Requirements](#requirements) -- [Project Structure](#project-structure) -- [Container Architecture](#container-architecture) -- [Initial Setup](#initial-setup) -- [Configuration](#configuration) -- [Volume Management](#volume-management) -- [Maintenance](#maintenance) -- [Backup System](#backup-system) -- [Deployment Scripts](#deployment-scripts) -- [Troubleshooting](#troubleshooting) -- [Security Considerations](#security-considerations) -- [Available Modules](#available-modules) - -## Overview - -This project provides a production-ready AzerothCore deployment using Docker/Podman containers, building upon the foundational work of the [AzerothCore project](https://github.com/azerothcore/azerothcore-wotlk) and incorporating containerization patterns from [coc0nut's Docker setup](https://github.com/coc0nut/AzerothCore-with-Playerbots-Docker-Setup). - -### What This Implementation Provides -- **Enhanced Configuration**: All settings externalized to environment variables -- **Container Runtime Flexibility**: Works with both Docker and Podman -- **Production Features**: Health checks, automated backups, log management -- **Improved Security**: No hardcoded passwords, configurable network isolation -- **Operational Tools**: Comprehensive maintenance scripts and troubleshooting guides -- **Full Documentation**: Complete setup, configuration, and maintenance procedures - -### Core Components -- Automated database initialization and imports -- Playerbot support for solo play (using [liyunfan1223's mod-playerbots](https://github.com/liyunfan1223/mod-playerbots)) -- Eluna Lua scripting engine -- Automated backups -- Full configuration through environment variables -- Support for both Docker and Podman runtimes -- Portainer compatibility - -### Version Information -- **AzerothCore**: 3.3.5a (master branch) from [azerothcore/azerothcore-wotlk](https://github.com/azerothcore/azerothcore-wotlk) -- **Playerbot Module**: [liyunfan1223/mod-playerbots](https://github.com/liyunfan1223/mod-playerbots) -- **MySQL**: 8.0 -- **Game Client**: World of Warcraft 3.3.5a (Build 12340) -- **Base Images**: Official AzerothCore Docker images - -## Features - -- โœ… **Fully Containerized**: All components run in isolated containers -- โœ… **Automated Setup**: Database creation, schema import, and configuration handled automatically -- โœ… **Auto-Restart Services**: Post-install automatically restarts authserver/worldserver (Docker/Podman compatible) -- โœ… **Playerbot Integration**: AI-controlled bots for solo/small group play -- โœ… **Eluna Support**: Lua scripting for custom content -- โœ… **Automated Backups**: Scheduled database backups with retention policies -- โœ… **Environment-Based Config**: All settings configurable via .env file -- โœ… **Health Monitoring**: Built-in health checks for all services -- โœ… **Network Isolation**: Custom bridge network for container communication -- โœ… **Persistent Storage**: Named volumes for data persistence - - -## Requirements - -### System Requirements -- **OS**: Linux (Ubuntu 20.04+, Debian 11+, RHEL 8+, or similar) -- **RAM**: Minimum 4GB, Recommended 8GB+ -- **Storage**: 20GB minimum (50GB+ recommended with client data) -- **CPU**: 2+ cores recommended -- **Network**: Static IP recommended for external access - -### Software Requirements -- **Container Runtime**: Docker 20.10+ OR Podman 3.0+ -- **Compose Tool**: docker-compose 1.29+ OR podman-compose 1.0+ -- **MySQL Client**: For manual database operations (optional) -- **Git**: For cloning repositories (optional) - -### MySQL MCP Requirements -- **Note**: To use the MySQL MCP (Model Context Protocol) with this project, the database must be running -- **Database Access**: The MySQL container must be accessible on port 64306 (configurable in environment files) -- **Connection Details**: MCP will need the database credentials configured in the environment files - -### Game Client Requirements -- **WoW Client**: Version 3.3.5a (Build 12340) -- **Client Data**: Extracted maps, vmaps, mmaps, and DBC files - -## Project Structure - -``` -acore-compose/ -โ”œโ”€โ”€ docker-compose-azerothcore-database.yml # Database layer -โ”œโ”€โ”€ docker-compose-azerothcore-database.env # Database configuration -โ”œโ”€โ”€ docker-compose-azerothcore-services.yml # Game services layer -โ”œโ”€โ”€ docker-compose-azerothcore-services.env # Services configuration -โ”œโ”€โ”€ docker-compose-azerothcore-tools.yml # Management tools layer -โ”œโ”€โ”€ docker-compose-azerothcore-tools.env # Tools configuration -โ”œโ”€โ”€ scripts/ # Deployment, cleanup, and backup automation -โ”œโ”€โ”€ storage/ # Unified storage root (configurable via STORAGE_ROOT) -โ”‚ โ””โ”€โ”€ azerothcore/ # All persistent data (database, configs, tools) -โ”‚ โ”œโ”€โ”€ backups/ # Database backups with automated retention -โ”‚ โ”‚ โ”œโ”€โ”€ hourly/ # Hourly backup snapshots -โ”‚ โ”‚ โ””โ”€โ”€ daily/ # Daily backup snapshots -โ”‚ โ”œโ”€โ”€ cache/ # Application cache and temporary files -โ”‚ โ”œโ”€โ”€ config/ # Server configuration files (.conf) -โ”‚ โ”œโ”€โ”€ data/ # Game client data (maps, vmaps, mmaps, dbc) -โ”‚ โ”‚ โ”œโ”€โ”€ Cameras/ # Camera configuration files -โ”‚ โ”‚ โ”œโ”€โ”€ dbc/ # Database Client files -โ”‚ โ”‚ โ”œโ”€โ”€ maps/ # Game world maps -โ”‚ โ”‚ โ”œโ”€โ”€ mmaps/ # Movement maps for pathfinding -โ”‚ โ”‚ โ””โ”€โ”€ vmaps/ # Visual maps for line-of-sight -โ”‚ โ”œโ”€โ”€ install-markers/ # Installation state tracking -โ”‚ โ”œโ”€โ”€ logs/ # Server log files -โ”‚ โ”œโ”€โ”€ modules/ # AzerothCore modules and extensions -โ”‚ โ””โ”€โ”€ mysql-data/ # MySQL database files -โ””โ”€โ”€ readme.md # This documentation -``` - -## Container Architecture - -### Service Containers - -| Container | Image | Purpose | Exposed Ports | -|-----------|-------|---------|---------------| -| **Database Layer** | -| `ac-mysql` | mysql:8.0 | MySQL database server | 64306:3306 | -| `ac-db-init` | mysql:8.0 | Database initialization (one-time) | - | -| `ac-db-import` | acore/ac-wotlk-db-import:14.0.0-dev | Database import (one-time) | - | -| `ac-backup` | mysql:8.0 | Automated backup service with GitHub scripts | - | -| **Services Layer** | -| `ac-client-data` | alpine:latest | Game client data download/extraction | - | -| `ac-authserver` | acore/ac-wotlk-authserver:14.0.0-dev | Authentication server | 3784:3724 | -| `ac-worldserver` | acore/ac-wotlk-worldserver:14.0.0-dev | Game world server | 8215:8085, 7778:7878 | -| `ac-eluna` | acore/eluna-ts:master | Lua scripting engine | - | -| `ac-modules` | alpine/git:latest | Module management with GitHub script download | - | -| `ac-post-install` | alpine:latest | Automatic post-installation configuration | - | -| **Tools Layer** | -| `ac-phpmyadmin` | phpmyadmin/phpmyadmin:latest | Database management web UI | 8081:80 | -| `ac-keira3` | uprightbass360/keira3:latest | Production database editor with API | 4201:8080 | - -### Container Relationships - -```mermaid -graph TD - %% Database Layer - A[ac-mysql] --> B[ac-db-init] - A --> C[ac-db-import] - A --> D[ac-backup] - - %% Services Layer - E[ac-client-data] --> F[ac-authserver] - F --> G[ac-worldserver] - G --> H[ac-eluna] - I[ac-modules] --> J[ac-post-install] - - %% Tools Layer (External) - K[ac-phpmyadmin] -.->|connects to| A - L[ac-keira3] -.->|connects to| A - - %% Database dependencies - A -.->|provides data| F - A -.->|provides data| G - - %% Layer grouping - subgraph "Database Layer" - A - B - C - D - end - - subgraph "Services Layer" - E - F - G - H - I - J - end - - subgraph "Tools Layer" - K - L - end -``` - -**Layer Dependencies**: -- **Database Layer**: Independent, starts first -- **Services Layer**: Depends on database layer being ready -- **Tools Layer**: Connects to database layer externally - -**Container Dependencies**: -- `ac-worldserver` depends on: `ac-authserver`, `ac-client-data` -- `ac-post-install` depends on: `ac-modules` -- All game services connect to: `ac-mysql` - -### Network Architecture -- **Network Name**: `azerothcore` -- **Type**: Bridge network -- **Subnet**: 172.28.0.0/16 (configurable) -- **Internal DNS**: Container names resolve to IPs - -## Initial Setup - -### Quick Setup Script (Recommended) - -For the easiest setup experience, use the interactive setup script: - -```bash -# Clone the repository -git clone https://github.com/uprightbass360/acore-compose.git -cd acore-compose - -# Run the interactive setup script -./scripts/setup-server.sh -``` - -The setup script will: -- โœ… **Guide you through deployment type selection** (Local, LAN, or Public server) -- โœ… **Auto-detect your network configuration** (LAN IP detection) -- โœ… **Validate all inputs** (IP addresses, ports, paths) -- โœ… **Generate custom environment files** (`*-custom.env`) with your settings -- โœ… **Provide deployment commands** tailored to your configuration -- โœ… **Show client configuration** with exact realmlist.wtf settings - -**Generated Files**: -- `docker-compose-azerothcore-database-custom.env` -- `docker-compose-azerothcore-services-custom.env` -- `docker-compose-azerothcore-tools-custom.env` - -**Deploy with custom configuration**: -```bash -# Database layer -docker compose --env-file docker-compose-azerothcore-database-custom.env -f docker-compose-azerothcore-database.yml up -d - -# Services layer -docker compose --env-file docker-compose-azerothcore-services-custom.env -f docker-compose-azerothcore-services.yml up -d - -# Tools layer (optional) -docker compose --env-file docker-compose-azerothcore-tools-custom.env -f docker-compose-azerothcore-tools.yml up -d -``` - -### Manual Setup - -### Step 1: Clone and Configure - -```bash -# Clone the repository -git clone https://github.com/uprightbass360/acore-compose.git -cd acore-compose - -# Environment files are pre-configured with defaults -# Modify the relevant .env files for your deployment: -# - docker-compose-azerothcore-database.env: Database settings -# - docker-compose-azerothcore-services.env: Game server settings -# - docker-compose-azerothcore-tools.env: Management tools settings - -# IMPORTANT: Configure storage location for your environment -# For local development (default): -# STORAGE_ROOT=./storage -# For production with NFS: -# STORAGE_ROOT=/nfs/containers -# For custom mount: -# STORAGE_ROOT=/mnt/azerothcore-data - -# IMPORTANT: Configure server address for client connections -# Edit docker-compose-azerothcore-services.env: -# SERVER_ADDRESS=your-server-ip-or-domain -# REALM_PORT=8215 -``` - -### Server Address Configuration - -Configure the external server address that WoW clients will use to connect: - -**Environment Variables** (in `docker-compose-azerothcore-services.env`): -- `SERVER_ADDRESS`: The IP address or domain name clients use to connect -- `REALM_PORT`: The external port clients connect to (default: 8215) - -**Configuration Examples**: -```bash -# Local development (single machine) -SERVER_ADDRESS=127.0.0.1 -REALM_PORT=8215 - -# LAN server (accessible on local network) -SERVER_ADDRESS=192.168.1.100 -REALM_PORT=8215 - -# Public server (internet-accessible) -SERVER_ADDRESS=your-domain.com -# or -SERVER_ADDRESS=203.0.113.100 -REALM_PORT=8215 -``` - -**Port Configuration**: -- **External Ports** (client-facing): Configured in environment file - - `REALM_PORT=8215` - World server port for client connections - - `AUTH_EXTERNAL_PORT=3784` - Auth server port - - `SOAP_EXTERNAL_PORT=7778` - SOAP API port -- **Internal Ports** (container-side): Fixed and mapped automatically - - Auth server: 3724 (mapped to external 3784) - - World server: 8085 (mapped to external 8215) - - SOAP API: 7878 (mapped to external 7778) - -**Configuration Workflow**: -1. **Edit Environment File**: Modify `docker-compose-azerothcore-services.env` - ```bash - # Update these values for your environment - SERVER_ADDRESS=your-server-address - REALM_PORT=8215 - ``` -2. **Restart Services**: Changes take effect after restart - ```bash - docker compose --env-file docker-compose-azerothcore-services.env -f docker-compose-azerothcore-services.yml restart - ``` -3. **Verify Configuration**: Check that realmlist was updated - ```bash - docker exec ac-mysql mysql -uroot -pazerothcore123 -e "USE acore_auth; SELECT address, port FROM realmlist WHERE id=1;" - ``` -4. **Update Client**: Edit your WoW client's `realmlist.wtf` with the new server address - -**Important Notes**: -- The post-install automation automatically updates the database realmlist -- Changes are persistent and survive container restarts -- Ensure firewall allows traffic on configured ports -- For public servers, configure port forwarding on your router - -### Step 2: Deploy the Stack - -Deploy services in the correct order: - -```bash -# Step 1: Deploy database layer -docker compose --env-file docker-compose-azerothcore-database.env -f docker-compose-azerothcore-database.yml up -d -#The database import happens automatically via the `ac-db-import` container. Monitor progress: -docker logs ac-db-init -f # Watch database initialization -# Check import status -docker logs ac-db-import -f -# Verify databases were created -docker exec ac-mysql mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e "SHOW DATABASES;" -``` - -```bash -# Step 2: Wait for database initialization, then deploy services -docker compose --env-file docker-compose-azerothcore-services.env -f docker-compose-azerothcore-services.yml up -d -docker logs ac-client-data -f # Watch data download/extraction -``` - -The server automatically downloads and extracts game data on first run. The `ac-client-data` service will: -- Download the latest client data from wowgaming/client-data releases (~15GB) -- Extract maps, vmaps, mmaps, and DBC files -- Cache the download for future deployments -- Verify data integrity -- This can take around 20 minutes to complete depending on your storage - -No manual data extraction is required, but ensure you have sufficient disk space and bandwidth. - -```bash -# Step 3: Deploy management tools (optional) -docker compose --env-file docker-compose-azerothcore-tools.env -f docker-compose-azerothcore-tools.yml up -d -``` - -### Step 3: Automatic Post-Installation Configuration - -The system automatically configures the server on new installations: - -```bash -# Post-install configuration runs automatically via the ac-post-install container -# Monitor the automated setup process: -docker logs ac-post-install -f - -# The automatic setup will: -# 1. Detect new installations (no previous marker file) -# 2. Wait for MySQL and configuration files to be ready -# 3. Update .conf files with production database settings -# 4. Update realmlist table with server address and port -# 5. Automatically restart authserver and worldserver to apply changes -# 6. Create a completion marker to prevent re-execution -``` - -#### Automatic Service Restart - -The post-install system includes **automatic service restart functionality** with support for both Docker and Podman: - -**Container Runtime Detection**: -- ๐Ÿณ **Docker**: Automatically detects Docker daemon and uses Docker CLI -- ๐Ÿฆญ **Podman**: Falls back to Podman CLI if Docker unavailable -- โš ๏ธ **Graceful fallback**: Skips restart if no runtime detected (continues other tasks) - -**Restart Process**: -```bash -๐Ÿ”„ Restarting authserver and worldserver to pick up new configuration... -๐Ÿณ Detected Docker runtime -๐Ÿ”„ Restarting authserver container: ac-authserver -โœ… Authserver restarted successfully -๐Ÿ”„ Restarting worldserver container: ac-worldserver -โœ… Worldserver restarted successfully -โœ… Service restart completed -``` - -**Requirements**: -- **Docker socket access**: Container has `/var/run/docker.sock` mounted -- **Container runtime**: Docker or Podman available in container -- **Environment variables**: `CONTAINER_AUTHSERVER` and `CONTAINER_WORLDSERVER` defined - -**Benefits**: -- โœ… **Immediate effect**: Configuration changes applied instantly -- โœ… **No manual intervention**: Fully automated restart process -- โœ… **Cross-platform**: Works with Docker Desktop, Podman, and cloud environments -- โœ… **Graceful shutdown**: Services shut down cleanly before restart - -#### Manual Post-Installation (Optional) - -If you need to run post-installation manually or troubleshoot: - -```bash -# Run manual post-installation setup -./scripts/post-install-setup.sh - -# Or force re-run automatic post-install (removes marker) -docker exec ac-post-install rm -f /install-markers/post-install-completed -docker compose -f docker-compose-azerothcore-services.yml restart ac-post-install -``` - -### Step 4: Create Admin Account - -Once the worldserver is running: - -```bash -# Attach to worldserver console -docker attach ac-worldserver - -# In the worldserver console, create admin account: -account create admin yourpassword -account set gmlevel admin 3 -1 -server info - -# Detach from console without stopping: Ctrl+P, Ctrl+Q -``` - -### Step 5: Configure Game Client - -**Client Connection Instructions**: - -1. **Locate your WoW 3.3.5a client directory** -2. **Edit `realmlist.wtf` file** (in your WoW client folder): - ``` - set realmlist SERVER_ADDRESS - ``` - -**Examples based on your server configuration**: -```bash -# Local development -set realmlist 127.0.0.1 - -# LAN server -set realmlist 192.168.1.100 - -# Public server with custom port -set realmlist your-domain.com 8215 -# or for IP with custom port -set realmlist 203.0.113.100 8215 -``` - -**Default Connection**: If using default `REALM_PORT=8215`, you can omit the port in most clients. - -**Troubleshooting Connection Issues**: -- Verify server is running: `docker ps` -- Check if ports are open: `telnet SERVER_ADDRESS 8215` -- Ensure firewall allows traffic on configured ports -- For public servers, verify port forwarding is configured -- Check server logs: `docker logs ac-worldserver` - -## Configuration - -### Environment Variables - -Configuration is managed through separate `.env` files for each layer: - -#### Storage Configuration (All Layers) -- `STORAGE_ROOT`: Root storage path (default: `./storage`) - - **Local development**: `./storage` - - **Production NFS**: `/nfs/containers` - - **Custom mount**: `/mnt/azerothcore-data` -- All layers use the same `STORAGE_PATH` variable derived from `STORAGE_ROOT`: - - Database: `STORAGE_PATH=${STORAGE_ROOT}/azerothcore` - - Services: `STORAGE_PATH=${STORAGE_ROOT}/azerothcore` - - Tools: `STORAGE_PATH=${STORAGE_ROOT}/azerothcore` - - Optional: `STORAGE_PATH=${STORAGE_ROOT}/azerothcore` - -#### Database Layer (`docker-compose-azerothcore-database.env`) -- `MYSQL_ROOT_PASSWORD`: Database root password (default: azerothcore123) -- `MYSQL_EXTERNAL_PORT`: External MySQL port (default: 64306) -- `STORAGE_ROOT`: Root storage path (default: ./storage) -- `STORAGE_PATH`: Derived storage path (${STORAGE_ROOT}/azerothcore) -- `NETWORK_SUBNET`: Docker network subnet -- `BACKUP_RETENTION_DAYS`: Backup retention period - -#### Services Layer (`docker-compose-azerothcore-services.env`) -- `AUTH_EXTERNAL_PORT`: Auth server external port (3784) -- `WORLD_EXTERNAL_PORT`: World server external port (8215) -- `SOAP_EXTERNAL_PORT`: SOAP API port (7778) -- `STORAGE_ROOT`: Root storage path (default: ./storage) -- `STORAGE_PATH`: Derived storage path (${STORAGE_ROOT}/azerothcore) -- `PLAYERBOT_ENABLED`: Enable/disable playerbots (1/0) -- `PLAYERBOT_MAX_BOTS`: Maximum number of bots (default: 40) - -#### Tools Layer (`docker-compose-azerothcore-tools.env`) -- `PMA_EXTERNAL_PORT`: PHPMyAdmin port (8081) -- `KEIRA3_EXTERNAL_PORT`: Database editor port (4201) -- `STORAGE_ROOT`: Root storage path (default: ./storage) -- `STORAGE_PATH`: Derived storage path (${STORAGE_ROOT}/azerothcore) - -### Realm Configuration - -Update realm settings in the database: - -```bash -# Update realm IP address -docker exec ac-mysql mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e " -USE acore_auth; -UPDATE realmlist SET address='NEW_IP' WHERE id=1;" - -# View current realm configuration -docker exec ac-mysql mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e " -USE acore_auth; -SELECT * FROM realmlist;" -``` - -## Volume Management - -### Storage Architecture - -The deployment uses a unified storage approach controlled by the `STORAGE_ROOT` variable: - -| Storage Component | Local Path | Production Path | Purpose | -|-------------------|------------|-----------------|---------| -| **Database Data** | `./storage/azerothcore/mysql-data` | `${STORAGE_ROOT}/azerothcore/mysql-data` | MySQL database files | -| **Game Data** | `./storage/azerothcore/data` | `${STORAGE_ROOT}/azerothcore/data` | Maps, vmaps, mmaps, DBC files | -| **Configuration** | `./storage/azerothcore/config` | `${STORAGE_ROOT}/azerothcore/config` | Server configuration files | -| **Application Logs** | `./storage/azerothcore/logs` | `${STORAGE_ROOT}/azerothcore/logs` | Server and service logs | -| **Backups** | `./storage/azerothcore/backups` | `${STORAGE_ROOT}/azerothcore/backups` | Database backup files | - -### Storage Configuration Examples - -#### Local Development -```bash -# All data stored locally in ./storage/ -STORAGE_ROOT=./storage -``` - -#### Production with NFS -```bash -# All data on NFS mount -STORAGE_ROOT=/nfs/containers -``` - -#### Custom Mount Point -```bash -# All data on dedicated storage mount -STORAGE_ROOT=/mnt/azerothcore-data -``` - -### Unified Storage Benefits - -โœ… **Single Mount Point**: Only need to mount one directory in production -โœ… **Simplified Backup**: All persistent data in one location -โœ… **Easy Migration**: Copy entire `${STORAGE_ROOT}/azerothcore` directory -โœ… **Consistent Paths**: All layers use same storage root -โœ… **Environment Flexibility**: Change storage location via single variable - -### Volume Backup Procedures - -#### Complete Storage Backup: -```bash -# Backup entire storage directory (recommended) -tar czf azerothcore-storage-backup-$(date +%Y%m%d).tar.gz storage/ - -# Or backup to remote location -rsync -av storage/ backup-server:/backups/azerothcore/$(date +%Y%m%d)/ -``` - -#### Component-Specific Backups: -```bash -# Backup just database files -tar czf mysql-backup-$(date +%Y%m%d).tar.gz storage/azerothcore/mysql-data/ - -# Backup just game data -tar czf gamedata-backup-$(date +%Y%m%d).tar.gz storage/azerothcore/data/ - -# Backup just configuration -tar czf config-backup-$(date +%Y%m%d).tar.gz storage/azerothcore/config/ -``` - -#### Production Storage Backup: -```bash -# When using custom STORAGE_ROOT -source docker-compose-azerothcore-database.env -tar czf azerothcore-backup-$(date +%Y%m%d).tar.gz ${STORAGE_ROOT}/azerothcore/ -``` - -## Maintenance - -### Daily Operations - -#### Check Service Status: -```bash -# View all AzerothCore containers -docker ps | grep ac- - -# Check resource usage -docker stats $(docker ps --format "{{.Names}}" | grep ac-) - -# View recent logs -docker logs ac-worldserver --tail 100 -docker logs ac-authserver --tail 100 -``` - -#### Server Commands: -```bash -# Attach to worldserver console -docker attach ac-worldserver - -# Common console commands: -server info # Show server status -account create USER PASS # Create new account -account set gmlevel USER 3 -1 # Set GM level -server shutdown 60 # Shutdown in 60 seconds -saveall # Save all characters -``` - -### Database Maintenance - -#### Manual Backup: -```bash -# Full database backup -docker exec ac-mysql mysqldump \ - -uroot -p${MYSQL_ROOT_PASSWORD} \ - --all-databases \ - --single-transaction \ - --routines \ - --triggers \ - > backup-$(date +%Y%m%d-%H%M%S).sql -``` - -#### Restore Backup: -```bash -# Restore from backup -docker exec -i ac-mysql mysql \ - -uroot -p${MYSQL_ROOT_PASSWORD} \ - < backup-file.sql -``` - -#### Database Optimization: -```bash -# Optimize all tables -docker exec ac-mysql mysqlcheck \ - -uroot -p${MYSQL_ROOT_PASSWORD} \ - --all-databases \ - --optimize -``` - -### Container Updates - -#### Update Containers: -```bash -# Pull latest images for database layer -docker-compose -f docker-compose-azerothcore-database.yml pull - -# Pull latest images for services layer -docker-compose -f docker-compose-azerothcore-services.yml pull - -# Pull latest images for tools layer -docker-compose -f docker-compose-azerothcore-tools.yml pull - -# Recreate containers with new images -docker-compose -f docker-compose-azerothcore-database.yml up -d --force-recreate -docker-compose -f docker-compose-azerothcore-services.yml up -d --force-recreate -docker-compose -f docker-compose-azerothcore-tools.yml up -d --force-recreate - -# Remove old unused images -docker image prune -a -``` - -#### Update AzerothCore: -```bash -# Stop services layer -docker-compose -f docker-compose-azerothcore-services.yml stop - -# Update database -docker-compose -f docker-compose-azerothcore-database.yml up ac-db-import - -# Restart services layer -docker-compose -f docker-compose-azerothcore-services.yml up -d -``` - -### Log Management - -#### View Logs: -```bash -# Follow worldserver logs -docker logs -f ac-worldserver - -# Export logs to file -docker logs ac-worldserver > worldserver.log 2>&1 - -# Clear old logs (adjust path based on STORAGE_ROOT) -find ${STORAGE_ROOT}/azerothcore/logs -name "*.log" -mtime +30 -delete -``` - -#### Log Rotation (using bind mount): -```bash -# Create logrotate config (adjust path based on STORAGE_ROOT) -cat > /etc/logrotate.d/azerothcore <` | -| `post-install-setup.sh` | Complete automated post-installation configuration | `./post-install-setup.sh` | -| `update-config.sh` | Update .conf files with production database settings | `./update-config.sh` | -| `update-realmlist.sh` | Update realmlist table with server address and port | `./update-realmlist.sh` | -| `rebuild-with-modules.sh` | Automated module compilation and rebuild | `./rebuild-with-modules.sh` | - -### Deployment and Health Check Script - -The `deploy-and-check.sh` script provides automated deployment and comprehensive health verification. - -#### Features -โœ… **Layered Deployment**: Deploys database โ†’ services โ†’ tools in correct order -โœ… **Container Health Validation**: Checks all 8 core containers -โœ… **Port Connectivity Tests**: Validates all external ports -โœ… **Web Service Verification**: HTTP response and content validation -โœ… **Database Validation**: Schema and realm configuration checks -โœ… **Comprehensive Reporting**: Color-coded status with detailed results - -#### Usage Examples - -```bash -cd scripts - -# Full deployment with health checks -./deploy-and-check.sh - -# Health check only (skip deployment) -./deploy-and-check.sh --skip-deploy - -# Quick health check (basic tests only) -./deploy-and-check.sh --skip-deploy --quick-check -``` - -### Cleanup Script - -The `cleanup.sh` script provides safe and comprehensive cleanup options with multiple levels of cleanup intensity. - -#### Cleanup Levels - -- **๐ŸŸข Soft (`--soft`)**: Stop containers only (preserves data) -- **๐ŸŸก Hard (`--hard`)**: Remove containers + networks (preserves volumes/data) -- **๐Ÿ”ด Nuclear (`--nuclear`)**: Complete removal (DESTROYS ALL DATA) - -#### Usage Examples - -```bash -cd scripts - -# Safe cleanup - stop containers only -./cleanup.sh --soft - -# Moderate cleanup - remove containers and networks (preserves data) -./cleanup.sh --hard - -# Complete cleanup - remove everything (DESTROYS ALL DATA) -./cleanup.sh --nuclear - -# See what would happen without doing it -./cleanup.sh --hard --dry-run - -# Force cleanup without prompts (for automation) -./cleanup.sh --hard --force -``` - -### Script Documentation - -For complete documentation on each script: -- **Deployment**: See `scripts/DEPLOYMENT.md` -- **Cleanup**: See `scripts/CLEANUP.md` -- **Scripts Overview**: See `scripts/README.md` - -## Troubleshooting - -### Common Issues - -#### 1. Worldserver Won't Start -**Error**: "Failed to find map files for starting areas" - -**Solution**: Ensure game data files are properly extracted and placed in the data volume: -```bash -# Check if data files exist -docker run --rm -v ac_data:/data alpine ls -la /data/ - -# Should see: dbc/, maps/, vmaps/, mmaps/ directories -``` - -#### 2. Cannot Connect to Realm -**Error**: Realm list shows but cannot enter world - -**Solution**: Update realm IP address: -```bash -docker exec ac-mysql mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e " -USE acore_auth; -UPDATE realmlist SET address='YOUR_PUBLIC_IP' WHERE id=1;" -``` - -#### 3. Database Connection Failed -**Error**: "Can't connect to MySQL server" - -**Solution**: Check MySQL container and credentials: -```bash -# Verify MySQL is running -docker ps | grep ac-mysql - -# Test connection -docker exec ac-authserver ping ac-mysql - -# Check MySQL logs -docker logs ac-mysql --tail 50 -``` - -#### 4. Permission Denied Errors -**Error**: Various permission denied messages - -**Solution**: Containers are configured to run as root to handle NFS permissions. Check volume mount permissions and ensure storage paths are accessible. - -### Debug Commands - -```bash -# Check container health -docker inspect ac-mysql | grep -A 10 "Health" - -# View network configuration -docker network inspect azerothcore - -# Check volume mounts -docker inspect ac-worldserver | grep -A 10 "Mounts" - -# Test database connectivity -docker exec ac-mysql mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e "STATUS;" - -# View process list in container -docker top ac-worldserver - -# Execute commands in container -docker exec ac-worldserver ls -la /azerothcore/data/ -``` - -### Reset Procedures - -#### Complete Reset: -```bash -# Stop all layers -docker-compose -f docker-compose-azerothcore-tools.yml down -docker-compose -f docker-compose-azerothcore-services.yml down -docker-compose -f docker-compose-azerothcore-database.yml down - -# Remove all volumes (WARNING: Deletes all data) -docker volume prune -f - -# Remove all containers and images -docker system prune -a - -# Start fresh (in order) -docker-compose -f docker-compose-azerothcore-database.yml up -d -docker-compose -f docker-compose-azerothcore-services.yml up -d -docker-compose -f docker-compose-azerothcore-tools.yml up -d -``` - -#### Reset Specific Service: -```bash -# Reset worldserver only -docker-compose -f docker-compose-azerothcore-services.yml stop ac-worldserver -docker-compose -f docker-compose-azerothcore-services.yml rm -f ac-worldserver -docker-compose -f docker-compose-azerothcore-services.yml up -d ac-worldserver -``` - -## Security Considerations - -### Best Practices - -1. **Strong Passwords** - - Use complex passwords for MySQL root - - Avoid default passwords for game accounts - - Regularly rotate admin credentials - -2. **Network Security** - - Use firewall rules to restrict access - - Consider VPN for admin access - - Disable SOAP if not needed - -3. **File Permissions** - - Restrict access to .env files: `chmod 600 *.env` - - Secure backup directories - - Containers run as root to handle NFS permissions - -4. **Regular Updates** - - Keep containers updated - - Apply security patches promptly - - Monitor security advisories - -### Firewall Configuration - -```bash -# Allow only necessary ports -ufw allow 3784/tcp # Auth server -ufw allow 8215/tcp # World server -ufw allow 22/tcp # SSH (restrict source IP) -ufw enable -``` - -### Monitoring - -```bash -# Monitor connection attempts -docker logs ac-authserver | grep -i "failed" - -# Check for unusual database queries -docker exec ac-mysql mysql -uroot -p${MYSQL_ROOT_PASSWORD} -e " -SHOW PROCESSLIST;" - -# Monitor resource usage -docker stats --no-stream -``` - -## Available Modules - -This deployment includes a **comprehensive automated module management system** that supports 28 AzerothCore modules with: - -- โœ… **Automatic Git-based module installation** -- โœ… **State tracking with rebuild detection** -- โœ… **SQL script execution for database setup** -- โœ… **Configuration file management (.conf.dist โ†’ .conf)** -- โœ… **Source-based compilation integration** -- โœ… **Hash-based change detection triggers rebuilds automatically** -- โœ… **Compatibility analysis and documentation** - -All modules are automatically downloaded from GitHub when enabled and include proper configuration files. - -### Module Management Architecture - -The system consists of three key components: - -1. **Module Manager Container** (`ac-modules`) - - Handles module downloading, SQL execution, and state tracking - - Runs as one-time setup during stack initialization - - Monitors module configuration changes - -2. **Rebuild Detection System** - - Tracks module enable/disable state changes - - Automatically detects when compilation is required - - Provides detailed rebuild instructions - -3. **Automated Rebuild Script** (`scripts/rebuild-with-modules.sh`) - - Orchestrates full compilation workflow - - Integrates with source-based Docker builds - - Handles module synchronization - -### Module Status Legend - -- โœ… **COMPATIBLE**: Module compiles and links successfully -- โš ๏ธ **TESTING**: Module requires testing for compatibility -- โŒ **INCOMPATIBLE**: Module has known compilation or linking issues -- ๐Ÿ”ง **REQUIRES_CONFIG**: Module needs configuration before compilation -- ๐Ÿšจ **CRITICAL**: Module has special requirements or limitations - -**Important**: All 28 analyzed modules require C++ compilation - none are compatible with pre-built containers. - -### Core Modules (High Priority) - -| Module | Status | Description | Repository | README | -|--------|--------|-------------|------------|--------| -| **AoE Loot** | โš ๏ธ | Area of effect looting feature | [mod-aoe-loot](https://github.com/azerothcore/mod-aoe-loot) | [๐Ÿ“–](https://github.com/azerothcore/mod-aoe-loot/blob/master/.github/README.md) | -| **Learn Spells** | โš ๏ธ | Automatic spell learning | [mod-learn-spells](https://github.com/azerothcore/mod-learn-spells) | [๐Ÿ“–](https://github.com/azerothcore/mod-learn-spells/blob/master/README.md) | -| **AutoBalance** | โš ๏ธ | Dynamic difficulty scaling for dungeons/raids | [mod-autobalance](https://github.com/azerothcore/mod-autobalance) | [๐Ÿ“–](https://github.com/azerothcore/mod-autobalance/blob/master/README.md) | -| **Solo LFG** | โš ๏ธ | Solo dungeon finder system | [mod-solo-lfg](https://github.com/azerothcore/mod-solo-lfg) | [๐Ÿ“–](https://github.com/azerothcore/mod-solo-lfg/blob/master/README.md) | -| **Transmog** | โš ๏ธ | Transmogrification system | [mod-transmog](https://github.com/azerothcore/mod-transmog) | [๐Ÿ“–](https://github.com/azerothcore/mod-transmog/blob/master/README.md) | - -### Quality of Life Modules - -| Module | Status | Description | Repository | README | -|--------|--------|-------------|------------|--------| -| **AHBot** | โŒ | Auction House bot for populated auctions - **LINKING ERROR** | [mod-ahbot](https://github.com/azerothcore/mod-ahbot) | [๐Ÿ“–](https://github.com/azerothcore/mod-ahbot/blob/master/README.md) | -| **NPC Buffer** | โš ๏ธ | Buff NPC services | [mod-npc-buffer](https://github.com/azerothcore/mod-npc-buffer) | [๐Ÿ“–](https://github.com/azerothcore/mod-npc-buffer/blob/master/README.md) | -| **Dynamic XP** | โš ๏ธ | Configurable experience rates | [mod-dynamic-xp](https://github.com/azerothcore/mod-dynamic-xp) | [๐Ÿ“–](https://github.com/azerothcore/mod-dynamic-xp/blob/master/README.md) | -| **Breaking News** | โš ๏ธ | Server announcement system | [mod-breaking-news-override](https://github.com/azerothcore/mod-breaking-news-override) | [๐Ÿ“–](https://github.com/azerothcore/mod-breaking-news-override/blob/master/README.md) | -| **Auto Revive** | โš ๏ธ | Auto-revive functionality for GMs | [mod-auto-revive](https://github.com/azerothcore/mod-auto-revive) | [๐Ÿ“–](https://github.com/azerothcore/mod-auto-revive/blob/master/README.md) | -| **NPC Enchanter** | โš ๏ธ | NPC-based gear enchantment services | [mod-npc-enchanter](https://github.com/azerothcore/mod-npc-enchanter) | [๐Ÿ“–](https://github.com/azerothcore/mod-npc-enchanter/blob/master/README.md) | -| **Instance Reset** | โš ๏ธ | NPC-based instance reset functionality | [mod-instance-reset](https://github.com/azerothcore/mod-instance-reset) | [๐Ÿ“–](https://github.com/azerothcore/mod-instance-reset/blob/master/README.md) | - -### Advanced Modules - -| Module | Status | Description | Repository | README | -|--------|--------|-------------|------------|--------| -| **Playerbots** | ๐Ÿšจ | AI-controlled bot system - **REQUIRES CUSTOM BRANCH** | [mod-playerbots](https://github.com/liyunfan1223/mod-playerbots) | [๐Ÿ“–](https://github.com/liyunfan1223/mod-playerbots/blob/master/README.md) | -| **Individual Progression** | ๐Ÿ”ง | Custom character progression system | [mod-individual-progression](https://github.com/ZhengPeiRu21/mod-individual-progression) | [๐Ÿ“–](https://github.com/ZhengPeiRu21/mod-individual-progression/blob/master/README.md) | -| **1v1 Arena** | โš ๏ธ | Arena combat system | [mod-1v1-arena](https://github.com/azerothcore/mod-1v1-arena) | [๐Ÿ“–](https://github.com/azerothcore/mod-1v1-arena/blob/master/README.md) | -| **Phased Duels** | โš ๏ธ | Isolated dueling system | [mod-phased-duels](https://github.com/azerothcore/mod-phased-duels) | [๐Ÿ“–](https://github.com/azerothcore/mod-phased-duels/blob/master/README.md) | -| **Solocraft** | โš ๏ธ | Solo dungeon scaling | [mod-solocraft](https://github.com/azerothcore/mod-solocraft) | [๐Ÿ“–](https://github.com/azerothcore/mod-solocraft/blob/master/.github/README.md) | -| **Random Enchants** | โš ๏ธ | Random item enchantments | [mod-random-enchants](https://github.com/azerothcore/mod-random-enchants) | [๐Ÿ“–](https://github.com/azerothcore/mod-random-enchants/blob/master/README.md) | - -### Server Management Modules - -| Module | Status | Description | Repository | README | -|--------|--------|-------------|------------|--------| -| **Boss Announcer** | โš ๏ธ | Raid boss kill notifications | [mod-boss-announcer](https://github.com/azerothcore/mod-boss-announcer) | [๐Ÿ“–](https://github.com/azerothcore/mod-boss-announcer/blob/master/README.md) | -| **Account Achievements** | โš ๏ธ | Cross-character achievements | [mod-account-achievements](https://github.com/azerothcore/mod-account-achievements) | [๐Ÿ“–](https://github.com/azerothcore/mod-account-achievements/blob/master/README.md) | -| **Eluna** | โš ๏ธ | Lua scripting engine integration | [mod-eluna](https://github.com/azerothcore/mod-eluna) | [๐Ÿ“–](https://github.com/azerothcore/mod-eluna/blob/master/README.md) | -| **Gain Honor Guard** | โš ๏ธ | Honor system for killing guards | [mod-gain-honor-guard](https://github.com/azerothcore/mod-gain-honor-guard) | [๐Ÿ“–](https://github.com/azerothcore/mod-gain-honor-guard/blob/master/.github/README.md) | -| **PvP Titles** | โš ๏ธ | Honor-based PvP title system | [mod-pvp-titles](https://github.com/azerothcore/mod-pvp-titles) | [๐Ÿ“–](https://github.com/azerothcore/mod-pvp-titles/blob/master/README.md) | -| **Pocket Portal** | โš ๏ธ | Teleportation portal system | [mod-pocket-portal](https://github.com/azerothcore/mod-pocket-portal) | [๐Ÿ“–](https://github.com/azerothcore/mod-pocket-portal/blob/master/README.md) | - -### Additional Modules - -| Module | Status | Description | Repository | README | -|--------|--------|-------------|------------|--------| -| **Time Is Time** | โš ๏ธ | Realistic day/night cycle | [mod-TimeIsTime](https://github.com/dunjeon/mod-TimeIsTime) | [๐Ÿ“–](https://github.com/dunjeon/mod-TimeIsTime/blob/main/README.md) | -| **NPC Beastmaster** | โš ๏ธ | Cross-class pet system | [mod-npc-beastmaster](https://github.com/azerothcore/mod-npc-beastmaster) | [๐Ÿ“–](https://github.com/azerothcore/mod-npc-beastmaster/blob/master/README.md) | -| **Fireworks** | โš ๏ธ | Fireworks on level up | [mod-fireworks-on-level](https://github.com/azerothcore/mod-fireworks-on-level) | [๐Ÿ“–](https://github.com/azerothcore/mod-fireworks-on-level/blob/master/README.md) | -| **Level Grant** | โš ๏ธ | Quest-based level granting | [mod-quest-count-level](https://github.com/michaeldelago/mod-quest-count-level) | [๐Ÿ“–](https://github.com/michaeldelago/mod-quest-count-level/blob/main/README.md) | - -### Module Configuration - -Enable modules by setting their environment variables to `1` in `docker-compose-azerothcore-services.env`: - -```bash -# Example: Enable AutoBalance and Transmog -MODULE_AUTOBALANCE=1 -MODULE_TRANSMOG=1 -``` - -After enabling/disabling modules: -1. Run the module manager: `docker compose -f docker-compose-azerothcore-services.yml up ac-modules` -2. **Enabled modules** will be automatically downloaded to `storage/azerothcore/modules/` -3. **Disabled modules** will be automatically removed from the modules directory -4. **Configuration files** (`.conf.dist`) are automatically managed: - - **Enabled modules**: Config files copied to `storage/azerothcore/config/` - - **Disabled modules**: Config files removed from config directory -5. **SQL scripts** are automatically executed for database setup -6. **Important**: All modules require server recompilation to be active - use `./scripts/rebuild-with-modules.sh` - -### Safe Module Testing Procedure - -1. **Enable Single Module**: - ```bash - # Edit docker-compose-azerothcore-services.env - MODULE_AOE_LOOT=1 # Enable one module - ``` - -2. **Test Compilation**: - ```bash - ./scripts/rebuild-with-modules.sh - ``` - -3. **Monitor Build**: - - Watch for compilation errors - - Check for linking issues - - Verify successful completion - -4. **Test Functionality**: - - Start services - - Test module features in-game - - Check server logs for errors - -### Module Management Behavior - -The module management system provides complete automation: - -- **Enable Module** (`MODULE_NAME=1`): - - Downloads module source code via Git if not present - - Copies `.conf.dist` files to config directory - - Executes SQL scripts for database setup - - Updates module state tracking for rebuild detection -- **Disable Module** (`MODULE_NAME=0`): - - Removes module directory completely - - Removes associated configuration files - - Updates state hash to trigger rebuild detection -- **Module Persistence**: Only enabled modules and their configs remain -- **Clean Slate**: Disabling and re-enabling ensures fresh download and config -- **Zero Manual Setup**: No need to manually copy configuration files or run SQL scripts - -### Known Issues and Limitations - -#### โŒ mod-ahbot (AuctionHouse Bot) -- **Error**: `undefined reference to 'Addmod_ahbotScripts()'` -- **Cause**: Module script loader function not properly exported -- **Status**: Disabled by default until fixed -- **Workaround**: Report issue to module maintainer - -#### ๐Ÿšจ mod-playerbots (Player Bots) -- **Issue**: Requires custom AzerothCore branch -- **Requirement**: `liyunfan1223/azerothcore-wotlk/tree/Playerbot` -- **Impact**: Incompatible with standard AzerothCore builds -- **Solution**: Use separate deployment for playerbot functionality - -#### ๐Ÿ”ง mod-individual-progression -- **Note**: Auto-configures accounts for individual progression -- **Requirement**: Account creation after server setup - -### Post-Installation Requirements - -โš ๏ธ **Critical**: All modules require source-based compilation: - -1. **Server Recompilation**: All modules need C++ compilation - use `./scripts/rebuild-with-modules.sh` -2. **Module State Tracking**: System automatically detects when rebuilds are required -3. **Rebuild Detection**: Hash-based change detection triggers rebuild notifications -4. **Database Integration**: SQL scripts are executed automatically during module installation - -### Module Documentation - -For detailed module management documentation, see: -- **Complete System Guide**: [docs/MODULE_MANAGEMENT.md](docs/MODULE_MANAGEMENT.md) -- **Compatibility Matrix**: [docs/MODULE_COMPATIBILITY.md](docs/MODULE_COMPATIBILITY.md) -- **Quick Start Guide**: [docs/README.md](docs/README.md) - -## Support and Resources - -### Official Documentation -- **[AzerothCore Wiki](https://www.azerothcore.org/)** - Official documentation -- **[AzerothCore GitHub](https://github.com/azerothcore/azerothcore-wotlk)** - Source code and issues -- **[AzerothCore Docker](https://github.com/azerothcore/acore-docker)** - Official Docker images -- **[Playerbot Documentation](https://github.com/liyunfan1223/mod-playerbots/wiki)** - Playerbot module wiki -- **[Docker Documentation](https://docs.docker.com/)** - Docker reference -- **[Podman Documentation](https://docs.podman.io/)** - Podman reference - -### Community Resources -- **[AzerothCore Discord](https://discord.gg/azerothcore)** - Community support -- **[AzerothCore Forums](https://github.com/azerothcore/azerothcore-wotlk/discussions)** - Discussions -- **[ChromieCraft](https://www.chromiecraft.com/)** - AzerothCore-based progressive server - -## Available Services - -| Service | Endpoint | Port | Purpose | -|---------|----------|------|---------| -| **Game Server** | `localhost:8215` | 8215 | World server (game connection) | -| **Auth Server** | `localhost:3784` | 3784 | Authentication server | -| **SOAP API** | `localhost:7778` | 7778 | Server administration API | -| **PHPMyAdmin** | `http://localhost:8081` | 8081 | Database management interface | -| **Keira3** | `http://localhost:4201` | 4201 | Database editor web UI with API backend | -| **MySQL** | `localhost:64306` | 64306 | Direct database access | - -### Database Credentials -- **Host**: `localhost:64306` -- **User**: `root` -- **Password**: `azerothcore123` (configurable in environment files) -- **Databases**: `acore_auth`, `acore_world`, `acore_characters` - -### Related Projects -- **[Original Docker Setup](https://github.com/coc0nut/AzerothCore-with-Playerbots-Docker-Setup)** - Base Docker configuration this project extends -- **[AzerothCore Modules](https://github.com/azerothcore/mod-repo-list)** - Additional modules catalog - -### Useful Commands Reference -```bash -# Quick status check -docker ps | grep ac- - -# Restart database layer -docker-compose -f docker-compose-azerothcore-database.yml restart - -# Restart services layer -docker-compose -f docker-compose-azerothcore-services.yml restart - -# Restart tools layer -docker-compose -f docker-compose-azerothcore-tools.yml restart - -# View database logs -docker-compose -f docker-compose-azerothcore-database.yml logs - -# View services logs -docker-compose -f docker-compose-azerothcore-services.yml logs - -# View tools logs -docker-compose -f docker-compose-azerothcore-tools.yml logs - -# Stop everything (in reverse order) -docker-compose -f docker-compose-azerothcore-tools.yml down -docker-compose -f docker-compose-azerothcore-services.yml down -docker-compose -f docker-compose-azerothcore-database.yml down - -# Start everything (in order) -docker-compose -f docker-compose-azerothcore-database.yml up -d -docker-compose -f docker-compose-azerothcore-services.yml up -d -docker-compose -f docker-compose-azerothcore-tools.yml up -d - -# Update and restart all layers -docker-compose -f docker-compose-azerothcore-database.yml pull && docker-compose -f docker-compose-azerothcore-database.yml up -d -docker-compose -f docker-compose-azerothcore-services.yml pull && docker-compose -f docker-compose-azerothcore-services.yml up -d -docker-compose -f docker-compose-azerothcore-tools.yml pull && docker-compose -f docker-compose-azerothcore-tools.yml up -d - -# Backup database -docker exec ac-mysql mysqldump -uroot -p${MYSQL_ROOT_PASSWORD} --all-databases > backup.sql - -# Connect to worldserver console -docker attach ac-worldserver -``` - -## License and Attribution - -### Project Licenses -- **AzerothCore**: Licensed under [AGPL-3.0](https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE) -- **This Docker Configuration**: Provided under MIT License for the configuration files -- **Playerbot Module**: Check [mod-playerbots](https://github.com/liyunfan1223/mod-playerbots) for specific licensing - -### Credits -- **[AzerothCore Team](https://github.com/azerothcore)**: For the core server application -- **[coc0nut](https://github.com/coc0nut)**: For the initial Docker setup approach with Playerbots -- **[liyunfan1223](https://github.com/liyunfan1223)**: For the Playerbot module -- **Community Contributors**: For various modules and improvements - -### Legal Notice -World of Warcraftยฎ and Blizzard Entertainmentยฎ are registered trademarks of Blizzard Entertainment, Inc. This project is not affiliated with Blizzard Entertainment. - -## Contributing - -Contributions are welcome! Please: -1. Fork the repository -2. Create a feature branch -3. Commit your changes -4. Push to the branch -5. Create a Pull Request - -**Note**: This is an unofficial community deployment. Always backup your data before updates or changes. diff --git a/scripts/README.md b/scripts/README.md index 3856592..7fbd2d2 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -1,35 +1,76 @@ # Scripts Directory -This directory contains deployment and validation scripts for the AzerothCore Docker deployment. +This directory contains deployment, configuration, and management scripts for the AzerothCore Docker deployment. -## Contents +## Core Scripts +### ๐Ÿš€ Setup & Deployment +- **`setup-server.sh`** - Interactive server setup wizard (recommended for new users) - **`deploy-and-check.sh`** - Automated deployment and comprehensive health check script +- **`auto-post-install.sh`** - Automated post-installation configuration + +### ๐Ÿ”ง Configuration & Management +- **`configure-modules.sh`** - Module configuration analysis and guidance tool +- **`setup-eluna.sh`** - Lua scripting environment setup +- **`update-realmlist.sh`** - Update server address in realmlist configuration +- **`update-config.sh`** - Configuration file updates and management + +### ๐Ÿ’พ Backup & Restore +- **`backup.sh`** - Manual database backup +- **`backup-hourly.sh`** - Hourly automated backup script +- **`backup-daily.sh`** - Daily automated backup script +- **`restore.sh`** - Database restoration from backup + +### ๐Ÿงน Maintenance - **`cleanup.sh`** - Resource cleanup script with multiple cleanup levels -- **`DEPLOYMENT.md`** - Complete documentation for the deployment script -- **`CLEANUP.md`** - Complete documentation for the cleanup script +- **`rebuild-with-modules.sh`** - Rebuild containers with module compilation +- **`test-local-worldserver.sh`** - Local worldserver testing + +### ๐Ÿ“š Documentation +- **`DEPLOYMENT.md`** - Complete documentation for deployment scripts +- **`CLEANUP.md`** - Complete documentation for cleanup scripts ## Quick Usage -### Run Health Check on Current Deployment +### ๐Ÿ†• First-Time Setup (Recommended) +```bash +# Interactive setup wizard +./scripts/setup-server.sh +``` + +### ๐Ÿ”ง Module Configuration Analysis +```bash +# Check module configuration requirements +./scripts/configure-modules.sh +``` + +### ๐ŸŽฎ Lua Scripting Setup +```bash +# Setup Eluna scripting environment +./scripts/setup-eluna.sh +``` + +### ๐Ÿฉบ Health Checks & Deployment + +**Run Health Check on Current Deployment** ```bash cd scripts ./deploy-and-check.sh --skip-deploy ``` -### Full Deployment with Health Checks +**Full Deployment with Health Checks** ```bash cd scripts ./deploy-and-check.sh ``` -### Quick Health Check (Basic Tests Only) +**Quick Health Check (Basic Tests Only)** ```bash cd scripts ./deploy-and-check.sh --skip-deploy --quick-check ``` -### Cleanup Resources +### ๐Ÿงน Cleanup Resources ```bash cd scripts @@ -46,22 +87,94 @@ cd scripts ./cleanup.sh --hard --dry-run ``` +### ๐Ÿ’พ Backup & Restore Operations +```bash +# Manual backup +./scripts/backup.sh + +# Restore from backup +./scripts/restore.sh backup_filename.sql + +# Setup automated backups (already configured in containers) +# Hourly: ./scripts/backup-hourly.sh +# Daily: ./scripts/backup-daily.sh +``` + ## Features -โœ… **Container Health Validation**: Checks all 8 core containers +### ๐Ÿš€ Setup & Deployment Features +โœ… **Interactive Setup Wizard**: Guided configuration for new users +โœ… **Automated Server Deployment**: Complete three-layer deployment system +โœ… **Module Management**: Automated installation and configuration of 13 enhanced modules +โœ… **Post-Install Automation**: Automatic database setup, realmlist configuration, and service restart + +### ๐Ÿ”ง Configuration Features +โœ… **Module Analysis**: Identifies missing configurations and requirements +โœ… **Lua Scripting Setup**: Automated Eluna environment with example scripts +โœ… **Realmlist Management**: Dynamic server address configuration +โœ… **Config File Management**: Automated .conf file generation from .conf.dist templates + +### ๐Ÿฉบ Health & Monitoring Features +โœ… **Container Health Validation**: Checks all core containers โœ… **Port Connectivity Tests**: Validates all external ports โœ… **Web Service Verification**: HTTP response and content validation โœ… **Database Validation**: Schema and realm configuration checks -โœ… **Automated Deployment**: Three-layer deployment (database โ†’ services โ†’ tools) โœ… **Comprehensive Reporting**: Color-coded status with detailed results -## Variable Names Verified +### ๐Ÿ’พ Backup & Maintenance Features +โœ… **Automated Backups**: Scheduled hourly and daily database backups +โœ… **Manual Backup/Restore**: On-demand backup and restoration tools +โœ… **Multi-Level Cleanup**: Safe, hard, and nuclear cleanup options +โœ… **Container Rebuilding**: Module compilation and container rebuilding support -The scripts validate the updated variable names: -- `MYSQL_EXTERNAL_PORT` (was `DOCKER_DB_EXTERNAL_PORT`) -- `AUTH_EXTERNAL_PORT` (was `DOCKER_AUTH_EXTERNAL_PORT`) -- `WORLD_EXTERNAL_PORT` (was `DOCKER_WORLD_EXTERNAL_PORT`) -- `SOAP_EXTERNAL_PORT` (was `DOCKER_SOAP_EXTERNAL_PORT`) -- `MYSQL_ROOT_PASSWORD` (was `DOCKER_DB_ROOT_PASSWORD`) +## Script Usage Examples -For complete documentation, see `DEPLOYMENT.md`. \ No newline at end of file +### First-Time Server Setup +```bash +# Complete guided setup (recommended) +./scripts/setup-server.sh + +# Follow the interactive prompts to configure: +# - Server network settings +# - Storage locations +# - Database passwords +# - Module selections +``` + +### Post-Installation Configuration +```bash +# Analyze and configure modules +./scripts/configure-modules.sh + +# Setup Lua scripting environment +./scripts/setup-eluna.sh + +# Update server address after IP changes +./scripts/update-realmlist.sh new.server.address +``` + +### Maintenance Operations +```bash +# Health check existing deployment +./scripts/deploy-and-check.sh --skip-deploy + +# Clean restart (preserves data) +./scripts/cleanup.sh --hard +./scripts/deploy-and-check.sh + +# Backup before major changes +./scripts/backup.sh +``` + +## Configuration Variables + +The scripts work with the updated environment variable names: +- `MYSQL_EXTERNAL_PORT` (database port) +- `AUTH_EXTERNAL_PORT` (authentication server port) +- `WORLD_EXTERNAL_PORT` (world server port) +- `SOAP_EXTERNAL_PORT` (SOAP API port) +- `MYSQL_ROOT_PASSWORD` (database root password) +- `SERVER_ADDRESS` (external server address) +- `STORAGE_ROOT` (data storage location) + +For complete documentation, see `DEPLOYMENT.md` and `CLEANUP.md`. \ No newline at end of file diff --git a/scripts/configure-modules.sh b/scripts/configure-modules.sh new file mode 100755 index 0000000..359dea6 --- /dev/null +++ b/scripts/configure-modules.sh @@ -0,0 +1,290 @@ +#!/bin/bash + +# ============================================== +# AzerothCore Module Configuration Script +# ============================================== +# Handles post-installation configuration that requires manual setup beyond Docker automation + +set -e + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +MAGENTA='\033[0;35m' +NC='\033[0m' # No Color + +# Function to print colored output +print_status() { + local status=$1 + local message=$2 + case $status in + "INFO") + echo -e "${BLUE}โ„น๏ธ ${message}${NC}" + ;; + "SUCCESS") + echo -e "${GREEN}โœ… ${message}${NC}" + ;; + "WARNING") + echo -e "${YELLOW}โš ๏ธ ${message}${NC}" + ;; + "ERROR") + echo -e "${RED}โŒ ${message}${NC}" + ;; + "HEADER") + echo -e "\n${MAGENTA}=== ${message} ===${NC}" + ;; + "CRITICAL") + echo -e "${RED}๐Ÿšจ CRITICAL: ${message}${NC}" + ;; + esac +} + +# Load environment variables +if [ -f "docker-compose-azerothcore-services.env" ]; then + source docker-compose-azerothcore-services.env +else + print_status "ERROR" "Environment file not found. Run from acore-compose directory." + exit 1 +fi + +print_status "HEADER" "AZEROTHCORE MODULE CONFIGURATION ANALYSIS" +echo "This script analyzes your enabled modules and identifies manual configuration requirements." +echo "" + +# Check which modules are enabled +ENABLED_MODULES=() +[ "$MODULE_PLAYERBOTS" = "1" ] && ENABLED_MODULES+=("PLAYERBOTS") +[ "$MODULE_AOE_LOOT" = "1" ] && ENABLED_MODULES+=("AOE_LOOT") +[ "$MODULE_LEARN_SPELLS" = "1" ] && ENABLED_MODULES+=("LEARN_SPELLS") +[ "$MODULE_FIREWORKS" = "1" ] && ENABLED_MODULES+=("FIREWORKS") +[ "$MODULE_INDIVIDUAL_PROGRESSION" = "1" ] && ENABLED_MODULES+=("INDIVIDUAL_PROGRESSION") +[ "$MODULE_TRANSMOG" = "1" ] && ENABLED_MODULES+=("TRANSMOG") +[ "$MODULE_SOLO_LFG" = "1" ] && ENABLED_MODULES+=("SOLO_LFG") +[ "$MODULE_ELUNA" = "1" ] && ENABLED_MODULES+=("ELUNA") +[ "$MODULE_ARAC" = "1" ] && ENABLED_MODULES+=("ARAC") +[ "$MODULE_NPC_ENCHANTER" = "1" ] && ENABLED_MODULES+=("NPC_ENCHANTER") +[ "$MODULE_ASSISTANT" = "1" ] && ENABLED_MODULES+=("ASSISTANT") +[ "$MODULE_REAGENT_BANK" = "1" ] && ENABLED_MODULES+=("REAGENT_BANK") +[ "$MODULE_BLACK_MARKET_AUCTION_HOUSE" = "1" ] && ENABLED_MODULES+=("BLACK_MARKET") + +print_status "INFO" "Found ${#ENABLED_MODULES[@]} enabled modules: ${ENABLED_MODULES[*]}" +echo "" + +# Critical Compatibility Issues +print_status "HEADER" "CRITICAL COMPATIBILITY ISSUES" + +if [[ " ${ENABLED_MODULES[*]} " =~ " PLAYERBOTS " ]]; then + print_status "CRITICAL" "mod-playerbots REQUIRES CUSTOM AZEROTHCORE BRANCH" + echo " ๐Ÿ”— Required: liyunfan1223/azerothcore-wotlk/tree/Playerbot" + echo " โŒ Current: Standard AzerothCore (INCOMPATIBLE)" + echo " ๐Ÿ“‹ Action: Switch to Playerbot branch OR disable MODULE_PLAYERBOTS" + echo "" +fi + +# Client-Side Requirements +print_status "HEADER" "CLIENT-SIDE PATCH REQUIREMENTS" + +CLIENT_PATCHES_NEEDED=false + +if [[ " ${ENABLED_MODULES[*]} " =~ " INDIVIDUAL_PROGRESSION " ]]; then + print_status "WARNING" "mod-individual-progression requires CLIENT PATCHES" + echo " ๐Ÿ“ Location: ${STORAGE_PATH}/modules/mod-individual-progression/optional/" + echo " ๐Ÿ“ฆ Required: patch-V.mpq (Vanilla crafting/recipes)" + echo " ๐Ÿ“ฆ Optional: patch-J.mpq (Vanilla login screen)" + echo " ๐Ÿ“ฆ Optional: patch-U.mpq (Vanilla loading screens)" + echo " ๐ŸŽฏ Install: Copy to client WoW/Data/ directory" + CLIENT_PATCHES_NEEDED=true + echo "" +fi + +if [[ " ${ENABLED_MODULES[*]} " =~ " ARAC " ]]; then + print_status "WARNING" "mod-arac requires CLIENT PATCHES" + echo " ๐Ÿ“ฆ Required: Patch-A.MPQ" + echo " ๐Ÿ“ Location: ${STORAGE_PATH}/modules/mod-arac/patch-contents/" + echo " ๐ŸŽฏ Install: Copy Patch-A.MPQ to client WoW/Data/ directory" + echo " ๐Ÿ”ง Server: DBC files automatically applied during module setup" + CLIENT_PATCHES_NEEDED=true + echo "" +fi + +if [ "$CLIENT_PATCHES_NEEDED" = true ]; then + print_status "INFO" "Client patches must be distributed manually to all players" +fi + +# Critical Server Configuration Requirements +print_status "HEADER" "CRITICAL SERVER CONFIGURATION" + +CONFIG_CHANGES_NEEDED=false + +if [[ " ${ENABLED_MODULES[*]} " =~ " INDIVIDUAL_PROGRESSION " ]]; then + print_status "CRITICAL" "mod-individual-progression requires worldserver.conf changes" + echo " โš™๏ธ Required: EnablePlayerSettings = 1" + echo " โš™๏ธ Required: DBC.EnforceItemAttributes = 0" + echo " ๐Ÿ“ File: ${STORAGE_PATH}/config/worldserver.conf" + CONFIG_CHANGES_NEEDED=true + echo "" +fi + +if [[ " ${ENABLED_MODULES[*]} " =~ " AOE_LOOT " ]]; then + print_status "WARNING" "mod-aoe-loot requires worldserver.conf optimization" + echo " โš™๏ธ Required: Rate.Corpse.Decay.Looted = 0.01 (default: 0.5)" + echo " ๐Ÿ“ File: ${STORAGE_PATH}/config/worldserver.conf" + CONFIG_CHANGES_NEEDED=true + echo "" +fi + +# Manual NPC Spawning Requirements +print_status "HEADER" "MANUAL NPC SPAWNING REQUIRED" + +NPC_SPAWNING_NEEDED=false + +if [[ " ${ENABLED_MODULES[*]} " =~ " TRANSMOG " ]]; then + print_status "INFO" "mod-transmog requires NPC spawning" + echo " ๐Ÿค– Command: .npc add 190010" + echo " ๐Ÿ“ Location: Spawn in major cities (Stormwind, Orgrimmar, etc.)" + NPC_SPAWNING_NEEDED=true + echo "" +fi + +if [[ " ${ENABLED_MODULES[*]} " =~ " NPC_ENCHANTER " ]]; then + print_status "INFO" "mod-npc-enchanter requires NPC spawning" + echo " ๐Ÿค– Command: .npc add [enchanter_id]" + echo " ๐Ÿ“ Location: Spawn in major cities" + NPC_SPAWNING_NEEDED=true + echo "" +fi + +if [[ " ${ENABLED_MODULES[*]} " =~ " REAGENT_BANK " ]]; then + print_status "INFO" "mod-reagent-bank requires NPC spawning" + echo " ๐Ÿค– Command: .npc add 290011" + echo " ๐Ÿ“ Location: Spawn in major cities" + NPC_SPAWNING_NEEDED=true + echo "" +fi + +if [ "$NPC_SPAWNING_NEEDED" = true ]; then + print_status "INFO" "Use GM account with level 3 permissions to spawn NPCs" +fi + +# Configuration File Management +print_status "HEADER" "CONFIGURATION FILE SETUP" + +echo "Module configuration files are automatically copied during container startup:" +echo "" + +for module in "${ENABLED_MODULES[@]}"; do + case $module in + "PLAYERBOTS") + echo " ๐Ÿ“ playerbots.conf - Bot behavior, RandomBot settings" + ;; + "AOE_LOOT") + echo " ๐Ÿ“ mod_aoe_loot.conf - Loot range, group settings" + ;; + "LEARN_SPELLS") + echo " ๐Ÿ“ mod_learnspells.conf - Auto-learn behavior" + ;; + "FIREWORKS") + echo " ๐Ÿ“ mod_fireworks.conf - Level-up effects" + ;; + "INDIVIDUAL_PROGRESSION") + echo " ๐Ÿ“ individual_progression.conf - Era progression settings" + ;; + "TRANSMOG") + echo " ๐Ÿ“ transmog.conf - Transmogrification rules" + ;; + "SOLO_LFG") + echo " ๐Ÿ“ SoloLfg.conf - Solo dungeon finder settings" + ;; + "ELUNA") + echo " ๐Ÿ“ mod_LuaEngine.conf - Lua scripting engine" + ;; + *) + ;; + esac +done + +# Database Backup Recommendation +print_status "HEADER" "DATABASE BACKUP RECOMMENDATION" + +if [[ " ${ENABLED_MODULES[*]} " =~ " ARAC " ]] || [[ " ${ENABLED_MODULES[*]} " =~ " INDIVIDUAL_PROGRESSION " ]]; then + print_status "CRITICAL" "Database backup STRONGLY RECOMMENDED" + echo " ๐Ÿ’พ Modules modify core database tables" + echo " ๐Ÿ”„ Backup command: docker exec ac-mysql mysqldump -u root -p\${MYSQL_ROOT_PASSWORD} --all-databases > backup.sql" + echo "" +fi + +# Performance Considerations +print_status "HEADER" "PERFORMANCE CONSIDERATIONS" + +if [[ " ${ENABLED_MODULES[*]} " =~ " PLAYERBOTS " ]]; then + print_status "WARNING" "mod-playerbots can significantly impact server performance" + echo " ๐Ÿค– Default: 500 RandomBots (MinRandomBots/MaxRandomBots)" + echo " ๐Ÿ’ก Recommendation: Start with lower numbers and scale up" + echo " ๐Ÿ“Š Monitor: CPU usage, memory consumption, database load" + echo "" +fi + +if [[ " ${ENABLED_MODULES[*]} " =~ " ELUNA " ]]; then + print_status "INFO" "mod-eluna performance depends on Lua script complexity" + echo " ๐Ÿ“œ Complex scripts can impact server performance" + echo " ๐Ÿ” Monitor script execution times" + echo "" +fi + +# Eluna Lua Scripting Setup +if [[ " ${ENABLED_MODULES[*]} " =~ " ELUNA " ]]; then + print_status "HEADER" "ELUNA LUA SCRIPTING REQUIREMENTS" + + if [ -d "${STORAGE_PATH}/lua_scripts" ]; then + print_status "SUCCESS" "Lua scripts directory exists: ${STORAGE_PATH}/lua_scripts" + SCRIPT_COUNT=$(find "${STORAGE_PATH}/lua_scripts" -name "*.lua" 2>/dev/null | wc -l) + print_status "INFO" "Found $SCRIPT_COUNT Lua script(s)" + else + print_status "WARNING" "Lua scripts directory missing: ${STORAGE_PATH}/lua_scripts" + print_status "INFO" "Run ./scripts/setup-eluna.sh to create directory and example scripts" + fi + + print_status "INFO" "Eluna Script Management:" + echo " ๐Ÿ”„ Reload scripts: .reload eluna" + echo " ๐Ÿ“ Script location: ${STORAGE_PATH}/lua_scripts" + echo " โš ๏ธ Compatibility: AzerothCore mod-eluna only (NOT standard Eluna)" + echo " ๐Ÿ“‹ Requirements: English DBC files recommended" + echo "" +fi + +# Summary and Next Steps +print_status "HEADER" "SUMMARY AND NEXT STEPS" + +echo "๐Ÿ“‹ REQUIRED MANUAL ACTIONS:" +echo "" + +if [[ " ${ENABLED_MODULES[*]} " =~ " PLAYERBOTS " ]]; then + echo "1. ๐Ÿ”ง CRITICAL: Switch to Playerbot AzerothCore branch OR disable MODULE_PLAYERBOTS" +fi + +if [ "$CONFIG_CHANGES_NEEDED" = true ]; then + echo "2. โš™๏ธ Edit worldserver.conf with required settings (see above)" +fi + +if [ "$CLIENT_PATCHES_NEEDED" = true ]; then + echo "3. ๐Ÿ“ฆ Distribute client patches to all players" +fi + +if [ "$NPC_SPAWNING_NEEDED" = true ]; then + echo "4. ๐Ÿค– Spawn required NPCs using GM commands" +fi + +echo "" +echo "๐Ÿ“– RECOMMENDED ORDER:" +echo " 1. Complete server configuration changes" +echo " 2. Rebuild containers with: ./scripts/rebuild-with-modules.sh" +echo " 3. Test in development environment first" +echo " 4. Create GM account and spawn NPCs" +echo " 5. Distribute client patches to players" +echo " 6. Monitor performance and adjust settings as needed" + +echo "" +print_status "SUCCESS" "Module configuration analysis complete!" +print_status "INFO" "Review all CRITICAL and WARNING items before deploying to production" \ No newline at end of file diff --git a/scripts/setup-eluna.sh b/scripts/setup-eluna.sh new file mode 100755 index 0000000..1015181 --- /dev/null +++ b/scripts/setup-eluna.sh @@ -0,0 +1,347 @@ +#!/bin/bash + +# ============================================== +# AzerothCore Eluna Lua Scripting Setup +# ============================================== +# Sets up Lua scripting environment for mod-eluna + +set -e + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +MAGENTA='\033[0;35m' +NC='\033[0m' # No Color + +# Function to print colored output +print_status() { + local status=$1 + local message=$2 + case $status in + "INFO") + echo -e "${BLUE}โ„น๏ธ ${message}${NC}" + ;; + "SUCCESS") + echo -e "${GREEN}โœ… ${message}${NC}" + ;; + "WARNING") + echo -e "${YELLOW}โš ๏ธ ${message}${NC}" + ;; + "ERROR") + echo -e "${RED}โŒ ${message}${NC}" + ;; + "HEADER") + echo -e "\n${MAGENTA}=== ${message} ===${NC}" + ;; + esac +} + +# Load environment variables +if [ -f "docker-compose-azerothcore-services.env" ]; then + source docker-compose-azerothcore-services.env +else + print_status "ERROR" "Environment file not found. Run from acore-compose directory." + exit 1 +fi + +print_status "HEADER" "AZEROTHCORE ELUNA LUA SCRIPTING SETUP" + +# Check if Eluna is enabled +if [ "$MODULE_ELUNA" != "1" ]; then + print_status "ERROR" "MODULE_ELUNA is not enabled. Set MODULE_ELUNA=1 in environment file." + exit 1 +fi + +print_status "SUCCESS" "mod-eluna is enabled" + +# Create lua_scripts directory +LUA_SCRIPTS_DIR="${STORAGE_PATH}/lua_scripts" +print_status "INFO" "Creating Lua scripts directory: $LUA_SCRIPTS_DIR" + +if [ ! -d "$LUA_SCRIPTS_DIR" ]; then + mkdir -p "$LUA_SCRIPTS_DIR" + print_status "SUCCESS" "Created lua_scripts directory" +else + print_status "INFO" "lua_scripts directory already exists" +fi + +# Create example scripts +print_status "HEADER" "CREATING EXAMPLE LUA SCRIPTS" + +# Welcome script +cat > "$LUA_SCRIPTS_DIR/welcome.lua" << 'EOF' +-- ============================================== +-- Welcome Script for AzerothCore mod-eluna +-- ============================================== +-- Sends welcome message to players on login + +local PLAYER_EVENT_ON_LOGIN = 3 + +local function OnPlayerLogin(event, player) + local playerName = player:GetName() + local accountId = player:GetAccountId() + + -- Send welcome message + player:SendBroadcastMessage("|cff00ff00Welcome to the AzerothCore server, " .. playerName .. "!|r") + player:SendBroadcastMessage("|cffyellow๐ŸŽฎ This server features custom modules and Lua scripting!|r") + + -- Log the login + print("Player " .. playerName .. " (Account: " .. accountId .. ") has logged in") +end + +-- Register the event +RegisterPlayerEvent(PLAYER_EVENT_ON_LOGIN, OnPlayerLogin) + +print("โœ… Welcome script loaded successfully") +EOF + +print_status "SUCCESS" "Created example welcome.lua script" + +# Server info script +cat > "$LUA_SCRIPTS_DIR/server_info.lua" << 'EOF' +-- ============================================== +-- Server Info Commands for AzerothCore mod-eluna +-- ============================================== +-- Provides custom server information commands + +local function ServerInfoCommand(player, command) + if command == "info" or command == "serverinfo" then + player:SendBroadcastMessage("|cff00ffffServer Information:|r") + player:SendBroadcastMessage("โ€ข Core: AzerothCore with mod-eluna") + player:SendBroadcastMessage("โ€ข Lua Scripting: Enabled") + player:SendBroadcastMessage("โ€ข Active Modules: 13 gameplay enhancing modules") + player:SendBroadcastMessage("โ€ข Features: Playerbots, Transmog, Solo LFG, and more!") + return false -- Command handled + end + return true -- Command not handled, continue processing +end + +-- Register the command handler +local PLAYER_EVENT_ON_COMMAND = 42 +RegisterPlayerEvent(PLAYER_EVENT_ON_COMMAND, ServerInfoCommand) + +print("โœ… Server info commands loaded successfully") +print(" Usage: .info or .serverinfo") +EOF + +print_status "SUCCESS" "Created example server_info.lua script" + +# Level reward script +cat > "$LUA_SCRIPTS_DIR/level_rewards.lua" << 'EOF' +-- ============================================== +-- Level Reward Script for AzerothCore mod-eluna +-- ============================================== +-- Gives rewards to players when they level up + +local PLAYER_EVENT_ON_LEVEL_CHANGE = 13 + +local function OnPlayerLevelUp(event, player, oldLevel) + local newLevel = player:GetLevel() + local playerName = player:GetName() + + -- Skip if level decreased (rare edge case) + if newLevel <= oldLevel then + return + end + + -- Congratulate the player + player:SendBroadcastMessage("|cffff6600Congratulations on reaching level " .. newLevel .. "!|r") + + -- Give rewards for milestone levels + local milestoneRewards = { + [10] = {item = 6948, count = 1, message = "Hearthstone for your travels!"}, + [20] = {gold = 100, message = "1 gold to help with expenses!"}, + [30] = {gold = 500, message = "5 gold for your dedication!"}, + [40] = {gold = 1000, message = "10 gold for reaching level 40!"}, + [50] = {gold = 2000, message = "20 gold for reaching level 50!"}, + [60] = {gold = 5000, message = "50 gold for reaching the original level cap!"}, + [70] = {gold = 10000, message = "100 gold for reaching the Burning Crusade cap!"}, + [80] = {gold = 20000, message = "200 gold for reaching max level!"} + } + + local reward = milestoneRewards[newLevel] + if reward then + if reward.item then + player:AddItem(reward.item, reward.count or 1) + end + if reward.gold then + player:ModifyMoney(reward.gold * 10000) -- Convert gold to copper + end + player:SendBroadcastMessage("|cffff0000Milestone Reward: " .. reward.message .. "|r") + + -- Announce to server for major milestones + if newLevel >= 60 then + SendWorldMessage("|cffff6600" .. playerName .. " has reached level " .. newLevel .. "! Congratulations!|r") + end + end + + print("Player " .. playerName .. " leveled from " .. oldLevel .. " to " .. newLevel) +end + +-- Register the event +RegisterPlayerEvent(PLAYER_EVENT_ON_LEVEL_CHANGE, OnPlayerLevelUp) + +print("โœ… Level rewards script loaded successfully") +EOF + +print_status "SUCCESS" "Created example level_rewards.lua script" + +# Create a main loader script +cat > "$LUA_SCRIPTS_DIR/init.lua" << 'EOF' +-- ============================================== +-- Main Loader Script for AzerothCore mod-eluna +-- ============================================== +-- This script loads all other Lua scripts + +print("๐Ÿš€ Loading AzerothCore Lua Scripts...") + +-- Load all scripts in this directory +-- Note: Individual scripts are loaded automatically by mod-eluna +-- This file serves as documentation for loaded scripts + +local loadedScripts = { + "welcome.lua - Player welcome messages on login", + "server_info.lua - Custom server information commands", + "level_rewards.lua - Milestone rewards for leveling" +} + +print("๐Ÿ“œ Available Lua Scripts:") +for i, script in ipairs(loadedScripts) do + print(" " .. i .. ". " .. script) +end + +print("โœ… Lua script initialization complete") +print("๐Ÿ”ง To reload scripts: .reload eluna") +EOF + +print_status "SUCCESS" "Created init.lua loader script" + +# Create Eluna configuration documentation +cat > "$LUA_SCRIPTS_DIR/README.md" << 'EOF' +# AzerothCore Eluna Lua Scripts + +This directory contains Lua scripts for the AzerothCore mod-eluna engine. + +## Available Scripts + +### welcome.lua +- Sends welcome messages to players on login +- Logs player login events +- Demonstrates basic player event handling + +### server_info.lua +- Provides `.info` and `.serverinfo` commands +- Shows server configuration and features +- Demonstrates custom command registration + +### level_rewards.lua +- Gives rewards to players at milestone levels (10, 20, 30, etc.) +- Announces major level achievements to the server +- Demonstrates player level change events and item/gold rewards + +### init.lua +- Documentation script listing all available scripts +- Serves as a reference for loaded functionality + +## Script Management + +### Reloading Scripts +``` +.reload eluna +``` + +### Adding New Scripts +1. Create `.lua` file in this directory +2. Use RegisterPlayerEvent, RegisterCreatureEvent, etc. to register events +3. Reload scripts with `.reload eluna` command + +### Configuration +Eluna configuration is managed in `/azerothcore/config/mod_LuaEngine.conf`: +- Script path: `lua_scripts` (this directory) +- Auto-reload: Disabled by default (enable for development) +- Bytecode cache: Enabled for performance + +## Event Types + +Common event types for script development: +- `PLAYER_EVENT_ON_LOGIN = 3` +- `PLAYER_EVENT_ON_LOGOUT = 4` +- `PLAYER_EVENT_ON_LEVEL_CHANGE = 13` +- `PLAYER_EVENT_ON_COMMAND = 42` +- `CREATURE_EVENT_ON_SPAWN = 5` +- `SPELL_EVENT_ON_CAST = 1` + +## API Reference + +### Player Methods +- `player:GetName()` - Get player name +- `player:GetLevel()` - Get player level +- `player:SendBroadcastMessage(msg)` - Send message to player +- `player:AddItem(itemId, count)` - Add item to player +- `player:ModifyMoney(copper)` - Add/remove money (in copper) + +### Global Functions +- `print(message)` - Log to server console +- `SendWorldMessage(message)` - Send message to all players +- `RegisterPlayerEvent(eventId, function)` - Register player event handler + +## Development Tips + +1. **Test in Development**: Enable auto-reload during development +2. **Error Handling**: Use pcall() for error-safe script execution +3. **Performance**: Avoid heavy operations in frequently called events +4. **Debugging**: Use print() statements for debugging output + +## Compatibility Notes + +- **AzerothCore Specific**: These scripts are for AzerothCore's mod-eluna +- **Not Compatible**: Standard Eluna scripts will NOT work +- **API Differences**: AzerothCore mod-eluna has different API than standard Eluna +EOF + +print_status "SUCCESS" "Created comprehensive README.md documentation" + +# Check if volume mount exists in docker-compose +print_status "HEADER" "CHECKING DOCKER COMPOSE CONFIGURATION" + +if grep -q "lua_scripts" docker-compose-azerothcore-services.yml; then + print_status "SUCCESS" "lua_scripts volume mount already configured" +else + print_status "WARNING" "lua_scripts volume mount not found in docker-compose-azerothcore-services.yml" + print_status "INFO" "You may need to add volume mount to worldserver service:" + echo " volumes:" + echo " - \${STORAGE_PATH}/lua_scripts:/azerothcore/lua_scripts" +fi + +# Check if Eluna container is configured +if grep -q "ac-eluna:" docker-compose-azerothcore-services.yml; then + print_status "SUCCESS" "Eluna container (ac-eluna) is configured" +else + print_status "INFO" "No separate Eluna container found (using embedded mod-eluna)" +fi + +# Summary +print_status "HEADER" "SETUP COMPLETE" + +echo "๐Ÿ“ Lua Scripts Directory: $LUA_SCRIPTS_DIR" +echo "๐Ÿ“œ Example Scripts Created:" +echo " โ€ข welcome.lua - Player login messages" +echo " โ€ข server_info.lua - Custom info commands" +echo " โ€ข level_rewards.lua - Milestone rewards" +echo " โ€ข init.lua - Script loader documentation" +echo " โ€ข README.md - Complete documentation" +echo "" + +print_status "INFO" "Next Steps:" +echo "1. Start/restart your worldserver container" +echo "2. Test scripts with GM commands:" +echo " โ€ข .reload eluna" +echo " โ€ข .info (test server_info.lua)" +echo "3. Login with a character to test welcome.lua" +echo "4. Level up a character to test level_rewards.lua" +echo "" + +print_status "SUCCESS" "Eluna Lua scripting environment setup complete!" +print_status "WARNING" "Remember: AzerothCore mod-eluna is NOT compatible with standard Eluna scripts" \ No newline at end of file