From 99878e027931ba50991ffa88990f3b40a69f9f18 Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Sat, 16 Dec 2023 14:04:15 +0100 Subject: [PATCH] Do it right --- software/rathole/egg-rathole.json | 33 +++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/software/rathole/egg-rathole.json b/software/rathole/egg-rathole.json index fa6292c7..d6930146 100644 --- a/software/rathole/egg-rathole.json +++ b/software/rathole/egg-rathole.json @@ -4,10 +4,10 @@ "version": "PTDL_v2", "update_url": null }, - "exported_at": "2023-12-15T15:44:13+03:00", + "exported_at": "2023-12-16T14:03:42+01:00", "name": "Rathole", "author": "tunayada@gmail.com", - "description": "A rathole server egg designed to work with pterodactyl.", + "description": "A lightweight and high-performance reverse proxy for NAT traversal, written in Rust. An alternative to frp and ngrok.", "features": null, "docker_images": { "ghcr.io\/parkervcp\/yolks:rust_latest": "ghcr.io\/parkervcp\/yolks:rust_latest" @@ -15,17 +15,38 @@ "file_denylist": [], "startup": ".\/rathole server.toml", "config": { - "files": "{\r\n \"server.toml\": {\r\n \"parser\": \"file\",\r\n \"find\": {\r\n \"bind_addr=\\\"0.0.0.0:-1\\\"\": \"bind_addr=\\\"0.0.0.0:{{server.build.default.port}}\\\"\"\r\n }\r\n }\r\n}", + "files": "{\r\n \"server.toml\": {\r\n \"parser\": \"ini\",\r\n \"find\": {\r\n \"server.bind_addr\": \"\\\"0.0.0.0:{{server.build.default.port}}\\\"\",\r\n \"server.services.test.token\": \"\\\"{{server.build.env.TOKEN}}\\\"\",\r\n \"server.services.test.bind_addr\": \"\\\"0.0.0.0:{{server.build.default.port}}\\\"\"\r\n }\r\n }\r\n}", "startup": "{\r\n \"done\": [\r\n \"Listening at \"\r\n ]\r\n}", "logs": "{}", "stop": "^C" }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n\r\napt update\r\napt install -y unzip wget\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nwget https:\/\/github.com\/rapiz1\/rathole\/releases\/download\/v0.5.0\/rathole-x86_64-unknown-linux-gnu.zip\r\n\r\nunzip rathole-x86_64-unknown-linux-gnu.zip\r\nrm rathole-x86_64-unknown-linux-gnu.zip\r\ntouch server.toml\r\nprintf \"[server]\\nbind_addr=\\\"0.0.0.0:-1\\\"\\n\\n[server.services.test]\\ntoken=\\\"a_hidden_token\\\"\\nbind_addr=\\\"0.0.0.0:3506\\\"\" > server.toml\r\n\r\nexport HOME=\/mnt\/server\r\n\r\necho -e \"install complete\"\r\nexit 0", - "container": "debian:buster-slim", + "script": "#!\/bin\/bash\r\n\r\n## get release info and download links\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/rapiz1\/rathole\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/rapiz1\/rathole\/releases\")\r\nARCH=$([[ \"$(uname -m)\" == \"x86_64\" ]] && echo \"amd64\" || echo \"aarch64\")\r\n\r\nif [\"${ARCH}\" == \"aarch64\"]; then\r\n MATCH=rathole-aarch64-unknown-linux-musl.zip\r\nelse\r\n MATCH=rathole-x86_64-unknown-linux-gnu.zip\r\nfi\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_URL=$(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_URL=$(echo ${LATEST_JSON} | jq .assets | jq -r .[].browser_download_url)\r\n fi\r\nfi\r\n\r\necho \"Download url: ${DOWNLOAD_URL}\"\r\ncurl -ssL -o rathole.zip ${DOWNLOAD_URL}\r\nunzip rathole.zip\r\nrm rathole.zip\r\ntouch server.toml\r\n\r\nprintf \"[server]\\nbind_addr=\\\"0.0.0.0:${SERVER_PORT}\\\"\\n\\n[server.services.test]\\ntoken=\\\"${TOKEN}\\\"\\nbind_addr=\\\"0.0.0.0:${SERVER_PORT}\\\"\" > server.toml\r\nchmod +x rathole\r\n\r\n## install end\r\necho \"-----------------------------------------\"\r\necho \"Installation completed...\"\r\necho \"-----------------------------------------\"", + "container": "ghcr.io\/parkervcp\/installers:debian", "entrypoint": "bash" } }, - "variables": [] + "variables": [ + { + "name": "Version", + "description": "", + "env_variable": "VERSION", + "default_value": "latest", + "user_viewable": true, + "user_editable": true, + "rules": "required|string|max:20", + "field_type": "text" + }, + { + "name": "Secret", + "description": "Your random token", + "env_variable": "TOKEN", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "required|string|min:5|max:60", + "field_type": "text" + } + ] } \ No newline at end of file