forked from Ym0T/pterodactyl-nginx-egg
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathegg-nginx-node-v1.json
More file actions
132 lines (132 loc) · 10.3 KB
/
egg-nginx-node-v1.json
File metadata and controls
132 lines (132 loc) · 10.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
"meta": {
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2025-06-23T20:47:50+02:00",
"name": "Pterodactyl Nginx + Node Egg",
"author": "YmoT@tuta.com",
"description": "Pterodactyl Nginx Egg\r\n\r\nThe Pterodactyl Nginx Egg is a web server solution for Pterodactyl, featuring Nginx, Node.js, Git support, and Cloudflare Tunnel integration. It supports AMD64 & ARM64 architectures. Key Features:\r\n\u2705 Git integration for automatic deployment\r\n\u2705 Cloudflare Tunnel support for secure remote access\r\n\u2705 HTTPS configuration support\r\n\u2705 Automatic updates for Git repositories",
"features": null,
"docker_images": {
"ririkoai/pterodactyl-nginx-node:node22": "ririkoai/pterodactyl-nginx-node:node22"
},
"file_denylist": [],
"startup": "./start-modules.sh",
"config": {
"files": "{\r\n \"nginx/conf.d/default.conf\": {\r\n \"parser\": \"file\",\r\n \"find\": {\r\n \" listen\": \" listen {{server.build.default.port}};\"\r\n }\r\n }\r\n}",
"startup": "{\r\n \"done\": \"Services successfully launched\"\r\n}",
"logs": "{\r\n \"location\": \"logs/latest.log\"\r\n}",
"stop": "^C & ^C"
},
"scripts": {
"installation": {
"script": "#!/bin/bash\n\n# [SETUP] Install necessary packages, including git\necho -e \"[SETUP] Install packages\"\napt-get update -qq > /dev/null 2>&1 && apt-get install -qq > /dev/null 2>&1 -y git wget\n\n# Change to server directory\ncd /mnt/server\n\n# [SETUP] Create necessary folders\necho -e \"[SETUP] Create folders\"\nmkdir -p logs tmp www node\n\n# Clone the default repository into a temporary directory\necho \"[Git] Cloning default repository 'https://github.com/earnestangel/pterodactyl-nginx-node-egg' into temporary directory.\"\ngit clone https://github.com/earnestangel/pterodactyl-nginx-node-egg /mnt/server/gtemp > /dev/null 2>&1 && echo \"[Git] Repository cloned successfully.\" || { echo \"[Git] Error: Default repository clone failed.\"; exit 21; }\n\n# Copy only nginx related folders and files from the temporary repository\necho \"[Git] Copying folder and files from default repository.\"\ncp -r /mnt/server/gtemp/nginx /mnt/server || { echo \"[Git] Error: Copying 'nginx' folder failed.\"; exit 22; }\ncp -r /mnt/server/gtemp/modules /mnt/server || { echo \"[Git] Error: Copying 'modules' folder failed.\"; exit 22; }\ncp /mnt/server/gtemp/start-modules.sh /mnt/server || { echo \"[Git] Error: Copying 'start-modules.sh' file failed.\"; exit 22; }\ncp /mnt/server/gtemp/LICENSE /mnt/server || { echo \"[Git] Error: Copying 'LICENSE' file failed.\"; exit 22; }\nchmod +x /mnt/server/start-modules.sh\nfind /mnt/server/modules -type f -name \"*.sh\" -exec chmod +x {} \\;\n\n# Remove the temporary cloned repository\nrm -rf /mnt/server/gtemp\n\n# Check if GIT_ADDRESS is set\nif [ -z \"${GIT_ADDRESS}\" ]; then\n echo \"[Git] Info: GIT_ADDRESS is not set.\"\n echo \"[Git] Git operations are disabled. Skipping Git actions.\"\nelse\n # Add .git suffix to GIT_ADDRESS if it's not present\n if [[ ${GIT_ADDRESS} != *.git ]]; then\n GIT_ADDRESS=\"${GIT_ADDRESS}.git\"\n echo \"[Git] Added .git suffix to GIT_ADDRESS: ${GIT_ADDRESS}\"\n fi\n\n # If username and access token are provided, use authenticated access\n if [ -n \"${USERNAME}\" ] && [ -n \"${ACCESS_TOKEN}\" ]; then\n echo \"[Git] Using authenticated Git access.\"\n \n # Extract the domain and the rest of the URL, ensuring the correct format\n GIT_DOMAIN=$(echo \"${GIT_ADDRESS}\" | cut -d/ -f3)\n GIT_REPO=$(echo \"${GIT_ADDRESS}\" | cut -d/ -f4-) # Rest of the URL after the domain\n \n # Construct the authenticated Git URL\n GIT_ADDRESS=\"https://${USERNAME}:${ACCESS_TOKEN}@${GIT_DOMAIN}/${GIT_REPO}\"\n \n echo \"[Git] Updated GIT_ADDRESS for authenticated access: ${GIT_ADDRESS}\"\n else\n echo \"[Git] Using anonymous Git access.\"\n fi\n\n # Check if the 'node' directory exists, if not create it\n if [ ! -d /mnt/server/node ]; then\n echo \"[Git] Creating /mnt/server/node directory.\"\n mkdir -p /mnt/server/node\n else\n rm -R /mnt/server/node && mkdir -p /mnt/server/node\n fi\n\n cd /mnt/server/node || { echo \"[Git] Error: Could not access /mnt/server/node directory.\"; exit 1; }\n\n if [ \"$(ls -A /mnt/server/node)\" ]; then\n echo \"[Git] /mnt/server/node directory is not empty.\"\n \n # Check if .git directory exists in 'node'\n if [ -d .git ]; then\n echo \"[Git] .git directory exists in 'node'.\"\n\n # Check if .git/config exists in 'node'\n if [ -f .git/config ]; then\n echo \"[Git] Loading repository info from git config in 'node'.\"\n ORIGIN=$(git config --get remote.origin.url)\n else\n echo \"[Git] Error: .git/config not found in 'node'. The directory may contain files, but it's not a valid Git repository.\"\n exit 10\n fi\n else\n echo \"[Git] Error: Directory contains files but no Git repository found in 'node'.\"\n exit 11\n fi\n\n # Check if origin matches the provided GIT_ADDRESS\n if [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\n echo \"[Git] Repository origin matches. Pulling latest changes from ${GIT_ADDRESS} in 'node'.\"\n git pull || { echo \"[Git] Error: git pull failed for 'node'.\"; exit 12; }\n else\n echo \"[Git] Error: Repository origin does not match the provided GIT_ADDRESS in 'node'.\"\n exit 13\n fi\n else\n # The directory is empty, clone the repository\n echo \"[Git] /mnt/server/node directory is empty. Cloning ${GIT_ADDRESS} into /mnt/server/node.\"\n git clone ${GIT_ADDRESS} . > /dev/null 2>&1 && echo \"[Git] Repository cloned successfully.\" || { echo \"[Git] Error: git clone failed for 'node'.\"; exit 14; }\n fi\nfi\n\necho -e \"[DONE] Everything has been installed successfully\"\necho -e \"[INFO] You can now start the nginx web server\"",
"container": "debian:bookworm-slim",
"entrypoint": "bash"
}
},
"variables": [
{
"name": "Enable LogCleaner Module",
"description": "Set to true to run the log cleanup module on container startup, or false to disable it.",
"env_variable": "LOGCLEANER_STATUS",
"default_value": "1",
"user_viewable": true,
"user_editable": true,
"rules": "required|boolean",
"field_type": "boolean"
},
{
"name": "Enable Git Module",
"description": "Set to true to enable the Git update module, or false to disable it.",
"env_variable": "GIT_STATUS",
"default_value": "0",
"user_viewable": true,
"user_editable": true,
"rules": "required|boolean",
"field_type": "text"
},
{
"name": "Git Repo Address",
"description": "Git repo to clone\r\n\r\nI.E. https:\/\/github.com\/Ym0T\/pterodactyl-nginx-egg",
"env_variable": "GIT_ADDRESS",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string",
"field_type": "text"
},
{
"name": "Git Branch",
"description": "What branch to pull from github.\r\n\r\nDefault is blank to pull the repo default branch",
"env_variable": "BRANCH",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string",
"field_type": "text"
},
{
"name": "Git Username",
"description": "Username to auth with git.",
"env_variable": "USERNAME",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string",
"field_type": "text"
},
{
"name": "Git Access Token",
"description": "Password to use with git.\r\n\r\nIt's best practice to use a Personal Access Token.\r\nhttps:\/\/github.com\/settings\/tokens\r\nhttps:\/\/gitlab.com\/-\/profile\/personal_access_tokens",
"env_variable": "ACCESS_TOKEN",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string",
"field_type": "text"
},
{
"name": "Enable Cloudflare Tunnel",
"description": "Set to true to start the Cloudflared tunnel on container startup, or false to skip it.",
"env_variable": "CLOUDFLARED_STATUS",
"default_value": "0",
"user_viewable": true,
"user_editable": true,
"rules": "required|boolean",
"field_type": "text"
},
{
"name": "Cloudflared Tunnel Token",
"description": "The authentication token used to connect to the Cloudflare Tunnel service (typically starts with \"ey...\").",
"env_variable": "CLOUDFLARED_TOKEN",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string|regex:\/^[A-Za-z0-9_-]+$\/",
"field_type": "text"
},
{
"name": "NPM Start Command",
"description": "The command to start your Node.js application (e.g., 'npm start' or 'node app.js').",
"env_variable": "NPM_START_CMD",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "required|string",
"field_type": "text"
},
{
"name": "Node Server Port",
"description": "The port on which your Node.js application listens (e.g., 3000).",
"env_variable": "NODE_PORT",
"default_value": "3000",
"user_viewable": true,
"user_editable": true,
"rules": "required|integer|min:1|max:65535",
"field_type": "text"
}
]
}