├── .gitignore ├── README.md ├── clear_custom_sql.sh ├── setup.sh ├── sqldump.sh ├── src ├── .env ├── docker-compose.override.yml └── sql │ └── acore_auth │ └── update_realmlist.sql ├── start_stop_acore.sh └── uninstall.sh /.gitignore: -------------------------------------------------------------------------------- 1 | azerothcore-wotlk 2 | wotlk/* 3 | sql_dumps/*/*.sql 4 | sql_dumps/*/*.*filepart 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # AzerothCore with Playerbots Docker setup (installscript) 2 | 3 | Script installing AzerothCore with Playerbots on Docker 4 | 5 | This is not a fork! Its just scripts to manage the game. 6 | 7 | Includes: 8 | - [MariaDB-Client]() (This is only client and will install only if you dont have the mysql command...) 9 | - [Docker](https://docker.com) (Will install if Docker is not installed.) 10 | - [Azeroth Core - Playerbots branch](https://github.com/liyunfan1223/azerothcore-wotlk.git) 11 | - [mod-playerbots](https://github.com/liyunfan1223/mod-playerbots) 12 | - [mod-aoe-loot](https://github.com/azerothcore/mod-aoe-loot) (optional) 13 | - [mod-learn-spells](https://github.com/noisiver/mod-learn-spells) (optional) 14 | - [mod-fireworks-on-level](https://github.com/azerothcore/mod-fireworks-on-level.git) (optional) 15 | - [mod-individual-progression](https://github.com/ZhengPeiRu21/mod-individual-progression.git) (optional) 16 | 17 | Prerequisits: 18 | 1. Debian 12 Bookworm 19 | 20 | 21 | Reference: 22 | [Azeroth Core](https://www.azerothcore.org/wiki/home) 23 | 24 | --- 25 | 26 | ### Steps: 27 | 28 | 1. 29 | > Be sure to set correct timezone on your debian before you start. 30 | ```bash 31 | git clone https://github.com/coc0nut/AzerothCore-with-Playerbots-Docker-Setup.git \ 32 | && cd AzerothCore-with-Playerbots-Docker-Setup && chmod +x *.sh && ./setup.sh 33 | ``` 34 | 35 | 2. 36 | ``` 37 | NOTE: 38 | 39 | 1. Execute 'docker attach ac-worldserver' 40 | 2. 'account create username password' creates an account. 41 | 3. 'account set gmlevel username 3 -1' sets the account as gm for all servers. 42 | 4. Ctrl+p Ctrl+q will take you out of the world console. 43 | 5. Now login to wow on $(hostname -I | awk '{print $1}') with 3.3.5a client! 44 | 6. All the configs for the server and modules is copied to a folder named wotlk. This is where you edit playerbots and server configuration. 45 | ``` 46 | See [Azeroth Core - Docker setup](https://www.azerothcore.org/wiki/install-with-docker) for more info. 47 | 48 | 3. 49 | ```shell 50 | AC> account create username password 51 | AC> account set gmlevel username 3 -1 52 | ``` 53 | 54 | 4. 55 | Edit your wow_client_3.3.5a\Data\enUS\realmlist.wtf and type in the ip address you get in the end of installing... 56 | `set realmlist dockerhost_ip` 57 | 58 | **Change dockerhost_ip to the ip that the machine that runs the docker containers has.** 59 | 60 | To uninstall and start fresh, run `./uninstall.sh` 61 | 62 | To clear the `data/sql/custom` folders run `./clear_custom_sql.sh` 63 | 64 | ## Usage 65 | 66 | ### Update 67 | 68 | - To update and get the latest versions, you can run `./uninstall.sh` without deleting the volumes and run `./setup.sh` again. 69 | It will prompt you if you want to delete the volumes. (Dont let the warnings scare you :) 70 | 71 | - You can add modules to the `setup.sh` file by scrolling to the "install_mod" section and add the entries you'd like. **Or** you could do it manually by putting the modules folders into the `azerothcore-wotlk/modules`folder. `setup.sh` will automatically add the sql. See [How do I install modules?](https://www.azerothcore.org/wiki/install-with-docker#how-do-i-install-modules) for more info. 72 | 73 | - Running `setup.sh` will not install anything over again unless you delete a modules folder or the `azerothcore-wotlk` folder before. You can run it if you only want to install new modules youve added, it will skip if you already downloaded the repos. 74 | 75 | - If you delete modules, remember to run `clear_custom_sql.sh` first and remove the respective tables in the db. 76 | 77 | ### Backup & Recovery 78 | 79 | - You can backup and recover the databases by running `./sqldump.sh`. It will place the backups in `sql_dumps` folder... On recovery, you will be prompted to enter a date (given you back up once a day at maximum.) 80 | 81 | --- 82 | -------------------------------------------------------------------------------- /clear_custom_sql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | destination_dir="azerothcore-wotlk/data/sql/custom" 4 | 5 | world=$destination_dir"/db_world" 6 | chars=$destination_dir"/db_characters" 7 | auth=$destination_dir"/db_auth" 8 | 9 | cd azerothcore-wotlk 10 | 11 | rm -rf $world/*.sql 12 | rm -rf $chars/*.sql 13 | rm -rf $auth/*.sql 14 | 15 | cd .. 16 | 17 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function ask_user() { 4 | read -p "$1 (y/n): " choice 5 | case "$choice" in 6 | y|Y ) return 0;; 7 | * ) return 1;; 8 | esac 9 | } 10 | 11 | sed -i "s|^TZ=.*$|TZ=$(cat /etc/timezone)|" src/.env 12 | 13 | sudo apt update 14 | 15 | # Check if MySQL client is installed 16 | if ! command -v mysql &> /dev/null 17 | then 18 | echo "MySQL client is not installed. Installing mariadb-client now..." 19 | sudo apt install -y mariadb-client 20 | else 21 | echo "MySQL client is already installed." 22 | fi 23 | 24 | # Check if Docker is installed 25 | if ! command -v docker &> /dev/null 26 | then 27 | echo "Docker is not installed. Installing Docker now..." 28 | # Add Docker's official GPG key: 29 | sudo apt-get install ca-certificates curl 30 | sudo install -m 0755 -d /etc/apt/keyrings 31 | sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc 32 | sudo chmod a+r /etc/apt/keyrings/docker.asc 33 | 34 | # Add the repository to Apt sources: 35 | echo \ 36 | "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \ 37 | $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ 38 | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 39 | sudo apt-get update 40 | sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin 41 | sudo usermod -aG docker $USER 42 | echo "::NOTE::" 43 | echo "Added your user to docker group to manage docker without root." 44 | echo "Log out and back in and rerun setup.sh." 45 | exit 1; 46 | else 47 | echo "Docker is already installed." 48 | fi 49 | 50 | # Check if Azeroth Core is installed 51 | if [ -d "azerothcore-wotlk" ]; then 52 | destination_dir="data/sql/custom" 53 | 54 | world=$destination_dir"/db_world/" 55 | chars=$destination_dir"/db_characters/" 56 | auth=$destination_dir"/db_auth/" 57 | 58 | cd azerothcore-wotlk 59 | 60 | rm -rf $world/*.sql 61 | rm -rf $chars/*.sql 62 | rm -rf $auth/*.sql 63 | 64 | cd .. 65 | 66 | cp src/.env azerothcore-wotlk/ 67 | cp src/*.yml azerothcore-wotlk/ 68 | cd azerothcore-wotlk 69 | else 70 | if ask_user "Download and install AzerothCore Playerbots?"; then 71 | git clone https://github.com/liyunfan1223/azerothcore-wotlk.git --branch=Playerbot 72 | cp src/.env azerothcore-wotlk/ 73 | cp src/*.yml azerothcore-wotlk/ 74 | cd azerothcore-wotlk/modules 75 | git clone https://github.com/liyunfan1223/mod-playerbots.git --branch=master 76 | cd .. 77 | else 78 | echo "Aborting..." 79 | exit 1 80 | fi 81 | fi 82 | 83 | if ask_user "Install modules?"; then 84 | 85 | cd modules 86 | 87 | function install_mod() { 88 | local mod_name=$1 89 | local repo_url=$2 90 | 91 | if [ -d "${mod_name}" ]; then 92 | echo "${mod_name} exists. Skipping..." 93 | else 94 | if ask_user "Install ${mod_name}?"; then 95 | git clone "${repo_url}" 96 | fi 97 | fi 98 | } 99 | 100 | install_mod "mod-aoe-loot" "https://github.com/azerothcore/mod-aoe-loot.git" 101 | install_mod "mod-learn-spells" "https://github.com/noisiver/mod-learnspells.git" 102 | install_mod "mod-fireworks-on-level" "https://github.com/azerothcore/mod-fireworks-on-level.git" 103 | install_mod "mod-individual-progression" "https://github.com/ZhengPeiRu21/mod-individual-progression.git" 104 | 105 | cd .. 106 | 107 | fi 108 | 109 | 110 | docker compose up -d --build 111 | 112 | cd .. 113 | 114 | sudo chown -R 1000:1000 wotlk 115 | 116 | # Directory for custom SQL files 117 | custom_sql_dir="src/sql" 118 | auth="acore_auth" 119 | world="acore_world" 120 | chars="acore_characters" 121 | 122 | ip_address=$(hostname -I | awk '{print $1}') 123 | 124 | # Temporary SQL file 125 | temp_sql_file="/tmp/temp_custom_sql.sql" 126 | 127 | # Function to execute SQL files with IP replacement 128 | function execute_sql() { 129 | local db_name=$1 130 | local sql_files=("$custom_sql_dir/$db_name"/*.sql) 131 | 132 | if [ -e "${sql_files[0]}" ]; then 133 | for custom_sql_file in "${sql_files[@]}"; do 134 | echo "Executing $custom_sql_file" 135 | temp_sql_file=$(mktemp) 136 | if [[ "$(basename "$custom_sql_file")" == "update_realmlist.sql" ]]; then 137 | sed -e "s/{{IP_ADDRESS}}/$ip_address/g" "$custom_sql_file" > "$temp_sql_file" 138 | else 139 | cp "$custom_sql_file" "$temp_sql_file" 140 | fi 141 | mysql -h "$ip_address" -uroot -ppassword "$db_name" < "$temp_sql_file" 142 | done 143 | else 144 | echo "No SQL files found in $custom_sql_dir/$db_name, skipping..." 145 | fi 146 | } 147 | 148 | # Run custom SQL files 149 | echo "Running custom SQL files..." 150 | execute_sql "$auth" 151 | execute_sql "$world" 152 | execute_sql "$chars" 153 | 154 | # Clean up temporary file 155 | rm "$temp_sql_file" 156 | 157 | echo "" 158 | echo "NOTE:" 159 | echo "" 160 | echo "!!! If ac-db-import failed, run 'sudo chown -R 1000:1000 wotlk' and './setup.sh' again !!!" 161 | echo "" 162 | echo "1. Execute 'docker attach ac-worldserver'" 163 | echo "2. 'account create username password' creates an account." 164 | echo "3. 'account set gmlevel username 3 -1' sets the account as gm for all servers." 165 | echo "4. Ctrl+p Ctrl+q will take you out of the world console." 166 | echo "5. Edit your gameclients realmlist.wtf and set it to $ip_address." 167 | echo "6. Now login to wow with 3.3.5a client!" 168 | echo "7. All config files are copied into the wotlk folder created with setup.sh." 169 | 170 | -------------------------------------------------------------------------------- /sqldump.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | read -sp "Enter mysql password: " password 4 | echo "" 5 | 6 | function ask_user() { 7 | read -p "$1 (recover/backup): " choice 8 | case "$choice" in 9 | recover|Recover ) 10 | read -p "Enter the date to recover (YYYY-MM-DD): " recover_date 11 | mysql -h127.0.0.1 -P3306 -uroot -p$password acore_auth < ./sql_dumps/acore_auth/acore_auth-$recover_date.sql 12 | mysql -h127.0.0.1 -P3306 -uroot -p$password acore_characters < ./sql_dumps/acore_characters/acore_characters-$recover_date.sql 13 | mysql -h127.0.0.1 -P3306 -uroot -p$password acore_world < ./sql_dumps/acore_world/acore_world-$recover_date.sql 14 | mysql -h127.0.0.1 -P3306 -uroot -p$password acore_playerbots < ./sql_dumps/acore_playerbots/acore_playerbots-$recover_date.sql 15 | docker restart ac-worldserver 16 | ;; 17 | backup|Backup ) 18 | if [[ ! -d sql_dumps ]]; then 19 | mkdir -p sql_dumps/acore_auth sql_dumps/acore_characters sql_dumps/acore_world sql_dumps/acore_playerbots 20 | fi 21 | mysqldump -h127.0.0.1 -P3306 -uroot -p$password acore_auth > ./sql_dumps/acore_auth/acore_auth-$(date +%F).sql 22 | mysqldump -h127.0.0.1 -P3306 -uroot -p$password acore_characters > ./sql_dumps/acore_characters/acore_characters-$(date +%F).sql 23 | mysqldump -h127.0.0.1 -P3306 -uroot -p$password acore_world > ./sql_dumps/acore_world/acore_world-$(date +%F).sql 24 | mysqldump -h127.0.0.1 -P3306 -uroot -p$password acore_playerbots > ./sql_dumps/acore_playerbots/acore_playerbots-$(date +%F).sql 25 | ;; 26 | esac 27 | } 28 | 29 | ask_user 'Type recover or backup.' 30 | 31 | -------------------------------------------------------------------------------- /src/.env: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Create a .env file in the root folder and use the following 4 | # variables to configure your docker compose 5 | # 6 | 7 | DOCKER_AC_ENV_FILE= 8 | 9 | DOCKER_VOL_ROOT= 10 | DOCKER_VOL_CONF= 11 | DOCKER_VOL_ETC=../wotlk/etc 12 | DOCKER_VOL_LOGS=../wotlk/logs 13 | DOCKER_VOL_DATA= 14 | 15 | DOCKER_WORLD_EXTERNAL_PORT= 16 | DOCKER_SOAP_EXTERNAL_PORT= 17 | DOCKER_AUTH_EXTERNAL_PORT= 18 | DOCKER_DB_EXTERNAL_PORT= 19 | DOCKER_DB_ROOT_PASSWORD= 20 | 21 | DOCKER_USER=acore 22 | DOCKER_USER_ID=1000 23 | DOCKER_GROUP_ID=1000 24 | 25 | TZ=Europe/Oslo 26 | -------------------------------------------------------------------------------- /src/docker-compose.override.yml: -------------------------------------------------------------------------------- 1 | services: 2 | ac-database: 3 | environment: 4 | TZ: ${TZ} 5 | 6 | ac-worldserver: 7 | environment: 8 | TZ: ${TZ} 9 | volumes: 10 | - ./modules:/azerothcore/modules:rw -------------------------------------------------------------------------------- /src/sql/acore_auth/update_realmlist.sql: -------------------------------------------------------------------------------- 1 | USE acore_auth; 2 | SELECT * FROM realmlist; 3 | UPDATE realmlist SET address='{{IP_ADDRESS}}'; 4 | -------------------------------------------------------------------------------- /start_stop_acore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | manage_docker_containers() { 4 | containers=("ac-worldserver" "ac-authserver" "ac-database") 5 | 6 | all_running=true 7 | for container in "${containers[@]}"; do 8 | if ! docker ps --format '{{.Names}}' | grep -q "^${container}$"; then 9 | all_running=false 10 | break 11 | fi 12 | done 13 | 14 | if $all_running; then 15 | echo "Stopping containers: ${containers[*]}" 16 | docker stop "${containers[@]}" 17 | else 18 | echo "Starting containers: ${containers[*]}" 19 | docker start "${containers[@]}" 20 | fi 21 | } 22 | 23 | manage_docker_containers -------------------------------------------------------------------------------- /uninstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function ask_user() { 4 | read -p "$1 (y/n): " choice 5 | case "$choice" in 6 | y|Y ) return 0;; 7 | * ) return 1;; 8 | esac 9 | } 10 | 11 | if ask_user "This will uninstall azerothcore, continue?"; then 12 | 13 | cd azerothcore-wotlk 14 | 15 | docker compose down 16 | docker image prune -a 17 | if ask_user "Delete volumes? If you keep the volumes, a reinstall will only update."; then 18 | docker system prune -a 19 | docker volume rm azerothcore-wotlk_ac-client-data 20 | docker volume rm azerothcore-wotlk_ac-database 21 | fi 22 | 23 | cd .. && rm -rf azerothcore-wotlk wotlk/* 24 | 25 | exit 0 26 | fi 27 | --------------------------------------------------------------------------------