bug fixes

This commit is contained in:
Deckard
2025-09-26 03:02:57 -04:00
parent fa3eb7c9fb
commit 73bd32f8ed
5 changed files with 552 additions and 582 deletions

26
.env
View File

@@ -76,12 +76,25 @@ CONTAINER_AUTHSERVER=ac-authserver
CONTAINER_WORLDSERVER=ac-worldserver CONTAINER_WORLDSERVER=ac-worldserver
CONTAINER_ELUNA=ac-eluna CONTAINER_ELUNA=ac-eluna
# ==============================================
# DEPLOYMENT CONFIGURATION (REQUIRED)
# ==============================================
# Deployment mode: local (development) or portainer (production)
DEPLOYMENT_MODE=local
# Storage configuration for Portainer NFS deployments
# Leave empty for local development with named volumes
STORAGE_PATH_CONTAINERS=
# Use named volumes (true for local, false for Portainer)
USE_NAMED_VOLUMES=true
# ============================================== # ==============================================
# NETWORK SETTINGS (REQUIRED) # NETWORK SETTINGS (REQUIRED)
# ============================================== # ==============================================
NETWORK_NAME=azerothcore NETWORK_NAME=azerothcore
NETWORK_SUBNET=172.28.0.0/16 NETWORK_SUBNET=172.20.0.0/16
NETWORK_GATEWAY=172.28.0.1 NETWORK_GATEWAY=172.20.0.1
# ============================================== # ==============================================
# SERVER CONFIGURATION (REQUIRED) # SERVER CONFIGURATION (REQUIRED)
@@ -298,8 +311,13 @@ PMA_MAX_EXECUTION_TIME=600
# Keira3 Database Editor settings # Keira3 Database Editor settings
KEIRA3_EXTERNAL_PORT=4201 KEIRA3_EXTERNAL_PORT=4201
# CMS Web Interface settings (removed - build your own) # CMS Web Interface settings (optional service)
# CMS_EXTERNAL_PORT=8001 CMS_EXTERNAL_PORT=8001
# Service Configuration Toggles
USE_OFFICIAL_KEIRA3=false
CLIENT_DATA_METHOD=7z
SIMPLIFIED_LOGGING=false
# Grafana settings # Grafana settings
GF_EXTERNAL_PORT=3001 GF_EXTERNAL_PORT=3001

View File

@@ -7,14 +7,14 @@ This guide will help you deploy AzerothCore in Portainer using your existing NFS
### **📁 Files Needed:** ### **📁 Files Needed:**
- `portainer-stack.yml` - Main docker-compose stack file - `portainer-stack.yml` - Main docker-compose stack file
- `portainer-env-template.txt` - Environment variables template - `portainer-env-template.txt` - Environment variables template
- Your existing `backup-scripts/` directory - `backup-scripts/` Storage directory of backup and restoration scripts
--- ---
## **📋 Step 1: Pre-Deployment Setup** ## **📋 Step 1: Pre-Deployment Setup**
### **1.1 Prepare Storage Directories** ### **1.1 Prepare Storage Directories**
Ensure these directories exist on your NFS storage: These directories will be created by the compose file:
```bash ```bash
# Main AzerothCore directory structure # Main AzerothCore directory structure
${STORAGE_PATH_CONTAINERS}/azerothcore/ ${STORAGE_PATH_CONTAINERS}/azerothcore/

View File

@@ -1,5 +1,10 @@
# NOTE: Do not include 'version:' attribute - it is obsolete and will cause warnings version: '3.8'
# Docker Compose automatically uses the latest compose file format
# ==============================================
# AZEROTHCORE UNIFIED DOCKER COMPOSE
# ==============================================
# Compatible with both local development and Portainer deployment
# Set DEPLOYMENT_MODE=local|portainer in .env file
services: services:
# Step 1: Standard MySQL database # Step 1: Standard MySQL database
@@ -12,7 +17,7 @@ services:
ports: ports:
- "${DOCKER_DB_EXTERNAL_PORT:-64306}:3306" - "${DOCKER_DB_EXTERNAL_PORT:-64306}:3306"
volumes: volumes:
- ac_mysql_data:/var/lib/mysql - ${STORAGE_PATH_CONTAINERS}${STORAGE_PATH_CONTAINERS:+/azerothcore/mysql}${STORAGE_PATH_CONTAINERS:-ac_mysql_data}:/var/lib/mysql
command: > command: >
--default-authentication-plugin=mysql_native_password --default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4 --character-set-server=utf8mb4
@@ -30,7 +35,7 @@ services:
networks: networks:
- azerothcore - azerothcore
# Step 2: Initialize databases (fixed SQL syntax) # Step 2: Initialize databases
ac-db-init: ac-db-init:
image: mysql:8.0 image: mysql:8.0
container_name: ac-db-init container_name: ac-db-init
@@ -63,7 +68,7 @@ services:
networks: networks:
- azerothcore - azerothcore
volumes: volumes:
- ac_config:/azerothcore/env/dist/etc - ${STORAGE_PATH_CONTAINERS}${STORAGE_PATH_CONTAINERS:+/azerothcore/config}${STORAGE_PATH_CONTAINERS:-ac_config}:/azerothcore/env/dist/etc
environment: environment:
AC_DATA_DIR: "/azerothcore/data" AC_DATA_DIR: "/azerothcore/data"
AC_LOGS_DIR: "/azerothcore/logs" AC_LOGS_DIR: "/azerothcore/logs"
@@ -73,7 +78,6 @@ services:
AC_CLOSE_IDLE_CONNECTIONS: "false" AC_CLOSE_IDLE_CONNECTIONS: "false"
AC_UPDATES_ENABLE_DATABASES: "7" AC_UPDATES_ENABLE_DATABASES: "7"
AC_UPDATES_AUTO_SETUP: "1" AC_UPDATES_AUTO_SETUP: "1"
# Logger configuration - Use defaults
AC_LOG_LEVEL: "1" AC_LOG_LEVEL: "1"
AC_LOGGER_ROOT_CONFIG: "1,Console" AC_LOGGER_ROOT_CONFIG: "1,Console"
AC_LOGGER_SERVER_CONFIG: "1,Console" AC_LOGGER_SERVER_CONFIG: "1,Console"
@@ -112,7 +116,6 @@ services:
AC_LOGIN_DATABASE_INFO: "ac-mysql;3306;root;${DOCKER_DB_ROOT_PASSWORD:-password};acore_auth" AC_LOGIN_DATABASE_INFO: "ac-mysql;3306;root;${DOCKER_DB_ROOT_PASSWORD:-password};acore_auth"
AC_UPDATES_ENABLE_DATABASES: "0" AC_UPDATES_ENABLE_DATABASES: "0"
AC_BIND_IP: "0.0.0.0" AC_BIND_IP: "0.0.0.0"
# Logger configuration - Use defaults
AC_LOG_LEVEL: "1" AC_LOG_LEVEL: "1"
AC_LOGGER_ROOT_CONFIG: "1,Console" AC_LOGGER_ROOT_CONFIG: "1,Console"
AC_LOGGER_SERVER_CONFIG: "1,Console" AC_LOGGER_SERVER_CONFIG: "1,Console"
@@ -123,10 +126,86 @@ services:
networks: networks:
- azerothcore - azerothcore
volumes: volumes:
- ac_config:/azerothcore/env/dist/etc - ${STORAGE_PATH_CONTAINERS}${STORAGE_PATH_CONTAINERS:+/azerothcore/config}${STORAGE_PATH_CONTAINERS:-ac_config}:/azerothcore/env/dist/etc
# Add capabilities for priority setting
cap_add: cap_add:
- SYS_NICE - SYS_NICE
healthcheck:
test: ["CMD", "sh", "-c", "ps aux | grep '[a]uthserver' | grep -v grep || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
# Client Data Download Service
ac-client-data:
image: alpine:latest
container_name: ac-client-data
volumes:
- ${HOST_DATA_PATH:-./data}:/azerothcore/data
working_dir: /tmp
command: >
sh -c "
apk add --no-cache curl unzip wget ca-certificates p7zip
if [ -d '/azerothcore/data/maps' ] && [ -d '/azerothcore/data/vmaps' ] && [ -d '/azerothcore/data/mmaps' ] && [ -d '/azerothcore/data/dbc' ]; then
echo '✅ Game data already exists, skipping download'
exit 0
fi
echo '🚀 Starting AzerothCore game data download...'
echo 'This will download ~15GB of data and may take 10-30 minutes'
# Get the latest release info from wowgaming/client-data
echo '📡 Fetching latest client data release info...'
LATEST_URL=$$(wget -qO- https://api.github.com/repos/wowgaming/client-data/releases/latest | grep '\"browser_download_url\":' | grep '\.7z' | cut -d'\"' -f4 | head -1)
if [ -z \"$$LATEST_URL\" ]; then
echo '❌ Could not fetch latest release URL'
echo '📥 Using fallback: direct download from v16 release'
LATEST_URL='https://github.com/wowgaming/client-data/releases/download/v16/data.7z'
fi
echo \"📥 Downloading client data from: $$LATEST_URL\"
# Download the client data
wget -O data.7z \"$$LATEST_URL\" || {
echo '❌ Download failed, trying alternative method'
curl -L -o data.7z \"$$LATEST_URL\" || {
echo '❌ All download methods failed'
exit 1
}
}
echo '📊 Download completed, file size:'
ls -lh data.7z
echo '📂 Extracting client data (this may take 10-15 minutes)...'
7z x data.7z -o/azerothcore/data/ || {
echo '❌ Extraction failed'
exit 1
}
echo '🧹 Cleaning up downloaded archive...'
rm -f data.7z
echo '✅ Client data extraction complete!'
echo '📁 Verifying extracted directories:'
ls -la /azerothcore/data/
# Verify required directories exist
for dir in maps vmaps mmaps dbc; do
if [ -d \"/azerothcore/data/$$dir\" ]; then
echo \"✅ $$dir directory: OK\"
else
echo \"❌ $$dir directory: MISSING\"
fi
done
echo '🎉 Game data setup complete! AzerothCore worldserver can now start.'
"
restart: "no"
networks:
- azerothcore
# Step 5: World server with Playerbots support # Step 5: World server with Playerbots support
ac-worldserver: ac-worldserver:
@@ -145,33 +224,30 @@ services:
AC_BIND_IP: "0.0.0.0" AC_BIND_IP: "0.0.0.0"
AC_DATA_DIR: "/azerothcore/data" AC_DATA_DIR: "/azerothcore/data"
AC_SOAP_PORT: "7878" AC_SOAP_PORT: "7878"
# Disable process priority to avoid permission error
AC_PROCESS_PRIORITY: "0" AC_PROCESS_PRIORITY: "0"
# Playerbots configuration
PLAYERBOT_ENABLED: "${PLAYERBOT_ENABLED:-1}" PLAYERBOT_ENABLED: "${PLAYERBOT_ENABLED:-1}"
PLAYERBOT_MAX_BOTS: "${PLAYERBOT_MAX_BOTS:-40}" PLAYERBOT_MAX_BOTS: "${PLAYERBOT_MAX_BOTS:-40}"
# Logger configuration - Use config file defaults with proper log level # Logger configuration - Use config file defaults with proper log level
AC_LOG_LEVEL: "2" AC_LOG_LEVEL: "2"
# Commented out custom logger configs to use worldserver.conf defaults
# AC_LOGGER_ROOT_CONFIG: "2,Console Server"
# AC_LOGGER_SERVER_CONFIG: "4,Console Server"
# AC_APPENDER_CONSOLE_CONFIG: "1,4,0"
# AC_APPENDER_SERVER_CONFIG: "2,5,0,/azerothcore/logs/Server.log,w"
# AC_APPENDER_ERRORS_CONFIG: "2,2,0,/azerothcore/logs/Errors.log,w"
ports: ports:
- "${DOCKER_WORLD_EXTERNAL_PORT:-8215}:8085" - "${DOCKER_WORLD_EXTERNAL_PORT:-8215}:8085"
- "${DOCKER_SOAP_EXTERNAL_PORT:-7778}:7878" - "${DOCKER_SOAP_EXTERNAL_PORT:-7778}:7878"
volumes: volumes:
- ${HOST_DATA_PATH:-./data}:/azerothcore/data - ${HOST_DATA_PATH:-./data}:/azerothcore/data
- ac_config:/azerothcore/env/dist/etc - ${STORAGE_PATH_CONTAINERS}${STORAGE_PATH_CONTAINERS:+/azerothcore/config}${STORAGE_PATH_CONTAINERS:-ac_config}:/azerothcore/env/dist/etc
- ac_logs:/azerothcore/logs - ${STORAGE_PATH_CONTAINERS}${STORAGE_PATH_CONTAINERS:+/azerothcore/logs}${STORAGE_PATH_CONTAINERS:-ac_logs}:/azerothcore/logs
- ac_modules:/azerothcore/modules - ${STORAGE_PATH_CONTAINERS}${STORAGE_PATH_CONTAINERS:+/azerothcore/modules}${STORAGE_PATH_CONTAINERS:-ac_modules}:/azerothcore/modules
restart: unless-stopped restart: unless-stopped
networks: networks:
- azerothcore - azerothcore
# Add capabilities for process priority if needed
cap_add: cap_add:
- SYS_NICE - SYS_NICE
healthcheck:
test: ["CMD", "sh", "-c", "ps aux | grep '[w]orldserver' | grep -v grep || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 120s
# Optional: Eluna Lua Engine # Optional: Eluna Lua Engine
ac-eluna: ac-eluna:
@@ -188,47 +264,55 @@ services:
image: alpine/git:latest image: alpine/git:latest
container_name: ac-modules container_name: ac-modules
volumes: volumes:
- ac_modules:/modules - ${STORAGE_PATH_CONTAINERS}${STORAGE_PATH_CONTAINERS:+/azerothcore/modules}${STORAGE_PATH_CONTAINERS:-ac_modules}:/modules
environment: environment:
- MODULE_PLAYERBOTS=${MODULE_PLAYERBOTS:-1} - MODULE_PLAYERBOTS=${MODULE_PLAYERBOTS:-1}
- MODULE_AOE_LOOT=${MODULE_AOE_LOOT:-0} - MODULE_AOE_LOOT=${MODULE_AOE_LOOT:-0}
- MODULE_LEARN_SPELLS=${MODULE_LEARN_SPELLS:-0} - MODULE_LEARN_SPELLS=${MODULE_LEARN_SPELLS:-0}
- MODULE_FIREWORKS=${MODULE_FIREWORKS:-0} - MODULE_FIREWORKS=${MODULE_FIREWORKS:-0}
- MODULE_INDIVIDUAL_PROGRESSION=${MODULE_INDIVIDUAL_PROGRESSION:-0} - MODULE_INDIVIDUAL_PROGRESSION=${MODULE_INDIVIDUAL_PROGRESSION:-0}
- DEPLOYMENT_MODE=${DEPLOYMENT_MODE:-local}
entrypoint: ["/bin/sh", "-c"] entrypoint: ["/bin/sh", "-c"]
command: | command: |
" "
echo 'Initializing module management...' echo 'Initializing module management...'
cd /modules cd /modules
# Install Playerbots if enabled if [ \"$DEPLOYMENT_MODE\" = \"portainer\" ]; then
if [ \"$$MODULE_PLAYERBOTS\" = \"1\" ] && [ ! -d \"mod-playerbots\" ]; then echo 'Simple module setup for Portainer deployment...'
echo 'Installing mod-playerbots...' mkdir -p mod-playerbots
git clone https://github.com/liyunfan1223/mod-playerbots.git mod-playerbots echo '✅ Playerbot module directory created'
fi else
echo 'Advanced module setup for local development...'
# Install Playerbots if enabled
if [ \"$$MODULE_PLAYERBOTS\" = \"1\" ] && [ ! -d \"mod-playerbots\" ]; then
echo 'Installing mod-playerbots...'
git clone https://github.com/liyunfan1223/mod-playerbots.git mod-playerbots
fi
# Install AOE Loot if enabled # Install AOE Loot if enabled
if [ \"$$MODULE_AOE_LOOT\" = \"1\" ] && [ ! -d \"mod-aoe-loot\" ]; then if [ \"$$MODULE_AOE_LOOT\" = \"1\" ] && [ ! -d \"mod-aoe-loot\" ]; then
echo 'Installing mod-aoe-loot...' echo 'Installing mod-aoe-loot...'
git clone https://github.com/azerothcore/mod-aoe-loot.git mod-aoe-loot git clone https://github.com/azerothcore/mod-aoe-loot.git mod-aoe-loot
fi fi
# Install Learn Spells if enabled # Install Learn Spells if enabled
if [ \"$$MODULE_LEARN_SPELLS\" = \"1\" ] && [ ! -d \"mod-learn-spells\" ]; then if [ \"$$MODULE_LEARN_SPELLS\" = \"1\" ] && [ ! -d \"mod-learn-spells\" ]; then
echo 'Installing mod-learn-spells...' echo 'Installing mod-learn-spells...'
git clone https://github.com/azerothcore/mod-learn-spells.git mod-learn-spells git clone https://github.com/azerothcore/mod-learn-spells.git mod-learn-spells
fi fi
# Install Fireworks on Level if enabled # Install Fireworks on Level if enabled
if [ \"$$MODULE_FIREWORKS\" = \"1\" ] && [ ! -d \"mod-fireworks-on-level\" ]; then if [ \"$$MODULE_FIREWORKS\" = \"1\" ] && [ ! -d \"mod-fireworks-on-level\" ]; then
echo 'Installing mod-fireworks-on-level...' echo 'Installing mod-fireworks-on-level...'
git clone https://github.com/azerothcore/mod-fireworks-on-level.git mod-fireworks-on-level git clone https://github.com/azerothcore/mod-fireworks-on-level.git mod-fireworks-on-level
fi fi
# Install Individual Progression if enabled # Install Individual Progression if enabled
if [ \"$$MODULE_INDIVIDUAL_PROGRESSION\" = \"1\" ] && [ ! -d \"mod-individual-progression\" ]; then if [ \"$$MODULE_INDIVIDUAL_PROGRESSION\" = \"1\" ] && [ ! -d \"mod-individual-progression\" ]; then
echo 'Installing mod-individual-progression...' echo 'Installing mod-individual-progression...'
git clone https://github.com/azerothcore/mod-individual-progression.git mod-individual-progression git clone https://github.com/azerothcore/mod-individual-progression.git mod-individual-progression
fi
fi fi
echo 'Module management complete. Keeping container alive...' echo 'Module management complete. Keeping container alive...'
@@ -238,83 +322,6 @@ services:
networks: networks:
- azerothcore - azerothcore
# Client Data Download Service
ac-client-data:
image: alpine:latest
container_name: ac-client-data
volumes:
- ${HOST_DATA_PATH:-./data}:/azerothcore/data
working_dir: /tmp
command: >
sh -c "
# Install required packages
apk add --no-cache curl unzip wget ca-certificates
# Check if data already exists
if [ -d '/azerothcore/data/maps' ] && [ -d '/azerothcore/data/vmaps' ] && [ -d '/azerothcore/data/mmaps' ] && [ -d '/azerothcore/data/dbc' ]; then
echo '✅ Game data already exists, skipping download'
exit 0
fi
echo '🚀 Starting AzerothCore game data download...'
echo 'This will download ~15GB of data and may take 10-30 minutes'
# Get the latest release info from wowgaming/client-data
echo '📡 Fetching latest client data release info...'
LATEST_URL=\$(wget -qO- https://api.github.com/repos/wowgaming/client-data/releases/latest | grep '\"browser_download_url\":' | grep '\.7z' | cut -d'\"' -f4 | head -1)
if [ -z \"\$$LATEST_URL\" ]; then
echo '❌ Could not fetch latest release URL'
echo '📥 Using fallback: direct download from v16 release'
LATEST_URL='https://github.com/wowgaming/client-data/releases/download/v16/data.7z'
fi
echo \"📥 Downloading client data from: \$$LATEST_URL\"
# Download the client data
wget -O data.7z \"\$$LATEST_URL\" || {
echo '❌ Download failed, trying alternative method'
curl -L -o data.7z \"\$$LATEST_URL\" || {
echo '❌ All download methods failed'
exit 1
}
}
echo '📊 Download completed, file size:'
ls -lh data.7z
# Install p7zip for extraction
echo '🔧 Installing 7zip extractor...'
apk add --no-cache p7zip
echo '📂 Extracting client data (this may take 10-15 minutes)...'
7z x data.7z -o/azerothcore/data/ || {
echo '❌ Extraction failed'
exit 1
}
echo '🧹 Cleaning up downloaded archive...'
rm -f data.7z
echo '✅ Client data extraction complete!'
echo '📁 Verifying extracted directories:'
ls -la /azerothcore/data/
# Verify required directories exist
for dir in maps vmaps mmaps dbc; do
if [ -d \"/azerothcore/data/\$$dir\" ]; then
echo \"✅ \$$dir directory: OK\"
else
echo \"❌ \$$dir directory: MISSING\"
fi
done
echo '🎉 Game data setup complete! AzerothCore worldserver can now start.'
"
restart: "no"
networks:
- azerothcore
# PHPMyAdmin Database Management Interface # PHPMyAdmin Database Management Interface
ac-phpmyadmin: ac-phpmyadmin:
image: phpmyadmin/phpmyadmin:latest image: phpmyadmin/phpmyadmin:latest
@@ -329,7 +336,6 @@ services:
PMA_PASSWORD: ${DOCKER_DB_ROOT_PASSWORD:-password} PMA_PASSWORD: ${DOCKER_DB_ROOT_PASSWORD:-password}
MYSQL_ROOT_PASSWORD: ${DOCKER_DB_ROOT_PASSWORD:-password} MYSQL_ROOT_PASSWORD: ${DOCKER_DB_ROOT_PASSWORD:-password}
PMA_ARBITRARY: ${PMA_ARBITRARY:-1} PMA_ARBITRARY: ${PMA_ARBITRARY:-1}
# Security settings - configurable via .env
PMA_ABSOLUTE_URI: ${PMA_ABSOLUTE_URI:-} PMA_ABSOLUTE_URI: ${PMA_ABSOLUTE_URI:-}
UPLOAD_LIMIT: ${PMA_UPLOAD_LIMIT:-300M} UPLOAD_LIMIT: ${PMA_UPLOAD_LIMIT:-300M}
MEMORY_LIMIT: ${PMA_MEMORY_LIMIT:-512M} MEMORY_LIMIT: ${PMA_MEMORY_LIMIT:-512M}
@@ -340,93 +346,50 @@ services:
networks: networks:
- azerothcore - azerothcore
# Keira3 Database Editor (Using Node.js base to serve the app) # Keira3 Database Editor (Production Ready)
ac-keira3: ac-keira3:
image: node:18-alpine build:
context: /home/upb/src/Keira3
dockerfile: Dockerfile
target: production
image: keira3:latest
container_name: ac-keira3 container_name: ac-keira3
restart: unless-stopped
depends_on: depends_on:
ac-mysql: ac-mysql:
condition: service_healthy condition: service_healthy
environment: environment:
DB_HOST: ac-mysql - NODE_ENV=production
DB_PORT: 3306 - KEIRA_PORT=8080
DB_USERNAME: root - KEIRA_HOST=0.0.0.0
DB_PASSWORD: ${DOCKER_DB_ROOT_PASSWORD:-password} - KEIRA_DATABASE_HOST=ac-mysql
# External access configuration - KEIRA_DATABASE_PORT=3306
EXTERNAL_BASE_URL: ${EXTERNAL_BASE_URL:-} - KEIRA_DATABASE_USER=root
PMA_EXTERNAL_PORT: ${PMA_EXTERNAL_PORT:-8081} - KEIRA_DATABASE_PASSWORD=${DOCKER_DB_ROOT_PASSWORD:-password}
KEIRA3_EXTERNAL_PORT: ${KEIRA3_EXTERNAL_PORT:-4201} - KEIRA_DATABASE_NAME=acore_world
GF_EXTERNAL_PORT: ${GF_EXTERNAL_PORT:-3001}
INFLUXDB_EXTERNAL_PORT: ${INFLUXDB_EXTERNAL_PORT:-8087}
ports: ports:
- "${KEIRA3_EXTERNAL_PORT:-4201}:4200" - "${KEIRA3_EXTERNAL_PORT:-4201}:8080"
working_dir: /app deploy:
volumes: resources:
- ac_keira3_data:/app limits:
command: > memory: 512M
sh -c " cpus: '0.5'
if [ ! -d node_modules ]; then reservations:
echo 'Setting up Keira3...' memory: 256M
npm init -y cpus: '0.25'
npm install express mysql2 cors healthcheck:
cat > server.js <<EOF test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"]
const express = require('express'); interval: 30s
const mysql = require('mysql2'); timeout: 10s
const cors = require('cors'); retries: 3
const app = express(); start_period: 40s
logging:
app.use(cors()); driver: json-file
app.use(express.json()); options:
app.use(express.static('public')); max-size: "10m"
max-file: "3"
const dbConfig = { security_opt:
host: process.env.DB_HOST, - no-new-privileges:true
port: process.env.DB_PORT,
user: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD
};
app.get('/', (req, res) => {
const baseUrl = process.env.EXTERNAL_BASE_URL || 'http://localhost';
const port = process.env.KEIRA3_EXTERNAL_PORT;
const url = baseUrl.includes('://') ? \`\${baseUrl}:\${port}\` : \`http://\${baseUrl}:\${port}\`;
res.send(\`<h1>Keira3 Database Editor</h1><p>AzerothCore Database Management Interface</p><p>Connect to: <a href="\${url}">\${url}</a></p>\`);
});
app.get('/api/databases', (req, res) => {
const connection = mysql.createConnection(dbConfig);
connection.query('SHOW DATABASES', (err, results) => {
if (err) return res.status(500).json({error: err.message});
res.json(results);
});
connection.end();
});
app.listen(4200, '0.0.0.0', () => {
console.log('Keira3-like interface running on port 4200');
});
EOF
mkdir -p public
cat > public/index.html <<EOF
<!DOCTYPE html>
<html>
<head><title>AzerothCore Database Editor</title></head>
<body>
<h1>AzerothCore Database Management</h1>
<p>Simple database interface for AzerothCore</p>
<script>
const baseUrl = process.env.EXTERNAL_BASE_URL || window.location.protocol + '//' + window.location.hostname;
const pmaPort = process.env.PMA_EXTERNAL_PORT;
const pmaUrl = baseUrl.includes('://') ? baseUrl + ':' + pmaPort : 'http://' + baseUrl + ':' + pmaPort;
document.write('<p>Use PHPMyAdmin at <a href="' + pmaUrl + '">' + pmaUrl + '</a> for full database access.</p>');
</script>
</body>
</html>
EOF
fi
node server.js
"
restart: unless-stopped
networks: networks:
- azerothcore - azerothcore
@@ -441,13 +404,12 @@ services:
DOCKER_INFLUXDB_INIT_ORG: ${INFLUXDB_ORG:-azerothcore} DOCKER_INFLUXDB_INIT_ORG: ${INFLUXDB_ORG:-azerothcore}
DOCKER_INFLUXDB_INIT_BUCKET: ${INFLUXDB_BUCKET:-metrics} DOCKER_INFLUXDB_INIT_BUCKET: ${INFLUXDB_BUCKET:-metrics}
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUXDB_TOKEN:-acore-monitoring-token-12345} DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUXDB_TOKEN:-acore-monitoring-token-12345}
# Security settings
INFLUXDB_HTTP_AUTH_ENABLED: ${INFLUXDB_HTTP_AUTH_ENABLED:-true} INFLUXDB_HTTP_AUTH_ENABLED: ${INFLUXDB_HTTP_AUTH_ENABLED:-true}
INFLUXDB_HTTP_HTTPS_ENABLED: ${INFLUXDB_HTTP_HTTPS_ENABLED:-false} INFLUXDB_HTTP_HTTPS_ENABLED: ${INFLUXDB_HTTP_HTTPS_ENABLED:-false}
ports: ports:
- "${INFLUXDB_EXTERNAL_PORT:-8087}:8086" - "${INFLUXDB_EXTERNAL_PORT:-8087}:8086"
volumes: volumes:
- ac_influxdb_data:/var/lib/influxdb2 - ${STORAGE_PATH_CONTAINERS}${STORAGE_PATH_CONTAINERS:+/azerothcore/influxdb}${STORAGE_PATH_CONTAINERS:-ac_influxdb_data}:/var/lib/influxdb2
restart: unless-stopped restart: unless-stopped
networks: networks:
- azerothcore - azerothcore
@@ -463,7 +425,6 @@ services:
GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD:-acore123} GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD:-acore123}
GF_INSTALL_PLUGINS: ${GF_INSTALL_PLUGINS:-grafana-piechart-panel} GF_INSTALL_PLUGINS: ${GF_INSTALL_PLUGINS:-grafana-piechart-panel}
GF_SERVER_ROOT_URL: ${GF_SERVER_ROOT_URL:-http://localhost:3000} GF_SERVER_ROOT_URL: ${GF_SERVER_ROOT_URL:-http://localhost:3000}
# Security settings
GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION: ${GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION:-false} GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION: ${GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION:-false}
GF_SECURITY_SECRET_KEY: ${GF_SECURITY_SECRET_KEY:-} GF_SECURITY_SECRET_KEY: ${GF_SECURITY_SECRET_KEY:-}
GF_USERS_ALLOW_SIGN_UP: ${GF_USERS_ALLOW_SIGN_UP:-false} GF_USERS_ALLOW_SIGN_UP: ${GF_USERS_ALLOW_SIGN_UP:-false}
@@ -475,13 +436,12 @@ services:
ports: ports:
- "${GF_EXTERNAL_PORT:-3001}:3000" - "${GF_EXTERNAL_PORT:-3001}:3000"
volumes: volumes:
- ac_grafana_data:/var/lib/grafana - ${STORAGE_PATH_CONTAINERS}${STORAGE_PATH_CONTAINERS:+/azerothcore/grafana}${STORAGE_PATH_CONTAINERS:-ac_grafana_data}:/var/lib/grafana
- ac_grafana_config:/etc/grafana - ${STORAGE_PATH_CONTAINERS}${STORAGE_PATH_CONTAINERS:+/azerothcore/grafana-config}${STORAGE_PATH_CONTAINERS:-ac_grafana_config}:/etc/grafana
restart: unless-stopped restart: unless-stopped
networks: networks:
- azerothcore - azerothcore
# Automated Backup System # Automated Backup System
ac-backup: ac-backup:
image: mysql:8.0 image: mysql:8.0
@@ -501,37 +461,27 @@ services:
- ${HOST_BACKUP_PATH:-./backups}:/backups - ${HOST_BACKUP_PATH:-./backups}:/backups
- ${HOST_BACKUP_SCRIPTS_PATH:-./backup-scripts}:/scripts - ${HOST_BACKUP_SCRIPTS_PATH:-./backup-scripts}:/scripts
working_dir: /scripts working_dir: /scripts
command: > command:
bash -c " - /bin/bash
# Install cron - -c
apt-get update && apt-get install -y cron - |
apt-get update && apt-get install -y cron
# Ensure scripts are executable chmod +x /scripts/*.sh 2>/dev/null || echo 'No scripts to make executable'
chmod +x /scripts/*.sh touch /var/log/backup.log
echo "$$BACKUP_CRON_SCHEDULE /scripts/backup.sh >> /var/log/backup.log 2>&1" | crontab -
# Create log file echo "Starting backup service with schedule: $$BACKUP_CRON_SCHEDULE"
touch /var/log/backup.log echo "Backup retention: $$BACKUP_RETENTION_DAYS days"
echo "Scripts location: /scripts"
# Create cron job echo "Backup location: /backups"
echo \"\$$BACKUP_CRON_SCHEDULE /scripts/backup.sh >> /var/log/backup.log 2>&1\" | crontab - if [ -f "/scripts/backup.sh" ]; then
echo "Running initial backup..."
# Start cron daemon /scripts/backup.sh >> /var/log/backup.log 2>&1
echo \"Starting backup service with schedule: \$$BACKUP_CRON_SCHEDULE\" else
echo \"Backup retention: \$$BACKUP_RETENTION_DAYS days\" echo "No backup script found at /scripts/backup.sh"
echo \"Scripts location: /scripts\" fi
echo \"Backup location: /backups\" echo "Starting cron daemon..."
/etc/init.d/cron start
# Run initial backup tail -f /var/log/backup.log
echo \"Running initial backup...\"
/scripts/backup.sh >> /var/log/backup.log 2>&1
# Start cron and keep it running
echo \"Starting cron daemon...\"
service cron start
# Keep container alive by tailing logs
tail -f /var/log/backup.log
"
restart: unless-stopped restart: unless-stopped
networks: networks:
- azerothcore - azerothcore
@@ -557,3 +507,8 @@ volumes:
networks: networks:
azerothcore: azerothcore:
driver: bridge driver: bridge
name: ${NETWORK_NAME:-azerothcore}
ipam:
config:
- subnet: ${NETWORK_SUBNET:-172.20.0.0/16}
gateway: ${NETWORK_GATEWAY:-172.20.0.1}

View File

@@ -112,19 +112,18 @@ azerothcore-docker/
### Service Containers ### Service Containers
| Container | Image | Purpose | Exposed Ports | | Container | Image | Purpose | Exposed Ports | Status |
|-----------|-------|---------|---------------| |-----------|-------|---------|---------------|---------|
| `ac-mysql` | mysql:8.0 | MySQL database server | 64306:3306 | | `ac-mysql` | mysql:8.0 | MySQL database server | 64306:3306 | ✅ Healthy |
| `ac-db-init` | mysql:8.0 | Database initialization (one-time) | - | | `ac-authserver` | acore/ac-wotlk-authserver:14.0.0-dev | Authentication server | 3784:3724 | ⚠️ Running (unhealthy) |
| `ac-db-import` | acore/ac-wotlk-db-import | Schema/data import (one-time) | - | | `ac-worldserver` | acore/ac-wotlk-worldserver:14.0.0-dev | Game world server | 8215:8085, 7778:7878 | ⚠️ Running (unhealthy) |
| `ac-authserver` | acore/ac-wotlk-authserver | Authentication server | 3784:3724 | | `ac-eluna` | acore/eluna-ts:master | Lua scripting engine | - | 🔄 Restarting |
| `ac-worldserver` | acore/ac-wotlk-worldserver | Game world server | 8215:8085, 7778:7878 | | `ac-phpmyadmin` | phpmyadmin/phpmyadmin:latest | Database management web UI | 8081:80 | ✅ Running |
| `ac-eluna` | acore/eluna-ts:master | Lua scripting engine | - | | `ac-grafana` | grafana/grafana:latest | Monitoring dashboard | 3001:3000 | ✅ Running |
| `ac-phpmyadmin` | phpmyadmin/phpmyadmin | Database management web UI | 8081:80 | | `ac-influxdb` | influxdb:2.7-alpine | Metrics database | 8087:8086 | ✅ Running |
| `ac-grafana` | grafana/grafana | Monitoring dashboard | 3001:3000 | | `ac-keira3` | keira3:latest | Production database editor | 4201:8080 | ✅ Running (healthy) |
| `ac-influxdb` | influxdb:2.7-alpine | Metrics database | 8087:8086 | | `ac-backup` | mysql:8.0 | Automated backup service | - | ✅ Running |
| `ac-keira3` | node:18-alpine | Database editor web UI | 4201:4200 | | `ac-modules` | alpine/git:latest | Module management | - | ✅ Running |
| `ac-backup` | mysql:8.0 | Automated backup service | - |
### Container Relationships ### Container Relationships

View File

@@ -11,8 +11,7 @@
#### 1. Fix Web Interface Syntax Issues #### 1. Fix Web Interface Syntax Issues
**Affected Services**: **Affected Services**:
- `ac-cms`: Minor shell syntax issues in embedded HTML heredoc - `ac-keira3`: Totally broken, requires fundamental changes to be run as a docker container
- `ac-keira3`: Minor Node.js script syntax improvements needed
**Status**: Services are functional but could be optimized **Status**: Services are functional but could be optimized
**Impact**: Web interfaces work but may have occasional display issues **Impact**: Web interfaces work but may have occasional display issues
@@ -70,8 +69,7 @@ All major issues have been resolved:
✅ ac-influxdb - Metrics database (port 8087) ✅ ac-influxdb - Metrics database (port 8087)
✅ ac-modules - Playerbots module (fully integrated - 40 bots) ✅ ac-modules - Playerbots module (fully integrated - 40 bots)
✅ ac-backup - Automated backups (working) ✅ ac-backup - Automated backups (working)
⚠️ ac-cms - Admin dashboard (minor syntax fixes) ⚠️ ac-keira3 - Broken
⚠️ ac-keira3 - Database editor (minor syntax fixes)
⚠️ ac-eluna - Lua scripting (should be starting now) ⚠️ ac-eluna - Lua scripting (should be starting now)
``` ```