Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DepotDownloader as alternative to steamcmd #577

Merged
merged 11 commits into from
Jul 7, 2024
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,5 @@ SHOW_PLAYER_LIST=True
# ALLOW_CONNECT_PLATFORM Defaults to "Steam" if not set, set this to "Xbox" if you want to host a server for Xbox players. CROSSPLAY BETWEEN XBOX-STEAM IS NOT YET SUPPORTED
ALLOW_CONNECT_PLATFORM=Steam
USE_BACKUP_SAVE_DATA=True
USE_DEPOT_DOWNLOADER=False
INSTALL_BETA_INSIDER=False
19 changes: 17 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ LABEL maintainer="[email protected]" \
# set envs
# SUPERCRONIC: Latest releases available at https://github.com/aptible/supercronic/releases
# RCON: Latest releases available at https://github.com/gorcon/rcon-cli/releases
# DEPOT_DOWNLOADER: Latest releases available at https://github.com/SteamRE/DepotDownloader/releases
# NOTICE: edit RCON_MD5SUM SUPERCRONIC_SHA1SUM when using binaries of another version or arch.
ARG SUPERCRONIC_SHA1SUM_ARM64="d5e02aa760b3d434bc7b991777aa89ef4a503e49"
ARG SUPERCRONIC_SHA1SUM_AMD64="9f27ad28c5c57cd133325b2a66bba69ba2235799"
ARG SUPERCRONIC_VERSION="0.2.30"
ARG DEPOT_DOWNLOADER_VERSION="2.6.0"

# update and install dependencies
# hadolint ignore=DL3008
Expand All @@ -53,6 +55,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
jo=1.9-1 \
jq=1.6-2.1 \
netcat-traditional=1.10-47 \
libicu72=72.1-3 \
unzip=6.0-28 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -62,15 +66,25 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
COPY --from=rcon-cli_builder /build/gorcon /usr/bin/rcon-cli

ARG TARGETARCH
RUN case ${TARGETARCH} in \
RUN case "${TARGETARCH}" in \
"amd64") SUPERCRONIC_SHA1SUM=${SUPERCRONIC_SHA1SUM_AMD64} ;; \
"arm64") SUPERCRONIC_SHA1SUM=${SUPERCRONIC_SHA1SUM_ARM64} ;; \
esac \
&& wget --progress=dot:giga https://github.com/aptible/supercronic/releases/download/v${SUPERCRONIC_VERSION}/supercronic-linux-${TARGETARCH} -O supercronic \
&& wget --progress=dot:giga "https://github.com/aptible/supercronic/releases/download/v${SUPERCRONIC_VERSION}/supercronic-linux-${TARGETARCH}" -O supercronic \
&& echo "${SUPERCRONIC_SHA1SUM}" supercronic | sha1sum -c - \
&& chmod +x supercronic \
&& mv supercronic /usr/local/bin/supercronic

RUN case "${TARGETARCH}" in \
"amd64") DEPOT_DOWNLOADER_FILENAME=DepotDownloader-linux-x64.zip ;; \
"arm64") DEPOT_DOWNLOADER_FILENAME=DepotDownloader-linux-arm64.zip ;; \
esac \
&& wget --progress=dot:giga "https://github.com/SteamRE/DepotDownloader/releases/download/DepotDownloader_${DEPOT_DOWNLOADER_VERSION}/${DEPOT_DOWNLOADER_FILENAME}" -O DepotDownloader.zip \
&& unzip DepotDownloader.zip \
&& rm -rf DepotDownloader.xml \
&& chmod +x DepotDownloader \
&& mv DepotDownloader /usr/local/bin/DepotDownloader

# hadolint ignore=DL3044
ENV HOME=/home/steam \
PORT= \
Expand Down Expand Up @@ -147,6 +161,7 @@ ENV HOME=/home/steam \
ARM_COMPATIBILITY_MODE=false \
DISABLE_GENERATE_ENGINE=true \
ALLOW_CONNECT_PLATFORM=Steam \
USE_DEPOT_DOWNLOADER=false \
INSTALL_BETA_INSIDER=false

