From 60abe76d556a92f81d0abc78d4a3e51ff0a21ae3 Mon Sep 17 00:00:00 2001 From: Gorian <1012176+Gorian@users.noreply.github.com> Date: Mon, 15 Nov 2021 13:39:20 -0800 Subject: [PATCH 1/3] Create README.md --- software/5e-tools/README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 software/5e-tools/README.md diff --git a/software/5e-tools/README.md b/software/5e-tools/README.md new file mode 100644 index 00000000..b8ffb15b --- /dev/null +++ b/software/5e-tools/README.md @@ -0,0 +1,4 @@ +# 5e Tools +> A suite of tools for 5th Edition Dungeons & Dragons players and Dungeon Masters. + +This is a self-hosted mirror of https://5e.tools. It will clone a github repository mirror on install and update on container reboot. From 563b828958492515df1f5af577fab2d36e5e932a Mon Sep 17 00:00:00 2001 From: Gorian <1012176+Gorian@users.noreply.github.com> Date: Mon, 15 Nov 2021 13:40:02 -0800 Subject: [PATCH 2/3] Create egg-5e-tools.json --- software/5e-tools/egg-5e-tools.json | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 software/5e-tools/egg-5e-tools.json diff --git a/software/5e-tools/egg-5e-tools.json b/software/5e-tools/egg-5e-tools.json new file mode 100644 index 00000000..7643cad4 --- /dev/null +++ b/software/5e-tools/egg-5e-tools.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-11-15T13:39:55-08:00", + "name": "5e Tools", + "author": "pterodactyl@demi.cloud", + "description": "A suite of tools for 5th Edition Dungeons & Dragons players and Dungeon Masters.", + "features": null, + "images": [ + "ghcr.io\/parkervcp\/yolks:debian" + ], + "file_denylist": [], + "startup": "cd ~\/5e-tools && git pull && cd && .\/caddy run -config ~\/caddy.json", + "config": { + "files": "{\r\n \"caddy.json\": {\r\n \"parser\": \"json\",\r\n \"find\": {\r\n \"apps.http.servers.srv0.listen.0\": \":{{server.build.default.port}}\"\r\n }\r\n }\r\n}", + "startup": "{\r\n \"done\": \"serving initial configuration\",\r\n \"userInteraction\": []\r\n}", + "logs": "{}", + "stop": "^C" + }, + "scripts": { + "installation": { + "script": "#!\/bin\/bash\r\n# 5e Tools install script\r\n#\r\n# Server Files: \/mnt\/server\r\ndeclare -r DIR=\"\/mnt\/server\"\r\ndeclare -r CADDY_INSTALL_URL=\"https:\/\/caddyserver.com\/api\/download?os=linux&arch=amd64&idempotency=41554620449867\"\r\ndeclare -r LOCAL_REPO=\"${DIR}\/5e-tools\"\r\n\r\ndie() {\r\n local message=\"$1\"\r\n printf \"\\n%s\\n\" \"${message}\"\r\n exit 2\r\n}\r\ncd_error() {\r\n die \"ERROR: installation encountered an error while trying to change directory\"\r\n}\r\n\r\nmain() {\r\n local git_origin\r\n apt update\r\n apt install -y wget\r\n cd \"${DIR}\" || cd_error\r\n printf \"\\nInstalling Caddy...\\n\"\r\n wget \"${CADDY_INSTALL_URL}\" -O .\/caddy\r\n chmod +x .\/caddy\r\n printf \"\\nGenerating Caddy configuration...\\n\"\r\n # this is a default config\r\n # key variables, such as the port, will get overwritten with the pterodactyl\r\n # configuration parser\r\n cat <\"${DIR}\/caddy.json\"\r\n{\r\n \"apps\": {\r\n \"http\": {\r\n \"servers\": {\r\n \"srv0\": {\r\n \"listen\": [\r\n \":8080\"\r\n ],\r\n \"routes\": [\r\n {\r\n \"handle\": [\r\n {\r\n \"handler\": \"vars\",\r\n \"root\": \"\/home\/container\/5e-tools\"\r\n },\r\n {\r\n \"encodings\": {\r\n \"gzip\": {},\r\n \"zstd\": {}\r\n },\r\n \"handler\": \"encode\",\r\n \"prefer\": [\r\n \"zstd\",\r\n \"gzip\"\r\n ]\r\n },\r\n {\r\n \"handler\": \"file_server\"\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n }\r\n}\r\nEOF\r\n git config --global pull.ff only\r\n if [[ ! -d \"${LOCAL_REPO}\" ]]; then\r\n printf \"\\nCloning latest version (this may take a while)...\\n\"\r\n # $REPOSITORY is passed via environment variable from pterodactyl\r\n git clone \"${REPOSITORY}\" \"${LOCAL_REPO}\"\r\n else\r\n cd \"${LOCAL_REPO}\" || cd_error\r\n git_origin=\"$(git config --get remote.origin.url)\"\r\n cd \"${DIR}\" || cd_error\r\n printf \"\\n\\ngit origin is %s\\n\\n\" \"${git_origin}\"\r\n # if the user hasn't change the repository variable\r\n if [[ \"${git_origin}\" == \"${REPOSITORY}\" ]]; then\r\n cd \"${LOCAL_REPO}\" || cd_error\r\n printf \"\\nRepository already installed - updating...\\n\"\r\n git fetch --all\r\n git reset --hard origin\/master\r\n git pull\r\n cd \"${DIR}\" || cd_error\r\n else\r\n printf \"\\nRepository variable changed since last update\\n...\\n\"\r\n rm -rf \"${LOCAL_REPO}\"\r\n git clone \"${REPOSITORY}\" \"${LOCAL_REPO}\"\r\n fi\r\n fi\r\n printf \"\\nInstallation Complete\\n\"\r\n}\r\nmain \"@\"", + "container": "ghcr.io\/pterodactyl\/installers:debian", + "entrypoint": "bash" + } + }, + "variables": [ + { + "name": "5e Tools Repository", + "description": "Git Repository to use for cloning 5e Tools", + "env_variable": "REPOSITORY", + "default_value": "https:\/\/github.com\/5etools-mirror-1\/5etools-mirror-1.github.io", + "user_viewable": false, + "user_editable": false, + "rules": "required|url" + } + ] +} From dcf1db3c5596c5ec82d730e32077b4bda2e02104 Mon Sep 17 00:00:00 2001 From: Gorian <1012176+Gorian@users.noreply.github.com> Date: Mon, 15 Nov 2021 13:41:19 -0800 Subject: [PATCH 3/3] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 302c1ad3..248a7d2f 100644 --- a/README.md +++ b/README.md @@ -257,3 +257,5 @@ If you are reading this it looks like you are looking to add an egg to your serv * [haste-server](/software/haste-server) ### RabbitMQ * [rabbitmq](/software/rabbitmq) +### 5e Tools +* [5e Tools](/software/5e-tools)