From 467d8b94f4f29ed60721916f2f1d6cd6b65e32c8 Mon Sep 17 00:00:00 2001 From: James Harrison Date: Sun, 10 Dec 2023 22:14:30 +0000 Subject: [PATCH] Fix auto update (#50) * Fix auto update * Fix typo --- egg-geyser-m-c.json | 10 ++++++++++ pterodactyl-geyser/entrypoint.sh | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/egg-geyser-m-c.json b/egg-geyser-m-c.json index 1202d0d..e44a50d 100644 --- a/egg-geyser-m-c.json +++ b/egg-geyser-m-c.json @@ -37,6 +37,16 @@ "user_editable": true, "rules": "required|regex:\/^([\\w\\d._-]+)(\\.jar)$\/", "field_type": "text" + }, + { + "name": "Geyser Auto Update", + "description": "Should Geyser attempt an auto-update on startup.", + "env_variable": "AUTO_UPDATE", + "default_value": "1", + "user_viewable": true, + "user_editable": true, + "rules": "required|boolean|numeric", + "field_type": "text" } ] } \ No newline at end of file diff --git a/pterodactyl-geyser/entrypoint.sh b/pterodactyl-geyser/entrypoint.sh index e9ace59..28a8b75 100644 --- a/pterodactyl-geyser/entrypoint.sh +++ b/pterodactyl-geyser/entrypoint.sh @@ -11,13 +11,13 @@ export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'` if [ "${AUTO_UPDATE}" == "1" ]; then echo "Checking for updates..." - LATEST_HASH=`curl -s https://ci.opencollab.dev/job/GeyserMC/job/Geyser/job/${UPDATE_BRANCH}/lastSuccessfulBuild/api/xml?xpath=//lastBuiltRevision/SHA1 | sed 's/.*>\(.*\)<.*/\1/'` + LATEST_HASH=`curl -L https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest | jq -r .downloads.standalone.sha256` CURRENT_HASH=`cat .currenthash 2>/dev/null` if [ "$LATEST_HASH" != "$CURRENT_HASH" ]; then echo "Update available!" echo "Updating from '$CURRENT_HASH' -> '$LATEST_HASH'" - curl -s -o ${SERVER_JARFILE} https://ci.opencollab.dev/job/GeyserMC/job/Geyser/job/${UPDATE_BRANCH}/lastSuccessfulBuild/artifact/bootstrap/standalone/build/libs/Geyser-Standalone.jar + curl -s -o ${SERVER_JARFILE} https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/standalone echo "$LATEST_HASH" > ".currenthash" echo "Updated!"