From 350bada3a879da8b1484487b8fdf719016b37a70 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Tue, 3 Dec 2024 21:25:44 -0600 Subject: [PATCH] Switch FTBA to use https://api.feed-the-beast.com/v1 (#3174) --- .../compose.yml} | 15 +++++++-------- scripts/start-deployFTBA | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 13 deletions(-) rename examples/{docker-compose-ftba.yml => ftba/compose.yml} (53%) diff --git a/examples/docker-compose-ftba.yml b/examples/ftba/compose.yml similarity index 53% rename from examples/docker-compose-ftba.yml rename to examples/ftba/compose.yml index 1cdb63c2..c66a66bd 100644 --- a/examples/docker-compose-ftba.yml +++ b/examples/ftba/compose.yml @@ -1,22 +1,21 @@ services: mc: - # FTBA support is only available in non-Alpine images - image: itzg/minecraft-server:${IMAGE_TAG:-java8-multiarch} + image: itzg/minecraft-server ports: # expose the Minecraft server port outside of container - - 25565:25565 + - "25565:25565" environment: # REQUIRED for all types EULA: "TRUE" # Set server type (vs the default of vanilla) TYPE: FTBA - # Use Pack ID from https://ftb.neptunepowered.org/pack/ftb-presents-direwolf20-1-12/ - FTB_MODPACK_ID: "31" - FTB_MODPACK_VERSION_ID: "" + # Use Pack ID from https://www.feed-the-beast.com/modpacks/119-ftb-presents-direwolf20-120?tab=about + FTB_MODPACK_ID: "119" +# FTB_MODPACK_VERSION_ID: "" volumes: # use a named, managed volume for data volume - - ftba:/data + - data:/data volumes: # declared the named volume, but use default/local storage engine - ftba: {} + data: {} diff --git a/scripts/start-deployFTBA b/scripts/start-deployFTBA index 87bbfa25..f266a2a5 100755 --- a/scripts/start-deployFTBA +++ b/scripts/start-deployFTBA @@ -1,6 +1,8 @@ #!/bin/bash : "${FTB_FORCE_REINSTALL:=false}" +: "${FTB_BASE_URL:=https://api.feed-the-beast.com/v1/modpacks}" +# Legacy base URL was https://api.modpacks.ch ftbInstallMarker=".ftb-installed" @@ -29,7 +31,7 @@ if ! [[ ${FTB_MODPACK_ID} =~ [0-9]+ ]]; then fi if [[ ! $FTB_MODPACK_VERSION_ID ]]; then - if ! FTB_MODPACK_VERSION_ID=$(curl -fsSL https://api.modpacks.ch/public/modpack/${FTB_MODPACK_ID} | jq -r '.versions | sort_by(.updated)[-1].id'); then + if ! FTB_MODPACK_VERSION_ID=$(curl -fsSL "${FTB_BASE_URL}/public/modpack/${FTB_MODPACK_ID}" | jq -r '.versions | sort_by(.updated)[-1].id'); then logError "Unable to resolve latest modpack version ID for modpack ${FTB_MODPACK_ID}" exit 1 fi @@ -42,14 +44,19 @@ if isTrue "$FTB_FORCE_REINSTALL" || ! [ -f "${ftbInstallMarker}" ] || [ "$(cat " ftbInstaller=/data/ftb-installer arm= if ! [[ -f "${ftbInstaller}" ]]; then - log "Downloading FTB installer" if [ "$(uname -m)" == "aarch64" ]; then - log "Downloading ARM installer" + log "Downloading FTB installer for ARM" arm="/arm" else - log "Downloading x86 installer" + log "Downloading FTB installer for x86" + fi + # Example: https://api.feed-the-beast.com/v1/modpacks/public/modpack/119/12252/server/linux + # https://api.feed-the-beast.com/v1/modpacks/public/modpack/119/12252/server/arm/linux + # 1-1 is a placeholder modpack for just grabbing the installer + if ! get -o "${ftbInstaller}" "${FTB_BASE_URL}/public/modpack/1/1/server${arm}/linux"; then + logError "Failed to download FTB installer" + exit 1 fi - curl -fsSL https://api.modpacks.ch/public/modpack/1/1/server${arm}/linux -o "${ftbInstaller}" chmod +x "${ftbInstaller}" fi