# Passed from Github Actions
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ It is highly recommended you set the following environment values before startin
| ENABLE_PLAYER_LOGGING | Enables Logging and announcing when players join and leave | true | true/false | 0.31.0 |
| PLAYER_LOGGING_POLL_PERIOD | Polling period (in seconds) to check for players who have joined or left | 5 | !0 | 0.31.0 |
| ARM_COMPATIBILITY_MODE | Switches the compatibility layer from Box86 to QEMU when executing steamcmd for server updates. This setting is only applicable for ARM64 hosts. | false | true/false | 0.30.0 |
| USE_DEPOT_DOWNLOADER | Uses DepotDownloader to download game server files instead of steamcmd. This will help hosts incompatible with steamcmd (e.g. M-series Mac) | false | true/false | 0.39.0 |

*highly recommended to set

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ It is highly recommended you set the following environment values before startin
| ENABLE_PLAYER_LOGGING | Enables Logging and announcing when players join and leave | true | true/false | 0.31.0 |
| PLAYER_LOGGING_POLL_PERIOD | Polling period (in seconds) to check for players who have joined or left | 5 | !0 | 0.31.0 |
| ARM_COMPATIBILITY_MODE | Switches the compatibility layer from Box86 to QEMU when executing steamcmd for server updates. This setting is only applicable for ARM64 hosts. | false | true/false | 0.30.0 |
| USE_DEPOT_DOWNLOADER | Uses DepotDownloader to download game server files instead of steamcmd. This will help hosts incompatible with steamcmd (e.g. M-series Mac) | false | true/false | 0.39.0 |

*highly recommended to set

