diff --git a/.env.template b/.env.template index 32b759b..f919892 100644 --- a/.env.template +++ b/.env.template @@ -2,7 +2,9 @@ # Docker Compose will auto-load .env in the same folder as docker-compose.yml. # Template for acore-compose profiles-based compose +# ===================== # Project name +# ===================== COMPOSE_PROJECT_NAME=acore-compose # ===================== @@ -10,10 +12,78 @@ COMPOSE_PROJECT_NAME=acore-compose # ===================== STORAGE_PATH=./storage STORAGE_PATH_LOCAL=./local-storage -HOST_BACKUP_PATH=./storage/backups +BACKUP_PATH=${STORAGE_PATH}/backups HOST_ZONEINFO_PATH=/usr/share/zoneinfo TZ=UTC +# ===================== +# Permissions & IDs +# ===================== +CONTAINER_USER=0:0 +PERMISSION_LOCAL_USER=0:0 +PERMISSION_NFS_USER=1001:1000 +DEFAULT_CUSTOM_UID=1000 +DEFAULT_CUSTOM_GID=1000 + +# ===================== +# Shared Storage Presets +# ===================== +NFS_STORAGE_PATH=/nfs/azerothcore +MOUNT_STORAGE_PATH=/mnt/azerothcore-data + +# ===================== +# Container identifiers +# ===================== +CONTAINER_DB_IMPORT=ac-db-import +CONTAINER_DB_INIT=ac-db-init +CONTAINER_BACKUP=ac-backup +CONTAINER_MODULES=ac-modules +CONTAINER_POST_INSTALL=ac-post-install + +# ===================== +# Images +# ===================== +AC_DB_IMPORT_IMAGE=acore/ac-wotlk-db-import:14.0.0-dev +# Services (Standard) +AC_AUTHSERVER_IMAGE=acore/ac-wotlk-authserver:14.0.0-dev +AC_WORLDSERVER_IMAGE=acore/ac-wotlk-worldserver:14.0.0-dev +# Services (Playerbots) +AC_AUTHSERVER_IMAGE_PLAYERBOTS=uprightbass360/azerothcore-wotlk-playerbots:authserver-Playerbot +AC_WORLDSERVER_IMAGE_PLAYERBOTS=uprightbass360/azerothcore-wotlk-playerbots:worldserver-Playerbot +# Services (Module Build Tags) +# Images used during module compilation and tagging +AC_AUTHSERVER_IMAGE_MODULES=uprightbass360/azerothcore-wotlk-playerbots:authserver-modules-latest +AC_WORLDSERVER_IMAGE_MODULES=uprightbass360/azerothcore-wotlk-playerbots:worldserver-modules-latest +# Client Data +AC_CLIENT_DATA_IMAGE=acore/ac-wotlk-client-data:14.0.0-dev +AC_CLIENT_DATA_IMAGE_PLAYERBOTS=uprightbass360/azerothcore-wotlk-playerbots:client-data-Playerbot +# Helper images +ALPINE_GIT_IMAGE=alpine/git:latest +ALPINE_IMAGE=alpine:latest + +# ===================== +# Ports +# ===================== +AUTH_EXTERNAL_PORT=3784 +AUTH_PORT=3724 +WORLD_EXTERNAL_PORT=8215 +WORLD_PORT=8085 +SOAP_EXTERNAL_PORT=7778 +SOAP_PORT=7878 + +# ===================== +# Networking +# ===================== +NETWORK_NAME=azerothcore +NETWORK_SUBNET=172.20.0.0/16 +NETWORK_GATEWAY=172.20.0.1 + +# ===================== +# Server address / realm +# ===================== +SERVER_ADDRESS=127.0.0.1 +REALM_PORT=8215 + # ===================== # MySQL / Database Layer # ===================== @@ -35,66 +105,13 @@ MYSQL_RUNTIME_TMPFS_SIZE=8G DB_WAIT_RETRIES=60 DB_WAIT_SLEEP=10 +# ===================== # DB names +# ===================== DB_AUTH_NAME=acore_auth DB_WORLD_NAME=acore_world DB_CHARACTERS_NAME=acore_characters DB_PLAYERBOTS_NAME=acore_playerbots - -# Container identifiers -CONTAINER_DB_IMPORT=ac-db-import -CONTAINER_DB_INIT=ac-db-init -CONTAINER_BACKUP=ac-backup -CONTAINER_MODULES=ac-modules -CONTAINER_POST_INSTALL=ac-post-install - -# DB import image -AC_DB_IMPORT_IMAGE=acore/ac-wotlk-db-import:14.0.0-dev - -# ===================== -# Services (Standard) -# ===================== -AC_AUTHSERVER_IMAGE=acore/ac-wotlk-authserver:14.0.0-dev -AC_WORLDSERVER_IMAGE=acore/ac-wotlk-worldserver:14.0.0-dev - -# ===================== -# Services (Playerbots) -# ===================== -AC_AUTHSERVER_IMAGE_PLAYERBOTS=uprightbass360/azerothcore-wotlk-playerbots:authserver-Playerbot -AC_WORLDSERVER_IMAGE_PLAYERBOTS=uprightbass360/azerothcore-wotlk-playerbots:worldserver-Playerbot - -# ===================== -# Services (Module Build Tags) -# ===================== -# Images used during module compilation and tagging -AC_AUTHSERVER_IMAGE_MODULES=uprightbass360/azerothcore-wotlk-playerbots:authserver-modules-latest -AC_WORLDSERVER_IMAGE_MODULES=uprightbass360/azerothcore-wotlk-playerbots:worldserver-modules-latest - -# ===================== -# Client Data -# ===================== -AC_CLIENT_DATA_IMAGE=acore/ac-wotlk-client-data:14.0.0-dev -AC_CLIENT_DATA_IMAGE_PLAYERBOTS=uprightbass360/azerothcore-wotlk-playerbots:client-data-Playerbot -CLIENT_DATA_VERSION=v17 -CLIENT_DATA_CACHE_PATH=${STORAGE_PATH_LOCAL:-./local-storage}/client-data-cache -CLIENT_DATA_VOLUME=ac-client-data - -# ===================== -# Ports -# ===================== -AUTH_EXTERNAL_PORT=3784 -AUTH_PORT=3724 -WORLD_EXTERNAL_PORT=8215 -WORLD_PORT=8085 -SOAP_EXTERNAL_PORT=7778 -SOAP_PORT=7878 - -# ===================== -# Server address / realm -# ===================== -SERVER_ADDRESS=127.0.0.1 -REALM_PORT=8215 - # ===================== # Backups # ===================== @@ -114,6 +131,13 @@ BACKUP_HEALTHCHECK_START_PERIOD=120s PLAYERBOT_ENABLED=0 PLAYERBOT_MAX_BOTS=40 +# ===================== +# Client Data Settings +# ===================== +CLIENT_DATA_VERSION=v17 +CLIENT_DATA_CACHE_PATH=${STORAGE_PATH_LOCAL}/client-data-cache +CLIENT_DATA_VOLUME=ac-client-data + # ===================== # Module toggles (0/1) # ===================== @@ -178,7 +202,7 @@ MODULE_BLACK_MARKET_AUCTION_HOUSE=0 # ===================== AUTO_REBUILD_ON_DEPLOY=0 # Default AzerothCore source checkout used for module rebuilds -MODULES_REBUILD_SOURCE_PATH=${STORAGE_PATH_LOCAL:-./local-storage}/source/azerothcore +MODULES_REBUILD_SOURCE_PATH=${STORAGE_PATH_LOCAL}/source/azerothcore # ===================== # Eluna runtime (worldserver.conf overrides) @@ -222,25 +246,6 @@ PMA_ABSOLUTE_URI= PMA_UPLOAD_LIMIT=300M PMA_MEMORY_LIMIT=512M PMA_MAX_EXECUTION_TIME=600 - KEIRA3_EXTERNAL_PORT=4201 KEIRA_DATABASE_HOST=ac-mysql KEIRA_DATABASE_PORT=3306 - -# ===================== -# Networking -# ===================== -NETWORK_NAME=azerothcore -NETWORK_SUBNET=172.20.0.0/16 -NETWORK_GATEWAY=172.20.0.1 - -# ===================== -# Container user mapping -# ===================== -CONTAINER_USER=0:0 - -# ===================== -# Helper images -# ===================== -ALPINE_GIT_IMAGE=alpine/git:latest -ALPINE_IMAGE=alpine:latest diff --git a/backup-export.sh b/backup-export.sh index 989f830..9fe267b 100755 --- a/backup-export.sh +++ b/backup-export.sh @@ -2,9 +2,9 @@ # Export auth and character databases to ExportBackup_/ set -euo pipefail -MYSQL_PW="${MYSQL_ROOT_PASSWORD:-azerothcore123}" -DB_AUTH="${DB_AUTH_NAME:-acore_auth}" -DB_CHAR="${DB_CHARACTERS_NAME:-acore_characters}" +MYSQL_PW="${MYSQL_ROOT_PASSWORD}" +DB_AUTH="${DB_AUTH_NAME}" +DB_CHAR="${DB_CHARACTERS_NAME}" usage(){ cat < "$ENV_OUT" < "$ENV_OUT" - local storage_abs_path="$STORAGE_PATH" + local storage_abs_path="${STORAGE_PATH:-$DEFAULT_LOCAL_STORAGE}" if [[ "$storage_abs_path" != /* ]]; then storage_abs_path="$(pwd)/${storage_abs_path#./}" fi + storage_abs_path="${storage_abs_path%/}" local host_modules_dir="${storage_abs_path}/modules" mkdir -p "$host_modules_dir" diff --git a/status.sh b/status.sh index 535f769..60b3543 100755 --- a/status.sh +++ b/status.sh @@ -42,7 +42,7 @@ docker info >/dev/null 2>&1 || { echo "Docker daemon unavailable" >&2; exit 1; } read_env(){ local key="$1" value="" if [ -f "$ENV_FILE" ]; then - value="$(grep -E "^${key}=" "$ENV_FILE" 2>/dev/null | tail -n1 | cut -d'=' -f2- | tr -d '\r')" + value="$(grep -E "^${key}=" "$ENV_FILE" 2>/dev/null | tail -n1 | cut -d'=' -f2- | tr -d '\r' | sed 's/[[:space:]]*#.*//' | sed 's/[[:space:]]*$//')" fi echo "$value" } @@ -172,7 +172,7 @@ print_service(){ fi } -module_summary(){ +module_summary_list(){ if [ ! -f "$ENV_FILE" ]; then echo "MODULES: (env not found)" return @@ -180,23 +180,17 @@ module_summary(){ local module_vars module_vars="$(grep -E '^MODULE_[A-Z_]+=1' "$ENV_FILE" 2>/dev/null | cut -d'=' -f1)" if [ -n "$module_vars" ]; then - local arr=() + echo "MODULES:" while IFS= read -r mod; do [ -z "$mod" ] && continue local pretty="${mod#MODULE_}" - pretty="$(echo "$pretty" | tr '[:upper:]' '[:lower:]' | tr '_' ' ')" - arr+=("$pretty") + pretty="$(echo "$pretty" | tr '[:upper:]' '[:lower:]' | tr '_' ' ' | sed 's/\b\w/\U&/g')" + printf " • %s\n" "$pretty" done <<< "$module_vars" - local joined="" - for item in "${arr[@]}"; do - joined+="$item, " - done - joined="${joined%, }" - echo "MODULES: $joined" else echo "MODULES: none" fi - + echo "" if container_running "ac-worldserver"; then local playerbot="disabled" local module_playerbots @@ -209,7 +203,7 @@ module_summary(){ fi local eluna="disabled" [ "$ELUNA_ENABLED" = "1" ] && eluna="running" - echo "RUNTIME: playerbots $playerbot | eluna $eluna" + # echo "RUNTIME: playerbots $playerbot | eluna $eluna" fi } @@ -290,8 +284,9 @@ show_realm_status_header(){ } render_snapshot(){ - show_realm_status_header - printf "\nTIME %s PROJECT %s\n\n" "$(date '+%Y-%m-%d %H:%M:%S')" "$PROJECT_NAME" + #show_realm_status_header + printf "TIME %s PROJECT %s\n\n" "$(date '+%Y-%m-%d %H:%M:%S')" "$PROJECT_NAME" + user_stats printf "%-20s %-15s %-28s %s\n" "SERVICE" "CONTAINER" "STATE" "IMAGE" printf "%-20s %-15s %-28s %s\n" "--------------------" "---------------" "----------------------------" "------------------------------" print_service ac-mysql "MySQL" @@ -306,10 +301,10 @@ render_snapshot(){ print_service ac-phpmyadmin "phpMyAdmin" print_service ac-keira3 "Keira3" echo "" - module_summary - user_stats + module_summary_list echo "" echo "$(ports_summary)" + echo "" echo "$(network_summary)" }