Skip to content

Commit db4fd84

Browse files
authored
feat(ptreodactyl): new egg (#515)
* Leave exposing ports to the compose/run setup * Add pterodactyl egg and adjust the start script for working in ro overlay2 setups * Update egg-discord-tickets-bot.json
1 parent 036c208 commit db4fd84

File tree

3 files changed

+107
-3
lines changed

3 files changed

+107
-3
lines changed

Dockerfile

-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ ENV USER=container \
2424
HOME=/home/container \
2525
NODE_ENV=production \
2626
HTTP_HOST=0.0.0.0 \
27-
HTTP_PORT=80 \
2827
DOCKER=true
2928
WORKDIR /home/container
3029
COPY --from=builder --chown=container:container --chmod=777 /build /app
31-
EXPOSE ${HTTP_PORT}/tcp
3230
ENTRYPOINT [ "/app/scripts/start.sh" ]
3331
HEALTHCHECK --interval=15s --timeout=5s --start-period=60s \
3432
CMD curl -f http://localhost:${HTTP_PORT}/status || exit 1

egg-discord-tickets-bot.json

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
{
2+
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
3+
"meta": {
4+
"version": "PTDL_v2",
5+
"update_url": null
6+
},
7+
"exported_at": "2024-01-14T14:44:45-05:00",
8+
"name": "Discord Tickets Bot",
9+
"author": "[email protected]",
10+
"description": "An egg for the discord-tickets bot service.",
11+
"features": null,
12+
"docker_images": {
13+
"docker.io\/eartharoid\/discord-tickets:main": "docker.io\/eartharoid\/discord-tickets:main"
14+
},
15+
"file_denylist": [],
16+
"startup": "\/app\/scripts\/start.sh",
17+
"config": {
18+
"files": "{\r\n \".env\": {\r\n \"parser\": \"properties\",\r\n \"find\": {\r\n \"HTTP_PORT\": \"{{server.build.default.port}}\",\r\n \"HTTP_HOST\": \"0.0.0.0\",\r\n \"DB_PROVIDER\": \"{{env.DB_PROV}}\",\r\n \"DB_CONNECTION_URL\": \"{{env.DBHOST}}\",\r\n \"DISCORD_SECRET\": \"{{env.DISCORDSECRET}}\",\r\n \"DISCORD_TOKEN\": \"{{env.DISCORDTOKEN}}\",\r\n \"HTTP_EXTERNAL\": \"{{env.EXTERNAL}}\",\r\n \"SUPER\": \"{{env.SUPERIDS}}\"\r\n }\r\n }\r\n}",
19+
"startup": "{\r\n \"done\": \"SUCCESS\"\r\n}",
20+
"logs": "{}",
21+
"stop": "exit"
22+
},
23+
"scripts": {
24+
"installation": {
25+
"script": "output_file=\"\/mnt\/server\/.env\"\r\nrandom=$(cat \/dev\/urandom | tr -dc 'a-f0-9' | fold -w 48 | head -n 1)\r\necho \"DB_CONNECTION_URL=\" >> $output_file\r\necho \"DB_PROVIDER=\" >> $output_file\r\necho \"DISCORD_SECRET=\" >> $output_file\r\necho \"DISCORD_TOKEN=\" >> $output_file\r\necho \"ENCRYPTION_KEY=${random}\" >> $output_file\r\necho \"HTTP_EXTERNAL=http:\/\/127.0.0.1:8169\" >> $output_file\r\necho \"HTTP_HOST=0.0.0.0\" >> $output_file\r\necho \"HTTP_PORT=8169\" >> $output_file\r\necho \"HTTP_TRUST_PROXY=false\" >> $output_file\r\necho \"NODE_ENV=production\" >> $output_file\r\necho \"OVERRIDE_ARCHIVE=\" >> $output_file\r\necho \"PUBLIC_BOT=false\" >> $output_file\r\necho \"PUBLISH_COMMANDS=false\" >> $output_file\r\necho \"SUPER=319467558166069248\" >> $output_file\r\n\r\necho \"Environment variables written to $output_file\"",
26+
"container": "node:14-buster-slim",
27+
"entrypoint": "bash"
28+
}
29+
},
30+
"variables": [
31+
{
32+
"name": "Database Provider",
33+
"description": "The database type you want to use, it is not recommended to use SQLite in production. - PostgreSQL \/ MySQL \/ SQLite",
34+
"env_variable": "DB_PROV",
35+
"default_value": "sqlite",
36+
"user_viewable": true,
37+
"user_editable": true,
38+
"rules": "required|string|max:20",
39+
"field_type": "text"
40+
},
41+
{
42+
"name": "Database URL",
43+
"description": "It is recommended you do not use SQLite in production.\r\nhttps:\/\/discordtickets.app\/self-hosting\/configuration\/#db_connection_url",
44+
"env_variable": "DBHOST",
45+
"default_value": "file:\/\/home\/container\/user\/database.db?socket_timeout=120000&busy_timeout=10000",
46+
"user_viewable": true,
47+
"user_editable": true,
48+
"rules": "nullable|string|max:200",
49+
"field_type": "text"
50+
},
51+
{
52+
"name": "Discord 0Auth Secret",
53+
"description": "",
54+
"env_variable": "DISCORDSECRET",
55+
"default_value": "",
56+
"user_viewable": true,
57+
"user_editable": true,
58+
"rules": "nullable|string|max:75",
59+
"field_type": "text"
60+
},
61+
{
62+
"name": "Discord Bot Token",
63+
"description": "",
64+
"env_variable": "DISCORDTOKEN",
65+
"default_value": "",
66+
"user_viewable": true,
67+
"user_editable": true,
68+
"rules": "nullable|string|max:100",
69+
"field_type": "text"
70+
},
71+
{
72+
"name": "External URL",
73+
"description": "The externally accessible url of the bot, in most cases this will be the server IP and Port assigned to you.",
74+
"env_variable": "EXTERNAL",
75+
"default_value": "http:\/\/ip:port",
76+
"user_viewable": true,
77+
"user_editable": true,
78+
"rules": "required|string|max:150",
79+
"field_type": "text"
80+
},
81+
{
82+
"name": "Owner IDs",
83+
"description": "Comma separated list of discord owner IDs, the default is that of the bot developer and is recommended to leave in if you wan them to be able to debug issues for you.",
84+
"env_variable": "SUPERIDS",
85+
"default_value": "319467558166069248",
86+
"user_viewable": true,
87+
"user_editable": true,
88+
"rules": "nullable|string|max:200",
89+
"field_type": "text"
90+
},
91+
{
92+
"name": "PTERODACTYL",
93+
"description": "Internal variable to denote to the bot that it is in a pterodactyl container, required for functionality",
94+
"env_variable": "PTERODACTYL",
95+
"default_value": "",
96+
"user_viewable": false,
97+
"user_editable": false,
98+
"rules": "required|string|max:20",
99+
"field_type": "text"
100+
}
101+
]
102+
}

scripts/start.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/usr/bin/env sh
22

3-
if [ "$DOCKER" = "true" ]; then
3+
if [ "$PTERODACTYL" = "true" ]; then
4+
rm -rf /home/container/app
5+
cp -R /app /home/container/
6+
base_dir="/home/container/app"
7+
elif [ "$DOCKER" = "true" ]; then
48
base_dir="/app"
59
else
610
source="${BASH_SOURCE}"

0 commit comments

Comments
 (0)