2019-11-08 19:05:28 +08:00
{
"_comment" : "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO" ,
"meta" : {
2021-05-08 07:35:14 +08:00
"version" : "PTDL_v1" ,
"update_url" : null
2019-11-08 19:05:28 +08:00
} ,
2021-05-08 07:35:14 +08:00
"exported_at" : "2021-05-08T02:33:54+03:00" ,
2019-11-08 19:05:28 +08:00
"name" : "Curseforge Generic" ,
"author" : "parker@parkervcp.com" ,
"description" : "A generic egg for a forge modpack" ,
2020-12-08 00:36:10 +08:00
"features" : null ,
2021-01-06 03:39:42 +08:00
"images" : [
"quay.io\/pterodactyl\/core:java" ,
"quay.io\/pterodactyl\/core:java-11"
] ,
2021-05-08 07:35:14 +08:00
"file_denylist" : [ ] ,
2019-11-08 19:05:28 +08:00
"startup" : "java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar server.jar" ,
"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}" ,
"startup" : "{\r\n \"done\": \")! For help, type \",\r\n \"userInteraction\": [\r\n \"Go to eula.txt for more info.\"\r\n ]\r\n}" ,
2021-05-08 07:35:14 +08:00
"logs" : "{}" ,
2019-11-08 19:05:28 +08:00
"stop" : "stop"
} ,
"scripts" : {
"installation" : {
2021-05-08 07:35:14 +08:00
"script" : "#!\/bin\/bash\r\n# Forge Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\nif [ ! -d \/mnt\/server ]; then\r\n mkdir -p \/mnt\/server\r\nfi\r\n\r\nfunction install_required {\r\n apt update\r\n apt install -y curl jq unzip dos2unix\r\n}\r\n\r\nfunction get_download {\r\n # get json data to work with\r\n echo -e \"Curling the json for the modpack\"\r\n echo -e \"running: curl -sSL https:\/\/addons-ecs.forgesvc.net\/api\/v2\/addon\/${MODPACK_ID}\"\r\n JSON_DATA=$(curl -sSL https:\/\/addons-ecs.forgesvc.net\/api\/v2\/addon\/${MODPACK_ID})\r\n\r\n # if no modpack version is set or is set to latest\r\n if [ -z ${MODPACK_VERSION} ] || [ \"${MODPACK_VERSION}\" = \"latest\" ]; then\r\n echo -e \"Getting latest download url\"\r\n # parse data to get the download url\r\n FILE_ID=$(echo -e ${JSON_DATA} | jq -r .defaultFileId)\r\n echo -e \"File ID is: ${FILE_ID}\"\r\n if [ \"$(echo -e ${JSON_DATA} | jq -r --arg FILE_ID \"$FILE_ID\" \".latestFiles[] | select(.id==$FILE_ID) | .isServerPack\")\" == \"false\" ] && [ \"$(echo -e ${JSON_DATA} | jq -r --arg FILE_ID \"$FILE_ID\" \".latestFiles[] | select(.id==$FILE_ID) | .serverPackFileId\")\" != \"null\" ]; then\r\n FILE_ID=$(echo -e ${JSON_DATA} | jq -r --arg FILE_ID \"$FILE_ID\" \".latestFiles[] | select(.id==$FILE_ID) | .serverPackFileId\")\r\n DOWNLOAD_URL=$(curl -sSL https:\/\/addons-ecs.forgesvc.net\/api\/v2\/addon\/${MODPACK_ID}\/file\/${FILE_ID}\/download-url)\r\n else\r\n DOWNLOAD_URL=$(curl -sSL https:\/\/addons-ecs.forgesvc.net\/api\/v2\/addon\/${MODPACK_ID}\/file\/${FILE_ID}\/download-url)\r\n fi\r\n echo -e \"Download url set to ${DOWNLOAD_URL}\"\r\n else\r\n echo -e \"Looking for download url for version ${MODPACK_VERSION}\"\r\n # parse files for version match\r\n FILES_JSON_DATA=$(curl -sSL https:\/\/addons-ecs.forgesvc.net\/api\/v2\/addon\/${MODPACK_ID}\/files)\r\n # get element number to get the exact location in the json\r\n FILES_JSON_ELEMENT=$(echo -e ${FILES_JSON_DATA} | jq --arg VERSION \"${MODPACK_VERSION}\" '.[] | select(.displayName) | .displayName | contains($VERSION)' | grep -n true | cut -f1 -d: | tail -1)\r\n # if there wasn't a match default to latest\r\n if [ ! -z ${FILES_JSON_ELEMENT} ]; then\r\n echo -e \"No matching version found\"\r\n echo -e \"defaulting to latest\"\r\n DOWNLOAD_URL=$(echo -e ${FILES_JSON_DATA} | jq --arg ELEMENT \"${FILES_JSON_ELEMENT}\" '.[$ELEMENT|tonumber-1] | .downloadUrl')\r\n else\r\n echo -e \"Version match found\"\r\n DOWNLOAD_URL=$(echo -e ${JSON_DATA} | jq -r .latestFiles[0].downloadUrl)\r\n echo -e \"Download url set to ${DOWNLOAD_URL}\"\r\n fi\r\n fi\r\n ## download modpack files\r\n cd \/mnt\/server\r\n echo \"Executing curl -L ${DOWNLOAD_URL} -o server.zip\"\r\n curl -L \"${DOWNLOAD_URL}\" -o server.zip\r\n unzip -o server.zip\r\n rm -rf server.zip\r\n}\r\n\r\nfunction forge_install {\r\n echo -e \"\\nInstalling forge server using the installer jar file.\\n\"\r\n if [ -f \/mnt\/server\/*installer.jar ]; then\r\n java -jar installer.jar --installServer || { echo -e \"install failed\"; exit 4; }\r\n else\r\n echo \"No forge installer found moving on.\"\r\n fi\r\n mv FTBServer.jar server.jar\r\n}\r\n\r\nfunction forge_cleanup {\r\n echo -e \"\\nDeleting installer jar file and cleaning up.\\n\" \ r \ n r m - r f * i n s t a l l e r . j a r \ r \ n i f [ ! - f \ / m n t \ / s e r v e r \ / * u n i v e r s a l . j a r ] ; t h e n \ r \ n m v - v \ / m n t \ / s e r v e r \ / * \ / * \ / m n t \ / s e r v e r \ / \ r \ n i f [ ! - f \ / m n t \ / s e r v e r \ / * u n i v e r s a l . j a r ] ; t h e n \ r \ n m v f o r g e * . j a r s e r v e r . j a r \ r \ n e l s e \ r \ n m v * u n i v e r s a l . j a r s e r v e r . j a r \ r \ n f i \ r \ n e l s e \ r \ n m v * u n i v e r s a l . j a r s e r v e r . j a r \ r \ n f i \ r \ n } \ r \ n \ r \ n f u n c t i o n j s o n _ d o w n l o a d _ p r e w o r k { \ r \ n m k d i r - p \ / m n t \ / s e r v e r \ / m o d s \ r \ n c d \ / m n t \ / s e r v e r \ / m o d s \ r \ n } \ r \ n \ r \ n f u n c t i o n j s o n _ d o
2019-11-08 19:05:28 +08:00
"container" : "openjdk:8-jdk-slim" ,
"entrypoint" : "bash"
}
} ,
"variables" : [
{
2021-05-08 07:35:14 +08:00
"name" : "Modpack Project ID" ,
2021-05-08 12:10:34 +08:00
"description" : "The modpack project ID from the curseforge site on the pack page.\r\n\r\n(Ex. https:\/\/www.curseforge.com\/minecraft\/modpacks\/bofa-mods ID is 375152)" ,
2019-11-08 19:05:28 +08:00
"env_variable" : "MODPACK_ID" ,
"default_value" : "" ,
2020-12-08 00:36:10 +08:00
"user_viewable" : true ,
"user_editable" : true ,
2019-11-08 19:05:28 +08:00
"rules" : "required|string"
} ,
{
"name" : "Modpack Version" ,
"description" : "Version of the modpack to use." ,
"env_variable" : "MODPACK_VERSION" ,
2020-03-29 03:25:43 +08:00
"default_value" : "latest" ,
2020-12-08 00:36:10 +08:00
"user_viewable" : true ,
"user_editable" : true ,
2019-11-08 19:05:28 +08:00
"rules" : "required|string|max:20"
}
]
2020-12-08 00:36:10 +08:00
}