|
1
|
|
{
|
|
2
|
|
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
|
|
3
|
|
"meta": {
|
|
展开 117 行未改动
|
|
4
|
|
"version": "PTDL_v2",
|
|
5
|
|
"update_url": "https://eggs.pterodactyl.top/eggs/266/download/egg-bun.json"
|
|
6
|
|
},
|
|
7
|
|
"exported_at": "2023-09-13T17:51:41+02:00",
|
|
8
|
|
"name": "Bun",
|
|
9
|
|
"author": "mratox@protonmail.com",
|
|
10
|
|
"description": "Bun 是一个极快的 JavaScript 运行时、转译器、打包器和 npm 包管理器的一体化工具。",
|
|
11
|
|
"features": null,
|
|
12
|
|
"docker_images": {
|
|
13
|
|
"Bun Latest": "ghcr.io/ptero-eggs/yolks:bun_latest",
|
|
14
|
|
"Bun Canary": "ghcr.io/ptero-eggs/yolks:bun_canary"
|
|
15
|
|
},
|
|
16
|
|
"file_denylist": [],
|
|
17
|
|
"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}}",
|
|
18
|
|
"config": {
|
|
19
|
|
"files": "{}",
|
|
20
|
|
"startup": "{\r\n \"done\": [\r\n \"change this text 1\",\r\n \"change this text 2\"\r\n ]\r\n}",
|
|
21
|
|
"logs": "{}",
|
|
22
|
|
"stop": "^^C"
|
|
23
|
|
},
|
|
24
|
|
"scripts": {
|
|
25
|
|
"installation": {
|
|
26
|
|
"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 \"-----------------------------------------\"",
|
|
27
|
|
"container": "ghcr.io/ptero-eggs/installers:debian",
|
|
28
|
|
"entrypoint": "bash"
|
|
29
|
|
}
|
|
30
|
|
},
|
|
31
|
|
"variables": [
|
|
32
|
|
{
|
|
33
|
|
"name": "Git仓库地址",
|
|
34
|
|
"description": "要克隆的Git仓库地址。",
|
|
35
|
|
"env_variable": "GIT_ADDRESS",
|
|
36
|
|
"default_value": "",
|
|
37
|
|
"user_viewable": true,
|
|
38
|
|
"user_editable": true,
|
|
39
|
|
"rules": "nullable|string",
|
|
40
|
|
"field_type": "text"
|
|
41
|
|
},
|
|
42
|
|
{
|
|
43
|
|
"name": "用户上传的文件",
|
|
44
|
|
"description": "如果让用户上传文件,则跳过所有安装内容。0 = 假(默认)1 = 真",
|
|
45
|
|
"env_variable": "USER_UPLOAD",
|
|
46
|
|
"default_value": "0",
|
|
47
|
|
"user_viewable": true,
|
|
48
|
|
"user_editable": true,
|
|
49
|
|
"rules": "required|boolean",
|
|
50
|
|
"field_type": "text"
|
|
51
|
|
},
|
|
52
|
|
{
|
|
53
|
|
"name": "自动更新",
|
|
54
|
|
"description": "在启动时使用 Git 仓库时拉取最新文件。 \n0 = false(默认) \n1 = true",
|
|
55
|
|
"env_variable": "AUTO_UPDATE",
|
|
56
|
|
"default_value": "0",
|
|
57
|
|
"user_viewable": true,
|
|
58
|
|
"user_editable": true,
|
|
59
|
|
"rules": "required|boolean",
|
|
60
|
|
"field_type": "text"
|
|
61
|
|
},
|
|
62
|
|
{
|
|
63
|
|
"name": "主文件",
|
|
64
|
|
"description": "传递给 bun run 命令的主文件",
|
|
65
|
|
"env_variable": "MAIN_FILE",
|
|
66
|
|
"default_value": "index.js",
|
|
67
|
|
"user_viewable": true,
|
|
68
|
|
"user_editable": true,
|
|
69
|
|
"rules": "required|string",
|
|
70
|
|
"field_type": "text"
|
|
71
|
|
},
|
|
72
|
|
{
|
|
73
|
|
"name": "附加的Bun包",
|
|
74
|
|
"description": "安装额外的 bun 包。使用空格分隔。",
|
|
75
|
|
"env_variable": "BUN_PACKAGES",
|
|
76
|
|
"default_value": "",
|
|
77
|
|
"user_viewable": true,
|
|
78
|
|
"user_editable": true,
|
|
79
|
|
"rules": "nullable|string",
|
|
80
|
|
"field_type": "text"
|
|
81
|
|
},
|
|
82
|
|
{
|
|
83
|
|
"name": "卸载 Bun 包",
|
|
84
|
|
"description": "卸载 bun 包。\n使用空格分隔。",
|
|
85
|
|
"env_variable": "RMBUN_PACKAGES",
|
|
86
|
|
"default_value": "",
|
|
87
|
|
"user_viewable": true,
|
|
88
|
|
"user_editable": true,
|
|
89
|
|
"rules": "nullable|string",
|
|
90
|
|
"field_type": "text"
|
|
91
|
|
},
|
|
92
|
|
{
|
|
93
|
|
"name": "Git 分支",
|
|
94
|
|
"description": "要安装的Git分支",
|
|
95
|
|
"env_variable": "BRANCH",
|
|
96
|
|
"default_value": "",
|
|
97
|
|
"user_viewable": true,
|
|
98
|
|
"user_editable": true,
|
|
99
|
|
"rules": "nullable|string",
|
|
100
|
|
"field_type": "text"
|
|
101
|
|
},
|
|
102
|
|
{
|
|
103
|
|
"name": "Git用户名",
|
|
104
|
|
"description": "用于认证的Git用户名。",
|
|
105
|
|
"env_variable": "USERNAME",
|
|
106
|
|
"default_value": "",
|
|
107
|
|
"user_viewable": true,
|
|
108
|
|
"user_editable": true,
|
|
109
|
|
"rules": "nullable|string",
|
|
110
|
|
"field_type": "text"
|
|
111
|
|
},
|
|
112
|
|
{
|
|
113
|
|
"name": "Git 访问令牌",
|
|
114
|
|
"description": "用于身份验证的Git访问令牌。",
|
|
115
|
|
"env_variable": "ACCESS_TOKEN",
|
|
116
|
|
"default_value": "",
|
|
117
|
|
"user_viewable": true,
|
|
118
|
|
"user_editable": true,
|
|
119
|
|
"rules": "nullable|string",
|
|
120
|
|
"field_type": "text"
|
|
121
|
|
}
|
|
122
|
|
]
|
|
123
|
|
}
|