craftaro / serverjars-website

This is our repo for the ServerJars.com website.
0 stars 0 forks source link

How To Utilize ServerJars Auto Update With Pterodactyl Egg! #1

Open iByteGamingKyle opened 9 months ago

iByteGamingKyle commented 9 months ago

After an incredible amount of research and digging, I couldn't find ANYWHERE on the internet of all things, without having to spend money for a add-on for ptero that would be out of date / poorly supported that would allow users to change some variables in the panel, which in turn allows them to get the server type they want!

I have been painstakingly attempting to get serverjars-auto updater to work, and I got it to where it works very well, but some issues such as purper and forge not downloading the 1.20.4 version, even though the API shows it is currently happening

Here is a couple screenshots of an example

image

image

image

This would possibly be able to replace ALL other ways of downloading anything for clients/users! The server-jars auto updater is great and works very well, but there are a couple hiccups that will hopefully be cranked out, I'd also love to see more jars and more actively updated version of jars since paper 1.20+ has been out for a while, but it isn't listed

iByteGamingKyle commented 9 months ago

I'm also attaching the egg for anyone wanting to test it currently egg-server-jars.json here is a snippet of the config for anyone curios { "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO", "meta": { "version": "PTDL_v2", "update_url": null }, "exported_at": "2024-01-05T12:48:00-07:00", "name": "ServerJars", "author": "github@ciputin.cf", "description": "The ServerJars Auto-Updater from https:\/\/serverjars.com", "features": null, "docker_images": { "Java 18": "ghcr.io\/pterodactyl\/yolks:java_18", "Java 17": "ghcr.io\/pterodactyl\/yolks:java_17", "Java 16": "ghcr.io\/pterodactyl\/yolks:java_16", "Java 11": "ghcr.io\/pterodactyl\/yolks:java_11", "Java 8": "ghcr.io\/pterodactyl\/yolks:java_8" }, "file_denylist": [], "startup": "java -Xms{{SERVER_MEMORY}}M -Xmx{{SERVER_MEMORY}}M -Dterminal.jline=false -Dterminal.ansi=true -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https:\/\/mcflags.emc.gs\/ -Daikars.new.flags=true -Dfml.readTimeout=120 -Dfile.encoding=UTF-8 -jar {{SERVER_JARFILE}} --sj.debug --sj.useHomeDirectory --sj.skipConfigCreation --sj.serverCategory={{SERVER_CATEGORY}} --sj.serverType={{SERVER_TYPE}} --sj.version={{SERVER_VERSION}}", "config": { "files": "{\r\n \"server.properties\": {\r\n \"parser\": \"properties\",\r\n \"find\": {\r\n \"server-ip\": \"0.0.0.0\",\r\n \"server-port\": \"{{server.build.default.port}}\",\r\n \"query.port\": \"{{server.build.default.port}}\"\r\n }\r\n },\r\n \"eula.txt\": {\r\n \"parser\": \"properties\",\r\n \"find\": {\r\n \"eula\": \"true\"\r\n }\r\n }\r\n}", "startup": "{\r\n \"done\": \")! For help, type \"\r\n}", "logs": "{}", "stop": "^C" }, "scripts": { "installation": { "script": "cd \/mnt\/server\r\n\r\ncurl -L -o server.jar https:\/\/github.com\/craftaro\/ServerJars-Updater\/releases\/download\/v3.2.2\/ServerJars.jar\r\n\r\nGITHUB_PACKAGE=\"ServerJars\/Updater\"\r\nVERSION=\"latest\"\r\nMATCH=\"*.jar\"\r\n\r\n## this is a simple script to use the github API for release versions.\r\n## this requires the egg has a variable for GITHUB_PACKAGE, VERSION and MATCH (match is to match the filename in some way)\r\n## this supports using oauth\/personal access tokens via GITHUB_USER and GITHUB_OAUTH_TOKEN (both are required.)\r\n## if you are getting hit with GitHub API limit issues then you need to have the user and token set.\r\napt update\r\napt install -y curl jq\r\n\r\nif [ -z \"${GITHUB_USER}\" ] && [ -z \"${GITHUB_OAUTH_TOKEN}\" ] ; then\r\n echo -e \"using anon api call\"\r\nelse\r\n echo -e \"user and oauth token set\"\r\n alias curl='curl -u ${GITHUB_USER}:${GITHUB_OAUTH_TOKEN} '\r\nfi\r\n\r\n## get release info and download links\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/${GITHUB_PACKAGE}\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/${GITHUB_PACKAGE}\/releases\")\r\n\r\nif [ -z \"${VERSION}\" ] || [ \"${VERSION}\" == \"latest\" ]; then\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH})\r\nelse\r\n VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .tag_name')\r\n if [ \"${VERSION}\" == \"${VERSION_CHECK}\" ]; then\r\n DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH})\r\n else\r\n echo -e \"defaulting to latest release\"\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)\r\n fi\r\nfi", "container": "ghcr.io\/pterodactyl\/installers:debian", "entrypoint": "bash" } }, "variables": [ { "name": "Server Jar Name", "description": "serverjars .jar file", "env_variable": "SERVER_JARFILE", "default_value": "server.jar", "user_viewable": true, "user_editable": false, "rules": "required|string|in:server.jar,custom.jar|", "field_type": "text" }, { "name": "Server Type", "description": "Select The Server Type In Correlation With The Server Category\r\nEX: Vanilla = Vanilla, Snapshot | Servers = Paper, Purper etc | Modded = Forge, Fabric | Proxies = Waterfall, Bungecord etc", "env_variable": "SERVER_TYPE", "default_value": "Paper", "user_viewable": true, "user_editable": true, "rules": "required|string|in:Vanilla,Snapshot,Paper,Purper,Velocity,Bungeecord,Waterfall,Fabric,Forge|", "field_type": "text" }, { "name": "Server Version", "description": "Enter the desired MC version exactly (Example: \"1.18.2\") or enter \"latest\" to automatically get the latest version", "env_variable": "SERVER_VERSION", "default_value": "latest", "user_viewable": true, "user_editable": true, "rules": "required|string|between:3,15", "field_type": "text" }, { "name": "Server Category", "description": "Select The Server Type In Correlation With The Server Category\r\nEX: Vanilla = Vanilla, Snapshot | Servers = Paper, Purper etc | Modded = Forge, Fabric | Proxies = Waterfall, Bungecord etc", "env_variable": "SERVER_CATEGORY", "default_value": "Servers", "user_viewable": true, "user_editable": true, "rules": "required|string|in:Vanilla,Servers,Modded,Proxies|", "field_type": "text" } ] }