Skip to content

Instantly share code, notes, and snippets.

@Be1zebub
Created April 6, 2025 10:29
Show Gist options
  • Save Be1zebub/a43d77cfa6fadb10be931254d90b92cc to your computer and use it in GitHub Desktop.
Save Be1zebub/a43d77cfa6fadb10be931254d90b92cc to your computer and use it in GitHub Desktop.
A SvelteKit egg for Pterodactyl.
{
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
"meta": {
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2025-04-06T10:28:26+00:00",
"name": "SvelteKit",
"author": "[email protected]",
"description": "A SvelteKit egg for Pterodactyl.\r\n\r\nThis will clone a git repo of your SvelteKit project.\r\nInstalls dependencies, builds the project, and runs the server on startup.",
"features": null,
"docker_images": {
"Nodejs 23": "ghcr.io\/parkervcp\/yolks:nodejs_23",
"Nodejs 22": "ghcr.io\/parkervcp\/yolks:nodejs_22",
"Nodejs 21": "ghcr.io\/parkervcp\/yolks:nodejs_21",
"Nodejs 20": "ghcr.io\/parkervcp\/yolks:nodejs_20",
"Nodejs 19": "ghcr.io\/parkervcp\/yolks:nodejs_19",
"Nodejs 18": "ghcr.io\/parkervcp\/yolks:nodejs_18",
"Nodejs 17": "ghcr.io\/parkervcp\/yolks:nodejs_17"
},
"file_denylist": [],
"startup": "if [ ! -f \"\/home\/container\/.env\" ]; then tput setaf 1; echo \".env missing!\"; tput sgr0; echo \"Check repo or .env.example\"; sleep 30; exit 1; fi;\r\n\r\nif [[ -d .git ]] && [[ {{STARTUP_GIT_STASH}} == \"1\" ]]; then git stash; fi;\r\nif [[ -d .git ]] && [[ {{STARTUP_GIT_PULL}} == \"1\" ]]; then git pull; fi;\r\n\r\nif [[ {{STARTUP_NPM_INSTALL}} == \"1\" ]]; then \/usr\/local\/bin\/npm install; fi;\r\nif [[ {{STARTUP_NPM_BUILD}} == \"1\" ]]; then \/usr\/local\/bin\/npm run build; fi;\r\n\r\n\/usr\/local\/bin\/node --env-file=.env build\/index.js;",
"config": {
"files": "{}",
"startup": "{\r\n \"done\": \"Listening on\"\r\n}",
"logs": "{}",
"stop": "^^C"
},
"scripts": {
"installation": {
"script": "#!\/bin\/bash\r\n# SvelteKit App Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n\r\napt update\r\napt install -y git curl jq file unzip make gcc g++\r\n\r\necho -e \"updating npm. please wait...\"\r\nnpm install npm@latest -g\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [[ -z \"${GIT_ORIGIN}\" ]]; then\r\n echo \"Git origin not specified\"\r\n exit 1\r\nfi\r\n\r\n# Add .git suffix if missing\r\nif [[ ${GIT_ORIGIN} != *.git ]]; then\r\n GIT_ORIGIN=${GIT_ORIGIN}.git\r\nfi\r\n\r\n# Convert various URL formats to standard https:\/\/ format\r\nif [[ ${GIT_ORIGIN} == [email protected]:* ]]; then\r\n # Convert SSH to HTTPS\r\n GIT_ORIGIN=\"https:\/\/github.com\/${GIT_ORIGIN#[email protected]:}\"\r\nelif [[ ${GIT_ORIGIN} == github.com\/* ]]; then\r\n # Add https:\/\/ prefix if missing\r\n GIT_ORIGIN=\"https:\/\/${GIT_ORIGIN}\"\r\nfi\r\n\r\n# Add authentication if token is provided\r\nif [ -n \"${GIT_ACCESS_TOKEN}\" ]; then\r\n GIT_ORIGIN=\"https:\/\/${GIT_ACCESS_TOKEN}@${GIT_ORIGIN#https:\/\/}\"\r\nfi\r\n\r\n## pull git 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_ORIGIN}\" ]; 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 ${GIT_BRANCH} ]; then\r\n echo -e \"cloning default branch\"\r\n git clone ${GIT_ORIGIN} .\r\n else\r\n echo -e \"cloning ${GIT_BRANCH}'\"\r\n git clone --single-branch --branch ${GIT_BRANCH} ${GIT_ORIGIN} .\r\n fi\r\n\r\nfi\r\n\r\necho \"Installing npm dependencies\"\r\nif [ -f \/mnt\/server\/package.json ]; then\r\n \/usr\/local\/bin\/npm install\r\nfi\r\n\r\n# Build the SvelteKit project if build flag is enabled\r\nif [ \"${INSTALL_NPM_BUILD}\" == \"true\" ] || [ \"${INSTALL_NPM_BUILD}\" == \"1\" ]; then\r\n echo \"Building SvelteKit project\"\r\n \/usr\/local\/bin\/npm run build\r\nfi\r\n\r\necho -e \"install complete\"\r\nexit 0",
"container": "node:23-bookworm-slim",
"entrypoint": "bash"
}
},
"variables": [
{
"name": "Git Origin (install)",
"description": "Git repo origin - eg github.com\/userName\/repoName",
"env_variable": "GIT_ORIGIN",
"default_value": "github.com\/userName\/repoName",
"user_viewable": true,
"user_editable": true,
"rules": "required|string",
"field_type": "text"
},
{
"name": "Git Branch (install)",
"description": "The branch to install.",
"env_variable": "GIT_BRANCH",
"default_value": "master",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string",
"field_type": "text"
},
{
"name": "Git Access Token (install)",
"description": "Token for git auth.\r\n\r\nhttps:\/\/github.com\/settings\/tokens\r\nhttps:\/\/gitlab.com\/-\/profile\/personal_access_tokens",
"env_variable": "GIT_ACCESS_TOKEN",
"default_value": "",
"user_viewable": true,
"user_editable": true,
"rules": "nullable|string",
"field_type": "text"
},
{
"name": "npm run build (on install)",
"description": "Build the SvelteKit project on install.",
"env_variable": "INSTALL_NPM_BUILD",
"default_value": "1",
"user_viewable": true,
"user_editable": true,
"rules": "required|boolean",
"field_type": "text"
},
{
"name": "npm run build (on startup)",
"description": "Build the SvelteKit project on startup.",
"env_variable": "STARTUP_NPM_BUILD",
"default_value": "1",
"user_viewable": true,
"user_editable": true,
"rules": "required|boolean",
"field_type": "text"
},
{
"name": "npm install (on startup)",
"description": "Install\/update deps on startup.",
"env_variable": "STARTUP_NPM_INSTALL",
"default_value": "1",
"user_viewable": true,
"user_editable": true,
"rules": "required|boolean",
"field_type": "text"
},
{
"name": "git pull (on startup)",
"description": "Pull the latest files on startup from git.",
"env_variable": "STARTUP_GIT_PULL",
"default_value": "1",
"user_viewable": true,
"user_editable": true,
"rules": "required|boolean",
"field_type": "text"
},
{
"name": "git stash (on startup)",
"description": "Stash local changes on startup.",
"env_variable": "STARTUP_GIT_STASH",
"default_value": "0",
"user_viewable": true,
"user_editable": true,
"rules": "required|boolean",
"field_type": "text"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment