mirror of
https://github.com/uprightbass360/AzerothCore-RealmMaster.git
synced 2026-01-15 09:50:28 +00:00
Compare commits
8 Commits
807618b82d
...
feat/varia
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9960444425 | ||
|
|
f5b3b07bcb | ||
|
|
07110902a6 | ||
|
|
a67bfcd87b | ||
|
|
b0444019ae | ||
|
|
29d299e402 | ||
|
|
10c45716cf | ||
|
|
3a8f076894 |
@@ -14,7 +14,7 @@ COMPOSE_OVERRIDE_WORLDSERVER_DEBUG_LOGGING_ENABLED=0
|
||||
# Project name
|
||||
# =====================
|
||||
# Customize this to match your deployment slug (used for container names/tags)
|
||||
COMPOSE_PROJECT_NAME=azerothcore-stack
|
||||
COMPOSE_PROJECT_NAME=azerothcore-realmmaster
|
||||
|
||||
# =====================
|
||||
# Storage & Timezone
|
||||
@@ -76,10 +76,17 @@ DB_GUARD_VERIFY_INTERVAL_SECONDS=86400
|
||||
# =====================
|
||||
STAGE_PATH_MODULE_SQL=${STORAGE_MODULE_SQL_PATH}
|
||||
|
||||
# =====================
|
||||
# Modules rebuild source path
|
||||
# =====================
|
||||
# Default AzerothCore source checkout used for module rebuilds
|
||||
MODULES_REBUILD_SOURCE_PATH=${STORAGE_PATH_LOCAL}/source/azerothcore
|
||||
|
||||
# =====================
|
||||
# SQL Source Overlay
|
||||
# =====================
|
||||
AC_SQL_SOURCE_PATH=${STORAGE_LOCAL_SOURCE_PATH}/azerothcore-playerbots/data/sql
|
||||
SOURCE_DIR=${MODULES_REBUILD_SOURCE_PATH}
|
||||
AC_SQL_SOURCE_PATH=${MODULES_REBUILD_SOURCE_PATH}/data/sql
|
||||
|
||||
# =====================
|
||||
# Images
|
||||
@@ -89,15 +96,15 @@ AC_DB_IMPORT_IMAGE=acore/ac-wotlk-db-import:master
|
||||
AC_AUTHSERVER_IMAGE=acore/ac-wotlk-authserver:master
|
||||
AC_WORLDSERVER_IMAGE=acore/ac-wotlk-worldserver:master
|
||||
# Services (Playerbots)
|
||||
AC_AUTHSERVER_IMAGE_PLAYERBOTS=azerothcore-realmmaster:authserver-playerbots
|
||||
AC_WORLDSERVER_IMAGE_PLAYERBOTS=azerothcore-realmmaster:worldserver-playerbots
|
||||
AC_AUTHSERVER_IMAGE_PLAYERBOTS=${COMPOSE_PROJECT_NAME}:authserver-playerbots
|
||||
AC_WORLDSERVER_IMAGE_PLAYERBOTS=${COMPOSE_PROJECT_NAME}:worldserver-playerbots
|
||||
# Services (Module Build Tags)
|
||||
# Images used during module compilation and tagging
|
||||
AC_AUTHSERVER_IMAGE_MODULES=azerothcore-realmmaster:authserver-modules-latest
|
||||
AC_WORLDSERVER_IMAGE_MODULES=azerothcore-realmmaster:worldserver-modules-latest
|
||||
AC_AUTHSERVER_IMAGE_MODULES=${COMPOSE_PROJECT_NAME}:authserver-modules-latest
|
||||
AC_WORLDSERVER_IMAGE_MODULES=${COMPOSE_PROJECT_NAME}:worldserver-modules-latest
|
||||
# Client Data
|
||||
AC_CLIENT_DATA_IMAGE=acore/ac-wotlk-client-data:master
|
||||
AC_CLIENT_DATA_IMAGE_PLAYERBOTS=uprightbass360/azerothcore-wotlk-playerbots:client-data-Playerbot
|
||||
AC_CLIENT_DATA_IMAGE_PLAYERBOTS=${COMPOSE_PROJECT_NAME}:client-data-playerbots
|
||||
# Build artifacts
|
||||
DOCKER_IMAGE_TAG=master
|
||||
AC_AUTHSERVER_IMAGE_BASE=acore/ac-wotlk-authserver
|
||||
@@ -230,81 +237,10 @@ CLIENT_DATA_PATH=
|
||||
SERVER_CONFIG_PRESET=none
|
||||
CLIENT_DATA_CACHE_PATH=${STORAGE_PATH_LOCAL}/client-data-cache
|
||||
|
||||
# =====================
|
||||
# Module toggles (0/1)
|
||||
# =====================
|
||||
# Enable/disable modules by setting to 1 (enabled) or 0 (disabled)
|
||||
# Modules are organized by category for easier navigation
|
||||
|
||||
# 🤖 Automation
|
||||
# Playerbot and AI systems
|
||||
# mod-playerbots: Installs SQL/config assets; core functionality is built into playerbot images
|
||||
|
||||
# ✨ Quality of Life
|
||||
# Convenience features that improve gameplay experience
|
||||
|
||||
# ⚔️ Gameplay Enhancement
|
||||
# Core gameplay improvements and mechanics
|
||||
|
||||
# 🏪 NPC Services
|
||||
# Service NPCs that provide player utilities
|
||||
# mod-npc-talent-template: Admin commands: .templatenpc create [TemplateName] and .templatenpc reload
|
||||
|
||||
# ⚡ PvP
|
||||
# Player vs Player focused modules
|
||||
# mod-arena-replay: NPC ID: 98500; known issue: players who were participants experience unusual behavior when watching their own replay
|
||||
|
||||
# 📈 Progression
|
||||
# Character and server progression systems
|
||||
# mod-progression-system: SQL files cannot be unloaded once executed; requires auto DB updater enabled in worldserver config
|
||||
# mod-zone-difficulty: Mythicmode NPC 1128001 spawned in raids/heroic dungeons; NPC 1128002 for Mythicmode rewards
|
||||
|
||||
# 💰 Economy
|
||||
# Auction house, trading, and economic systems
|
||||
|
||||
# 👥 Social
|
||||
# Social and community features
|
||||
|
||||
# 👤 Account-Wide
|
||||
# Features that apply across all characters on an account
|
||||
|
||||
# 🎨 Customization
|
||||
# Character and appearance customization
|
||||
# mod-morphsummon: Allows customization of summoned creature appearances (Warlock demons, Death Knight ghouls, Mage water elementals); NPC ID: 601072
|
||||
|
||||
# 📜 Scripting
|
||||
# Lua/Eluna scripting frameworks and tools
|
||||
# mod-aio: Azeroth Interface Override - enables client-server interface communication
|
||||
|
||||
# 🔧 Admin Tools
|
||||
# Server administration and management utilities
|
||||
# mod-keep-out: Requires editing database table mod_mko_map_lock; use .gps command to obtain map and zone IDs
|
||||
# mod-spell-regulator: WARNING: Custom code changes mandatory before module functions; requires custom hooks from external gist
|
||||
|
||||
# 💎 Premium/VIP
|
||||
# Premium account and VIP systems
|
||||
# mod-premium: Script must be assigned to an item (like hearthstone) using script name 'premium_account'
|
||||
|
||||
# 🎮 Mini-Games
|
||||
# Fun and entertainment features
|
||||
# mod-tic-tac-toe: NPC ID: 100155
|
||||
|
||||
# 🏰 Content
|
||||
# Additional game content and features
|
||||
|
||||
# 🎁 Rewards
|
||||
# Player reward and incentive systems
|
||||
# mod-resurrection-scroll: Requires EnablePlayerSettings to be enabled in worldserver config file
|
||||
|
||||
# 🛠️ Developer Tools
|
||||
# Development and testing utilities
|
||||
|
||||
# =====================
|
||||
# Rebuild automation
|
||||
# =====================
|
||||
AUTO_REBUILD_ON_DEPLOY=0
|
||||
# Default AzerothCore source checkout used for module rebuilds
|
||||
MODULES_REBUILD_SOURCE_PATH=${STORAGE_PATH_LOCAL}/source/azerothcore
|
||||
|
||||
# =====================
|
||||
# Source repositories
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -2,6 +2,7 @@ database-import/*.sql
|
||||
database-import/*.sql.gz
|
||||
database-import/*/
|
||||
database-import/ImportBackup*/
|
||||
db_*/
|
||||
source/*
|
||||
local-data-tools/
|
||||
changelogs/
|
||||
@@ -12,6 +13,7 @@ images/
|
||||
node_modules/
|
||||
.mcp*/
|
||||
scripts/__pycache__/*
|
||||
scripts/bash/__pycache__/*
|
||||
scripts/python/__pycache__/*
|
||||
.env
|
||||
package-lock.json
|
||||
|
||||
87
CHANGELOG.md
87
CHANGELOG.md
@@ -1,87 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
## [2025-11-09] - Recent Changes
|
||||
|
||||
### ✨ Features
|
||||
|
||||
#### Backup System Enhancements
|
||||
- **Manual Backup Support**: Added `manual-backup.sh` script (92 lines) enabling on-demand database backups through the ac-backup container
|
||||
- **Backup Permission Fixes**: Resolved Docker volume permission issues with backup operations
|
||||
- **Container User Configuration**: Backup operations now run as proper container user to avoid permission conflicts
|
||||
|
||||
#### Remote Deployment
|
||||
- **Auto Deploy Option**: Added remote auto-deployment functionality to `deploy.sh` (36 additional lines) for automated server provisioning
|
||||
|
||||
#### Configuration Management System
|
||||
- **Database/Config Import**: Major new feature with 1,405+ lines of code across 15 files
|
||||
- Added `apply-config.py` (323 lines) for dynamic server configuration
|
||||
- Created `configure-server.sh` (162 lines) for server setup automation
|
||||
- Implemented `import-database-files.sh` (68 lines) for database initialization
|
||||
- Added `parse-config-presets.py` (92 lines) for configuration templating
|
||||
- **Configuration Presets**: 5 new server preset configurations
|
||||
- `blizzlike.conf` - Authentic Blizzard-like experience
|
||||
- `casual-pve.conf` - Relaxed PvE gameplay
|
||||
- `fast-leveling.conf` - Accelerated character progression
|
||||
- `hardcore-pvp.conf` - Competitive PvP settings
|
||||
- `none.conf` - Minimal configuration baseline
|
||||
- **Dynamic Server Overrides**: `server-overrides.conf` (134 lines) for customizable server parameters
|
||||
- **Comprehensive Config Documentation**: `CONFIG_MANAGEMENT.md` (279 lines) detailing the entire configuration system
|
||||
|
||||
#### Infrastructure Improvements
|
||||
- **MySQL Exposure Toggle**: Optional MySQL port exposure for external database access
|
||||
- **Client Data Management**: Automatic client data detection, download, and binding with version detection
|
||||
- **Dynamic Docker Overrides**: Flexible compose override system for modular container configurations
|
||||
- **Module Profile System**: Structured module management with preset profiles
|
||||
|
||||
### 🏗️ Refactoring
|
||||
|
||||
#### Script Organization
|
||||
- **Directory Restructure**: Reorganized all scripts into `scripts/bash/` and `scripts/python/` directories (40 files moved/modified)
|
||||
- **Project Naming**: Added centralized project name management with `project_name.sh`
|
||||
- **Module Manifest Rename**: Moved `modules.json` → `module-manifest.json` for clarity
|
||||
|
||||
### 🐛 Bug Fixes
|
||||
|
||||
#### Container Improvements
|
||||
- **Client Data Container**: Enhanced with 7zip support, root access during extraction, and ownership fixes
|
||||
- **Permission Resolution**: Fixed file ownership issues in client data extraction process
|
||||
- **Path Updates**: Corrected deployment paths and script references after reorganization
|
||||
|
||||
### 📚 Documentation
|
||||
|
||||
#### Major Documentation Overhaul
|
||||
- **Modular Documentation**: Split massive README into focused documents (1,500+ lines reorganized)
|
||||
- `docs/GETTING_STARTED.md` (467 lines) - Setup and initial configuration
|
||||
- `docs/MODULES.md` (264 lines) - Module management and customization
|
||||
- `docs/SCRIPTS.md` (404 lines) - Script reference and automation
|
||||
- `docs/ADVANCED.md` (207 lines) - Advanced configuration topics
|
||||
- `docs/TROUBLESHOOTING.md` (127 lines) - Common issues and solutions
|
||||
- **README Streamlining**: Reduced main README from 1,200+ to focused overview
|
||||
- **Script Documentation**: Updated script references and usage examples throughout
|
||||
|
||||
### 🔧 Technical Changes
|
||||
|
||||
#### Development Experience
|
||||
- **Setup Enhancements**: Improved `setup.sh` with better error handling and configuration options (66 lines added)
|
||||
- **Status Monitoring**: Enhanced `status.sh` with better container and service monitoring
|
||||
- **Build Process**: Updated build scripts with new directory structure and module handling
|
||||
- **Cleanup Operations**: Improved cleanup scripts with proper path handling
|
||||
|
||||
#### DevOps & Deployment
|
||||
- **Remote Cleanup**: Enhanced remote server cleanup and temporary file management
|
||||
- **Network Binding**: Improved container networking and port management
|
||||
- **Import Folder**: Added dedicated import directory structure
|
||||
- **Development Onboarding**: Streamlined developer setup process
|
||||
|
||||
---
|
||||
|
||||
### Migration Notes
|
||||
- Scripts have moved from `scripts/` to `scripts/bash/` and `scripts/python/`
|
||||
- Module configuration is now in `config/module-manifest.json`
|
||||
- New environment variables added for MySQL exposure and client data management
|
||||
- Configuration presets are available in `config/presets/`
|
||||
|
||||
### Breaking Changes
|
||||
- Script paths have changed due to reorganization
|
||||
- Module manifest file has been renamed
|
||||
- Some environment variables have been added/modified
|
||||
49
changelog.sh
49
changelog.sh
@@ -99,7 +99,36 @@ done
|
||||
# Get last build time from container metadata
|
||||
get_last_build_time() {
|
||||
local containers=("ac-worldserver" "ac-authserver")
|
||||
local images=("azerothcore-stack:worldserver-playerbots" "azerothcore-stack:authserver-playerbots")
|
||||
local images=()
|
||||
|
||||
# Require COMPOSE_PROJECT_NAME to be set
|
||||
if [[ -z "${COMPOSE_PROJECT_NAME:-}" ]]; then
|
||||
warn "COMPOSE_PROJECT_NAME not set in environment"
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Use actual image names from environment
|
||||
# Detect variant to check appropriate images
|
||||
if [[ "${STACK_IMAGE_MODE:-standard}" == "playerbots" ]] || [[ "${MODULE_PLAYERBOTS:-0}" == "1" ]] || [[ "${PLAYERBOT_ENABLED:-0}" == "1" ]] || [[ "${STACK_SOURCE_VARIANT:-}" == "playerbots" ]]; then
|
||||
if [[ -z "${AC_WORLDSERVER_IMAGE_PLAYERBOTS:-}" ]] || [[ -z "${AC_AUTHSERVER_IMAGE_PLAYERBOTS:-}" ]]; then
|
||||
warn "Playerbots mode detected but AC_WORLDSERVER_IMAGE_PLAYERBOTS or AC_AUTHSERVER_IMAGE_PLAYERBOTS not set"
|
||||
return 1
|
||||
fi
|
||||
images=(
|
||||
"${AC_WORLDSERVER_IMAGE_PLAYERBOTS}"
|
||||
"${AC_AUTHSERVER_IMAGE_PLAYERBOTS}"
|
||||
)
|
||||
else
|
||||
if [[ -z "${AC_WORLDSERVER_IMAGE:-}" ]] || [[ -z "${AC_AUTHSERVER_IMAGE:-}" ]]; then
|
||||
warn "Standard mode detected but AC_WORLDSERVER_IMAGE or AC_AUTHSERVER_IMAGE not set"
|
||||
return 1
|
||||
fi
|
||||
images=(
|
||||
"${AC_WORLDSERVER_IMAGE}"
|
||||
"${AC_AUTHSERVER_IMAGE}"
|
||||
)
|
||||
fi
|
||||
|
||||
local latest_date=""
|
||||
|
||||
# Try to get build timestamp from containers and images
|
||||
@@ -143,7 +172,7 @@ if [[ -n "$SINCE_DATE" ]]; then
|
||||
DATE_DESC="since $SINCE_DATE"
|
||||
else
|
||||
# Try to use last build time as default
|
||||
LAST_BUILD_DATE=$(get_last_build_time)
|
||||
LAST_BUILD_DATE=$(get_last_build_time 2>/dev/null) || LAST_BUILD_DATE=""
|
||||
|
||||
if [[ -n "$LAST_BUILD_DATE" ]]; then
|
||||
SINCE_OPTION="--since=$LAST_BUILD_DATE"
|
||||
@@ -194,11 +223,17 @@ detect_source_config() {
|
||||
$VERBOSE && log "Switched to playerbots variant" >&2
|
||||
fi
|
||||
|
||||
# Repository URLs from environment or defaults
|
||||
local standard_repo="${ACORE_REPO_STANDARD:-https://github.com/azerothcore/azerothcore-wotlk.git}"
|
||||
local standard_branch="${ACORE_BRANCH_STANDARD:-master}"
|
||||
local playerbots_repo="${ACORE_REPO_PLAYERBOTS:-https://github.com/mod-playerbots/azerothcore-wotlk.git}"
|
||||
local playerbots_branch="${ACORE_BRANCH_PLAYERBOTS:-Playerbot}"
|
||||
# Repository URLs from environment (required)
|
||||
local standard_repo="${ACORE_REPO_STANDARD}"
|
||||
local standard_branch="${ACORE_BRANCH_STANDARD}"
|
||||
local playerbots_repo="${ACORE_REPO_PLAYERBOTS}"
|
||||
local playerbots_branch="${ACORE_BRANCH_PLAYERBOTS}"
|
||||
|
||||
if [[ -z "$standard_repo" ]] || [[ -z "$standard_branch" ]] || [[ -z "$playerbots_repo" ]] || [[ -z "$playerbots_branch" ]]; then
|
||||
warn "Repository configuration missing from environment"
|
||||
warn "Required: ACORE_REPO_STANDARD, ACORE_BRANCH_STANDARD, ACORE_REPO_PLAYERBOTS, ACORE_BRANCH_PLAYERBOTS"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ "$variant" == "playerbots" ]]; then
|
||||
echo "$playerbots_repo|$playerbots_branch|$LOCAL_STORAGE_ROOT/source/azerothcore-playerbots"
|
||||
|
||||
@@ -146,8 +146,6 @@ sanitize_project_name(){
|
||||
project_name::sanitize "$1"
|
||||
}
|
||||
|
||||
PROJECT_IMAGE_PREFIX="$(sanitize_project_name "${COMPOSE_PROJECT_NAME:-$DEFAULT_PROJECT_NAME}")"
|
||||
|
||||
remove_storage_dir(){
|
||||
local path="$1"
|
||||
if [ -d "$path" ]; then
|
||||
@@ -223,8 +221,7 @@ nuclear_cleanup() {
|
||||
|
||||
# Remove project images (server/tool images typical to this project)
|
||||
execute_command "Remove acore images" "docker images --format '{{.Repository}}:{{.Tag}}' | grep -E '^acore/' | xargs -r docker rmi"
|
||||
execute_command "Remove local project images" "docker images --format '{{.Repository}}:{{.Tag}}' | grep -E '^${PROJECT_IMAGE_PREFIX}:' | xargs -r docker rmi"
|
||||
execute_command "Remove legacy playerbots images" "docker images --format '{{.Repository}}:{{.Tag}}' | grep -E '^uprightbass360/azerothcore-wotlk-playerbots' | xargs -r docker rmi"
|
||||
execute_command "Remove project-specific images" "docker images --format '{{.Repository}}:{{.Tag}}' | grep -E \"^${PROJECT_NAME}:\" | xargs -r docker rmi"
|
||||
execute_command "Remove tool images" "docker images --format '{{.Repository}}:{{.Tag}}' | grep -E 'phpmyadmin|uprightbass360/keira3' | xargs -r docker rmi"
|
||||
|
||||
# Storage cleanup (preserve backups if requested)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"modules": [
|
||||
|
||||
],
|
||||
"label": "\u2b50 AzerothCore Main - Mod Free",
|
||||
"label": "\ud83d\udd30 AzerothCore Main - Mod Free",
|
||||
"description": "Pure AzerothCore with no optional modules enabled",
|
||||
"order": 3
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ MODULES_ENABLED="mod-playerbots mod-aoe-loot ..."
|
||||
**What Gets Built:**
|
||||
- AzerothCore with playerbots branch
|
||||
- 93 modules compiled and integrated in this run (current manifest: 348 total / 221 supported)
|
||||
- Custom Docker images: `acore-compose:worldserver-modules-latest` etc.
|
||||
- Custom Docker images: `${COMPOSE_PROJECT_NAME}:worldserver-modules-latest` etc.
|
||||
|
||||
### Deployment Status: READY TO DEPLOY 🚀
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import os
|
||||
import re
|
||||
import socket
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
from pathlib import Path
|
||||
|
||||
@@ -468,8 +469,14 @@ def docker_stats():
|
||||
|
||||
def main():
|
||||
env = load_env()
|
||||
project = read_env(env, "COMPOSE_PROJECT_NAME", "acore-compose")
|
||||
network = read_env(env, "NETWORK_NAME", "azerothcore")
|
||||
project = read_env(env, "COMPOSE_PROJECT_NAME")
|
||||
if not project:
|
||||
print(json.dumps({"error": "COMPOSE_PROJECT_NAME not set in environment"}), file=sys.stderr)
|
||||
sys.exit(1)
|
||||
network = read_env(env, "NETWORK_NAME")
|
||||
if not network:
|
||||
print(json.dumps({"error": "NETWORK_NAME not set in environment"}), file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
services = [
|
||||
("ac-mysql", "MySQL"),
|
||||
|
||||
301
scripts/bash/validate-env.sh
Executable file
301
scripts/bash/validate-env.sh
Executable file
@@ -0,0 +1,301 @@
|
||||
#!/bin/bash
|
||||
# Validate environment configuration for AzerothCore RealmMaster
|
||||
# Usage: ./scripts/bash/validate-env.sh [--strict] [--quiet]
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
ENV_FILE="$PROJECT_ROOT/.env"
|
||||
TEMPLATE_FILE="$PROJECT_ROOT/.env.template"
|
||||
|
||||
# Colors
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
# Flags
|
||||
STRICT_MODE=false
|
||||
QUIET_MODE=false
|
||||
EXIT_CODE=0
|
||||
|
||||
# Parse arguments
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--strict)
|
||||
STRICT_MODE=true
|
||||
shift
|
||||
;;
|
||||
--quiet)
|
||||
QUIET_MODE=true
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
cat <<EOF
|
||||
Usage: $0 [OPTIONS]
|
||||
|
||||
Validates environment configuration for required variables.
|
||||
|
||||
OPTIONS:
|
||||
--strict Fail on missing optional variables
|
||||
--quiet Only show errors, suppress info/success messages
|
||||
-h, --help Show this help
|
||||
|
||||
EXIT CODES:
|
||||
0 - All required variables present
|
||||
1 - Missing required variables
|
||||
2 - Missing optional variables (only in --strict mode)
|
||||
|
||||
REQUIRED VARIABLES:
|
||||
Project Configuration:
|
||||
COMPOSE_PROJECT_NAME - Project name for containers/images
|
||||
NETWORK_NAME - Docker network name
|
||||
|
||||
Repository Configuration:
|
||||
ACORE_REPO_STANDARD - Standard AzerothCore repository URL
|
||||
ACORE_BRANCH_STANDARD - Standard AzerothCore branch name
|
||||
ACORE_REPO_PLAYERBOTS - Playerbots repository URL
|
||||
ACORE_BRANCH_PLAYERBOTS - Playerbots branch name
|
||||
|
||||
Storage Paths:
|
||||
STORAGE_PATH - Main storage path
|
||||
STORAGE_PATH_LOCAL - Local storage path
|
||||
|
||||
Database Configuration:
|
||||
MYSQL_ROOT_PASSWORD - MySQL root password
|
||||
MYSQL_USER - MySQL user (typically root)
|
||||
MYSQL_PORT - MySQL port (typically 3306)
|
||||
MYSQL_HOST - MySQL hostname
|
||||
DB_AUTH_NAME - Auth database name
|
||||
DB_WORLD_NAME - World database name
|
||||
DB_CHARACTERS_NAME - Characters database name
|
||||
DB_PLAYERBOTS_NAME - Playerbots database name
|
||||
|
||||
Container Configuration:
|
||||
CONTAINER_MYSQL - MySQL container name
|
||||
CONTAINER_USER - Container user (format: uid:gid)
|
||||
|
||||
OPTIONAL VARIABLES (checked with --strict):
|
||||
MySQL Performance:
|
||||
MYSQL_INNODB_BUFFER_POOL_SIZE - InnoDB buffer pool size
|
||||
MYSQL_INNODB_LOG_FILE_SIZE - InnoDB log file size
|
||||
MYSQL_INNODB_REDO_LOG_CAPACITY - InnoDB redo log capacity
|
||||
|
||||
Database Connection:
|
||||
DB_RECONNECT_SECONDS - Database reconnection delay
|
||||
DB_RECONNECT_ATTEMPTS - Database reconnection attempts
|
||||
|
||||
Build Configuration:
|
||||
MODULES_REBUILD_SOURCE_PATH - Path to source for module builds
|
||||
|
||||
Backup Configuration:
|
||||
BACKUP_PATH - Backup storage path
|
||||
BACKUP_RETENTION_DAYS - Daily backup retention
|
||||
BACKUP_RETENTION_HOURS - Hourly backup retention
|
||||
|
||||
Image Configuration:
|
||||
AC_AUTHSERVER_IMAGE - Auth server Docker image
|
||||
AC_WORLDSERVER_IMAGE - World server Docker image
|
||||
AC_DB_IMPORT_IMAGE - Database import Docker image
|
||||
|
||||
EXAMPLES:
|
||||
$0 # Basic validation
|
||||
$0 --strict # Strict validation (check optional vars)
|
||||
$0 --quiet # Only show errors
|
||||
EOF
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo -e "${RED}Unknown option: $1${NC}" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
log_info() {
|
||||
$QUIET_MODE || echo -e "${BLUE}ℹ️ $*${NC}"
|
||||
}
|
||||
|
||||
log_success() {
|
||||
$QUIET_MODE || echo -e "${GREEN}✅ $*${NC}"
|
||||
}
|
||||
|
||||
log_warning() {
|
||||
echo -e "${YELLOW}⚠️ $*${NC}" >&2
|
||||
}
|
||||
|
||||
log_error() {
|
||||
echo -e "${RED}❌ $*${NC}" >&2
|
||||
}
|
||||
|
||||
# Load environment
|
||||
load_env() {
|
||||
local file="$1"
|
||||
if [[ ! -f "$file" ]]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
set -a
|
||||
# shellcheck disable=SC1090
|
||||
source "$file" 2>/dev/null || return 1
|
||||
set +a
|
||||
return 0
|
||||
}
|
||||
|
||||
# Check if variable is set and non-empty
|
||||
check_var() {
|
||||
local var_name="$1"
|
||||
local var_value="${!var_name:-}"
|
||||
|
||||
if [[ -z "$var_value" ]]; then
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# Validate required variables
|
||||
validate_required() {
|
||||
local missing=()
|
||||
|
||||
local required_vars=(
|
||||
# Project Configuration
|
||||
"COMPOSE_PROJECT_NAME"
|
||||
"NETWORK_NAME"
|
||||
# Repository Configuration
|
||||
"ACORE_REPO_STANDARD"
|
||||
"ACORE_BRANCH_STANDARD"
|
||||
"ACORE_REPO_PLAYERBOTS"
|
||||
"ACORE_BRANCH_PLAYERBOTS"
|
||||
# Storage Paths
|
||||
"STORAGE_PATH"
|
||||
"STORAGE_PATH_LOCAL"
|
||||
# Database Configuration
|
||||
"MYSQL_ROOT_PASSWORD"
|
||||
"MYSQL_USER"
|
||||
"MYSQL_PORT"
|
||||
"MYSQL_HOST"
|
||||
"DB_AUTH_NAME"
|
||||
"DB_WORLD_NAME"
|
||||
"DB_CHARACTERS_NAME"
|
||||
"DB_PLAYERBOTS_NAME"
|
||||
# Container Configuration
|
||||
"CONTAINER_MYSQL"
|
||||
"CONTAINER_USER"
|
||||
)
|
||||
|
||||
log_info "Checking required variables..."
|
||||
|
||||
for var in "${required_vars[@]}"; do
|
||||
if check_var "$var"; then
|
||||
log_success "$var=${!var}"
|
||||
else
|
||||
log_error "$var is not set"
|
||||
missing+=("$var")
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ ${#missing[@]} -gt 0 ]]; then
|
||||
log_error "Missing required variables: ${missing[*]}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
log_success "All required variables are set"
|
||||
return 0
|
||||
}
|
||||
|
||||
# Validate optional variables (strict mode)
|
||||
validate_optional() {
|
||||
local missing=()
|
||||
|
||||
local optional_vars=(
|
||||
# MySQL Performance Tuning
|
||||
"MYSQL_INNODB_BUFFER_POOL_SIZE"
|
||||
"MYSQL_INNODB_LOG_FILE_SIZE"
|
||||
"MYSQL_INNODB_REDO_LOG_CAPACITY"
|
||||
# Database Connection Settings
|
||||
"DB_RECONNECT_SECONDS"
|
||||
"DB_RECONNECT_ATTEMPTS"
|
||||
# Build Configuration
|
||||
"MODULES_REBUILD_SOURCE_PATH"
|
||||
# Backup Configuration
|
||||
"BACKUP_PATH"
|
||||
"BACKUP_RETENTION_DAYS"
|
||||
"BACKUP_RETENTION_HOURS"
|
||||
# Image Configuration
|
||||
"AC_AUTHSERVER_IMAGE"
|
||||
"AC_WORLDSERVER_IMAGE"
|
||||
"AC_DB_IMPORT_IMAGE"
|
||||
)
|
||||
|
||||
log_info "Checking optional variables..."
|
||||
|
||||
for var in "${optional_vars[@]}"; do
|
||||
if check_var "$var"; then
|
||||
log_success "$var is set"
|
||||
else
|
||||
log_warning "$var is not set (using default)"
|
||||
missing+=("$var")
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ ${#missing[@]} -gt 0 ]]; then
|
||||
log_warning "Optional variables not set: ${missing[*]}"
|
||||
return 2
|
||||
fi
|
||||
|
||||
log_success "All optional variables are set"
|
||||
return 0
|
||||
}
|
||||
|
||||
# Main validation
|
||||
main() {
|
||||
log_info "Validating environment configuration..."
|
||||
echo ""
|
||||
|
||||
# Check if .env exists
|
||||
if [[ ! -f "$ENV_FILE" ]]; then
|
||||
log_error ".env file not found at $ENV_FILE"
|
||||
log_info "Copy .env.template to .env and configure it:"
|
||||
log_info " cp $TEMPLATE_FILE $ENV_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Load environment
|
||||
if ! load_env "$ENV_FILE"; then
|
||||
log_error "Failed to load $ENV_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log_success "Loaded environment from $ENV_FILE"
|
||||
echo ""
|
||||
|
||||
# Validate required variables
|
||||
if ! validate_required; then
|
||||
EXIT_CODE=1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
|
||||
# Validate optional variables if strict mode
|
||||
if $STRICT_MODE; then
|
||||
if ! validate_optional; then
|
||||
[[ $EXIT_CODE -eq 0 ]] && EXIT_CODE=2
|
||||
fi
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Final summary
|
||||
if [[ $EXIT_CODE -eq 0 ]]; then
|
||||
log_success "Environment validation passed ✨"
|
||||
elif [[ $EXIT_CODE -eq 1 ]]; then
|
||||
log_error "Environment validation failed (missing required variables)"
|
||||
elif [[ $EXIT_CODE -eq 2 ]]; then
|
||||
log_warning "Environment validation passed with warnings (missing optional variables)"
|
||||
fi
|
||||
|
||||
exit $EXIT_CODE
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,4 +1,4 @@
|
||||
module acore-compose/statusdash
|
||||
module azerothcore-realmmaster/statusdash
|
||||
|
||||
go 1.22
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ def cmd_list(directory: Path) -> int:
|
||||
profiles.sort(key=lambda item: item[4])
|
||||
|
||||
for name, modules, label, description, order in profiles:
|
||||
modules_csv = ",".join(modules)
|
||||
modules_csv = ",".join(modules) if modules else "-"
|
||||
print("\t".join([name, modules_csv, label, description, str(order)]))
|
||||
return 0
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ CATEGORY_BY_TYPE = {
|
||||
"data": "data",
|
||||
"cpp": "uncategorized",
|
||||
}
|
||||
USER_AGENT = "acore-compose-module-manifest"
|
||||
USER_AGENT = "azerothcore-realmmaster-module-manifest"
|
||||
|
||||
|
||||
def parse_args(argv: Sequence[str]) -> argparse.Namespace:
|
||||
|
||||
67
setup.sh
67
setup.sh
@@ -1139,12 +1139,29 @@ fi
|
||||
MODE_PRESET_NAME="$CLI_MODULE_PRESET"
|
||||
fi
|
||||
|
||||
# Function to determine source branch for a preset
|
||||
get_preset_source_branch() {
|
||||
local preset_name="$1"
|
||||
local preset_modules="${MODULE_PRESET_CONFIGS[$preset_name]:-}"
|
||||
|
||||
# Check if playerbots module is in the preset
|
||||
if [[ "$preset_modules" == *"MODULE_PLAYERBOTS"* ]]; then
|
||||
echo "azerothcore-playerbots"
|
||||
else
|
||||
echo "azerothcore-wotlk"
|
||||
fi
|
||||
}
|
||||
|
||||
# Module config
|
||||
say HEADER "MODULE PRESET"
|
||||
echo "1) ${MODULE_PRESET_LABELS[$DEFAULT_PRESET_SUGGESTED]:-⭐ Suggested Modules}"
|
||||
echo "2) ${MODULE_PRESET_LABELS[$DEFAULT_PRESET_PLAYERBOTS]:-🤖 Playerbots + Suggested modules}"
|
||||
echo "3) ⚙️ Manual selection"
|
||||
echo "4) 🚫 No modules"
|
||||
printf " %s) %s\n" "1" "⭐ Suggested Modules"
|
||||
printf " %s (%s)\n" "Baseline solo-friendly quality of life mix" "azerothcore-wotlk"
|
||||
printf " %s) %s\n" "2" "🤖 Playerbots + Suggested modules"
|
||||
printf " %s (%s)\n" "Suggested stack plus playerbots enabled" "azerothcore-playerbots"
|
||||
printf " %s) %s\n" "3" "⚙️ Manual selection"
|
||||
printf " %s (%s)\n" "Choose individual modules manually" "(depends on modules)"
|
||||
printf " %s) %s\n" "4" "🚫 No modules"
|
||||
printf " %s (%s)\n" "Pure AzerothCore with no modules" "azerothcore-wotlk"
|
||||
|
||||
local menu_index=5
|
||||
declare -A MENU_PRESET_INDEX=()
|
||||
@@ -1163,13 +1180,16 @@ fi
|
||||
for entry in "${ORDERED_PRESETS[@]}"; do
|
||||
local preset_name="${entry#*::}"
|
||||
[ -n "${MODULE_PRESET_CONFIGS[$preset_name]:-}" ] || continue
|
||||
local pretty_name
|
||||
local pretty_name preset_desc
|
||||
if [ -n "${MODULE_PRESET_LABELS[$preset_name]:-}" ]; then
|
||||
pretty_name="${MODULE_PRESET_LABELS[$preset_name]}"
|
||||
else
|
||||
pretty_name=$(echo "$preset_name" | tr '_-' ' ' | awk '{for(i=1;i<=NF;i++){$i=toupper(substr($i,1,1)) substr($i,2)}}1')
|
||||
fi
|
||||
echo "${menu_index}) ${pretty_name} (config/module-profiles/${preset_name}.json)"
|
||||
preset_desc="${MODULE_PRESET_DESCRIPTIONS[$preset_name]:-No description available}"
|
||||
local source_branch=$(get_preset_source_branch "$preset_name")
|
||||
printf " %s) %s\n" "$menu_index" "$pretty_name"
|
||||
printf " %s (%s)\n" "$preset_desc" "$source_branch"
|
||||
MENU_PRESET_INDEX[$menu_index]="$preset_name"
|
||||
menu_index=$((menu_index + 1))
|
||||
done
|
||||
@@ -1567,7 +1587,7 @@ fi
|
||||
fi
|
||||
|
||||
local default_source_rel="${LOCAL_STORAGE_ROOT}/source/azerothcore"
|
||||
if [ "$NEEDS_CXX_REBUILD" = "1" ] || [ "$MODULE_PLAYERBOTS" = "1" ]; then
|
||||
if [ "$MODULE_PLAYERBOTS" = "1" ]; then
|
||||
default_source_rel="${LOCAL_STORAGE_ROOT}/source/azerothcore-playerbots"
|
||||
fi
|
||||
|
||||
@@ -1661,6 +1681,15 @@ COMPOSE_PROJECT_NAME=$DEFAULT_COMPOSE_PROJECT_NAME
|
||||
|
||||
STORAGE_PATH=$STORAGE_PATH
|
||||
STORAGE_PATH_LOCAL=$LOCAL_STORAGE_ROOT
|
||||
STORAGE_CONFIG_PATH=$(get_template_value "STORAGE_CONFIG_PATH")
|
||||
STORAGE_LOGS_PATH=$(get_template_value "STORAGE_LOGS_PATH")
|
||||
STORAGE_MODULES_PATH=$(get_template_value "STORAGE_MODULES_PATH")
|
||||
STORAGE_LUA_SCRIPTS_PATH=$(get_template_value "STORAGE_LUA_SCRIPTS_PATH")
|
||||
STORAGE_MODULES_META_PATH=$(get_template_value "STORAGE_MODULES_META_PATH")
|
||||
STORAGE_MODULE_SQL_PATH=$(get_template_value "STORAGE_MODULE_SQL_PATH")
|
||||
STORAGE_INSTALL_MARKERS_PATH=$(get_template_value "STORAGE_INSTALL_MARKERS_PATH")
|
||||
STORAGE_CLIENT_DATA_PATH=$(get_template_value "STORAGE_CLIENT_DATA_PATH")
|
||||
STORAGE_LOCAL_SOURCE_PATH=$(get_template_value "STORAGE_LOCAL_SOURCE_PATH")
|
||||
BACKUP_PATH=$BACKUP_PATH
|
||||
TZ=$DEFAULT_TZ
|
||||
|
||||
@@ -1729,10 +1758,31 @@ CONTAINER_USER=$CONTAINER_USER
|
||||
CONTAINER_MYSQL=$DEFAULT_CONTAINER_MYSQL
|
||||
CONTAINER_DB_IMPORT=$DEFAULT_CONTAINER_DB_IMPORT
|
||||
CONTAINER_DB_INIT=$DEFAULT_CONTAINER_DB_INIT
|
||||
CONTAINER_DB_GUARD=$(get_template_value "CONTAINER_DB_GUARD")
|
||||
CONTAINER_BACKUP=$DEFAULT_CONTAINER_BACKUP
|
||||
CONTAINER_MODULES=$DEFAULT_CONTAINER_MODULES
|
||||
CONTAINER_POST_INSTALL=$DEFAULT_CONTAINER_POST_INSTALL
|
||||
|
||||
# Database Guard Defaults
|
||||
DB_GUARD_RECHECK_SECONDS=$(get_template_value "DB_GUARD_RECHECK_SECONDS")
|
||||
DB_GUARD_RETRY_SECONDS=$(get_template_value "DB_GUARD_RETRY_SECONDS")
|
||||
DB_GUARD_WAIT_ATTEMPTS=$(get_template_value "DB_GUARD_WAIT_ATTEMPTS")
|
||||
DB_GUARD_HEALTH_MAX_AGE=$(get_template_value "DB_GUARD_HEALTH_MAX_AGE")
|
||||
DB_GUARD_HEALTHCHECK_INTERVAL=$(get_template_value "DB_GUARD_HEALTHCHECK_INTERVAL")
|
||||
DB_GUARD_HEALTHCHECK_TIMEOUT=$(get_template_value "DB_GUARD_HEALTHCHECK_TIMEOUT")
|
||||
DB_GUARD_HEALTHCHECK_RETRIES=$(get_template_value "DB_GUARD_HEALTHCHECK_RETRIES")
|
||||
DB_GUARD_VERIFY_INTERVAL_SECONDS=$(get_template_value "DB_GUARD_VERIFY_INTERVAL_SECONDS")
|
||||
|
||||
# Module SQL staging
|
||||
STAGE_PATH_MODULE_SQL=$(get_template_value "STAGE_PATH_MODULE_SQL")
|
||||
|
||||
# Modules rebuild source path
|
||||
MODULES_REBUILD_SOURCE_PATH=$MODULES_REBUILD_SOURCE_PATH
|
||||
|
||||
# SQL Source Overlay
|
||||
SOURCE_DIR=$(get_template_value "SOURCE_DIR")
|
||||
AC_SQL_SOURCE_PATH=$(get_template_value "AC_SQL_SOURCE_PATH")
|
||||
|
||||
# Ports
|
||||
AUTH_EXTERNAL_PORT=$AUTH_EXTERNAL_PORT
|
||||
AUTH_PORT=$DEFAULT_AUTH_INTERNAL_PORT
|
||||
@@ -1749,6 +1799,8 @@ REALM_PORT=$REALM_PORT
|
||||
BACKUP_RETENTION_DAYS=$BACKUP_RETENTION_DAYS
|
||||
BACKUP_RETENTION_HOURS=$BACKUP_RETENTION_HOURS
|
||||
BACKUP_DAILY_TIME=$BACKUP_DAILY_TIME
|
||||
BACKUP_INTERVAL_MINUTES=$(get_template_value "BACKUP_INTERVAL_MINUTES")
|
||||
BACKUP_EXTRA_DATABASES=$(get_template_value "BACKUP_EXTRA_DATABASES")
|
||||
BACKUP_HEALTHCHECK_MAX_MINUTES=$BACKUP_HEALTHCHECK_MAX_MINUTES
|
||||
BACKUP_HEALTHCHECK_GRACE_SECONDS=$BACKUP_HEALTHCHECK_GRACE_SECONDS
|
||||
|
||||
@@ -1763,7 +1815,6 @@ EOF
|
||||
fi
|
||||
done
|
||||
cat <<EOF
|
||||
MODULES_REBUILD_SOURCE_PATH=$MODULES_REBUILD_SOURCE_PATH
|
||||
|
||||
# Client data
|
||||
CLIENT_DATA_VERSION=${CLIENT_DATA_VERSION:-$DEFAULT_CLIENT_DATA_VERSION}
|
||||
|
||||
Reference in New Issue
Block a user