From 120fc64242aaef153ad82c3b41182def25c00ff4 Mon Sep 17 00:00:00 2001 From: Torsten Widmann Date: Tue, 5 Sep 2023 14:22:02 +0200 Subject: [PATCH] Update egg-backend.json (#192) Co-authored-by: gOOvER <116325+gOOvER@users.noreply.github.com> Co-authored-by: Presti --- Eggs/egg-backend.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Eggs/egg-backend.json b/Eggs/egg-backend.json index 7e4cc1a3..c26683b2 100644 --- a/Eggs/egg-backend.json +++ b/Eggs/egg-backend.json @@ -4,10 +4,10 @@ "version": "PTDL_v2", "update_url": null }, - "exported_at": "2023-08-10T16:19:06+02:00", - "name": "Backend", + "exported_at": "2023-08-19T09:20:08+02:00", + "name": "Ree6 Backend", "author": "presti@presti.me", - "description": "A Egg for the Ree6 Webinterface Bacckend", + "description": "A Egg for the Ree6 Webinterface Backend", "features": null, "docker_images": { "ghcr.io\/parkervcp\/yolks:java_17": "ghcr.io\/parkervcp\/yolks:java_17" @@ -15,15 +15,15 @@ "file_denylist": [], "startup": "java -Dserver.port={{SERVER_PORT}} -jar Webinterface.jar", "config": { - "files": "{\r\n \"config.yml\": {\r\n \"parser\": \"yaml\",\r\n \"find\": {\r\n \"hikari.sql.user\": \"{{server.build.env.DATABASE_USER}}\",\r\n \"hikari.sql.db\": \"{{server.build.env.DATABASE_DB}}\",\r\n \"hikari.sql.pw\": \"{{server.build.env.DATABASE_PASSWORD}}\",\r\n \"hikari.sql.host\": \"{{server.build.env.DATABASE_HOST}}\",\r\n \"hikari.sql.port\": \"{{server.build.env.DATABASE_PORT}}\",\r\n \"hikari.misc.storage\": \"{{server.build.env.DATABASE_TYP}}\",\r\n \"hikari.misc.storageFile\": \"{{server.build.env.DATABASE_FILE}}\",\r\n \"hikari.misc.createEmbeddedServer\": \"{{server.build.env.DATABASE_EMBED}}\",\r\n \"hikari.misc.poolSize\": \"{{server.build.env.DATABASE_POOL}}\",\r\n \"twitch.client.id\": \"{{server.build.env.TWITCH_ID}}\",\r\n \"twitch.client.secret\": \"{{server.build.env.TWITCH_SECRET}}\",\r\n \"discord.bot.tokens.release\": \"{{server.build.env.DISCORD_TOKEN}}\",\r\n \"discord.client.id\": \"{{server.build.env.DISCORD_ID}}\",\r\n \"discord.client.secret\": \"{{server.build.env.DISCORD_SECRET}}\",\r\n \"discord.client.shards\": \"{{server.build.env.DISCORD_SHARDS}}\",\r\n \"webinterface.discordRedirect\": \"{{server.build.env.WEB_DISCORD}}\",\r\n \"webinterface.twitchRedirect\": \"{{server.build.env.WEB_TWITCH}}\",\r\n \"webinterface.errorRedirect\": \"{{server.build.env.WEB_ERROR}}\",\r\n \"webinterface.loginRedirect\": \"{{server.build.env.WEB_LOGIN}}\",\r\n \"webinterface.allowedDomains\": \"{{server.build.env.WEB_DOMAINS}}\"\r\n }\r\n }\r\n}", - "startup": "{\r\n \"done\": \"Started WebinterfaceAplication\"\r\n}", + "files": "{\r\n \"config.yml\": {\r\n \"parser\": \"yaml\",\r\n \"find\": {\r\n \"hikari.sql.user\": \"{{server.build.env.DATABASE_USER}}\",\r\n \"hikari.sql.db\": \"{{server.build.env.DATABASE_DB}}\",\r\n \"hikari.sql.pw\": \"{{server.build.env.DATABASE_PASSWORD}}\",\r\n \"hikari.sql.host\": \"{{server.build.env.DATABASE_HOST}}\",\r\n \"hikari.sql.port\": \"{{server.build.env.DATABASE_PORT}}\",\r\n \"hikari.misc.storage\": \"{{server.build.env.DATABASE_TYP}}\",\r\n \"hikari.misc.storageFile\": \"{{server.build.env.DATABASE_FILE}}\",\r\n \"hikari.misc.createEmbeddedServer\": \"{{server.build.env.DATABASE_EMBED}}\",\r\n \"hikari.misc.poolSize\": \"{{server.build.env.DATABASE_POOL}}\",\r\n \"twitch.client.id\": \"{{server.build.env.TWITCH_ID}}\",\r\n \"twitch.client.secret\": \"{{server.build.env.TWITCH_SECRET}}\",\r\n \"discord.bot.tokens.release\": \"{{server.build.env.DISCORD_TOKEN}}\",\r\n \"discord.client.id\": \"{{server.build.env.DISCORD_ID}}\",\r\n \"discord.client.secret\": \"{{server.build.env.DISCORD_SECRET}}\",\r\n \"discord.client.shards\": \"{{server.build.env.DISCORD_SHARDS}}\",\r\n \"webinterface.discordRedirect\": \"{{server.build.env.WEB_DISCORD}}\",\r\n \"webinterface.twitchRedirect\": \"{{server.build.env.WEB_TWITCH}}\",\r\n \"webinterface.errorRedirect\": \"{{server.build.env.WEB_ERROR}}\",\r\n \"webinterface.loginRedirect\": \"{{server.build.env.WEB_LOGIN}}\",\r\n \"webinterface.allowedDomains\": \"{{server.build.env.WEB_DOMAINS}}\"\r\n }\r\n }\r\n}", + "startup": "{\r\n \"done\": \" Started WebinterfaceApplication \"\r\n}", "logs": "{}", - "stop": "^C" + "stop": "^^C" }, "scripts": { "installation": { - "script": "## this is a simple script to use the github API for release versions.\r\n## this requires the egg has a variable for GITHUB_PACKAGE, VERSION and MATCH (match is to match the filename in some way)\r\n## this supports using oauth\/personal access tokens via GITHUB_USER and GITHUB_OAUTH_TOKEN (both are required.)\r\n## if you are getting hit with GitHub API limit issues then you need to have the user and token set.\r\napt update\r\napt install -y curl jq\r\n\r\n## get release info and download links\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/Ree6-Applications\/Webinterface\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/Ree6-Applications\/Webinterface\/releases\")\r\n\r\nMATCH=Webinterface-Backend-\r\n\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}\" | head -1 )\r\nelse\r\n VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .tag_name')\r\n if [ \"${VERSION}\" == \"${VERSION_CHECK}\" ]; then\r\n DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i \"${MATCH}\" | head -1)\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 | grep -i *.jar)\r\n fi\r\nfi\r\n\r\n## Backend Setup\r\n[ ! -d \/mnt\/server ] && mkdir -p \/mnt\/server\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\ncd \/mnt\/server\r\necho -e \"\\nInstalling\/Updating Backend...\\n\"\r\n\r\nif [ -f Webinterface.jar ]; then\r\n echo -e \"Updating Webinterface.jar to latest version...\"\r\n echo -e '\\t(Old version can be found at \"Webinterface.jar-old\")'\r\n mv -f Webinterface.jar Webinterface.jar-old\r\nfi\r\n\r\necho -e \"Running: curl -sSL -o Webinterface.jar ${DOWNLOAD_LINK}\\n\"\r\ncurl -sSL -o Webinterface.jar ${DOWNLOAD_LINK}\r\n\r\nif [ -f config.yml ]; then\r\n echo -e \"Updating config.yml to latest version...\"\r\n echo -e '\\t(Old version can be found at \"config.yml-old\")'\r\n mv -f config.yml config.yml-old\r\nfi\r\n\r\necho -e \"\\nBackend Successfully Installed!\"", - "container": "debian:bullseye-slim", + "script": "#!\/bin\/bash\r\n# Ree6 Backend installscript\r\n#\r\n#Variables\r\nclear\r\nRED='\\033[0;31m'\r\nGREEN='\\033[0;32m'\r\nYELLOW='\\033[1;33m'\r\nBLUE='\\033[0;34m'\r\nNC='\\033[0m'\r\n\r\nexport HOME=\/mnt\/server\r\n\r\necho -e \"${BLUE}-------------------------------------------------${NC}\"\r\necho -e \"${YELLOW}Ree6 Backend installscript${NC}\"\r\necho -e \"${BLUE}-------------------------------------------------${NC}\"\r\n\r\necho -e \"${BLUE}-------------------------------------------------${NC}\"\r\necho -e \"${YELLOW}installing dependencies...${NC}\"\r\necho -e \"${BLUE}-------------------------------------------------${NC}\"\r\napt update\r\napt install -y curl jq\r\necho -e \"${GREEN}..done..\\n${NC}\"\r\n\r\n## get release info and download links\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/Ree6-Applications\/Webinterface\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/Ree6-Applications\/Webinterface\/releases\")\r\n\r\nMATCH=Webinterface-Backend-\r\n\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}\" | head -1 )\r\nelse\r\n VERSION_CHECK=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .tag_name')\r\n if [ \"${VERSION}\" == \"${VERSION_CHECK}\" ]; then\r\n DOWNLOAD_URL=$(echo ${RELEASES} | jq -r --arg VERSION \"${VERSION}\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i \"${MATCH}\" | head -1)\r\n else\r\n echo -e \"${BLUE}-------------------------------------------------${NC}\"\r\n echo -e \"${YELLOW}defaulting to latest release...${NC}\"\r\n echo -e \"${BLUE}-------------------------------------------------${NC}\"\r\n DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url | grep -i *.jar)\r\n fi\r\nfi\r\n\r\n## Backend Setup\r\n[ ! -d \/mnt\/server ] && mkdir -p \/mnt\/server\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 \"${BLUE}-------------------------------------------------${NC}\"\r\n echo -e \"${GREEN}link is valid.${NC}\"\r\n echo -e \"${GREEN}setting download link to: ${YELLOW} ${DOWNLOAD_URL} ${NC}\"\r\n echo -e \"${BLUE}-------------------------------------------------\\n${NC}\"\r\n DOWNLOAD_LINK=${DOWNLOAD_URL}\r\n else\r\n echo -e \"${BLUE}-------------------------------------------------${NC}\"\r\n echo -e \"${RED}link is invalid closing out${NC}\"\r\n echo -e \"${BLUE}-------------------------------------------------${NC}\"\r\n exit 2\r\n fi\r\nfi\r\n\r\ncd \/mnt\/server\r\necho -e \"${BLUE}-------------------------------------------------${NC}\"\r\necho -e \"${YELLOW}Installing\/Updating Backend...${NC}\"\r\necho -e \"${BLUE}-------------------------------------------------\\n${NC}\"\r\n\r\nif [ -f Webinterface.jar ]; then\r\n echo -e \"${BLUE}-------------------------------------------------${NC}\"\r\n echo -e \"${YELLOW}Updating Webinterface.jar to latest version... ${NC}\"\r\n echo -e \"${YELLOW}(Old version can be found at ${RED}Webinterface.jar-old) ${NC}\"\r\n echo -e \"${BLUE}-------------------------------------------------${NC}\"\r\n mv -f Webinterface.jar Webinterface.jar-old\r\n echo -e \"${GREEN}..done..\\n${NC}\"\r\nfi\r\n\r\necho -e \"${BLUE}-------------------------------------------------${NC}\"\r\necho -e \"${YELLOW}Running: curl -sSL -o Webinterface.jar ${DOWNLOAD_LINK} ${NC}\"\r\necho -e \"${BLUE}-------------------------------------------------${NC}\"\r\n\r\necho -e \"\"\r\ncurl -sSL -o Webinterface.jar ${DOWNLOAD_LINK}\r\necho -e \"${GREEN}..done..\\n${NC}\"\r\n\r\nif [ -f config.yml ]; then\r\n echo -e \"${BLUE}-------------------------------------------------${NC}\"\r\n echo -e \"${YELLOW}Updating config.yml to latest version... ${NC}\"\r\n echo -e \"${YELLOW}(Old version can be found at ${RED}config.yml-old) ${NC}\"\r\n echo -e \"${BLUE}-------------------------------------------------${NC}\"\r\n mv -f config.yml config.yml-old\r\n echo -e \"${GREEN}..done..\\n${NC}\"\r\nfi\r\n\r\necho -e \"${BLUE}-------------------------------------------------${NC}\"\r\necho -e \"${YELLOW}Backend Successfully Installed! ${NC}\"\r\necho -e \"${BLUE}-------------------------------------------------${NC}\"", + "container": "debian:bookworm-slim", "entrypoint": "bash" } },