eggs/game_eggs/minecraft/java/curseforge/egg-curse-forge-generic.json

69 lines
20 KiB
JSON
Raw Normal View History

{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
"meta": {
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2023-05-05T19:03:39-07:00",
"name": "CurseForge Generic",
"author": "contact@chromozone.dev",
"description": "A generic egg for a CurseForge modpack.",
"features": [
"eula",
"java_version",
"pid_limit"
],
"docker_images": {
"Java 8": "ghcr.io\/pterodactyl\/yolks:java_8",
"Java 11": "ghcr.io\/pterodactyl\/yolks:java_11",
"Java 16": "ghcr.io\/pterodactyl\/yolks:java_16",
"Java 17": "ghcr.io\/pterodactyl\/yolks:java_17"
},
"file_denylist": [],
"startup": "java -Xms128M -Xmx{{SERVER_MEMORY}}M -Dterminal.jline=false -Dterminal.ansi=true $([[ ! -f unix_args.txt ]] && printf %s \"-jar `cat .serverjar`\" || printf %s \"@unix_args.txt\")",
"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}",
"logs": "{}",
"stop": "stop"
},
"scripts": {
"installation": {
"script": "#!\/bin\/bash\r\n# shellcheck disable=SC2155\r\n#\r\n# CurseForge Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n\r\n: \"${SERVER_DIR:=\/mnt\/server}\"\r\n: \"${PROJECT_ID:=}\"\r\n: \"${VERSION_ID:=}\"\r\n: \"${API_KEY:=}\"\r\n\r\nif [[ ! -d $SERVER_DIR ]]; then\r\n mkdir -p \"$SERVER_DIR\"\r\nfi\r\n\r\nif ! cd \"$SERVER_DIR\"; then\r\n echo -e \"Failed to change directory to ${SERVER_DIR}\"\r\n exit 1\r\nfi\r\n\r\nfunction install_required {\r\n echo -e \"Installing required packages...\"\r\n echo -e \"\\tRunning apt update\"\r\n apt update > \/dev\/null 2>&1 || { echo \"apt update failed!\"; exit 1; }\r\n echo -e \"\\tRunning apt install\"\r\n apt install -y wget jq unzip > \/dev\/null 2>&1 || { echo \"apt install failed!\"; exit 1; }\r\n}\r\n\r\nCURSEFORGE_API_URL=\"https:\/\/api.curseforge.com\/v1\/mods\/\"\r\nCURSEFORGE_API_HEADERS=(\"--header=Accept: application\/json\" \"--header=x-api-key: ${API_KEY}\")\r\n\r\nfunction get_download {\r\n echo -e \"Retrieving CurseForge project information...\"\r\n local PROJECT_DATA=$(wget -q \"${CURSEFORGE_API_HEADERS[@]}\" \"${CURSEFORGE_API_URL}${PROJECT_ID}\" -O -)\r\n local PROJECT_TITLE=$(echo \"$PROJECT_DATA\" | jq -r '.data.name \/\/ empty')\r\n\r\n if [[ -z \"${PROJECT_DATA}\" ]]; then\r\n echo -e \"\\tERROR: Failed to retrieve project data for project id '${PROJECT_ID}'\"\r\n exit 1\r\n fi\r\n\r\n local IS_SERVER_PACK=false\r\n\r\n if [[ -z \"${VERSION_ID}\" || \"${VERSION_ID}\" == \"latest\" ]]; then\r\n echo -e \"\\tNo version ID specified, using latest version\"\r\n VERSION_ID=$(echo \"$PROJECT_DATA\" | jq -r '.data.mainFileId \/\/ empty')\r\n\r\n local VERSION_SERVER_PACK=\"$(echo -e \"${PROJECT_DATA}\" | jq -r --arg VERSION_ID \"$VERSION_ID\" '.data.latestFiles[] | select(.id|tostring==$VERSION_ID) | .isServerPack')\"\r\n local VERSION_SERVER_ID=\"$(echo -e \"${PROJECT_DATA}\" | jq -r --arg VERSION_ID \"$VERSION_ID\" '.data.latestFiles[] | select(.id|tostring==$VERSION_ID) | .serverPackFileId')\"\r\n\r\n if [[ \"${VERSION_SERVER_PACK}\" == \"false\" && -n \"${VERSION_SERVER_ID}\" ]]; then\r\n echo -e \"\\tFound server pack version id '${VERSION_SERVER_ID}'\"\r\n VERSION_ID=$VERSION_SERVER_ID\r\n IS_SERVER_PACK=true\r\n elif [[ \"${VERSION_SERVER_PACK}\" == \"true\" ]]; then\r\n IS_SERVER_PACK=true\r\n fi\r\n else\r\n echo -e \"\\tChecking if provided version id '${VERSION_ID}' exists\"\r\n\r\n local VERSION_SERVER_PACK=\"$(echo -e \"${PROJECT_DATA}\" | jq -r --arg VERSION_ID \"$VERSION_ID\" '.data.latestFiles[]? | select(.serverPackFileId|tostring==$VERSION_ID) | .serverPackFileId')\"\r\n local VERSION_SERVER_ID;\r\n if [[ -n \"${VERSION_SERVER_PACK}\" ]]; then\r\n VERSION_ID=$VERSION_SERVER_PACK\r\n IS_SERVER_PACK=true\r\n elif [[ $(echo \"$PROJECT_DATA\" | jq -r --arg VERSION_ID \"$VERSION_ID\" '.data.latestFiles[]? | select(.id|tostring == $VERSION_ID) | .id') == \"${VERSION_ID}\" ]]; then\r\n VERSION_SERVER_PACK=\"$(echo -e \"${PROJECT_DATA}\" | jq -r --arg VERSION_ID \"$VERSION_ID\" '.data.latestFiles[] | select(.id|tostring==$VERSION_ID) | .isServerPack')\"\r\n VERSION_SERVER_ID=\"$(echo -e \"${PROJECT_DATA}\" | jq -r --arg VERSION_ID \"$VERSION_ID\" '.data.latestFiles[] | select(.id|tostring==$VERSION_ID) | .serverPackFileId')\"\r\n\r\n if [[ \"${VERSION_SERVER_PACK}\" == \"false\" && -n \"${VERSION_SERVER_ID}\" ]]; then\r\n echo -e \"\\tFound server pack version id '${VERSION_SERVER_ID}'\"\r\n VERSION_ID=$VERSION_SERVER_ID\r\n IS_SERVER_PACK=true\r\n elif [[ \"${VERSION_SERVER_PACK}\" == \"true\" ]]; then\r\n IS_SERVER_PACK=true\r\n fi\r\n else\r\n echo -e \"\\tERROR: Version id '${VERSION_ID}' not found for project '${PROJECT_TITLE}'\"\r\n exit 1\r\n fi\r\n fi
"container": "openjdk:8-jdk-slim",
"entrypoint": "bash"
}
},
"variables": [
{
"name": "Modpack Project ID",
"description": "The modpack project ID from the CurseForge site on the pack page, or 'zip' if installing from an uploaded server.zip file.\r\n\r\nFor example, the project Id of https:\/\/www.curseforge.com\/minecraft\/modpacks\/bofa-mods ID is 375152",
"env_variable": "PROJECT_ID",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "required|numeric",
"field_type": "text"
},
{
"name": "Modpack File ID",
"description": "The file ID belonging to a specific version of a modpack. Can either be the main file or the file ID associated with the server pack.\r\n\r\nIf not provided the script will attempt to retrieve the latest server pack or client pack available.",
"env_variable": "VERSION_ID",
"default_value": "latest",
"user_viewable": true,
"user_editable": true,
"rules": "numeric",
"field_type": "text"
},
{
"name": "CurseForge API Key",
"description": "A CurseForge API key is required to use this egg. You can learn how to get an API key here: https:\/\/support.curseforge.com\/en\/support\/solutions\/articles\/9000208346-about-the-curseforge-api-and-how-to-apply-for-a-key",
"env_variable": "API_KEY",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "required|string|max:60",
"field_type": "text"
}
]
}