From 6d1a39e003236b1d06cab60339ce12b39fe1297a Mon Sep 17 00:00:00 2001 From: Paz Date: Sat, 23 Jan 2021 13:42:33 +0800 Subject: [PATCH] Update egg-alt--v.json --- gta/altv/egg-alt--v.json | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/gta/altv/egg-alt--v.json b/gta/altv/egg-alt--v.json index d305748c..a00d491f 100644 --- a/gta/altv/egg-alt--v.json +++ b/gta/altv/egg-alt--v.json @@ -1,23 +1,28 @@ { "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO", "meta": { - "version": "PTDL_v1" + "version": "PTDL_v1", + "update_url": null }, - "exported_at": "2020-10-16T12:30:37+00:00", + "exported_at": "2021-01-23T05:41:04+00:00", "name": "alt:V", "author": "parker@parkervcp.com", "description": "alt:V Multiplayer a third-party multiplayer modification for Grand Theft Auto: V", - "image": "quay.io\/parkervcp\/pterodactyl-images:debian_dotnet", - "startup": "sleep 2 && .\/altv-server", + "features": null, + "images": [ + "quay.io\/paz\/game_altv:game_altv" + ], + "file_denylist": "", + "startup": ".\/update.sh && chmod +x .\/altv-server && .\/altv-server", "config": { - "files": "{\r\n \"server.cfg\": {\r\n \"parser\": \"file\",\r\n \"find\": {\r\n \"host:\": \"host: 0.0.0.0\",\r\n \"port:\": \"port: {{server.build.default.port}}\",\r\n \"password:\": \"password: {{server.build.env.PASSWORD}}\",\r\n \"description:\": \"description: {{server.build.env.SERVER_DESC}}\"\r\n }\r\n }\r\n}", + "files": "{\r\n \"server.cfg\": {\r\n \"parser\": \"file\",\r\n \"find\": {\r\n \"host:\": \"host: 0.0.0.0\",\r\n \"port:\": \"port: {{server.build.default.port}}\",\r\n \"password:\": \"password: {{server.build.env.PASSWORD}}\",\r\n \"description:\": \"description: {{server.build.env.SERVER_DESC}}\"\r\n }\r\n },\r\n \"update.cfg\": {\r\n \"parser\": \"file\",\r\n \"find\": {\r\n \"branch:\": \"branch: {{server.build.env.BUILD}}\"\r\n }\r\n }\r\n}", "startup": "{\r\n \"done\": \"Server started\"\r\n}", "logs": "{}", "stop": "^C" }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n# AltV Install Script\r\n#\r\n# Server Files: \/mnt\/server\r\n# BUILD=stable ## this should be an egg variable.\r\nBASE_URL=\"https:\/\/cdn.altv.mp\/\" ## Where the files are stored.\r\n\r\n## install required dependancies.\r\nfunction install_deps () {\r\n apt update\r\n apt install -y libatomic1 zip unzip jq curl wget\r\n echo -e \"deps installed\"\r\n echo -e\r\n}\r\n\r\n## check the has on files and compare to a remote source.\r\n## usage 'check_hash \"file\" \"remote_hash_source\"'\r\nfunction check_hash () {\r\n echo -e \"Checking for file ${1}\"\r\n echo -e \"running: curl -sSL ${2} | jq -r --arg FILENAME \\\"${3}\\\" '.hashList | .[\\$FILENAME]'\"\r\n hash=$(curl -sSL ${2} | jq -r --arg FILENAME ${3} '.hashList | .[$FILENAME]')\r\n echo -e \"hash: $hash\"\r\n\r\n if [ -f ${2} ]; then\r\n\r\n echo -e \"hash is $(sha1sum ${1} | awk '{ print $1 }')\"\r\n echo -e \"current has is ${hash}\"\r\n\r\n if [ \"$(sha1sum ${2} | awk '{ print $1 }')\" == \"${hash}\" ]; then\r\n echo -e \"Hash matched\"\r\n echo -e \"No need to download new file.\"\r\n return 0\r\n else\r\n echo -e \"Hash didn't match\"\r\n echo -e \"Need to download the correct version\"\r\n return 1\r\n fi\r\n else\r\n echo \"No file found\"\r\n return 1\r\n fi\r\n}\r\n\r\n## makes sure a download link is valid.\r\nfunction validate_download () {\r\n DOWNLOAD_URL=${1}\r\n\r\n echo -e \"Download url is ${DOWNLOAD_URL}\"\r\n\r\n if [ ! -z \"${DOWNLOAD_URL}\" ]; then \r\n if curl --output \/dev\/null --silent --head --fail ${DOWNLOAD_URL}; then\r\n echo -e \"link is valid. setting download link to ${DOWNLOAD_URL}\"\r\n DOWNLOAD_LINK=${DOWNLOAD_URL}\r\n else \r\n echo -e \"link is invalid closing out\"\r\n exit 2\r\n fi\r\n fi\r\n\r\n}\r\n\r\nfunction download_files () {\r\n ## validate download link and get files\r\n validate_download ${1}\r\n echo -e \"running wget ${DOWNLOAD_URL} -O ${2}\"\r\n wget ${DOWNLOAD_URL} -O ${2}\r\n}\r\n\r\n## This is a file array for files to get downloaded.\r\n## They are all comma separated lists.\r\n## remote folder (0), json file with hashes (1), file name in json file (2), file name (3), file folder (4), extra commands (5)\r\nfile_array=( \\\r\n\"server\/${BUILD}\/x64_linux\/\",\"update.json\",\"altv-server\",\"altv-server\",\/mnt\/server\/,execute \\\r\n\"server\/${BUILD}\/x64_linux\/\",\"update.json\",\"data\/vehmodels.bin\",\"vehmodels.bin\",\/mnt\/server\/data\/ \\\r\n\"server\/${BUILD}\/x64_linux\/\",\"update.json\",\"data\/vehmods.bin\",\"vehmods.bin\",\/mnt\/server\/data\/ \\\r\n\"others\/\",,\"server.cfg\",server.cfg,\/mnt\/server\/ \\\r\n\"js-module\/${BUILD}\/x64_linux\/\",\"update.json\",\"modules\/js-module\/libnode.so.72\",\"libnode.so.72\",\/mnt\/server\/ \\\r\n\"js-module\/${BUILD}\/x64_linux\/\",\"update.json\",\"modules\/js-module\/libjs-module.so\",\"libjs-module.so\",\/mnt\/server\/modules\/ \\\r\n\"coreclr-module\/${BUILD}\/x64_linux\/\",,\"AltV.Net.Host.dll\",\"AltV.Net.Host.dll\",\/mnt\/server\/ \\\r\n\"coreclr-module\/${BUILD}\/x64_linux\/\",,\"AltV.Net.Host.runtimeconfig.json\",\"AltV.Net.Host.runtimeconfig.json\",\/mnt\/server\/ \\\r\n\"coreclr-module\/stable\/x64_linux\/\",\"update.json\",\"modules\/libcsharp-module.so\",\"libcsharp-module.so\",\/mnt\/server\/modules\/ \\\r\n\"samples\/\",,\"resources.zip\",\"resources.zip\",\/mnt\/server\/,unzip \\\r\n)\r\n\r\ninstall_deps\r\n\r\n## this goes through each value in the array and then checks the hash\r\nfor EACH in ${file_array[@]}\r\ndo\r\n ## this needs to be here to break apart the arrays.\r\n IFS=',' read -r -a array <<< \"$EACH\"\r\n\r\n if [ ! -z \"${array[1]}\" ]; then\r\n ## check hash on 'folder\/file' with 'remote file base url\/remote folder\/ json file' 'json file name' \r\n if check_hash \"${array[4]}${array[3]}\" \"${BASE_URL}${array[0]}${array[1]}\" \"${array[2]}\"; then\r\n echo -e \"file up to date\"\r\n else\r\n echo -e \"downloading most recent file\"\r\n fi\r\n ## make the directory if it doesn't exist.\r\n if [ ! -d ${array[4]} ]; then\r\n mkdir ${array[4]}\r\n fi\r\n download_files \"${BASE_URL}${array[0]}${array[2]}\" \"${array[4]}${array[3]}\"\r\n else\r\n ## make the directory if it doesn't exist.\r\n if [ ! -d ${array[4]} ]; then\r\n mkdir ${array[4]}\r\n fi\r\n download_files \"${BASE_URL}${array[0]}${array[2]}\" \"${array[4]}${array[3]}\"\r\n fi\r\n\r\n ## run extra commands if needed.\r\n case ${array[5]} in\r\n unzip)\r\n cd ${array[4]}\r\n unzip -o ${array[3]}\r\n rm ${array[3]}\r\n ;;\r\n execute)\r\n chmod +x ${array[4]}${array[3]}\r\n ;;\r\n esac\r\n\r\n# echo -e \"HashFile: ${BASE_URL}${array[0]}${array[1]}\"\r\n# echo -e \"Download URL ${BASE_URL}${array[0]}${array[2]}\"\r\n# echo -e \"Filename ${array[3]}\"\r\n# echo -e \"File Folder ${array[4]}\"\r\n# echo -e \"commands to run ${array[5]}\"\r\n# echo -e\r\ndone\r\n\r\necho -e \"install complete\"", + "script": "#!\/bin\/bash\r\n# AltV Install Script\r\n#\r\n# Server Files: \/mnt\/server\r\n# BUILD=stable ## this should be an egg variable.\r\napt update && apt install -y libatomic1 zip unzip jq curl wget libc-bin && cd \/mnt\/server && wget -O 'update.sh' 'https:\/\/raw.githubusercontent.com\/Lhoerion\/altv-serverupdater\/master\/update.sh' && chmod +x .\/update.sh && .\/update.sh && chmod +x .\/altv-server\r\necho -e \"install complete\"", "container": "debian:buster-slim", "entrypoint": "bash" } @@ -25,7 +30,7 @@ "variables": [ { "name": "ld lib path", - "description": "Needed to load modules correctly.", + "description": "Needed to load modules correctly. Best left at default.", "env_variable": "LD_LIBRARY_PATH", "default_value": ".", "user_viewable": false, @@ -33,8 +38,8 @@ "rules": "required|string|max:20" }, { - "name": "Which alt:V build to download", - "description": "The supported versions are release, rc, dev (default: release).\r\n\r\nIf you don't know what you are doing leave it on stable", + "name": "Release Branch", + "description": "The supported versions are release, rc, dev (default: release).\r\nIf you don't know what you are doing leave it on release", "env_variable": "BUILD", "default_value": "release", "user_viewable": true, @@ -60,4 +65,4 @@ "rules": "required|string" } ] -} \ No newline at end of file +}