|
1
|
|
{
|
|
2
|
|
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PANEL",
|
|
3
|
|
"meta": {
|
|
展开 38 行未改动
|
|
4
|
|
"version": "PTDL_v2",
|
|
5
|
|
"update_url": "https://eggs.pterodactyl.top/eggs/1/download/egg-5e-tools.json"
|
|
6
|
|
},
|
|
7
|
|
"exported_at": "2024-06-02T14:40:56+00:00",
|
|
8
|
|
"name": "5e Tools",
|
|
9
|
|
"author": "pterodactyl@demi.cloud",
|
|
10
|
|
"uuid": "ae9f372e-01d7-4c9b-a109-e49990d68d45",
|
|
11
|
|
"description": "A suite of tools for 5th Edition Dungeons & Dragons players and Dungeon Masters.",
|
|
12
|
|
"features": null,
|
|
13
|
|
"docker_images": {
|
|
14
|
|
"registry.cn-shanghai.aliyuncs.com/pterodactyl-images/yolks:debian": "registry.cn-shanghai.aliyuncs.com/pterodactyl-images/yolks:debian"
|
|
15
|
|
},
|
|
16
|
|
"file_denylist": [],
|
|
17
|
|
"startup": "cd ~/5e-tools && git pull && cd && ./caddy run --config ~/caddy.json",
|
|
18
|
|
"config": {
|
|
19
|
|
"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}",
|
|
20
|
|
"startup": "{\r\n \"done\": \"serving initial configuration\"\r\n}",
|
|
21
|
|
"logs": "{}",
|
|
22
|
|
"stop": "^C"
|
|
23
|
|
},
|
|
24
|
|
"scripts": {
|
|
25
|
|
"installation": {
|
|
26
|
|
"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 <<EOF >\"${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 \"@\"",
|
|
27
|
|
"container": "registry.cn-shanghai.aliyuncs.com/pterodactyl-images/installers:debian",
|
|
28
|
|
"entrypoint": "bash"
|
|
29
|
|
}
|
|
30
|
|
},
|
|
31
|
|
"variables": [
|
|
32
|
|
{
|
|
33
|
|
"name": "5e Tools Repository",
|
|
34
|
|
"description": "Git Repository to use for cloning 5e Tools",
|
|
35
|
|
"env_variable": "REPOSITORY",
|
|
36
|
|
"default_value": "https://github.com/5etools-mirror-1/5etools-mirror-1.github.io",
|
|
37
|
|
"user_viewable": false,
|
|
38
|
|
"user_editable": false,
|
|
39
|
|
"rules": "required|url",
|
|
40
|
|
"sort": null,
|
|
41
|
|
"field_type": "text"
|
|
42
|
|
}
|
|
43
|
|
]
|
|
44
|
|
}
|