B
描述
Bun 是一个极快的 JavaScript 运行时、转译器、打包器和 npm 包管理器的一体化工具。
33 浏览
1 下载
2026-07-01
更新于 7 小时前
预设配置详情
Bun - JavaScript & TypeScript 通用
来自他们的网站
此镜像(egg)旨在运行任何通用的 Bun 应用,允许用户从 Git 仓库拉取自己的 Bun 源代码。
此外,还提供让用户上传自己的文件来运行服务器的选项。
启动配置和命令可能需要修改才能正常运行。
配置
在修改镜像的启动配置之前,服务器将一直处于 starting 状态。你需要编辑文本,使其与你机器人打印的内容匹配,以便 Pterodact
crpi-61s8ghuciu93bus8.cn-shanghai.personal.cr.aliyuncs.com/pterocn-eggs/yolks:bun_latest
crpi-61s8ghuciu93bus8.cn-shanghai.personal.cr.aliyuncs.com/pterocn-eggs/yolks:bun_canary
if [[ -d .git ]] && [[ {{AUTO_UPDATE}} == "1" ]]; then git pull; fi; if [[ ! -z ${BUN_PACKAGES} ]]; then bun install ${BUN_PACKAGES}; fi; if [[ ! -z ${RMBUN_PACKAGES} ]]; then bun remove ${RMBUN_PACKAGES}; fi; if [ -f /home/container/package.json ]; then bun install; fi; bun run {{MAIN_FILE}}
| 变量名 | 变量 | 描述 | 默认值 | 规则 | 可查看 | 可编辑 |
|---|---|---|---|---|---|---|
| Git仓库地址 | GIT_ADDRESS |
要克隆的Git仓库地址。 | |
nullable|string
可选 字符串
|
||
| 用户上传的文件 | USER_UPLOAD |
如果让用户上传文件,则跳过所有安装内容。0 = 假(默认)1 = 真 | 0 |
required|boolean
必填 布尔
|
||
| 自动更新 | AUTO_UPDATE |
在启动时使用 Git 仓库时拉取最新文件。 0 = false(默认) 1 = true | 0 |
required|boolean
必填 布尔
|
||
| 主文件 | MAIN_FILE |
传递给 bun run 命令的主文件 | index.js |
required|string
必填 字符串
|
||
| 附加的Bun包 | BUN_PACKAGES |
安装额外的 bun 包。使用空格分隔。 | |
nullable|string
可选 字符串
|
||
| 卸载 Bun 包 | RMBUN_PACKAGES |
卸载 bun 包。 使用空格分隔。 | |
nullable|string
可选 字符串
|
||
| Git 分支 | BRANCH |
要安装的Git分支 | |
nullable|string
可选 字符串
|
||
| Git用户名 | USERNAME |
用于认证的Git用户名。 | |
nullable|string
可选 字符串
|
||
| Git 访问令牌 | ACCESS_TOKEN |
用于身份验证的Git访问令牌。 | |
nullable|string
可选 字符串
|
镜像
crpi-61s8ghuciu93bus8.cn-shanghai.personal.cr.aliyuncs.com/pterocn-eggs/installers:debian
入口
bash
#!/bin/bash
# Bun App Installation Script
#
# Server Files: /mnt/server
apt update
apt install -y git curl jq file unzip make gcc g++ python python-dev libtool
mkdir -p /mnt/server
cd /mnt/server
mkdir -p /mnt/server
cd /mnt/server
if [ "${USER_UPLOAD}" == "true" ] || [ "${USER_UPLOAD}" == "1" ]; then
echo -e "assuming user knows what they are doing have a good day."
exit 0
fi
## add git ending if it's not on the address
if [[ ${GIT_ADDRESS} != *.git ]]; then
GIT_ADDRESS=${GIT_ADDRESS}.git
fi
if [ -z "${USERNAME}" ] && [ -z "${ACCESS_TOKEN}" ]; then
echo -e "using anon api call"
else
GIT_ADDRESS="https://${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d/ -f3-)"
fi
## pull git js bot repo
if [ "$(ls -A /mnt/server)" ]; then
echo -e "/mnt/server directory is not empty."
if [ -d .git ]; then
echo -e ".git directory exists"
if [ -f .git/config ]; then
echo -e "loading info from git config"
ORIGIN=$(git config --get remote.origin.url)
else
echo -e "files found with no git config"
echo -e "closing out without touching things to not break anything"
exit 10
fi
fi
if [ "${ORIGIN}" == "${GIT_ADDRESS}" ]; then
echo "pulling latest from github"
git pull
fi
else
echo -e "/mnt/server is empty.
cloning files into repo"
if [ -z ${BRANCH} ]; then
echo -e "cloning default branch"
git clone ${GIT_ADDRESS} .
else
echo -e "cloning ${BRANCH}'"
git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .
fi
fi
echo "Installing bun packages"
if [[ ! -z ${BUN_PACKAGES} ]]; then
bun install ${BUN_PACKAGES}
fi
if [ -f /mnt/server/package.json ]; then
bun install --production
fi
## install end
echo "-----------------------------------------"
echo "Installation completed..."
echo "-----------------------------------------"
{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
"meta": {
"version": "PTDL_v2",
"update_url": "https://eggs.pterodactyl.top/eggs/266/download/egg-bun.json"
},
"exported_at": "2023-09-13T17:51:41+02:00",
"name": "Bun",
"author": "mratox@protonmail.com",
"description": "Bun 是一个极快的 JavaScript 运行时、转译器、打包器和 npm 包管理器的一体化工具。",
"features": null,
"docker_images": {
"Bun Latest": "crpi-61s8ghuciu93bus8.cn-shanghai.personal.cr.aliyuncs.com/pterocn-eggs/yolks:bun_latest",
"Bun Canary": "crpi-61s8ghuciu93bus8.cn-shanghai.personal.cr.aliyuncs.com/pterocn-eggs/yolks:bun_canary"
},
"file_denylist": [],
"startup": "if [[ -d .git ]] && [[ {{AUTO_UPDATE}} == \"1\" ]]; then git pull; fi; if [[ ! -z ${BUN_PACKAGES} ]]; then bun install ${BUN_PACKAGES}; fi; if [[ ! -z ${RMBUN_PACKAGES} ]]; then bun remove ${RMBUN_PACKAGES}; fi; if [ -f /home/container/package.json ]; then bun install; fi; bun run {{MAIN_FILE}}",
"config": {
"files": "{}",
"startup": "{\r\n \"done\": [\r\n \"change this text 1\",\r\n \"change this text 2\"\r\n ]\r\n}",
"logs": "{}",
"stop": "^^C"
},
"scripts": {
"installation": {
"script": "#!/bin/bash\r\n# Bun App Installation Script\r\n#\r\n# Server Files: /mnt/server\r\napt update\r\napt install -y git curl jq file unzip make gcc g++ python python-dev libtool\r\nmkdir -p /mnt/server\r\ncd /mnt/server\r\n\r\n\r\nmkdir -p /mnt/server\r\ncd /mnt/server\r\n\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n echo -e \"assuming user knows what they are doing have a good day.\"\r\n exit 0\r\nfi\r\n\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\n GIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\n\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\n echo -e \"using anon api call\"\r\nelse\r\n GIT_ADDRESS=\"https://${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d/ -f3-)\"\r\nfi\r\n\r\n## pull git js bot repo\r\nif [ \"$(ls -A /mnt/server)\" ]; then\r\n echo -e \"/mnt/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \".git directory exists\"\r\n if [ -f .git/config ]; then\r\n echo -e \"loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"files found with no git config\"\r\n echo -e \"closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"/mnt/server is empty.\\ncloning files into repo\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ADDRESS} .\r\n else\r\n echo -e \"cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\n fi\r\nfi\r\n\r\n\r\necho \"Installing bun packages\"\r\nif [[ ! -z ${BUN_PACKAGES} ]]; then\r\n bun install ${BUN_PACKAGES}\r\nfi\r\n\r\nif [ -f /mnt/server/package.json ]; then\r\n bun install --production\r\nfi\r\n\r\n## install end\r\necho \"-----------------------------------------\"\r\necho \"Installation completed...\"\r\necho \"-----------------------------------------\"",
"container": "crpi-61s8ghuciu93bus8.cn-shanghai.personal.cr.aliyuncs.com/pterocn-eggs/installers:debian",
"entrypoint": "bash"
}
},
"variables": [
{
"name": "Git仓库地址",
"description": "要克隆的Git仓库地址。",
"env_variable": "GIT_ADDRESS",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string",
"field_type": "text"
},
{
"name": "用户上传的文件",
"description": "如果让用户上传文件,则跳过所有安装内容。0 = 假(默认)1 = 真",
"env_variable": "USER_UPLOAD",
"default_value": "0",
"user_viewable": true,
"user_editable": true,
"rules": "required|boolean",
"field_type": "text"
},
{
"name": "自动更新",
"description": "在启动时使用 Git 仓库时拉取最新文件。 \n0 = false(默认) \n1 = true",
"env_variable": "AUTO_UPDATE",
"default_value": "0",
"user_viewable": true,
"user_editable": true,
"rules": "required|boolean",
"field_type": "text"
},
{
"name": "主文件",
"description": "传递给 bun run 命令的主文件",
"env_variable": "MAIN_FILE",
"default_value": "index.js",
"user_viewable": true,
"user_editable": true,
"rules": "required|string",
"field_type": "text"
},
{
"name": "附加的Bun包",
"description": "安装额外的 bun 包。使用空格分隔。",
"env_variable": "BUN_PACKAGES",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string",
"field_type": "text"
},
{
"name": "卸载 Bun 包",
"description": "卸载 bun 包。\n使用空格分隔。",
"env_variable": "RMBUN_PACKAGES",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string",
"field_type": "text"
},
{
"name": "Git 分支",
"description": "要安装的Git分支",
"env_variable": "BRANCH",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string",
"field_type": "text"
},
{
"name": "Git用户名",
"description": "用于认证的Git用户名。",
"env_variable": "USERNAME",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string",
"field_type": "text"
},
{
"name": "Git 访问令牌",
"description": "用于身份验证的Git访问令牌。",
"env_variable": "ACCESS_TOKEN",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string",
"field_type": "text"
}
]
}附属文件
暂无附属文件
提交历史
Fork 关系
查看关系图暂无 Fork,成为第一个 Fork 的人吧!
统计
33
浏览
1
下载
0
星标
0
复刻
作者
飒
飒爽师叔
UID: 1
279 预设
·
2026-06