From cc2f1be1b6927ef5fd0e5cebba3cfe87905ca443 Mon Sep 17 00:00:00 2001 From: TASelwyn <37274951+TASelwyn@users.noreply.github.com> Date: Thu, 18 Mar 2021 12:13:12 -0400 Subject: [PATCH 01/23] Fixes valheim readme The steamcmd readme did not contain valheim/ in the relative path, which leads to a 404 page as /valheim_vanilla is empty, it should be /valheim/valheim_vanilla Also fixes the category formatting in the valheim_plus's readme to separate the blocks of text. (Also puts assetto corsa above avorion, which is alphabetical order) --- steamcmd_servers/README.md | 12 ++++++------ steamcmd_servers/valheim/valheim_plus/README.md | 4 ++-- steamcmd_servers/valheim/valheim_vanilla/README.md | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/steamcmd_servers/README.md b/steamcmd_servers/README.md index baa4c5b0..18e27f7b 100644 --- a/steamcmd_servers/README.md +++ b/steamcmd_servers/README.md @@ -14,12 +14,12 @@ This is a collection of servers that use SteamCMD to install. * [Arma 3 64 Bit](arma/arma3_x64) * [Arma 3 Headless Client](arma/arma3_headless_client) -## Avorion -[Avorion](avorion) - ## Assetto Corsa [Assetto Corsa](assetto_corsa) +## Avorion +[Avorion](avorion) + ## Barotrauma [Barotrauma](barotrauma) @@ -121,6 +121,6 @@ This is a collection of servers that use SteamCMD to install. [Unturned](unturned) ## Valheim -[Valheim](/valheim) - * [Valheim Vanilla](valheim_vanilla) - * [Valheim Plus Mod](valheim_plus) \ No newline at end of file +[Valheim](valheim) + * [Valheim Vanilla](valheim/valheim_vanilla) + * [Valheim Plus Mod](valheim/valheim_plus) \ No newline at end of file diff --git a/steamcmd_servers/valheim/valheim_plus/README.md b/steamcmd_servers/valheim/valheim_plus/README.md index 1db81152..bf4e054e 100644 --- a/steamcmd_servers/valheim/valheim_plus/README.md +++ b/steamcmd_servers/valheim/valheim_plus/README.md @@ -1,10 +1,10 @@ # Valheim Plus Mod -##Valheim +## Valheim A brutal exploration and survival game for 1-10 players, set in a procedurally-generated purgatory inspired by viking culture. Battle, build, and conquer your way to a saga worthy of Odin’s patronage! https://store.steampowered.com/app/892970/Valheim/ -##Plus Mod +## Plus Mod A HarmonyX Mod aimed at improving the gameplay quality of Valheim. The mod includes several different main features including modifiers to ingame stats of players, buildings and entities and a sophisticated system to build and place objects with high precision and a system to modify already placed objects with high precision. The general goal is to provide V+ as a base modification for your gameplay to increase quality of life, change difficulty or have a better experience in general. The mod also comes with a version and configuration control system for servers and users, allowing servers to make sure that only people with the same configuration are able to join their servers. Support: https://github.com/valheimPlus/ValheimPlus Discord: https://discord.gg/AmH6Va97GT diff --git a/steamcmd_servers/valheim/valheim_vanilla/README.md b/steamcmd_servers/valheim/valheim_vanilla/README.md index d6cbac74..bc38b1f5 100644 --- a/steamcmd_servers/valheim/valheim_vanilla/README.md +++ b/steamcmd_servers/valheim/valheim_vanilla/README.md @@ -1,4 +1,4 @@ -# Valheim Server +# Valheim A brutal exploration and survival game for 1-10 players, set in a procedurally-generated purgatory inspired by viking culture. Battle, build, and conquer your way to a saga worthy of Odin’s patronage! https://store.steampowered.com/app/892970/Valheim/ From ebafbf8cb35365e0ad0c792753656098e0678d73 Mon Sep 17 00:00:00 2001 From: TASelwyn <37274951+TASelwyn@users.noreply.github.com> Date: Thu, 18 Mar 2021 12:16:35 -0400 Subject: [PATCH 02/23] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 0f9d759a..6ee82927 100644 --- a/README.md +++ b/README.md @@ -147,8 +147,8 @@ If you are reading this it looks like you are looking to add an egg to your serv * [Arma 3](/steamcmd_servers/arma/arma3) * [Arma 3 64 Bit](/steamcmd_servers/arma/arma3_x64) * [Arma 3 Headless Client](/steamcmd_servers/arma/arma3_headless_client) -* [Avorion](/steamcmd_servers/avorion) * [Assetto Corsa](/steamcmd_servers/assetto_corsa) +* [Avorion](/steamcmd_servers/avorion) * [Barotrauma](/steamcmd_servers/barotrauma) * [Citadel: Forged with Fire](/steamcmd_servers/citadel) * [Conan Exiles](/steamcmd_servers/conan_exiles) @@ -203,8 +203,6 @@ If you are reading this it looks like you are looking to add an egg to your serv * [Tower Unite](/unreal_engine/tower_unite) * [Tower Unite](/steamcmd_servers/tower_unite) - - [Vintage Story](/vintage_story/vintage_story) [Xonotic](/xonotic/xonotic) From b4f5ab3e0402ba7bbb311d0cf03a6a57048ffd4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien?= <43724816+Aurelien30000@users.noreply.github.com> Date: Fri, 26 Mar 2021 19:19:36 +0100 Subject: [PATCH 03/23] Fix typo --- software/code-server/egg-code--server.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/software/code-server/egg-code--server.json b/software/code-server/egg-code--server.json index f9d01f4a..eb6a6adc 100644 --- a/software/code-server/egg-code--server.json +++ b/software/code-server/egg-code--server.json @@ -29,7 +29,7 @@ "variables": [ { "name": "Password", - "description": "Passwort to login to your Code-Server instance", + "description": "Password to login to your Code-Server instance", "env_variable": "PASSWORD", "default_value": "changeme", "user_viewable": true, @@ -46,4 +46,4 @@ "rules": "required|string|max:20" } ] -} \ No newline at end of file +} From 25128e4000935c46c6fcfee29a6127c26bfb10e6 Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Mon, 29 Mar 2021 19:16:28 -0400 Subject: [PATCH 04/23] Organize server files Move into the same folder structure as other servers. Needed for "reasons" --- README.md | 3 +++ leaguesandbox/{ => leaguesandbox}/LeagueSandbox_Egg.json | 0 leaguesandbox/{ => leaguesandbox}/README.md | 0 mindustry/{ => mindustry}/README.md | 0 mindustry/{ => mindustry}/egg-mindustry.json | 0 minetest/{ => minetest}/README.md | 0 minetest/{ => minetest}/egg-minetest.json | 0 7 files changed, 3 insertions(+) rename leaguesandbox/{ => leaguesandbox}/LeagueSandbox_Egg.json (100%) rename leaguesandbox/{ => leaguesandbox}/README.md (100%) rename mindustry/{ => mindustry}/README.md (100%) rename mindustry/{ => mindustry}/egg-mindustry.json (100%) rename minetest/{ => minetest}/README.md (100%) rename minetest/{ => minetest}/egg-minetest.json (100%) diff --git a/README.md b/README.md index 0f9d759a..c03d79cb 100644 --- a/README.md +++ b/README.md @@ -92,10 +92,13 @@ If you are reading this it looks like you are looking to add an egg to your serv * [SA-MP](/gta/samp) [Mindustry](/mindustry) + * [Mindustry](/mindustry/mindustry) [League Sandbox](/leaguesandbox) + * [League Sandbox](/leaguesandbox/leaguesandbox) [Minetest](/minetest) (including MTG) + * [Minetest](/minetest/minetest) [Minecraft](/minecraft) * [Bedrock](/minecraft/bedrock) Servers for Bedrock Minecraft (Windows 10, mobile, console) diff --git a/leaguesandbox/LeagueSandbox_Egg.json b/leaguesandbox/leaguesandbox/LeagueSandbox_Egg.json similarity index 100% rename from leaguesandbox/LeagueSandbox_Egg.json rename to leaguesandbox/leaguesandbox/LeagueSandbox_Egg.json diff --git a/leaguesandbox/README.md b/leaguesandbox/leaguesandbox/README.md similarity index 100% rename from leaguesandbox/README.md rename to leaguesandbox/leaguesandbox/README.md diff --git a/mindustry/README.md b/mindustry/mindustry/README.md similarity index 100% rename from mindustry/README.md rename to mindustry/mindustry/README.md diff --git a/mindustry/egg-mindustry.json b/mindustry/mindustry/egg-mindustry.json similarity index 100% rename from mindustry/egg-mindustry.json rename to mindustry/mindustry/egg-mindustry.json diff --git a/minetest/README.md b/minetest/minetest/README.md similarity index 100% rename from minetest/README.md rename to minetest/minetest/README.md diff --git a/minetest/egg-minetest.json b/minetest/minetest/egg-minetest.json similarity index 100% rename from minetest/egg-minetest.json rename to minetest/minetest/egg-minetest.json From ca3a18a1e5c987bbdcd8ff5eca4b5f0d4ef6450a Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Mon, 29 Mar 2021 19:21:27 -0400 Subject: [PATCH 05/23] Add Deno Generic Egg resolves #1022 --- bots/discord/deno/README.md | 9 +++ bots/discord/deno/egg-deno-generic.json | 86 +++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 bots/discord/deno/README.md create mode 100644 bots/discord/deno/egg-deno-generic.json diff --git a/bots/discord/deno/README.md b/bots/discord/deno/README.md new file mode 100644 index 00000000..70905747 --- /dev/null +++ b/bots/discord/deno/README.md @@ -0,0 +1,9 @@ +# Deno generic + +### From their [site](https://deno.land/) + +This egg was designed to allow a user to pull their own deno repo. + +There is an option to allow a user to upload their own files to run a server. + +The startup configs and commands may need changing to actually function properly. \ No newline at end of file diff --git a/bots/discord/deno/egg-deno-generic.json b/bots/discord/deno/egg-deno-generic.json new file mode 100644 index 00000000..96ef2e8b --- /dev/null +++ b/bots/discord/deno/egg-deno-generic.json @@ -0,0 +1,86 @@ +{ + "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO", + "meta": { + "version": "PTDL_v1", + "update_url": null + }, + "exported_at": "2021-03-29T23:09:55+00:00", + "name": "Deno Generic", + "author": "parker@parkervcp.com", + "description": "A generic egg to run deno code.", + "features": null, + "images": [ + "quay.io\/parkervcp\/pterodactyl-images:base_debian" + ], + "file_denylist": [], + "startup": ".\/deno run {{JS_FILE}}", + "config": { + "files": "{}", + "startup": "{\r\n \"done\": \"change this part\"\r\n}", + "logs": "{}", + "stop": "^C" + }, + "scripts": { + "installation": { + "script": "#!\/bin\/bash\r\n# Deno Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n\r\napt update\r\napt install -y git curl jq file unzip\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\nif [[ ! \"${USERNAME}\" == \"\" ]]; then\r\n if [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"\/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \".git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"files found with no git config\"\r\n echo -e \"closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\n else\r\n echo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ADDRESS} .\r\n else\r\n echo -e \"cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\n fi\r\n\r\n fi\r\nfi\r\n\r\n## get deno\r\nGITHUB_PACKAGE=denoland\/deno\r\nMATCH=linux\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_LINK=$(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_LINK=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)\r\n fi\r\nfi\r\n\r\nif [ ! -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\nfi\r\n\r\ncurl -sSL $DOWNLOAD_LINK -o ${DOWNLOAD_LINK##*\/}\r\n\r\nFILETYPE=$(file -F ',' ${DOWNLOAD_LINK##*\/} | cut -d',' -f2 | cut -d' ' -f2)\r\nif [ \"$FILETYPE\" == \"gzip\" ]; then\r\n tar xzvf ${DOWNLOAD_LINK##*\/}\r\nelif [ \"$FILETYPE\" == \"Zip\" ]; then\r\n unzip -o ${DOWNLOAD_LINK##*\/}\r\nelif [ \"$FILETYPE\" == \"XZ\" ]; then\r\n tar xvf ${DOWNLOAD_LINK##*\/}\r\nelse\r\n echo -e \"unknown filetype. Exiting\"\r\n exit 2\r\nfi\r\n\r\n## cleaning up downloaded file\r\nrm -f ${DOWNLOAD_LINK##*\/}\r\n\r\necho -e \"install complete\"\r\nexit 0", + "container": "debian:buster-slim", + "entrypoint": "bash" + } + }, + "variables": [ + { + "name": "Git Username", + "description": "Username to auth with git.", + "env_variable": "USERNAME", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string" + }, + { + "name": "Git Access Token", + "description": "Password to use with git.\r\n\r\nIt's best practice to use a Personal Access Token.\r\nhttps:\/\/github.com\/settings\/tokens\r\nhttps:\/\/gitlab.com\/-\/profile\/personal_access_tokens", + "env_variable": "ACCESS_TOKEN", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string" + }, + { + "name": "Git Repo Address", + "description": "GitHub Repo to clone\r\n\r\nI.E. https:\/\/github.com\/parkervcp\/repo_name", + "env_variable": "GIT_ADDRESS", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string" + }, + { + "name": "User Uploaded Files", + "description": "Skip all the install stuff if you are letting a user upload files.\r\n\r\n0 = false (default)\r\n1 = true", + "env_variable": "USER_UPLOAD", + "default_value": "0", + "user_viewable": true, + "user_editable": true, + "rules": "required|bool" + }, + { + "name": "Git Branch", + "description": "What branch to pull from github.\r\n\r\nDefault is blank to pull the repo default branch", + "env_variable": "BRANCH", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string" + }, + { + "name": "Bot js file", + "description": "The JavaScript file to run", + "env_variable": "JS_FILE", + "default_value": "bot.js", + "user_viewable": true, + "user_editable": true, + "rules": "required|string|max:20" + } + ] +} \ No newline at end of file From 8e378d0ce8250b1b5fd08311f761eb7636421512 Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Mon, 29 Mar 2021 19:25:17 -0400 Subject: [PATCH 06/23] Add git cloner script --- scripts/git_cloner.sh | 58 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 scripts/git_cloner.sh diff --git a/scripts/git_cloner.sh b/scripts/git_cloner.sh new file mode 100644 index 00000000..eea0cf42 --- /dev/null +++ b/scripts/git_cloner.sh @@ -0,0 +1,58 @@ +## clone git repos +## supports both github and gitlab +## supports using a personal access token to run git pull + +apt update +apt install -y git curl jq file unzip + +mkdir -p /mnt/server +cd /mnt/server + +if [ "${USER_UPLOAD}" == "true" ] || [ "${USER_UPLOAD}" == "1" ]; then + echo -e "assuming user knows what they are doing have a good day." + exit 0 +fi + +## add git ending if it's not on the address +if [[ ${GIT_ADDRESS} != *.git ]]; then + GIT_ADDRESS=${GIT_ADDRESS}.git +fi + +if [ -z "${USERNAME}" ] && [ -z "${ACCESS_TOKEN}" ]; then + echo -e "using anon api call" +else + GIT_ADDRESS="https://${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d/ -f3-)" +fi + +## pull git js bot repo +if [[ ! "${USERNAME}" == "" ]]; then + if [ "$(ls -A /mnt/server)" ]; then + echo -e "/mnt/server directory is not empty." + if [ -d .git ]; then + echo -e ".git directory exists" + if [ -f .git/config ]; then + echo -e "loading info from git config" + ORIGIN=$(git config --get remote.origin.url) + else + echo -e "files found with no git config" + echo -e "closing out without touching things to not break anything" + exit 10 + fi + fi + + if [ "${ORIGIN}" == "${GIT_ADDRESS}" ]; then + echo "pulling latest from github" + git pull + fi + else + echo -e "/mnt/server is empty.\ncloning files into repo" + if [ -z ${BRANCH} ]; then + echo -e "cloning default branch" + git clone ${GIT_ADDRESS} . + else + echo -e "cloning ${BRANCH}'" + git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} . + fi + + fi +fi \ No newline at end of file From d97ad2f0390708c7a0502ff422bfbe2c8eca0a72 Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Mon, 29 Mar 2021 19:36:25 -0400 Subject: [PATCH 07/23] update generic bot installers update python and nodejs bot eggs. --- .../discord.js/egg-discord-js-generic.json | 74 ++++++++++--------- .../discord.py/egg-discord-py-generic.json | 46 ++++++------ 2 files changed, 62 insertions(+), 58 deletions(-) diff --git a/bots/discord/discord.js/egg-discord-js-generic.json b/bots/discord/discord.js/egg-discord-js-generic.json index db63abb6..e184d8c2 100644 --- a/bots/discord/discord.js/egg-discord-js-generic.json +++ b/bots/discord/discord.js/egg-discord-js-generic.json @@ -1,18 +1,20 @@ { "_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-08-13T22:04:35-04:00", + "exported_at": "2021-03-29T23:34:14+00:00", "name": "discord.js generic", "author": "parker@parkervcp.com", "description": "a generic discord js bot egg\r\n\r\nThis will clone a git repo for a bot. it defaults to master if no branch is specified.\r\n\r\nInstalls the node_modules on install. If you set user_upload then I assume you know what you are doing.", - "image": "quay.io\/parkervcp\/pterodactyl-images:debian_nodejs-12", + "features": null, "images": [ "quay.io\/parkervcp\/pterodactyl-images:debian_nodejs-14", "quay.io\/parkervcp\/pterodactyl-images:debian_nodejs-12", "quay.io\/parkervcp\/pterodactyl-images:debian_nodejs-10" ], + "file_denylist": [], "startup": "if [[ -d .git ]] && [[ {{AUTO_UPDATE}} == \"1\" ]]; then git pull; fi; if [[ ! -z ${NODE_PACKAGES} ]]; then \/usr\/local\/bin\/npm install ${NODE_PACKAGES}; fi; if [ -f \/home\/container\/package.json ]; then \/usr\/local\/bin\/npm install --production; fi; \/usr\/local\/bin\/node \/home\/container\/{{BOT_JS_FILE}}", "config": { "files": "{}", @@ -22,8 +24,8 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n# NodeJS Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y git make gcc g++ python python-dev libtool\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [[ ! \"${USERNAME}\" == \"\" ]]; then\r\n if [[ ! https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git = *\\.git ]]; then\r\n INSTALL_REPO=$(echo -e https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git | sed 's:\/*$::')\r\n INSTALL_REPO=\"https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git\"\r\n fi\r\n \r\n echo -e \"working on installing a discord.js bot from https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git\"\r\n \r\n if [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n \techo -e \"assuming user knows what they are doing have a good day.\"\r\n \texit 0\r\n else\r\n \tif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n \t\techo -e \"\/mnt\/server directory is not empty.\"\r\n \t if [ -d .git ]; then\r\n \t\t\techo -e \".git directory exists\" \r\n \t\t\tif [ -f .git\/config ]; then\r\n \t\t\t\techo -e \"loading info from git config\"\r\n \t\t\t\tORIGIN=$(git config --get remote.origin.url)\r\n \t\t\telse\r\n \t\t\t\techo -e \"files found with no git config\"\r\n \t\t\t\techo -e \"closing out without touching things to not break anything\"\r\n \t\t\t\texit 10\r\n \t\t\tfi\r\n \t\tfi\r\n \t\tif [ \"${ORIGIN}\" == \"https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git\" ]; then\r\n \t\t\techo \"pulling latest from github\"\r\n \t\t\tgit pull \r\n \t\tfi\r\n \telse\r\n \techo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n \t\tif [ -z ${INSTALL_BRANCH} ]; then\r\n \t\t\techo -e \"assuming master branch\"\r\n \t\t\tINSTALL_BRANCH=master\r\n \t\tfi\r\n \r\n \t\techo -e \"running 'git clone --single-branch --branch ${INSTALL_BRANCH} https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git .'\"\r\n \t\tgit clone --single-branch --branch ${INSTALL_BRANCH} https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git .\r\n \tfi\r\n fi \r\nelse\r\n if [[ ! ${INSTALL_REPO} = *\\.git ]]; then\r\n INSTALL_REPO=$(echo -e ${INSTALL_REPO} | sed 's:\/*$::')\r\n INSTALL_REPO=\"${INSTALL_REPO}.git\"\r\n fi\r\n \r\n echo -e \"working on installing a discord.js bot from ${INSTALL_REPO}\"\r\n \r\n if [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n \techo -e \"assuming user knows what they are doing have a good day.\"\r\n \texit 0\r\n else\r\n \tif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n \t\techo -e \"\/mnt\/server directory is not empty.\"\r\n \t if [ -d .git ]; then\r\n \t\t\techo -e \".git directory exists\" \r\n \t\t\tif [ -f .git\/config ]; then\r\n \t\t\t\techo -e \"loading info from git config\"\r\n \t\t\t\tORIGIN=$(git config --get remote.origin.url)\r\n \t\t\telse\r\n \t\t\t\techo -e \"files found with no git config\"\r\n \t\t\t\techo -e \"closing out without touching things to not break anything\"\r\n \t\t\t\texit 10\r\n \t\t\tfi\r\n \t\tfi\r\n \t\tif [ \"${ORIGIN}\" == \"${INSTALL_REPO}\" ]; then\r\n \t\t\techo \"pulling latest from github\"\r\n \t\t\tgit pull \r\n \t\tfi\r\n \telse\r\n \techo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n \t\tif [ -z ${INSTALL_BRANCH} ]; then\r\n \t\t\techo -e \"assuming master branch\"\r\n \t\t\tINSTALL_BRANCH=master\r\n \t\tfi\r\n \r\n \t\techo -e \"running 'git clone --single-branch --branch ${INSTALL_BRANCH} ${INSTALL_REPO} .'\"\r\n \t\tgit clone --single-branch --branch ${INSTALL_BRANCH} ${INSTALL_REPO} .\r\n \tfi\r\n fi \r\nfi\r\n\r\necho \"Installing python requirements into folder\"\r\nif [[ ! -z ${NODE_PACKAGES} ]]; then\r\n \/usr\/local\/bin\/npm install ${NODE_PACKAGES}\r\nfi\r\n\r\nif [ -f \/mnt\/server\/package.json ]; then\r\n \/usr\/local\/bin\/npm install --production\r\nfi\r\n\r\necho -e \"install complete\"\r\nexit 0", - "container": "node:12-buster-slim", + "script": "#!\/bin\/bash\r\n# NodeJS Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y git curl jq file unzip make gcc g++ python python-dev libtool\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\nif [[ ! \"${USERNAME}\" == \"\" ]]; then\r\n if [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"\/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \".git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"files found with no git config\"\r\n echo -e \"closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\n else\r\n echo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ADDRESS} .\r\n else\r\n echo -e \"cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\n fi\r\n\r\n fi\r\nfi\r\n\r\necho \"Installing nodejs packages\"\r\nif [[ ! -z ${NODE_PACKAGES} ]]; then\r\n \/usr\/local\/bin\/npm install ${NODE_PACKAGES}\r\nfi\r\n\r\nif [ -f \/mnt\/server\/package.json ]; then\r\n \/usr\/local\/bin\/npm install --production\r\nfi\r\n\r\necho -e \"install complete\"\r\nexit 0", + "container": "node:14-buster-slim", "entrypoint": "bash" } }, @@ -33,26 +35,8 @@ "description": "The GitHub repo to clone and install the discord js bot from.", "env_variable": "INSTALL_REPO", "default_value": "", - "user_viewable": 1, - "user_editable": 1, - "rules": "nullable|string|max:128" - }, - { - "name": "Username", - "description": "The GitHub username. Leave this field blank if the GitHub repo is NOT a private repo.", - "env_variable": "USERNAME", - "default_value": "", - "user_viewable": 1, - "user_editable": 1, - "rules": "nullable|string|max:128" - }, - { - "name": "Password", - "description": "The GitHub password. Leave this field blank if the GitHub repo is NOT a private repo.", - "env_variable": "PASSWORD", - "default_value": "", - "user_viewable": 1, - "user_editable": 1, + "user_viewable": true, + "user_editable": true, "rules": "nullable|string|max:128" }, { @@ -60,8 +44,8 @@ "description": "The branch of the bot to install.", "env_variable": "INSTALL_BRANCH", "default_value": "", - "user_viewable": 1, - "user_editable": 1, + "user_viewable": true, + "user_editable": true, "rules": "nullable|string|max:32" }, { @@ -69,8 +53,8 @@ "description": "Skip all the install stuff if you are letting a user upload files.\r\n\r\n0 = false (default)\r\n1 = true", "env_variable": "USER_UPLOAD", "default_value": "0", - "user_viewable": 1, - "user_editable": 1, + "user_viewable": true, + "user_editable": true, "rules": "required|bool" }, { @@ -78,8 +62,8 @@ "description": "Pull the latest files on startup when using a GitHub repo.", "env_variable": "AUTO_UPDATE", "default_value": "0", - "user_viewable": 1, - "user_editable": 1, + "user_viewable": true, + "user_editable": true, "rules": "required|boolean" }, { @@ -87,8 +71,8 @@ "description": "The file that starts the bot.", "env_variable": "BOT_JS_FILE", "default_value": "index.js", - "user_viewable": 1, - "user_editable": 1, + "user_viewable": true, + "user_editable": true, "rules": "required|string" }, { @@ -96,9 +80,27 @@ "description": "Install additional node packages.\r\n\r\nUse spaces to separate.", "env_variable": "NODE_PACKAGES", "default_value": "", - "user_viewable": 1, - "user_editable": 1, + "user_viewable": true, + "user_editable": true, "rules": "nullable|string" + }, + { + "name": "Username", + "description": "The GitHub username. Leave this field blank if the GitHub repo is NOT a private repo.", + "env_variable": "USERNAME", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string|max:128" + }, + { + "name": "Password", + "description": "The GitHub password. Leave this field blank if the GitHub repo is NOT a private repo.", + "env_variable": "PASSWORD", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string|max:128" } ] -} +} \ No newline at end of file diff --git a/bots/discord/discord.py/egg-discord-py-generic.json b/bots/discord/discord.py/egg-discord-py-generic.json index 7a3f3692..41fcecdb 100644 --- a/bots/discord/discord.py/egg-discord-py-generic.json +++ b/bots/discord/discord.py/egg-discord-py-generic.json @@ -1,18 +1,20 @@ { "_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-09-28T22:35:14-04:00", + "exported_at": "2021-03-29T23:34:50+00:00", "name": "discord.py generic", "author": "parker@parkervcp.com", "description": "A Discord bot written in Python using discord.py\r\n\r\nhttps:\/\/github.com\/Ispira\/pixel-bot", - "image": "quay.io\/parkervcp\/pterodactyl-images:debian_python-3.8", + "features": null, "images": [ "quay.io\/parkervcp\/pterodactyl-images:debian_python-3.8", "quay.io\/parkervcp\/pterodactyl-images:debian_python-2.7" ], - "startup": "if [[ -d .git ]] && [[ {{AUTO_UPDATE}} == \"1\" ]]; then git pull; fi; if [[ ! -z ${PY_PACKAGES} ]]; then pip install -U --target \/home\/container\/ ${PY_PACKAGES}; fi; if [[ -f \/home\/container\/requirements.txt ]]; then pip install -U --target \/home\/container\/ -r requirements.txt; fi; \/usr\/local\/bin\/python \/home\/container\/{{BOT_PY_FILE}}", + "file_denylist": [], + "startup": "if [[ -d .git ]] && [[ {{AUTO_UPDATE}} == \"1\" ]]; then git pull; fi; if [[ ! -z ${PY_PACKAGES} ]]; then pip install -U --target \/home\/container\/packages\/ ${PY_PACKAGES}; fi; if [[ -f \/home\/container\/requirements.txt ]]; then pip install -U --target \/home\/container\/packages\/ -r requirements.txt; fi; \/usr\/local\/bin\/python \/home\/container\/{{BOT_PY_FILE}}", "config": { "files": "{}", "startup": "{\r\n \"done\": \"change this part\"\r\n}", @@ -21,7 +23,7 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n# Python Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y git make gcc g++ python python-dev libtool\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [[ ! \"${USERNAME}\" == \"\" ]]; then\r\n if [[ ! https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git = *\\.git ]]; then\r\n INSTALL_REPO=$(echo -e https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git | sed 's:\/*$::')\r\n INSTALL_REPO=\"https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git\"\r\n fi\r\n \r\n echo -e \"working on installing a discord.py bot from https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git\"\r\n \r\n if [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n \techo -e \"assuming user knows what they are doing have a good day.\"\r\n \texit 0\r\n else\r\n \tif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n \t\techo -e \"\/mnt\/server directory is not empty.\"\r\n \t if [ -d .git ]; then\r\n \t\t\techo -e \".git directory exists\" \r\n \t\t\tif [ -f .git\/config ]; then\r\n \t\t\t\techo -e \"loading info from git config\"\r\n \t\t\t\tORIGIN=$(git config --get remote.origin.url)\r\n \t\t\telse\r\n \t\t\t\techo -e \"files found with no git config\"\r\n \t\t\t\techo -e \"closing out without touching things to not break anything\"\r\n \t\t\t\texit 10\r\n \t\t\tfi\r\n \t\tfi\r\n \t\tif [ \"${ORIGIN}\" == \"https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git\" ]; then\r\n \t\t\techo \"pulling latest from github\"\r\n \t\t\tgit pull \r\n \t\tfi\r\n \telse\r\n \techo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n \t\tif [ -z ${INSTALL_BRANCH} ]; then\r\n \t\t\techo -e \"assuming master branch\"\r\n \t\t\tINSTALL_BRANCH=master\r\n \t\tfi\r\n \r\n \t\techo -e \"running 'git clone --single-branch --branch ${INSTALL_BRANCH} https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git .'\"\r\n \t\tgit clone --single-branch --branch ${INSTALL_BRANCH} https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git .\r\n \tfi\r\n fi \r\nelse\r\n if [[ ! ${INSTALL_REPO} = *\\.git ]]; then\r\n INSTALL_REPO=$(echo -e ${INSTALL_REPO} | sed 's:\/*$::')\r\n INSTALL_REPO=\"${INSTALL_REPO}.git\"\r\n fi\r\n \r\n echo -e \"working on installing a discord.py bot from ${INSTALL_REPO}\"\r\n \r\n if [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n \techo -e \"assuming user knows what they are doing have a good day.\"\r\n \texit 0\r\n else\r\n \tif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n \t\techo -e \"\/mnt\/server directory is not empty.\"\r\n \t if [ -d .git ]; then\r\n \t\t\techo -e \".git directory exists\" \r\n \t\t\tif [ -f .git\/config ]; then\r\n \t\t\t\techo -e \"loading info from git config\"\r\n \t\t\t\tORIGIN=$(git config --get remote.origin.url)\r\n \t\t\telse\r\n \t\t\t\techo -e \"files found with no git config\"\r\n \t\t\t\techo -e \"closing out without touching things to not break anything\"\r\n \t\t\t\texit 10\r\n \t\t\tfi\r\n \t\tfi\r\n \t\tif [ \"${ORIGIN}\" == \"${INSTALL_REPO}\" ]; then\r\n \t\t\techo \"pulling latest from github\"\r\n \t\t\tgit pull \r\n \t\tfi\r\n \telse\r\n \techo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n \t\tif [ -z ${INSTALL_BRANCH} ]; then\r\n \t\t\techo -e \"assuming master branch\"\r\n \t\t\tINSTALL_BRANCH=master\r\n \t\tfi\r\n \r\n \t\techo -e \"running 'git clone --single-branch --branch ${INSTALL_BRANCH} ${INSTALL_REPO} .'\"\r\n \t\tgit clone --single-branch --branch ${INSTALL_BRANCH} ${INSTALL_REPO} .\r\n \tfi\r\n fi \r\nfi\r\n\r\necho \"Installing python requirements into folder\"\r\nif [[ ! -z ${PY_PACKAGES} ]]; then\r\n pip install -U --target \/mnt\/server\/ ${PY_PACKAGES}\r\nfi\r\n\r\nif [ -f \/mnt\/server\/requirements.txt ]; then\r\n pip install -U --target \/mnt\/server\/ -r requirements.txt\r\nfi\r\n\r\necho -e \"install complete\"\r\nexit 0", + "script": "#!\/bin\/bash\r\n# Python Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y git curl jq file unzip make gcc g++ python python-dev libtool\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\nif [[ ! \"${USERNAME}\" == \"\" ]]; then\r\n if [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"\/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \".git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"files found with no git config\"\r\n echo -e \"closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\n else\r\n echo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ADDRESS} .\r\n else\r\n echo -e \"cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\n fi\r\n\r\n fi\r\nfi\r\n\r\nmkdir \/mnt\/server\/packages\/\r\n\r\necho \"Installing python requirements into folder\"\r\nif [[ ! -z ${PY_PACKAGES} ]]; then\r\n pip install -U --target \/mnt\/server\/packages\/ ${PY_PACKAGES}\r\nfi\r\n\r\nif [ -f \/mnt\/server\/requirements.txt ]; then\r\n pip install -U --target \/mnt\/server\/packages\/ -r requirements.txt\r\nfi\r\n\r\necho -e \"install complete\"\r\nexit 0", "container": "python:3.8-slim", "entrypoint": "bash" } @@ -32,8 +34,8 @@ "description": "The GitHub repo to clone and install the discord py bot from.", "env_variable": "INSTALL_REPO", "default_value": "", - "user_viewable": 1, - "user_editable": 1, + "user_viewable": true, + "user_editable": true, "rules": "nullable|string|max:128" }, { @@ -41,8 +43,8 @@ "description": "The branch of the bot to install", "env_variable": "INSTALL_BRANCH", "default_value": "", - "user_viewable": 1, - "user_editable": 1, + "user_viewable": true, + "user_editable": true, "rules": "nullable|string|max:32" }, { @@ -50,8 +52,8 @@ "description": "Skip all the install stuff if you are letting a user upload files.\r\n\r\n0 = false (default)\r\n1 = true", "env_variable": "USER_UPLOAD", "default_value": "0", - "user_viewable": 1, - "user_editable": 1, + "user_viewable": true, + "user_editable": true, "rules": "required|boolean" }, { @@ -59,8 +61,8 @@ "description": "Pull the latest files on startup when using a GitHub repo.", "env_variable": "AUTO_UPDATE", "default_value": "0", - "user_viewable": 1, - "user_editable": 1, + "user_viewable": true, + "user_editable": true, "rules": "required|boolean" }, { @@ -68,8 +70,8 @@ "description": "The file that starts the bot.", "env_variable": "BOT_PY_FILE", "default_value": "bot.py", - "user_viewable": 1, - "user_editable": 1, + "user_viewable": true, + "user_editable": true, "rules": "required|string" }, { @@ -77,8 +79,8 @@ "description": "Install additional python packages.\r\n\r\nUse spaces to separate", "env_variable": "PY_PACKAGES", "default_value": "", - "user_viewable": 1, - "user_editable": 1, + "user_viewable": true, + "user_editable": true, "rules": "nullable|string" }, { @@ -86,8 +88,8 @@ "description": "The GitHub username. Leave this field blank if the GitHub repo is NOT a private repo.", "env_variable": "USERNAME", "default_value": "", - "user_viewable": 1, - "user_editable": 1, + "user_viewable": true, + "user_editable": true, "rules": "nullable|string|max:128" }, { @@ -95,9 +97,9 @@ "description": "The GitHub password. Leave this field blank if the GitHub repo is NOT a private repo.", "env_variable": "PASSWORD", "default_value": "", - "user_viewable": 1, - "user_editable": 1, + "user_viewable": true, + "user_editable": true, "rules": "nullable|string|max:128" } ] -} +} \ No newline at end of file From 942a1eccfbdadba57d82f078fc19ddd491b444b9 Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Mon, 29 Mar 2021 19:38:41 -0400 Subject: [PATCH 08/23] update download script fixes a but in the download link script. --- scripts/download_link_validator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/download_link_validator.sh b/scripts/download_link_validator.sh index 10a6d69a..d9d15051 100644 --- a/scripts/download_link_validator.sh +++ b/scripts/download_link_validator.sh @@ -1,6 +1,6 @@ ## this is a simple script to validate a download url actaully exists -if [ ! -z "${DOWNLOAD_URL}"]; then +if [ ! -z "${DOWNLOAD_URL}" ]; then if curl --output /dev/null --silent --head --fail ${DOWNLOAD_URL}; then echo -e "link is valid. setting download link to ${DOWNLOAD_URL}" DOWNLOAD_LINK=${DOWNLOAD_URL} From 237ae0613dd61bca7162cd2ffd7dfba6a47c2e73 Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Mon, 29 Mar 2021 19:41:36 -0400 Subject: [PATCH 09/23] update release_grabber update release grabber to fit right into the download link validation script --- scripts/github_release_grabber.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/github_release_grabber.sh b/scripts/github_release_grabber.sh index 14d4e70e..ccbeba09 100644 --- a/scripts/github_release_grabber.sh +++ b/scripts/github_release_grabber.sh @@ -2,6 +2,8 @@ ## this requires the egg has a variable for GITHUB_PACKAGE, VERSION and MATCH (match is to match the filename in some way) ## this supports using oauth/personal access tokens via GITHUB_USER and GITHUB_OAUTH_TOKEN (both are required.) ## if you are getting hit with GitHub API limit issues then you need to have the user and token set. +apt update +apt install -y curl jq if [ -z "${GITHUB_USER}" ] && [ -z "${GITHUB_OAUTH_TOKEN}" ] ; then echo -e "using anon api call" @@ -15,13 +17,13 @@ LATEST_JSON=$(curl --silent "https://api.github.com/repos/${GITHUB_PACKAGE}/rele RELEASES=$(curl --silent "https://api.github.com/repos/${GITHUB_PACKAGE}/releases") if [ -z "${VERSION}" ] || [ "${VERSION}" == "latest" ]; then - DOWNLOAD_LINK=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH}) + DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i ${MATCH}) else VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION "${VERSION}" '.[] | select(.tag_name==$VERSION) | .tag_name') if [ "${VERSION}" == "${VERSION_CHECK}" ]; then - DOWNLOAD_LINK=$(echo ${RELEASES} | jq -r --arg VERSION "${VERSION}" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH}) + DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION "${VERSION}" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i ${MATCH}) else echo -e "defaulting to latest release" - DOWNLOAD_LINK=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url) + DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url) fi fi \ No newline at end of file From 7dfc5ce47173c3ab6bbc5b0076e1d8a05295f57f Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Mon, 29 Mar 2021 19:43:40 -0400 Subject: [PATCH 10/23] update file unpacker script update file unpacker script to work with the github release grabber and download validation script --- scripts/file_unpacker.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/file_unpacker.sh b/scripts/file_unpacker.sh index c5d818f5..0389f2e6 100644 --- a/scripts/file_unpacker.sh +++ b/scripts/file_unpacker.sh @@ -3,11 +3,16 @@ ## The value for ${DOWNLOAD_LINK##*/} is derived from DOWNLOAD_LINK ## if the download link is https://launcher.mojang.com/v1/objects/3dc3d84a581f14691199cf6831b71ed1296a9fdf/server.jar then the ##*/ is server.jar +apt update +apt install -y curl file unzip + +curl -sSL ${DOWNLOAD_LINK} + FILETYPE=$(file -F ',' ${DOWNLOAD_LINK##*/} | cut -d',' -f2 | cut -d' ' -f2) if [ "$FILETYPE" == "gzip" ]; then tar xzvf ${DOWNLOAD_LINK##*/} elif [ "$FILETYPE" == "Zip" ]; then - unzip ${DOWNLOAD_LINK##*/} + unzip -o ${DOWNLOAD_LINK##*/} elif [ "$FILETYPE" == "XZ" ]; then tar xvf ${DOWNLOAD_LINK##*/} else From 6b401c77c3c1753c4620e585fee741302b9244da Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Mon, 29 Mar 2021 20:33:05 -0400 Subject: [PATCH 11/23] update bot egg variables --- .../discord.js/egg-discord-js-generic.json | 28 ++++++++-------- .../discord.py/egg-discord-py-generic.json | 32 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/bots/discord/discord.js/egg-discord-js-generic.json b/bots/discord/discord.js/egg-discord-js-generic.json index e184d8c2..ffd44419 100644 --- a/bots/discord/discord.js/egg-discord-js-generic.json +++ b/bots/discord/discord.js/egg-discord-js-generic.json @@ -4,7 +4,7 @@ "version": "PTDL_v1", "update_url": null }, - "exported_at": "2021-03-29T23:34:14+00:00", + "exported_at": "2021-03-30T00:32:25+00:00", "name": "discord.js generic", "author": "parker@parkervcp.com", "description": "a generic discord js bot egg\r\n\r\nThis will clone a git repo for a bot. it defaults to master if no branch is specified.\r\n\r\nInstalls the node_modules on install. If you set user_upload then I assume you know what you are doing.", @@ -31,22 +31,22 @@ }, "variables": [ { - "name": "Install Repo", - "description": "The GitHub repo to clone and install the discord js bot from.", - "env_variable": "INSTALL_REPO", + "name": "Git Repo Address", + "description": "GitHub Repo to clone\r\n\r\nI.E. https:\/\/github.com\/parkervcp\/repo_name", + "env_variable": "GIT_ADDRESS", "default_value": "", "user_viewable": true, "user_editable": true, - "rules": "nullable|string|max:128" + "rules": "nullable|string" }, { "name": "Install Branch", "description": "The branch of the bot to install.", - "env_variable": "INSTALL_BRANCH", + "env_variable": "BRANCH", "default_value": "", "user_viewable": true, "user_editable": true, - "rules": "nullable|string|max:32" + "rules": "nullable|string" }, { "name": "User Uploaded Files", @@ -85,22 +85,22 @@ "rules": "nullable|string" }, { - "name": "Username", - "description": "The GitHub username. Leave this field blank if the GitHub repo is NOT a private repo.", + "name": "Git Username", + "description": "Username to auth with git.", "env_variable": "USERNAME", "default_value": "", "user_viewable": true, "user_editable": true, - "rules": "nullable|string|max:128" + "rules": "nullable|string" }, { - "name": "Password", - "description": "The GitHub password. Leave this field blank if the GitHub repo is NOT a private repo.", - "env_variable": "PASSWORD", + "name": "Git Access Token", + "description": "Password to use with git.\r\n\r\nIt's best practice to use a Personal Access Token.\r\nhttps:\/\/github.com\/settings\/tokens\r\nhttps:\/\/gitlab.com\/-\/profile\/personal_access_tokens", + "env_variable": "ACCESS_TOKEN", "default_value": "", "user_viewable": true, "user_editable": true, - "rules": "nullable|string|max:128" + "rules": "nullable|string" } ] } \ No newline at end of file diff --git a/bots/discord/discord.py/egg-discord-py-generic.json b/bots/discord/discord.py/egg-discord-py-generic.json index 41fcecdb..f66a70e8 100644 --- a/bots/discord/discord.py/egg-discord-py-generic.json +++ b/bots/discord/discord.py/egg-discord-py-generic.json @@ -4,7 +4,7 @@ "version": "PTDL_v1", "update_url": null }, - "exported_at": "2021-03-29T23:34:50+00:00", + "exported_at": "2021-03-30T00:32:29+00:00", "name": "discord.py generic", "author": "parker@parkervcp.com", "description": "A Discord bot written in Python using discord.py\r\n\r\nhttps:\/\/github.com\/Ispira\/pixel-bot", @@ -30,22 +30,22 @@ }, "variables": [ { - "name": "Install Repo", - "description": "The GitHub repo to clone and install the discord py bot from.", - "env_variable": "INSTALL_REPO", + "name": "Git Repo Address", + "description": "Git repo to clone\r\n\r\nI.E. https:\/\/github.com\/parkervcp\/repo_name", + "env_variable": "GIT_ADDRESS", "default_value": "", "user_viewable": true, "user_editable": true, - "rules": "nullable|string|max:128" + "rules": "nullable|string" }, { - "name": "Install Branch", - "description": "The branch of the bot to install", - "env_variable": "INSTALL_BRANCH", + "name": "Git Branch", + "description": "What branch to pull from github.\r\n\r\nDefault is blank to pull the repo default branch", + "env_variable": "BRANCH", "default_value": "", "user_viewable": true, "user_editable": true, - "rules": "nullable|string|max:32" + "rules": "nullable|string" }, { "name": "User Uploaded Files", @@ -84,22 +84,22 @@ "rules": "nullable|string" }, { - "name": "Username", - "description": "The GitHub username. Leave this field blank if the GitHub repo is NOT a private repo.", + "name": "Git Username", + "description": "Username to auth with git.", "env_variable": "USERNAME", "default_value": "", "user_viewable": true, "user_editable": true, - "rules": "nullable|string|max:128" + "rules": "nullable|string" }, { - "name": "Password", - "description": "The GitHub password. Leave this field blank if the GitHub repo is NOT a private repo.", - "env_variable": "PASSWORD", + "name": "Git Access Token", + "description": "Password to use with git.\r\n\r\nIt's best practice to use a Personal Access Token.\r\nhttps:\/\/github.com\/settings\/tokens\r\nhttps:\/\/gitlab.com\/-\/profile\/personal_access_tokens", + "env_variable": "ACCESS_TOKEN", "default_value": "", "user_viewable": true, "user_editable": true, - "rules": "nullable|string|max:128" + "rules": "nullable|string" } ] } \ No newline at end of file From e0f35165d3adfff9978c29bab92d1ab42dbadfb8 Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Mon, 29 Mar 2021 20:46:24 -0400 Subject: [PATCH 12/23] update clone script missed a part that causes the script to basically fail if a username is not set. --- .../discord.js/egg-discord-js-generic.json | 4 +- .../discord.py/egg-discord-py-generic.json | 4 +- scripts/git_cloner.sh | 52 +++++++++---------- 3 files changed, 29 insertions(+), 31 deletions(-) diff --git a/bots/discord/discord.js/egg-discord-js-generic.json b/bots/discord/discord.js/egg-discord-js-generic.json index ffd44419..37892969 100644 --- a/bots/discord/discord.js/egg-discord-js-generic.json +++ b/bots/discord/discord.js/egg-discord-js-generic.json @@ -4,7 +4,7 @@ "version": "PTDL_v1", "update_url": null }, - "exported_at": "2021-03-30T00:32:25+00:00", + "exported_at": "2021-03-30T00:45:23+00:00", "name": "discord.js generic", "author": "parker@parkervcp.com", "description": "a generic discord js bot egg\r\n\r\nThis will clone a git repo for a bot. it defaults to master if no branch is specified.\r\n\r\nInstalls the node_modules on install. If you set user_upload then I assume you know what you are doing.", @@ -24,7 +24,7 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n# NodeJS Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y git curl jq file unzip make gcc g++ python python-dev libtool\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\nif [[ ! \"${USERNAME}\" == \"\" ]]; then\r\n if [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"\/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \".git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"files found with no git config\"\r\n echo -e \"closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\n else\r\n echo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ADDRESS} .\r\n else\r\n echo -e \"cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\n fi\r\n\r\n fi\r\nfi\r\n\r\necho \"Installing nodejs packages\"\r\nif [[ ! -z ${NODE_PACKAGES} ]]; then\r\n \/usr\/local\/bin\/npm install ${NODE_PACKAGES}\r\nfi\r\n\r\nif [ -f \/mnt\/server\/package.json ]; then\r\n \/usr\/local\/bin\/npm install --production\r\nfi\r\n\r\necho -e \"install complete\"\r\nexit 0", + "script": "#!\/bin\/bash\r\n# NodeJS Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y git curl jq file unzip make gcc g++ python python-dev libtool\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\n## clone git repos\r\n## supports both github and gitlab\r\n## supports using a personal access token to run git pull\r\n\r\napt update\r\napt install -y git curl jq file unzip\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"\/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \".git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"files found with no git config\"\r\n echo -e \"closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ADDRESS} .\r\n else\r\n echo -e \"cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\n fi\r\n\r\nfi\r\n\r\necho \"Installing nodejs packages\"\r\nif [[ ! -z ${NODE_PACKAGES} ]]; then\r\n \/usr\/local\/bin\/npm install ${NODE_PACKAGES}\r\nfi\r\n\r\nif [ -f \/mnt\/server\/package.json ]; then\r\n \/usr\/local\/bin\/npm install --production\r\nfi\r\n\r\necho -e \"install complete\"\r\nexit 0", "container": "node:14-buster-slim", "entrypoint": "bash" } diff --git a/bots/discord/discord.py/egg-discord-py-generic.json b/bots/discord/discord.py/egg-discord-py-generic.json index f66a70e8..4148158b 100644 --- a/bots/discord/discord.py/egg-discord-py-generic.json +++ b/bots/discord/discord.py/egg-discord-py-generic.json @@ -4,7 +4,7 @@ "version": "PTDL_v1", "update_url": null }, - "exported_at": "2021-03-30T00:32:29+00:00", + "exported_at": "2021-03-30T00:45:26+00:00", "name": "discord.py generic", "author": "parker@parkervcp.com", "description": "A Discord bot written in Python using discord.py\r\n\r\nhttps:\/\/github.com\/Ispira\/pixel-bot", @@ -23,7 +23,7 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n# Python Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y git curl jq file unzip make gcc g++ python python-dev libtool\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\nif [[ ! \"${USERNAME}\" == \"\" ]]; then\r\n if [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"\/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \".git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"files found with no git config\"\r\n echo -e \"closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\n else\r\n echo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ADDRESS} .\r\n else\r\n echo -e \"cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\n fi\r\n\r\n fi\r\nfi\r\n\r\nmkdir \/mnt\/server\/packages\/\r\n\r\necho \"Installing python requirements into folder\"\r\nif [[ ! -z ${PY_PACKAGES} ]]; then\r\n pip install -U --target \/mnt\/server\/packages\/ ${PY_PACKAGES}\r\nfi\r\n\r\nif [ -f \/mnt\/server\/requirements.txt ]; then\r\n pip install -U --target \/mnt\/server\/packages\/ -r requirements.txt\r\nfi\r\n\r\necho -e \"install complete\"\r\nexit 0", + "script": "#!\/bin\/bash\r\n# Python Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y git curl jq file unzip make gcc g++ python python-dev libtool\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\n## clone git repos\r\n## supports both github and gitlab\r\n## supports using a personal access token to run git pull\r\n\r\napt update\r\napt install -y git curl jq file unzip\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"\/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \".git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"files found with no git config\"\r\n echo -e \"closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ADDRESS} .\r\n else\r\n echo -e \"cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\n fi\r\n\r\nfi\r\n\r\nmkdir \/mnt\/server\/packages\/\r\n\r\necho \"Installing python requirements into folder\"\r\nif [[ ! -z ${PY_PACKAGES} ]]; then\r\n pip install -U --target \/mnt\/server\/packages\/ ${PY_PACKAGES}\r\nfi\r\n\r\nif [ -f \/mnt\/server\/requirements.txt ]; then\r\n pip install -U --target \/mnt\/server\/packages\/ -r requirements.txt\r\nfi\r\n\r\necho -e \"install complete\"\r\nexit 0", "container": "python:3.8-slim", "entrypoint": "bash" } diff --git a/scripts/git_cloner.sh b/scripts/git_cloner.sh index eea0cf42..3e5ae00c 100644 --- a/scripts/git_cloner.sh +++ b/scripts/git_cloner.sh @@ -25,34 +25,32 @@ else fi ## pull git js bot repo -if [[ ! "${USERNAME}" == "" ]]; then - if [ "$(ls -A /mnt/server)" ]; then - echo -e "/mnt/server directory is not empty." - if [ -d .git ]; then - echo -e ".git directory exists" - if [ -f .git/config ]; then - echo -e "loading info from git config" - ORIGIN=$(git config --get remote.origin.url) - else - echo -e "files found with no git config" - echo -e "closing out without touching things to not break anything" - exit 10 - fi - fi - - if [ "${ORIGIN}" == "${GIT_ADDRESS}" ]; then - echo "pulling latest from github" - git pull - fi - else - echo -e "/mnt/server is empty.\ncloning files into repo" - if [ -z ${BRANCH} ]; then - echo -e "cloning default branch" - git clone ${GIT_ADDRESS} . +if [ "$(ls -A /mnt/server)" ]; then + echo -e "/mnt/server directory is not empty." + if [ -d .git ]; then + echo -e ".git directory exists" + if [ -f .git/config ]; then + echo -e "loading info from git config" + ORIGIN=$(git config --get remote.origin.url) else - echo -e "cloning ${BRANCH}'" - git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} . + echo -e "files found with no git config" + echo -e "closing out without touching things to not break anything" + exit 10 fi - fi + + if [ "${ORIGIN}" == "${GIT_ADDRESS}" ]; then + echo "pulling latest from github" + git pull + fi +else + echo -e "/mnt/server is empty.\ncloning files into repo" + if [ -z ${BRANCH} ]; then + echo -e "cloning default branch" + git clone ${GIT_ADDRESS} . + else + echo -e "cloning ${BRANCH}'" + git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} . + fi + fi \ No newline at end of file From 69813b29df940027b19f52976b43287a867bc666 Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Mon, 29 Mar 2021 20:49:04 -0400 Subject: [PATCH 13/23] update install script --- bots/discord/deno/egg-deno-generic.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bots/discord/deno/egg-deno-generic.json b/bots/discord/deno/egg-deno-generic.json index 96ef2e8b..f42053d8 100644 --- a/bots/discord/deno/egg-deno-generic.json +++ b/bots/discord/deno/egg-deno-generic.json @@ -4,7 +4,7 @@ "version": "PTDL_v1", "update_url": null }, - "exported_at": "2021-03-29T23:09:55+00:00", + "exported_at": "2021-03-30T00:48:40+00:00", "name": "Deno Generic", "author": "parker@parkervcp.com", "description": "A generic egg to run deno code.", @@ -22,7 +22,7 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n# Deno Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n\r\napt update\r\napt install -y git curl jq file unzip\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\nif [[ ! \"${USERNAME}\" == \"\" ]]; then\r\n if [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"\/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \".git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"files found with no git config\"\r\n echo -e \"closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\n else\r\n echo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ADDRESS} .\r\n else\r\n echo -e \"cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\n fi\r\n\r\n fi\r\nfi\r\n\r\n## get deno\r\nGITHUB_PACKAGE=denoland\/deno\r\nMATCH=linux\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_LINK=$(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_LINK=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)\r\n fi\r\nfi\r\n\r\nif [ ! -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\nfi\r\n\r\ncurl -sSL $DOWNLOAD_LINK -o ${DOWNLOAD_LINK##*\/}\r\n\r\nFILETYPE=$(file -F ',' ${DOWNLOAD_LINK##*\/} | cut -d',' -f2 | cut -d' ' -f2)\r\nif [ \"$FILETYPE\" == \"gzip\" ]; then\r\n tar xzvf ${DOWNLOAD_LINK##*\/}\r\nelif [ \"$FILETYPE\" == \"Zip\" ]; then\r\n unzip -o ${DOWNLOAD_LINK##*\/}\r\nelif [ \"$FILETYPE\" == \"XZ\" ]; then\r\n tar xvf ${DOWNLOAD_LINK##*\/}\r\nelse\r\n echo -e \"unknown filetype. Exiting\"\r\n exit 2\r\nfi\r\n\r\n## cleaning up downloaded file\r\nrm -f ${DOWNLOAD_LINK##*\/}\r\n\r\necho -e \"install complete\"\r\nexit 0", + "script": "#!\/bin\/bash\r\n# Deno Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n\r\napt update\r\napt install -y git curl jq file unzip\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"\/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \".git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"files found with no git config\"\r\n echo -e \"closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ADDRESS} .\r\n else\r\n echo -e \"cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\n fi\r\n\r\nfi\r\n\r\n## get deno\r\nGITHUB_PACKAGE=denoland\/deno\r\nMATCH=linux\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_LINK=$(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_LINK=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)\r\n fi\r\nfi\r\n\r\nif [ ! -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\nfi\r\n\r\ncurl -sSL $DOWNLOAD_LINK -o ${DOWNLOAD_LINK##*\/}\r\n\r\nFILETYPE=$(file -F ',' ${DOWNLOAD_LINK##*\/} | cut -d',' -f2 | cut -d' ' -f2)\r\nif [ \"$FILETYPE\" == \"gzip\" ]; then\r\n tar xzvf ${DOWNLOAD_LINK##*\/}\r\nelif [ \"$FILETYPE\" == \"Zip\" ]; then\r\n unzip -o ${DOWNLOAD_LINK##*\/}\r\nelif [ \"$FILETYPE\" == \"XZ\" ]; then\r\n tar xvf ${DOWNLOAD_LINK##*\/}\r\nelse\r\n echo -e \"unknown filetype. Exiting\"\r\n exit 2\r\nfi\r\n\r\n## cleaning up downloaded file\r\nrm -f ${DOWNLOAD_LINK##*\/}\r\n\r\necho -e \"install complete\"\r\nexit 0", "container": "debian:buster-slim", "entrypoint": "bash" } From 6a5945fd0965fff30d8db8b03f8be9e05ce33aae Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Mon, 29 Mar 2021 21:41:16 -0400 Subject: [PATCH 14/23] update scripts --- scripts/git_cloner.sh | 1 - scripts/steamcmd_installer.sh | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/git_cloner.sh b/scripts/git_cloner.sh index 3e5ae00c..098fd050 100644 --- a/scripts/git_cloner.sh +++ b/scripts/git_cloner.sh @@ -52,5 +52,4 @@ else echo -e "cloning ${BRANCH}'" git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} . fi - fi \ No newline at end of file diff --git a/scripts/steamcmd_installer.sh b/scripts/steamcmd_installer.sh index 7742daa9..206567da 100644 --- a/scripts/steamcmd_installer.sh +++ b/scripts/steamcmd_installer.sh @@ -10,7 +10,7 @@ # STEAM_USER, STEAM_PASS, STEAM_AUTH - Steam user setup. If a user has 2fa enabled it will most likely fail due to timeout. Leave blank for anon install. # WINDOWS_INSTALL - if it's a windows server you want to install set to 1 # SRCDS_APPID - steam app id ffound here - https://developer.valvesoftware.com/wiki/Dedicated_Servers_List -# EXTRA_FLAGS - when a server has extra glas for things like beta installs or updates. +# INSTALL_FLAGS - when a server has extra glas for things like beta installs or updates. # ## @@ -18,7 +18,7 @@ apt -y update apt -y --no-install-recommends install curl lib32gcc1 ca-certificates ## just in case someone removed the defaults. -if [ "${STEAM_USER}" == "" ]; then +if [[ "${STEAM_USER}" == "" ]] || [[ "${STEAM_PASS}" == "" ]]; then echo -e "steam user is not set.\n" echo -e "Using anonymous user.\n" STEAM_USER=anonymous @@ -41,7 +41,7 @@ chown -R root:root /mnt export HOME=/mnt/server ## install game using steamcmd -./steamcmd.sh +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +force_install_dir /mnt/server +app_update ${SRCDS_APPID} ${EXTRA_FLAGS} validate +quit ## other flags may be needed depending on install. looking at you cs 1.6 +./steamcmd.sh +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +force_install_dir /mnt/server +app_update ${SRCDS_APPID} ${INSTALL_FLAGS} validate +quit ## other flags may be needed depending on install. looking at you cs 1.6 ## set up 32 bit libraries mkdir -p /mnt/server/.steam/sdk32 From 4811c2b2cedb1511c0229c713e79fb5ee3a6569b Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Mon, 29 Mar 2021 21:43:08 -0400 Subject: [PATCH 15/23] update discordpy install script --- bots/discord/discord.py/egg-discord-py-generic.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bots/discord/discord.py/egg-discord-py-generic.json b/bots/discord/discord.py/egg-discord-py-generic.json index 4148158b..5cba54c2 100644 --- a/bots/discord/discord.py/egg-discord-py-generic.json +++ b/bots/discord/discord.py/egg-discord-py-generic.json @@ -4,7 +4,7 @@ "version": "PTDL_v1", "update_url": null }, - "exported_at": "2021-03-30T00:45:26+00:00", + "exported_at": "2021-03-30T01:42:10+00:00", "name": "discord.py generic", "author": "parker@parkervcp.com", "description": "A Discord bot written in Python using discord.py\r\n\r\nhttps:\/\/github.com\/Ispira\/pixel-bot", @@ -23,7 +23,7 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n# Python Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y git curl jq file unzip make gcc g++ python python-dev libtool\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\n## clone git repos\r\n## supports both github and gitlab\r\n## supports using a personal access token to run git pull\r\n\r\napt update\r\napt install -y git curl jq file unzip\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"\/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \".git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"files found with no git config\"\r\n echo -e \"closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ADDRESS} .\r\n else\r\n echo -e \"cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\n fi\r\n\r\nfi\r\n\r\nmkdir \/mnt\/server\/packages\/\r\n\r\necho \"Installing python requirements into folder\"\r\nif [[ ! -z ${PY_PACKAGES} ]]; then\r\n pip install -U --target \/mnt\/server\/packages\/ ${PY_PACKAGES}\r\nfi\r\n\r\nif [ -f \/mnt\/server\/requirements.txt ]; then\r\n pip install -U --target \/mnt\/server\/packages\/ -r requirements.txt\r\nfi\r\n\r\necho -e \"install complete\"\r\nexit 0", + "script": "#!\/bin\/bash\r\n# Python Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y git curl jq file unzip make gcc g++ python python-dev libtool\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"\/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \".git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"files found with no git config\"\r\n echo -e \"closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ADDRESS} .\r\n else\r\n echo -e \"cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\n fi\r\n\r\nfi\r\n\r\nmkdir \/mnt\/server\/packages\/\r\n\r\necho \"Installing python requirements into folder\"\r\nif [[ ! -z ${PY_PACKAGES} ]]; then\r\n pip install -U --target \/mnt\/server\/packages\/ ${PY_PACKAGES}\r\nfi\r\n\r\nif [ -f \/mnt\/server\/requirements.txt ]; then\r\n pip install -U --target \/mnt\/server\/packages\/ -r requirements.txt\r\nfi\r\n\r\necho -e \"install complete\"\r\nexit 0", "container": "python:3.8-slim", "entrypoint": "bash" } From 220ef0abf12781e19934490c4abd6eb4166cf3ba Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Mon, 29 Mar 2021 21:48:22 -0400 Subject: [PATCH 16/23] update nodejs install script --- bots/discord/discord.js/egg-discord-js-generic.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bots/discord/discord.js/egg-discord-js-generic.json b/bots/discord/discord.js/egg-discord-js-generic.json index 37892969..4fb3cb89 100644 --- a/bots/discord/discord.js/egg-discord-js-generic.json +++ b/bots/discord/discord.js/egg-discord-js-generic.json @@ -4,7 +4,7 @@ "version": "PTDL_v1", "update_url": null }, - "exported_at": "2021-03-30T00:45:23+00:00", + "exported_at": "2021-03-30T01:47:36+00:00", "name": "discord.js generic", "author": "parker@parkervcp.com", "description": "a generic discord js bot egg\r\n\r\nThis will clone a git repo for a bot. it defaults to master if no branch is specified.\r\n\r\nInstalls the node_modules on install. If you set user_upload then I assume you know what you are doing.", @@ -24,7 +24,7 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n# NodeJS Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y git curl jq file unzip make gcc g++ python python-dev libtool\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\n## clone git repos\r\n## supports both github and gitlab\r\n## supports using a personal access token to run git pull\r\n\r\napt update\r\napt install -y git curl jq file unzip\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"\/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \".git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"files found with no git config\"\r\n echo -e \"closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ADDRESS} .\r\n else\r\n echo -e \"cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\n fi\r\n\r\nfi\r\n\r\necho \"Installing nodejs packages\"\r\nif [[ ! -z ${NODE_PACKAGES} ]]; then\r\n \/usr\/local\/bin\/npm install ${NODE_PACKAGES}\r\nfi\r\n\r\nif [ -f \/mnt\/server\/package.json ]; then\r\n \/usr\/local\/bin\/npm install --production\r\nfi\r\n\r\necho -e \"install complete\"\r\nexit 0", + "script": "#!\/bin\/bash\r\n# NodeJS Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y git curl jq file unzip make gcc g++ python python-dev libtool\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"\/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \".git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"files found with no git config\"\r\n echo -e \"closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ADDRESS} .\r\n else\r\n echo -e \"cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\n fi\r\n\r\nfi\r\n\r\necho \"Installing nodejs packages\"\r\nif [[ ! -z ${NODE_PACKAGES} ]]; then\r\n \/usr\/local\/bin\/npm install ${NODE_PACKAGES}\r\nfi\r\n\r\nif [ -f \/mnt\/server\/package.json ]; then\r\n \/usr\/local\/bin\/npm install --production\r\nfi\r\n\r\necho -e \"install complete\"\r\nexit 0", "container": "node:14-buster-slim", "entrypoint": "bash" } From 95a65646f8cd36b28470d2ad457dd27fae6755b4 Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Mon, 29 Mar 2021 22:13:10 -0400 Subject: [PATCH 17/23] add luvit generic --- bots/discord/lua/luvit/README.md | 7 ++ bots/discord/lua/luvit/egg-luvit-generic.json | 95 +++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 bots/discord/lua/luvit/README.md create mode 100644 bots/discord/lua/luvit/egg-luvit-generic.json diff --git a/bots/discord/lua/luvit/README.md b/bots/discord/lua/luvit/README.md new file mode 100644 index 00000000..8c51a6c3 --- /dev/null +++ b/bots/discord/lua/luvit/README.md @@ -0,0 +1,7 @@ +# luvit generic + +This egg was designed to allow a user to pull their own lua discord bot from a repo and run it with luvit. + +There is an option to allow a user to upload their own files to run a bot. + +The startup configs and commands may need changing to actually function properly. \ No newline at end of file diff --git a/bots/discord/lua/luvit/egg-luvit-generic.json b/bots/discord/lua/luvit/egg-luvit-generic.json new file mode 100644 index 00000000..ecdb6564 --- /dev/null +++ b/bots/discord/lua/luvit/egg-luvit-generic.json @@ -0,0 +1,95 @@ +{ + "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO", + "meta": { + "version": "PTDL_v1", + "update_url": null + }, + "exported_at": "2021-03-30T02:11:23+00:00", + "name": "luvit generic", + "author": "parker@parkervcp.com", + "description": "A generic luvit egg This will clone a git repo for a bot. It defaults to master if no branch is specified.\r\n\r\nSupports the discordia lua framework.", + "features": null, + "images": [ + "quay.io\/parkervcp\/pterodactyl-images:base_debian" + ], + "file_denylist": [], + "startup": ".\/luvit {{LUA_FILE}}", + "config": { + "files": "{}", + "startup": "{\r\n \"done\": \"change me\"\r\n}", + "logs": "{}", + "stop": "^c" + }, + "scripts": { + "installation": { + "script": "#!\/bin\/bash\r\n## luvit generic install script\r\n\r\napt update\r\napt install -y git curl jq file unzip\r\n\r\n## get git files\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"\/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \".git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"files found with no git config\"\r\n echo -e \"closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ADDRESS} .\r\n else\r\n echo -e \"cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\n fi\r\nfi\r\n\r\n## install luvit for install time\r\ncurl -L https:\/\/github.com\/luvit\/lit\/raw\/master\/get-lit.sh | sh\r\n\r\n## Install luvit packages\r\n.\/lit install ${LIT_PACKAGES}", + "container": "debian:buster-slim", + "entrypoint": "bash" + } + }, + "variables": [ + { + "name": "Git Username", + "description": "Username to auth with git.", + "env_variable": "USERNAME", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string" + }, + { + "name": "Git Access Token", + "description": "Password to use with git.\r\n\r\nIt's best practice to use a Personal Access Token.\r\nhttps:\/\/github.com\/settings\/tokens\r\nhttps:\/\/gitlab.com\/-\/profile\/personal_access_tokens", + "env_variable": "ACCESS_TOKEN", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string" + }, + { + "name": "Git Repo Address", + "description": "GitHub Repo to clone\r\n\r\nI.E. https:\/\/github.com\/parkervcp\/repo_name", + "env_variable": "GIT_ADDRESS", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string" + }, + { + "name": "User Uploaded Files", + "description": "Skip all the install stuff if you are letting a user upload files.\r\n\r\n0 = false (default)\r\n1 = true", + "env_variable": "USER_UPLOAD", + "default_value": "0", + "user_viewable": true, + "user_editable": false, + "rules": "required|bool" + }, + { + "name": "Git Branch", + "description": "What branch to pull from github.\r\n\r\nDefault is blank to pull the repo default branch", + "env_variable": "BRANCH", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string" + }, + { + "name": "Bot lua file", + "description": "The Lua file to run", + "env_variable": "LUA_FILE", + "default_value": "bot.lua", + "user_viewable": true, + "user_editable": true, + "rules": "required|string" + }, + { + "name": "Lit Packages", + "description": "Lit Packages to install\r\n\r\nexample\r\nSinisterRectus\/discordia lduboeuf\/cjson", + "env_variable": "LIT_PACKAGES", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string" + } + ] +} \ No newline at end of file From 79091ce6f0ebb3779a5151eefbde30f325f3a362 Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Wed, 31 Mar 2021 19:12:23 -0400 Subject: [PATCH 18/23] update python generic install installs python packages into the standard `.local/lib/python3.8/site-packages` updates install script to user new site-packages and configurable requirements.txt file name. Resolves #1002 --- .../discord.py/egg-discord-py-generic.json | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bots/discord/discord.py/egg-discord-py-generic.json b/bots/discord/discord.py/egg-discord-py-generic.json index 5cba54c2..21a5eb7a 100644 --- a/bots/discord/discord.py/egg-discord-py-generic.json +++ b/bots/discord/discord.py/egg-discord-py-generic.json @@ -4,7 +4,7 @@ "version": "PTDL_v1", "update_url": null }, - "exported_at": "2021-03-30T01:42:10+00:00", + "exported_at": "2021-03-31T23:08:12+00:00", "name": "discord.py generic", "author": "parker@parkervcp.com", "description": "A Discord bot written in Python using discord.py\r\n\r\nhttps:\/\/github.com\/Ispira\/pixel-bot", @@ -14,7 +14,7 @@ "quay.io\/parkervcp\/pterodactyl-images:debian_python-2.7" ], "file_denylist": [], - "startup": "if [[ -d .git ]] && [[ {{AUTO_UPDATE}} == \"1\" ]]; then git pull; fi; if [[ ! -z ${PY_PACKAGES} ]]; then pip install -U --target \/home\/container\/packages\/ ${PY_PACKAGES}; fi; if [[ -f \/home\/container\/requirements.txt ]]; then pip install -U --target \/home\/container\/packages\/ -r requirements.txt; fi; \/usr\/local\/bin\/python \/home\/container\/{{BOT_PY_FILE}}", + "startup": "if [[ -d .git ]] && [[ {{AUTO_UPDATE}} == \"1\" ]]; then git pull; fi; if [[ ! -z {{PY_PACKAGES}} ]]; then pip install -U --target .local\/lib\/python3.8\/site-packages {{PY_PACKAGES}}; fi; if [[ -f \/home\/container\/${REQUIREMENTS_FILE} ]]; then pip install -U --target .local\/lib\/python3.8\/site-packages -r ${REQUIREMENTS_FILE}; fi; \/usr\/local\/bin\/python \/home\/container\/{{BOT_PY_FILE}}", "config": { "files": "{}", "startup": "{\r\n \"done\": \"change this part\"\r\n}", @@ -23,7 +23,7 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n# Python Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y git curl jq file unzip make gcc g++ python python-dev libtool\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"\/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \".git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"files found with no git config\"\r\n echo -e \"closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ADDRESS} .\r\n else\r\n echo -e \"cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\n fi\r\n\r\nfi\r\n\r\nmkdir \/mnt\/server\/packages\/\r\n\r\necho \"Installing python requirements into folder\"\r\nif [[ ! -z ${PY_PACKAGES} ]]; then\r\n pip install -U --target \/mnt\/server\/packages\/ ${PY_PACKAGES}\r\nfi\r\n\r\nif [ -f \/mnt\/server\/requirements.txt ]; then\r\n pip install -U --target \/mnt\/server\/packages\/ -r requirements.txt\r\nfi\r\n\r\necho -e \"install complete\"\r\nexit 0", + "script": "#!\/bin\/bash\r\n# Python Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y git curl jq file unzip make gcc g++ python python-dev libtool\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"\/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \".git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"files found with no git config\"\r\n echo -e \"closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ADDRESS} .\r\n else\r\n echo -e \"cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\n fi\r\n\r\nfi\r\n\r\nexport HOME=\/mnt\/server\r\n\r\necho \"Installing python requirements into folder\"\r\nif [[ ! -z ${PY_PACKAGES} ]]; then\r\n pip install -U --target .local\/lib\/python3.8\/site-packages ${PY_PACKAGES}\r\nfi\r\n\r\nif [ -f \/mnt\/server\/requirements.txt ]; then\r\n pip install -U --target .local\/lib\/python3.8\/site-packages -r ${REQUIREMENTS_FILE}\r\nfi\r\n\r\necho -e \"install complete\"\r\nexit 0", "container": "python:3.8-slim", "entrypoint": "bash" } @@ -100,6 +100,15 @@ "user_viewable": true, "user_editable": true, "rules": "nullable|string" + }, + { + "name": "Requirements file", + "description": "if there are other requirements files to choose from.", + "env_variable": "REQUIREMENTS_FILE", + "default_value": "requirements.txt", + "user_viewable": true, + "user_editable": true, + "rules": "required|string" } ] } \ No newline at end of file From dc4a321bde1ae77841c3be31c995af66c94c9bc1 Mon Sep 17 00:00:00 2001 From: Sneaky <78713939+SneakyHub@users.noreply.github.com> Date: Sun, 4 Apr 2021 12:03:30 +0100 Subject: [PATCH 19/23] Create egg-discord-java.json Added a basic java egg that allows people to run java discord bots ( or other java applications ) supports java 11. --- .../discord java/egg-discord-java.json | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 bots/discord/discord java/egg-discord-java.json diff --git a/bots/discord/discord java/egg-discord-java.json b/bots/discord/discord java/egg-discord-java.json new file mode 100644 index 00000000..b9c1e760 --- /dev/null +++ b/bots/discord/discord java/egg-discord-java.json @@ -0,0 +1,41 @@ +{ + "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO", + "meta": { + "version": "PTDL_v1", + "update_url": null + }, + "exported_at": "2021-04-04T11:34:06+01:00", + "name": "Discord Java", + "author": "sneaky@sneakyhub.com", + "description": "Creates a container that runs java.", + "features": null, + "images": [ + "quay.io\/pterodactyl\/core:java-11" + ], + "file_denylist": [], + "startup": "java -Dterminal.jline=false -Dterminal.ansi=true -jar {{JARFILE}}", + "config": { + "files": "{}", + "startup": "{\r\n \"done\": \"\"\r\n}", + "logs": "{}", + "stop": "^C" + }, + "scripts": { + "installation": { + "script": "#!\/bin\/bash\r\n# Java Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\nPROJECT=java\r\n\r\napt update\r\napt install -y curl jq\r\n\r\ncd \/mnt\/server", + "container": "debian:buster-slim", + "entrypoint": "bash" + } + }, + "variables": [ + { + "name": "JAR FILE", + "description": "", + "env_variable": "JARFILE", + "default_value": "sneakyhub.jar", + "user_viewable": true, + "user_editable": true, + "rules": "required|string|max:20" + } + ] +} \ No newline at end of file From ce1fae29fb0af07584c82888ac450141413153c0 Mon Sep 17 00:00:00 2001 From: TASelwyn <37274951+TASelwyn@users.noreply.github.com> Date: Sun, 4 Apr 2021 15:30:00 -0400 Subject: [PATCH 20/23] proxy egg readme cleanup/fixes Updates waterdog's github link to the current repo Alphabetically orders the java proxies list Adds the more descriptive description to typhoon limbo's readme. Removed all traces of "DragonProxy" as it's completely abandoned --- README.md | 1 - minecraft/proxy/README.md | 1 - minecraft/proxy/cross_platform/README.md | 6 +++--- minecraft/proxy/java/README.md | 15 ++++++++------- minecraft/proxy/java/typhoonlimbo/README.md | 2 +- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c03d79cb..e41675f1 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,6 @@ If you are reading this it looks like you are looking to add an egg to your serv * [Cross Platform](/minecraft/proxy/cross_platform) * [GeyserMC](/minecraft/proxy/cross_platform/geyser) * [Waterdog](/minecraft/proxy/cross_platform/waterdog) - * DragonProxy abandoned in favour of GeyserMC. [OpenRA](/openra) * [OpenRA Dune2000](/openra/openra_dune2000) diff --git a/minecraft/proxy/README.md b/minecraft/proxy/README.md index b5bfa102..65b474d7 100644 --- a/minecraft/proxy/README.md +++ b/minecraft/proxy/README.md @@ -8,4 +8,3 @@ * [Cross Platform](/minecraft/proxy/cross_platform) * [GeyserMC](/minecraft/proxy/cross_platform/geyser) * [Waterdog](/minecraft/proxy/cross_platform/waterdog) - * DragonProxy abandoned in favour of GeyserMC. diff --git a/minecraft/proxy/cross_platform/README.md b/minecraft/proxy/cross_platform/README.md index 51553d00..39a88343 100644 --- a/minecraft/proxy/cross_platform/README.md +++ b/minecraft/proxy/cross_platform/README.md @@ -1,13 +1,13 @@ # Mineraft Cross Platform Proxies ### GeyserMC -[GeyserMC](https://github.com/GeyserMC/) +[GeyserMC](https://github.com/GeyserMC) A bridge/proxy allowing you to connect to Minecraft: Java Edition servers with Minecraft: Bedrock edition. -#### Waterdog -[Waterdog](https://github.com/yesdog/Waterdog) +### Waterdog +[Waterdog](https://github.com/WaterdogPE/Waterdog) Waterdog provides native support for the Minecraft Bedrock protocols along with the existing java protocols. It is capable of using the ProtocolSupport PE encapsulation protocol over TCP, or it can use the native RakNet Bedrock protocol for traditional downstream Bedrock servers such as Nukkit, Pocketmine, Bedrock Alpha Server, MiNET, and others. diff --git a/minecraft/proxy/java/README.md b/minecraft/proxy/java/README.md index 920b9918..22f93fb7 100644 --- a/minecraft/proxy/java/README.md +++ b/minecraft/proxy/java/README.md @@ -1,17 +1,18 @@ # Minecraft Java Proxies -#### Waterfall -[Waterfall](https://papermc.io/downloads#Waterfall) -Paper fork of the BungeeCord software, with improved Forge support and more features. #### Travertine [Travertine](https://papermc.io/downloads#Travertine) Waterfall, with additional support for Minecraft 1.7.10. +#### TyphoonLimbo +[TyphoonLimbo](https://github.com/TyphoonMC/TyphoonLimbo) +A limbo server is a fallback server able to handle a massive amount of simultaneous connections. The player spawns into the void then waits here. It can be used to keep players connected to a network after a lobby crashed or as an afk server. + #### Velocity -[Velocity](https://velocitypowered.com/) +[Velocity](https://velocitypowered.com) Velocity is a Minecraft server proxy with unparalleled server support, scalability, and flexibility. -#### Typhoonlimbo -[TyphoonLimbo](https://github.com/TyphoonMC/TyphoonLimbo) -Lightweight Minecraft limbo server +#### Waterfall +[Waterfall](https://papermc.io/downloads#Waterfall) +Paper fork of the BungeeCord software, with improved Forge support and more features. \ No newline at end of file diff --git a/minecraft/proxy/java/typhoonlimbo/README.md b/minecraft/proxy/java/typhoonlimbo/README.md index 697210e2..54e7d22d 100644 --- a/minecraft/proxy/java/typhoonlimbo/README.md +++ b/minecraft/proxy/java/typhoonlimbo/README.md @@ -1,5 +1,5 @@ # TyphoonLimbo server -Lightweight minecraft limbo server +A limbo server is a fallback server able to handle a massive amount of simultaneous connections. The player spawns into the void then waits here. It can be used to keep players connected to a network after a lobby crashed or as an afk server. ## Server Ports The minecraft server requires a single port for access (default 25565) but plugins may require extra ports to enabled for the server. From d3fed1037fa0ce866a719ab733e86a640408f229 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 7 Apr 2021 08:53:09 +0300 Subject: [PATCH 21/23] add chmod and fix cp typo --- minecraft/bedrock/bedrock/egg-vanilla-bedrock.json | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/minecraft/bedrock/bedrock/egg-vanilla-bedrock.json b/minecraft/bedrock/bedrock/egg-vanilla-bedrock.json index c0f53a63..f62fd629 100644 --- a/minecraft/bedrock/bedrock/egg-vanilla-bedrock.json +++ b/minecraft/bedrock/bedrock/egg-vanilla-bedrock.json @@ -1,14 +1,18 @@ { "_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-12-01T21:01:12-05:00", + "exported_at": "2021-04-07T08:52:12+03:00", "name": "Vanilla Bedrock", "author": "parker@parkervcp.com", "description": "Bedrock Edition (also known as the Bedrock Version, Bedrock Codebase, Bedrock Engine or just Bedrock) refers to the multi-platform family of editions of Minecraft developed by Mojang AB, Microsoft Studios, 4J Studios, and SkyBox Labs. Prior to this term, as the engine originated with Pocket Edition, this entire product family was referred to as \"Pocket Edition\", \"MCPE\", or \"Pocket\/Windows 10 Edition\".", "features": null, - "image": "quay.io\/parkervcp\/pterodactyl-images:base_debian", + "images": [ + "quay.io\/parkervcp\/pterodactyl-images:base_debian" + ], + "file_denylist": [], "startup": ".\/bedrock_server", "config": { "files": "{\r\n \"server.properties\": {\r\n \"parser\": \"properties\",\r\n \"find\": {\r\n \"server-port\": \"{{server.build.default.port}}\",\r\n \"server-name\": \"{{server.build.env.SERVERNAME}}\",\r\n \"gamemode\": \"{{server.build.env.GAMEMODE}}\",\r\n \"difficulty\": \"{{server.build.env.DIFFICULTY}}\",\r\n \"allow-cheats\": \"{{server.build.env.CHEATS}}\"\r\n }\r\n }\r\n}", @@ -18,7 +22,7 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n\r\napt update\r\napt install -y zip unzip wget curl\r\n\r\nif [ ! -d \/mnt\/server\/ ]; then\r\n mkdir \/mnt\/server\/\r\nfi\r\n\r\ncd \/mnt\/server\r\n\r\nif [ -z \"${BEDROCK_VERSION}\" ] || [ \"${BEDROCK_VERSION}\" == \"latest\" ]; then\r\n echo -e \"\\n Downloading latest Bedrock server\"\r\n DOWNLOAD_URL=$(curl -sSL https:\/\/www.minecraft.net\/en-us\/download\/server\/bedrock\/ | grep azureedge | grep linux | grep -Eo \"(http|https):\/\/[a-zA-Z0-9.\/?=_-]*\")\r\nelse \r\n echo -e \"\\n Downloading ${BEDROCK_VERSION} Bedrock server\"\r\n DOWNLOAD_URL=https:\/\/minecraft.azureedge.net\/bin-linux\/bedrock-server-$BEDROCK_VERSION.zip\r\nfi\r\n\r\necho -e \"backing up config files\"\r\nrm *.bak\r\ncp server.properties server.properties.bak\r\ncp permissions.json permissions.json.bak\r\ncp whitelist.json whitlist.json.bak\r\n\r\necho -e \"Downloading files from https:\/\/minecraft.azureedge.net\/bin-linux\/bedrock-server-$BEDROCK_VERSION.zip\"\r\n\r\nwget ${DOWNLOAD_URL}\r\n\r\necho -e \"Unpacking server files\"\r\nunzip -o $(echo ${DOWNLOAD_URL} | cut -d\"\/\" -f5)\r\n\r\necho -e \"Cleaning up after installing\"\r\nrm $(echo ${DOWNLOAD_URL} | cut -d\"\/\" -f5)\r\n\r\necho -e \"restoring config files\"\r\ncp -rf server.properties.bak server.properties\r\ncp -rf permissions.json.bak permissions.json\r\ncp -rf whitelist.json.bak whitlist.json\r\n\r\necho -e \"Done\"", + "script": "#!\/bin\/bash\r\n\r\napt update\r\napt install -y zip unzip wget curl\r\n\r\nif [ ! -d \/mnt\/server\/ ]; then\r\n mkdir \/mnt\/server\/\r\nfi\r\n\r\ncd \/mnt\/server\r\n\r\nif [ -z \"${BEDROCK_VERSION}\" ] || [ \"${BEDROCK_VERSION}\" == \"latest\" ]; then\r\n echo -e \"\\n Downloading latest Bedrock server\"\r\n DOWNLOAD_URL=$(curl -sSL https:\/\/www.minecraft.net\/en-us\/download\/server\/bedrock\/ | grep azureedge | grep linux | grep -Eo \"(http|https):\/\/[a-zA-Z0-9.\/?=_-]*\")\r\nelse \r\n echo -e \"\\n Downloading ${BEDROCK_VERSION} Bedrock server\"\r\n DOWNLOAD_URL=https:\/\/minecraft.azureedge.net\/bin-linux\/bedrock-server-$BEDROCK_VERSION.zip\r\nfi\r\n\r\necho -e \"backing up config files\"\r\nrm *.bak\r\ncp server.properties server.properties.bak\r\ncp permissions.json permissions.json.bak\r\ncp whitelist.json whitlist.json.bak\r\n\r\necho -e \"Downloading files from https:\/\/minecraft.azureedge.net\/bin-linux\/bedrock-server-$BEDROCK_VERSION.zip\"\r\n\r\nwget ${DOWNLOAD_URL}\r\n\r\necho -e \"Unpacking server files\"\r\nunzip -o $(echo ${DOWNLOAD_URL} | cut -d\"\/\" -f5)\r\n\r\necho -e \"Cleaning up after installing\"\r\nrm $(echo ${DOWNLOAD_URL} | cut -d\"\/\" -f5)\r\n\r\necho -e \"restoring config files\"\r\ncp -rf server.properties.bak server.properties\r\ncp -rf permissions.json.bak permissions.json\r\ncp -rf whitelist.json.bak whitelist.json\r\nchmod +x bedrock_server\r\n\r\necho -e \"Done\"", "container": "debian:buster-slim", "entrypoint": "bash" } @@ -79,4 +83,4 @@ "rules": "required|string|in:true,false" } ] -} \ No newline at end of file +} From fdb827cab445dbce2aea24e19ecc820d391ddb5a Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 7 Apr 2021 08:57:36 +0300 Subject: [PATCH 22/23] fix second whitelist typo --- minecraft/bedrock/bedrock/egg-vanilla-bedrock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/minecraft/bedrock/bedrock/egg-vanilla-bedrock.json b/minecraft/bedrock/bedrock/egg-vanilla-bedrock.json index f62fd629..c14216e1 100644 --- a/minecraft/bedrock/bedrock/egg-vanilla-bedrock.json +++ b/minecraft/bedrock/bedrock/egg-vanilla-bedrock.json @@ -4,7 +4,7 @@ "version": "PTDL_v1", "update_url": null }, - "exported_at": "2021-04-07T08:52:12+03:00", + "exported_at": "2021-04-07T08:57:04+03:00", "name": "Vanilla Bedrock", "author": "parker@parkervcp.com", "description": "Bedrock Edition (also known as the Bedrock Version, Bedrock Codebase, Bedrock Engine or just Bedrock) refers to the multi-platform family of editions of Minecraft developed by Mojang AB, Microsoft Studios, 4J Studios, and SkyBox Labs. Prior to this term, as the engine originated with Pocket Edition, this entire product family was referred to as \"Pocket Edition\", \"MCPE\", or \"Pocket\/Windows 10 Edition\".", @@ -22,7 +22,7 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n\r\napt update\r\napt install -y zip unzip wget curl\r\n\r\nif [ ! -d \/mnt\/server\/ ]; then\r\n mkdir \/mnt\/server\/\r\nfi\r\n\r\ncd \/mnt\/server\r\n\r\nif [ -z \"${BEDROCK_VERSION}\" ] || [ \"${BEDROCK_VERSION}\" == \"latest\" ]; then\r\n echo -e \"\\n Downloading latest Bedrock server\"\r\n DOWNLOAD_URL=$(curl -sSL https:\/\/www.minecraft.net\/en-us\/download\/server\/bedrock\/ | grep azureedge | grep linux | grep -Eo \"(http|https):\/\/[a-zA-Z0-9.\/?=_-]*\")\r\nelse \r\n echo -e \"\\n Downloading ${BEDROCK_VERSION} Bedrock server\"\r\n DOWNLOAD_URL=https:\/\/minecraft.azureedge.net\/bin-linux\/bedrock-server-$BEDROCK_VERSION.zip\r\nfi\r\n\r\necho -e \"backing up config files\"\r\nrm *.bak\r\ncp server.properties server.properties.bak\r\ncp permissions.json permissions.json.bak\r\ncp whitelist.json whitlist.json.bak\r\n\r\necho -e \"Downloading files from https:\/\/minecraft.azureedge.net\/bin-linux\/bedrock-server-$BEDROCK_VERSION.zip\"\r\n\r\nwget ${DOWNLOAD_URL}\r\n\r\necho -e \"Unpacking server files\"\r\nunzip -o $(echo ${DOWNLOAD_URL} | cut -d\"\/\" -f5)\r\n\r\necho -e \"Cleaning up after installing\"\r\nrm $(echo ${DOWNLOAD_URL} | cut -d\"\/\" -f5)\r\n\r\necho -e \"restoring config files\"\r\ncp -rf server.properties.bak server.properties\r\ncp -rf permissions.json.bak permissions.json\r\ncp -rf whitelist.json.bak whitelist.json\r\nchmod +x bedrock_server\r\n\r\necho -e \"Done\"", + "script": "#!\/bin\/bash\r\n\r\napt update\r\napt install -y zip unzip wget curl\r\n\r\nif [ ! -d \/mnt\/server\/ ]; then\r\n mkdir \/mnt\/server\/\r\nfi\r\n\r\ncd \/mnt\/server\r\n\r\nif [ -z \"${BEDROCK_VERSION}\" ] || [ \"${BEDROCK_VERSION}\" == \"latest\" ]; then\r\n echo -e \"\\n Downloading latest Bedrock server\"\r\n DOWNLOAD_URL=$(curl -sSL https:\/\/www.minecraft.net\/en-us\/download\/server\/bedrock\/ | grep azureedge | grep linux | grep -Eo \"(http|https):\/\/[a-zA-Z0-9.\/?=_-]*\")\r\nelse \r\n echo -e \"\\n Downloading ${BEDROCK_VERSION} Bedrock server\"\r\n DOWNLOAD_URL=https:\/\/minecraft.azureedge.net\/bin-linux\/bedrock-server-$BEDROCK_VERSION.zip\r\nfi\r\n\r\necho -e \"backing up config files\"\r\nrm *.bak\r\ncp server.properties server.properties.bak\r\ncp permissions.json permissions.json.bak\r\ncp whitelist.json whitelist.json.bak\r\n\r\necho -e \"Downloading files from https:\/\/minecraft.azureedge.net\/bin-linux\/bedrock-server-$BEDROCK_VERSION.zip\"\r\n\r\nwget ${DOWNLOAD_URL}\r\n\r\necho -e \"Unpacking server files\"\r\nunzip -o $(echo ${DOWNLOAD_URL} | cut -d\"\/\" -f5)\r\n\r\necho -e \"Cleaning up after installing\"\r\nrm $(echo ${DOWNLOAD_URL} | cut -d\"\/\" -f5)\r\n\r\necho -e \"restoring config files\"\r\ncp -rf server.properties.bak server.properties\r\ncp -rf permissions.json.bak permissions.json\r\ncp -rf whitelist.json.bak whitelist.json\r\nchmod +x bedrock_server\r\n\r\necho -e \"Done\"", "container": "debian:buster-slim", "entrypoint": "bash" } From 3b06e830cc951624e3a2284c7e50c1d8e64f094c Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 7 Apr 2021 10:35:06 +0300 Subject: [PATCH 23/23] update to match the new gomint release type --- minecraft/bedrock/gomint/egg-go-mint.json | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/minecraft/bedrock/gomint/egg-go-mint.json b/minecraft/bedrock/gomint/egg-go-mint.json index 21051f86..0ed158b5 100644 --- a/minecraft/bedrock/gomint/egg-go-mint.json +++ b/minecraft/bedrock/gomint/egg-go-mint.json @@ -1,24 +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-12-12T16:14:47+00:00", + "exported_at": "2021-04-07T10:33:24+03:00", "name": "GoMint", "author": "parker@parkervcp.com", "description": "A performant and stable Minecraft server software for the Bedrock Edition that comes with a modern API and support for Java 11 LTS.", "features": null, - "image": "quay.io\/parkervcp\/pterodactyl-images:debian_openjdk-11", + "images": [ + "quay.io\/pterodactyl\/core:java-11" + ], + "file_denylist": [], "startup": "java --add-opens java.base\/java.nio=io.netty.common --add-exports java.base\/jdk.internal.misc=io.netty.common -p modules -m gomint.server\/io.gomint.server.Bootstrap", "config": { "files": "{\r\n \"server.yml\": {\r\n \"parser\": \"yml\",\r\n \"find\": {\r\n \"listener.port\": \"{{server.build.default.port}}\"\r\n }\r\n }\r\n}", - "startup": "{\r\n \"done\":\"Done in \"\r\n}", + "startup": "{\r\n \"done\": \"Done in \"\r\n}", "logs": "{}", "stop": "stop" }, "scripts": { "installation": { - "script": "#! \/bin\/bash\r\n\r\nGITHUB_PACKAGE=gomint\/gomint\r\nVERSION=latest\r\nMATCH=modules\r\n\r\napt update\r\napt install -y curl jq file unzip\r\n\r\nif [ ! -d \/mnt\/server\/ ]; then\r\n mkdir -p \/mnt\/server\/\r\nfi\r\n\r\ncd \/mnt\/server\/\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 [ \"$(echo ${LATEST_JSON} | jq -r '.message')\" != \"Not Found\" ] && [[ -z \"${VERSION}\" || \"${VERSION}\" == \"latest\" ]]; then\r\n echo -e \"grabbing latest version\"\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -m 1 -i ${MATCH})\r\nelif [ \"$(echo ${LATEST_JSON} | jq -r '.message')\" == \"Not Found\" ]; then\r\n ## emergency fallback if latest isn't found\r\n ## grabs the latest release even it it's a pre-release\r\n echo -e \"grabbing latest pre-release\"\r\n DOWNLOAD_URL=$(echo ${RELEASES} | jq -r '.[0].assets[].browser_download_url' | grep -m 1 -i ${MATCH})\r\nelse\r\n echo -e \"grabbing version $VERSION\"\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 -m 1 -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\r\n\r\nif [ ! -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 VALIDATED_URL=${DOWNLOAD_URL}\r\n else \r\n echo -e \"link is invalid closing out\"\r\n exit 2\r\n fi\r\nfi\r\n\r\ncurl -sSL -o ${VALIDATED_URL##*\/} ${VALIDATED_URL}\r\n\r\nFILETYPE=$(file -F ',' ${VALIDATED_URL##*\/} | cut -d',' -f2 | cut -d' ' -f2)\r\nif [ \"$FILETYPE\" == \"gzip\" ]; then\r\n tar xzvf ${VALIDATED_URL##*\/}\r\nelif [ \"$FILETYPE\" == \"Zip\" ]; then\r\n unzip ${VALIDATED_URL##*\/} -d modules\/\r\nelif [ \"$FILETYPE\" == \"XZ\" ]; then\r\n tar xvf ${VALIDATED_URL##*\/}\r\nelse\r\n echo -e \"unknown filetype. Exiting\"\r\n # exit 2 \r\nfi\r\n\r\nrm ${VALIDATED_URL##*\/}\r\n\r\nif [ ! -f server.yml ]; then\r\n curl -sSL -o server.yml https:\/\/raw.githubusercontent.com\/parkervcp\/eggs\/master\/minecraft\/bedrock\/gomint\/server.yml\r\nfi", + "script": "#! \/bin\/bash\r\n\r\nGITHUB_PACKAGE=gomint\/gomint\r\n\r\napt update\r\napt install -y curl jq file unzip\r\n\r\nif [ ! -d \/mnt\/server\/ ]; then\r\n mkdir -p \/mnt\/server\/\r\nfi\r\n\r\ncd \/mnt\/server\/\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# retrieve latest tag to be used as version match, because gomint doesn't use normal releases\r\nLATEST_VERSION=$(curl -sL https:\/\/api.github.com\/repos\/gomint\/gomint\/tags | jq -r '.[-1].name')\r\n\r\nDOWNLOAD_URL=https:\/\/github.com\/gomint\/gomint\/releases\/download\/${LATEST_VERSION}\/${LATEST_VERSION}.zip\r\n\r\nif [ ! -z \"${DOWNLOAD_URL}\" ]; then \r\n if curl --output \/dev\/null --silent --head --fail ${DOWNLOAD_URL}; then\r\n echo -e \"download link is valid. setting download link to ${DOWNLOAD_URL}\"\r\n VALIDATED_URL=${DOWNLOAD_URL}\r\n else \r\n echo -e \"download link is invalid, something went wrong. Closing out\"\r\n exit 2\r\n fi\r\nfi\r\n\r\ncurl -sSL -o ${VALIDATED_URL##*\/} ${VALIDATED_URL}\r\n\r\nFILETYPE=$(file -F ',' ${VALIDATED_URL##*\/} | cut -d',' -f2 | cut -d' ' -f2)\r\nif [ \"$FILETYPE\" == \"gzip\" ]; then\r\n tar xzvf ${VALIDATED_URL##*\/}\r\nelif [ \"$FILETYPE\" == \"Zip\" ]; then\r\n unzip ${VALIDATED_URL##*\/} -d modules\/\r\nelif [ \"$FILETYPE\" == \"XZ\" ]; then\r\n tar xvf ${VALIDATED_URL##*\/}\r\nelse\r\n echo -e \"unknown filetype. Exiting\"\r\n # exit 2 \r\nfi\r\n\r\n# Move files into correct folders and remove unnecessary stuff\r\nrm ${VALIDATED_URL##*\/}\r\nmv modules\/modules\/* modules\r\nrm -rf modules\/modules\r\nrm modules\/start.*\r\n\r\n# Fetch server config\r\nif [ ! -f server.yml ]; then\r\n curl -sSL -o server.yml https:\/\/raw.githubusercontent.com\/parkervcp\/eggs\/master\/minecraft\/bedrock\/gomint\/server.yml\r\nfi", "container": "debian:buster-slim", "entrypoint": "bash" }