5
描述
一套为第五版龙与地下城玩家和地下城主设计的工具套件。
168 浏览
5 下载
2026-06-30
更新于 3 小时前
预设配置详情
registry.cn-shanghai.aliyuncs.com/pterodactyl-images/yolks:debian
cd ~/5e-tools && git pull && cd && ./caddy run --config ~/caddy.json
| 变量名 | 变量 | 描述 | 默认值 | 规则 | 可查看 | 可编辑 |
|---|---|---|---|---|---|---|
| 5e工具仓库 | REPOSITORY |
用于克隆5e工具的Git仓库 | https://github.com/5etools-mirror-1/5etools-mirror-1.github.io |
required|url
必填 URL
|
镜像
registry.cn-shanghai.aliyuncs.com/pterodactyl-images/installers:debian
入口
bash
#!/bin/bash
# 5e Tools install script
#
# Server Files: /mnt/server
declare -r DIR="/mnt/server"
declare -r CADDY_INSTALL_URL="https://caddyserver.com/api/download?os=linux&arch=amd64&idempotency=41554620449867"
declare -r LOCAL_REPO="${DIR}/5e-tools"
die() {
local message="$1"
printf "
%s
" "${message}"
exit 2
}
cd_error() {
die "ERROR: installation encountered an error while trying to change directory"
}
main() {
local git_origin
apt update
apt install -y wget
cd "${DIR}" || cd_error
printf "
Installing Caddy...
"
wget "${CADDY_INSTALL_URL}" -O ./caddy
chmod +x ./caddy
printf "
Generating Caddy configuration...
"
# this is a default config
# key variables, such as the port, will get overwritten with the pterodactyl
# configuration parser
cat <<EOF >"${DIR}/caddy.json"
{
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [
":8080"
],
"routes": [
{
"handle": [
{
"handler": "vars",
"root": "/home/container/5e-tools"
},
{
"encodings": {
"gzip": {},
"zstd": {}
},
"handler": "encode",
"prefer": [
"zstd",
"gzip"
]
},
{
"handler": "file_server"
}
]
}
]
}
}
}
}
}
EOF
git config --global pull.ff only
if [[ ! -d "${LOCAL_REPO}" ]]; then
printf "
Cloning latest version (this may take a while)...
"
# $REPOSITORY is passed via environment variable from pterodactyl
git clone "${REPOSITORY}" "${LOCAL_REPO}"
else
cd "${LOCAL_REPO}" || cd_error
git_origin="$(git config --get remote.origin.url)"
cd "${DIR}" || cd_error
printf "
git origin is %s
" "${git_origin}"
# if the user hasn't change the repository variable
if [[ "${git_origin}" == "${REPOSITORY}" ]]; then
cd "${LOCAL_REPO}" || cd_error
printf "
Repository already installed - updating...
"
git fetch --all
git reset --hard origin/master
git pull
cd "${DIR}" || cd_error
else
printf "
Repository variable changed since last update
...
"
rm -rf "${LOCAL_REPO}"
git clone "${REPOSITORY}" "${LOCAL_REPO}"
fi
fi
printf "
Installation Complete
"
}
main "@"
{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PANEL",
"meta": {
"version": "PTDL_v2",
"update_url": "https://eggs.pterodactyl.top/eggs/1/download/egg-5e-tools.json"
},
"exported_at": "2024-06-02T14:40:56+00:00",
"name": "5e Tools",
"author": "pterodactyl@demi.cloud",
"uuid": "ae9f372e-01d7-4c9b-a109-e49990d68d45",
"description": "一套为第五版龙与地下城玩家和地下城主设计的工具套件。",
"features": null,
"docker_images": {
"registry.cn-shanghai.aliyuncs.com/pterodactyl-images/yolks:debian": "registry.cn-shanghai.aliyuncs.com/pterodactyl-images/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}",
"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 <<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 \"@\"",
"container": "registry.cn-shanghai.aliyuncs.com/pterodactyl-images/installers:debian",
"entrypoint": "bash"
}
},
"variables": [
{
"name": "5e工具仓库",
"description": "用于克隆5e工具的Git仓库",
"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",
"sort": null,
"field_type": "text"
}
]
}附属文件
暂无附属文件
提交历史
Fork 关系
查看关系图暂无 Fork,成为第一个 Fork 的人吧!
统计
168
浏览
5
下载
0
星标
0
复刻
作者
飒
飒爽师叔
UID: 1
279 预设
·
2026-06