Expand Down
53 changes: 47 additions & 6 deletions scripts/helper_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,54 @@ InstallServer() {
kernel_page_size=$(getconf PAGESIZE)

# Check kernel page size for arm64 hosts before running steamcmd
if [ "$architecture" == "arm64" ] && [ "$kernel_page_size" != "4096" ]; then
LogWarn "WARNING: Only ARM64 hosts with 4k page size is supported when running steamcmd. Expect server installation to fail."
if [ "$architecture" == "arm64" ] && [ "$kernel_page_size" != "4096" ] && [ "${USE_DEPOT_DOWNLOADER}" != true ]; then
LogWarn "WARNING: Only ARM64 hosts with 4k page size is supported when running steamcmd. Please set USE_DEPOT_DOWNLOADER to true."
fi

if [ -z "${TARGET_MANIFEST_ID}" ]; then
DiscordMessage "Install" "${DISCORD_PRE_UPDATE_BOOT_MESSAGE}" "in-progress" "${DISCORD_PRE_UPDATE_BOOT_MESSAGE_ENABLED}" "${DISCORD_PRE_UPDATE_BOOT_MESSAGE_URL}"
## If INSTALL_BETA_INSIDER is set to true, install the latest beta version
if [ "${INSTALL_BETA_INSIDER}" == true ]; then
LogWarn "Installing latest beta version"
/home/steam/steamcmd/steamcmd.sh +@sSteamCmdForcePlatformType linux +@sSteamCmdForcePlatformBitness 64 +force_install_dir "/palworld" +login anonymous +app_update 2394010 -beta insiderprogram validate +quit
if [ "${USE_DEPOT_DOWNLOADER}" == true ]; then
LogWarn "Downloading server files using DepotDownloader"
DepotDownloader -app 2394010 -osarch 64 -dir /palworld -beta insiderprogram -validate
DepotDownloader -app 2394010 -depot 2394012 -osarch 64 -dir /tmp -beta insiderprogram -manifest-only
else
/home/steam/steamcmd/steamcmd.sh +@sSteamCmdForcePlatformType linux +@sSteamCmdForcePlatformBitness 64 +force_install_dir "/palworld" +login anonymous +app_update 2394010 -beta insiderprogram validate +quit
fi
else
/home/steam/steamcmd/steamcmd.sh +@sSteamCmdForcePlatformType linux +@sSteamCmdForcePlatformBitness 64 +force_install_dir "/palworld" +login anonymous +app_update 2394010 validate +quit
if [ "${USE_DEPOT_DOWNLOADER}" == true ]; then
LogWarn "Downloading server files using DepotDownloader"
DepotDownloader -app 2394010 -osarch 64 -dir /palworld -validate
DepotDownloader -app 2394010 -depot 2394012 -osarch 64 -dir /tmp -manifest-only
else
/home/steam/steamcmd/steamcmd.sh +@sSteamCmdForcePlatformType linux +@sSteamCmdForcePlatformBitness 64 +force_install_dir "/palworld" +login anonymous +app_update 2394010 validate +quit
fi
fi

# Create ACF file for DepoDownloader downloads for script compatibility
if [ "${USE_DEPOT_DOWNLOADER}" == true ]; then
local manifestFile
manifestFile=$(find /tmp -type f -name "manifest_2394012_*.txt" | head -n 1)

if [ -z "$manifestFile" ]; then
echo "DepotDownloader manifest file not found."
else
local manifestId
manifestId=$(grep -oP 'Manifest ID / date\s*:\s*\K[0-9]+' "$manifestFile")

if [ -z "$manifestId" ]; then
echo "Manifest ID not found in DepotDownloader manifest file."
else
mkdir -p /palworld/steamapps
CreateACFFile "$manifestId"
fi

rm -rf "$manifestFile"
fi
fi

DiscordMessage "Install" "${DISCORD_POST_UPDATE_BOOT_MESSAGE}" "success" "${DISCORD_POST_UPDATE_BOOT_MESSAGE_ENABLED}" "${DISCORD_POST_UPDATE_BOOT_MESSAGE_URL}"
return
fi
Expand All @@ -147,8 +182,14 @@ InstallServer() {

LogWarn "Installing Target Version: $targetManifest"
DiscordMessage "Install" "${DISCORD_PRE_UPDATE_BOOT_MESSAGE}" "in-progress" "${DISCORD_PRE_UPDATE_BOOT_MESSAGE_ENABLED}" "${DISCORD_PRE_UPDATE_BOOT_MESSAGE_URL}"
/home/steam/steamcmd/steamcmd.sh +@sSteamCmdForcePlatformType linux +@sSteamCmdForcePlatformBitness 64 +force_install_dir "/palworld" +login anonymous +download_depot 2394010 2394012 "$targetManifest" +quit
cp -vr "/home/steam/steamcmd/linux32/steamapps/content/app_2394010/depot_2394012/." "/palworld/"
if [ "${USE_DEPOT_DOWNLOADER}" == true ]; then
LogWarn "Downloading server files using DepotDownloader"
DepotDownloader -app 2394010 -depot 2394012 -manifest "$targetManifest" -osarch 64 -dir /palworld -validate
DepotDownloader -app 2394010 -depot 1006 -osarch 64 -dir /palworld -validate
else
/home/steam/steamcmd/steamcmd.sh +@sSteamCmdForcePlatformType linux +@sSteamCmdForcePlatformBitness 64 +force_install_dir "/palworld" +login anonymous +download_depot 2394010 2394012 "$targetManifest" +quit
cp -vr "/home/steam/steamcmd/linux32/steamapps/content/app_2394010/depot_2394012/." "/palworld/"
fi
CreateACFFile "$targetManifest"
DiscordMessage "Install" "${DISCORD_POST_UPDATE_BOOT_MESSAGE}" "success" "${DISCORD_POST_UPDATE_BOOT_MESSAGE_ENABLED}" "${DISCORD_POST_UPDATE_BOOT_MESSAGE_URL}"
}