diff --git a/.env.example b/.env.example index b0a320824..a2fe636e9 100644 --- a/.env.example +++ b/.env.example @@ -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 diff --git a/Dockerfile b/Dockerfile index a65d0da6d..1c8409b7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,10 +38,12 @@ LABEL maintainer="thijs@loef.dev" \ # 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 @@ -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/* @@ -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= \ @@ -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 diff --git a/README.md b/README.md index 34b50c4ed..9a63b8d9c 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docusaurus/docs/getting-started/configuration/server-settings.md b/docusaurus/docs/getting-started/configuration/server-settings.md index 7330cc512..628784aab 100644 --- a/docusaurus/docs/getting-started/configuration/server-settings.md +++ b/docusaurus/docs/getting-started/configuration/server-settings.md @@ -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 diff --git a/scripts/helper_install.sh b/scripts/helper_install.sh index 46dc92273..d141f6877 100644 --- a/scripts/helper_install.sh +++ b/scripts/helper_install.sh @@ -125,8 +125,8 @@ 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 @@ -134,10 +134,45 @@ InstallServer() { ## 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 @@ -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}" }