- DB updater: SQL files are hashed with CRLF turned into LF on every platform. Text mode did that only on Windows, so files with CRLF bytes in their git copy (the world baselines: line breaks inside text strings) hashed differently on Linux, and a database made on Windows (dev, repack, release dump) re-ran the 65 MB baseline there and failed halfway. The hash is the one Windows has always stored, so no existing database sees a change. No SQL file contains 0x1A, so text mode's Ctrl+Z stop never applied either. - contrib/linux/configure_server.sh: writes bnetserver.conf and worldserver.conf for a public server from the .dist files (bind 0.0.0.0, Classic client keys incl. Network.EnterEncryptedModeRegionGroup, which the .dist lacks, DB warnings to file only) - doc/LinuxServerSetup.md: setup of a clean Ubuntu 24.04 server (4 GB droplet, 48 min build, no GCC errors), tested by logging in from a home PC, with every problem found on the way - README: "Hosting for other players" checklist (BindIP, realm address, hosts entry on the server too, per-player CA trust, ports), the repack's host-for-others.bat, and the dead ServerGuide.md link replaced
74 lines
2.9 KiB
Bash
74 lines
2.9 KiB
Bash
#!/bin/sh
|
|
# Creates bnetserver.conf and worldserver.conf for a public Forever server (one realm, Normal ruleset)
|
|
# from the installed .conf.dist files. Only the keys a public Classic server needs are changed.
|
|
#
|
|
# Usage: configure_server.sh <install prefix> <public ip> <mysql password>
|
|
# e.g. configure_server.sh /root/server 203.0.113.7 "$(cat /root/.forever_db_pass)"
|
|
set -e
|
|
|
|
PREFIX="$1"
|
|
PUBLIC_IP="$2"
|
|
DB_PASS="$3"
|
|
if [ -z "$PREFIX" ] || [ -z "$PUBLIC_IP" ] || [ -z "$DB_PASS" ]; then
|
|
echo "usage: $0 <install prefix> <public ip> <mysql password>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
ETC="$PREFIX/etc"
|
|
BNET="$ETC/bnetserver.conf"
|
|
WORLD="$ETC/worldserver.conf"
|
|
|
|
# setkey <file> <key> <value>: replaces "key = ..." or appends it when the .dist has no such line
|
|
setkey() {
|
|
if grep -qE "^$2[[:space:]]*=" "$1"; then
|
|
sed -i -E "s|^$2[[:space:]]*=.*|$2 = $3|" "$1"
|
|
else
|
|
printf '\n%s = %s\n' "$2" "$3" >> "$1"
|
|
fi
|
|
}
|
|
|
|
cp "$ETC/bnetserver.conf.dist" "$BNET"
|
|
cp "$ETC/worldserver.conf.dist" "$WORLD"
|
|
mkdir -p "$PREFIX/logs"
|
|
|
|
# bnetserver: listen on all interfaces; the client is always told the hostname (TLS certificate name).
|
|
# Both LoginREST names must resolve on this machine too (see /etc/hosts in the guide).
|
|
setkey "$BNET" LoginDatabaseInfo "\"127.0.0.1;3306;trinity;$DB_PASS;auth\""
|
|
setkey "$BNET" BindIP '"0.0.0.0"'
|
|
setkey "$BNET" LoginREST.ExternalAddress trinity.actual.battle.net
|
|
setkey "$BNET" LoginREST.LocalAddress trinity.actual.battle.net
|
|
setkey "$BNET" CertificatesFile '"./forever.cert.pem"'
|
|
setkey "$BNET" PrivateKeyFile '"./forever.key.pem"'
|
|
setkey "$BNET" LogsDir "\"$PREFIX/logs\""
|
|
setkey "$BNET" Realm.CfgContentSetID 137
|
|
setkey "$BNET" Realm.SuperDistrictID 2
|
|
|
|
# worldserver: Classic client requirements (README), public bind, updater on
|
|
for db in Login:auth World:world Character:characters Hotfix:hotfixes; do
|
|
setkey "$WORLD" "${db%%:*}DatabaseInfo" "\"127.0.0.1;3306;trinity;$DB_PASS;${db##*:}\""
|
|
done
|
|
setkey "$WORLD" RealmID 70
|
|
setkey "$WORLD" BindIP '"0.0.0.0"'
|
|
setkey "$WORLD" DataDir "\"$PREFIX/data\""
|
|
setkey "$WORLD" LogsDir "\"$PREFIX/logs\""
|
|
setkey "$WORLD" Network.SkipBuildAuthKeyCheck 1
|
|
setkey "$WORLD" Network.EnterEncryptedModeRegionGroup 8
|
|
setkey "$WORLD" Realm.CfgContentSetID 137
|
|
setkey "$WORLD" Realm.SuperDistrictID 2
|
|
setkey "$WORLD" Updates.EnableDatabases 15
|
|
setkey "$WORLD" Updates.AutoSetup 1
|
|
setkey "$WORLD" mmap.enablePathFinding 0
|
|
# DB warnings (about a million lines on every start: retail rows the Classic data does not have) go to DBErrors.log only
|
|
setkey "$WORLD" Logger.sql.sql 5,DBErrors
|
|
setkey "$WORLD" Ra.Enable 0
|
|
setkey "$WORLD" SOAP.Enabled 0
|
|
# same gameplay settings as the repack
|
|
setkey "$WORLD" Classic.GuildFinder 1
|
|
setkey "$WORLD" Classic.Shop.Enabled 1
|
|
setkey "$WORLD" AccountInstancesPerHour 5
|
|
setkey "$WORLD" PlayerSave.Stats.MinLevel 1
|
|
|
|
chmod 600 "$BNET" "$WORLD"
|
|
echo "written: $BNET $WORLD"
|
|
echo "realmlist must point at $PUBLIC_IP (see guide), hosts entry: $PUBLIC_IP trinity.actual.battle.net"
|