2019-04-01 21:45:21 +08:00
{
"_comment" : "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO" ,
"meta" : {
"version" : "PTDL_v1"
} ,
2020-08-30 23:09:47 +08:00
"exported_at" : "2020-08-13T22:04:35-04:00" ,
2019-04-01 21:45:21 +08:00
"name" : "discord.js generic" ,
"author" : "parker@parkervcp.com" ,
"description" : "a generic discord js bot egg\r\n\r\nThis will clone a git repo for a bot. it defaults to master if no branch is specified.\r\n\r\nInstalls the node_modules on install. If you set user_upload then I assume you know what you are doing." ,
2020-03-26 23:17:05 +08:00
"image" : "quay.io\/parkervcp\/pterodactyl-images:debian_nodejs-12" ,
2021-01-06 03:33:25 +08:00
"images" : [
2021-01-07 06:07:55 +08:00
"quay.io\/parkervcp\/pterodactyl-images:debian_nodejs-14" ,
2021-01-06 03:33:25 +08:00
"quay.io\/parkervcp\/pterodactyl-images:debian_nodejs-12" ,
2021-01-07 06:07:55 +08:00
"quay.io\/parkervcp\/pterodactyl-images:debian_nodejs-10"
2021-01-06 03:33:25 +08:00
] ,
2020-07-24 04:18:54 +08:00
"startup" : "if [[ -d .git ]] && [[ {{AUTO_UPDATE}} == \"1\" ]]; then git pull; fi; if [[ ! -z ${NODE_PACKAGES} ]]; then \/usr\/local\/bin\/npm install ${NODE_PACKAGES}; fi; if [ -f \/home\/container\/package.json ]; then \/usr\/local\/bin\/npm install --production; fi; \/usr\/local\/bin\/node \/home\/container\/{{BOT_JS_FILE}}" ,
2019-04-01 21:45:21 +08:00
"config" : {
"files" : "{}" ,
2019-06-13 05:48:11 +08:00
"startup" : "{\r\n \"done\": \"change this part\"\r\n}" ,
2019-04-01 21:45:21 +08:00
"logs" : "{}" ,
"stop" : "^c"
} ,
"scripts" : {
"installation" : {
2020-08-30 23:09:47 +08:00
"script" : "#!\/bin\/bash\r\n# NodeJS Bot Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y git make gcc g++ python python-dev libtool\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nif [[ ! \"${USERNAME}\" == \"\" ]]; then\r\n if [[ ! https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git = *\\.git ]]; then\r\n INSTALL_REPO=$(echo -e https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git | sed 's:\/*$::')\r\n INSTALL_REPO=\"https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git\"\r\n fi\r\n \r\n echo -e \"working on installing a discord.js bot from https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git\"\r\n \r\n if [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n \techo -e \"assuming user knows what they are doing have a good day.\"\r\n \texit 0\r\n else\r\n \tif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n \t\techo -e \"\/mnt\/server directory is not empty.\"\r\n \t if [ -d .git ]; then\r\n \t\t\techo -e \".git directory exists\" \r\n \t\t\tif [ -f .git\/config ]; then\r\n \t\t\t\techo -e \"loading info from git config\"\r\n \t\t\t\tORIGIN=$(git config --get remote.origin.url)\r\n \t\t\telse\r\n \t\t\t\techo -e \"files found with no git config\"\r\n \t\t\t\techo -e \"closing out without touching things to not break anything\"\r\n \t\t\t\texit 10\r\n \t\t\tfi\r\n \t\tfi\r\n \t\tif [ \"${ORIGIN}\" == \"https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git\" ]; then\r\n \t\t\techo \"pulling latest from github\"\r\n \t\t\tgit pull \r\n \t\tfi\r\n \telse\r\n \techo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n \t\tif [ -z ${INSTALL_BRANCH} ]; then\r\n \t\t\techo -e \"assuming master branch\"\r\n \t\t\tINSTALL_BRANCH=master\r\n \t\tfi\r\n \r\n \t\techo -e \"running 'git clone --single-branch --branch ${INSTALL_BRANCH} https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git .'\"\r\n \t\tgit clone --single-branch --branch ${INSTALL_BRANCH} https:\/\/${USERNAME}:${PASSWORD}@github.com\/${INSTALL_REPO}.git .\r\n \tfi\r\n fi \r\nelse\r\n if [[ ! ${INSTALL_REPO} = *\\.git ]]; then\r\n INSTALL_REPO=$(echo -e ${INSTALL_REPO} | sed 's:\/*$::')\r\n INSTALL_REPO=\"${INSTALL_REPO}.git\"\r\n fi\r\n \r\n echo -e \"working on installing a discord.js bot from ${INSTALL_REPO}\"\r\n \r\n if [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\n \techo -e \"assuming user knows what they are doing have a good day.\"\r\n \texit 0\r\n else\r\n \tif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n \t\techo -e \"\/mnt\/server directory is not empty.\"\r\n \t if [ -d .git ]; then\r\n \t\t\techo -e \".git directory exists\" \r\n \t\t\tif [ -f .git\/config ]; then\r\n \t\t\t\techo -e \"loading info from git config\"\r\n \t\t\t\tORIGIN=$(git config --get remote.origin.url)\r\n \t\t\telse\r\n \t\t\t\techo -e \"files found with no git config\"\r\n \t\t\t\techo -e \"closing out without touching things to not break anything\"\r\n \t\t\t\texit 10\r\n \t\t\tfi\r\n \t\tfi\r\n \t\tif [ \"${ORIGIN}\" == \"${INSTALL_REPO}\" ]; then\r\n \t\t\techo \"pulling latest from github\"\r\n \t\t\tgit pull \r\n \t\tfi\r\n \telse\r\n \techo -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\n \t\tif [ -z ${INSTALL_BRANCH} ]; then\r\n \t\t\techo -e \"assuming master branch\"\r\n \t\t\tINSTALL_BRANCH=master\r\n \t\tfi\r\n \r\n \t\techo -e \"running 'git clone --single-branch --branch ${INSTALL_BRANCH} ${INSTALL_REPO} .'\"\r\n \t\tgit clone --single-branch --branch ${INSTALL_BRANCH} ${INSTALL_REPO} .\r\n \tfi\r\n fi \r\nfi\r\n\r\necho \"Installing python requirements into folder\" \ r \ n i f [ [ ! - z $ { N O D E _ P A C K A G E S } ] ] ; t h e n \ r \ n \ / u s r \ / l o c a l \ / b i n \ / n p m i n s t a l l $ { N O D E _ P A C K A G E S } \ r \ n f i \ r \ n \ r \ n i f [ - f \ / m n t \ / s e r v e r \ / p a c k a g e
2020-06-30 05:11:32 +08:00
"container" : "node:12-buster-slim" ,
"entrypoint" : "bash"
2019-04-01 21:45:21 +08:00
}
} ,
"variables" : [
{
"name" : "Install Repo" ,
2020-08-30 23:09:47 +08:00
"description" : "The GitHub repo to clone and install the discord js bot from." ,
2019-04-01 21:45:21 +08:00
"env_variable" : "INSTALL_REPO" ,
"default_value" : "" ,
"user_viewable" : 1 ,
2020-08-30 23:09:47 +08:00
"user_editable" : 1 ,
"rules" : "nullable|string|max:128"
} ,
{
"name" : "Username" ,
"description" : "The GitHub username. Leave this field blank if the GitHub repo is NOT a private repo." ,
"env_variable" : "USERNAME" ,
"default_value" : "" ,
"user_viewable" : 1 ,
"user_editable" : 1 ,
"rules" : "nullable|string|max:128"
} ,
{
"name" : "Password" ,
"description" : "The GitHub password. Leave this field blank if the GitHub repo is NOT a private repo." ,
"env_variable" : "PASSWORD" ,
"default_value" : "" ,
"user_viewable" : 1 ,
"user_editable" : 1 ,
2019-04-02 03:17:36 +08:00
"rules" : "nullable|string|max:128"
2019-04-01 21:45:21 +08:00
} ,
{
"name" : "Install Branch" ,
2020-08-30 23:09:47 +08:00
"description" : "The branch of the bot to install." ,
2019-04-01 21:45:21 +08:00
"env_variable" : "INSTALL_BRANCH" ,
"default_value" : "" ,
"user_viewable" : 1 ,
2020-08-30 23:09:47 +08:00
"user_editable" : 1 ,
2019-04-01 21:45:21 +08:00
"rules" : "nullable|string|max:32"
} ,
{
"name" : "User Uploaded Files" ,
2020-08-30 23:09:47 +08:00
"description" : "Skip all the install stuff if you are letting a user upload files.\r\n\r\n0 = false (default)\r\n1 = true" ,
2019-04-01 21:45:21 +08:00
"env_variable" : "USER_UPLOAD" ,
"default_value" : "0" ,
"user_viewable" : 1 ,
2020-08-30 23:09:47 +08:00
"user_editable" : 1 ,
2019-04-01 21:45:21 +08:00
"rules" : "required|bool"
2019-06-13 22:46:29 +08:00
} ,
{
"name" : "Auto Update" ,
2020-08-30 23:09:47 +08:00
"description" : "Pull the latest files on startup when using a GitHub repo." ,
2019-06-13 22:46:29 +08:00
"env_variable" : "AUTO_UPDATE" ,
2019-06-16 23:08:16 +08:00
"default_value" : "0" ,
2019-06-13 22:46:29 +08:00
"user_viewable" : 1 ,
"user_editable" : 1 ,
"rules" : "required|boolean"
2020-02-02 10:37:44 +08:00
} ,
{
"name" : "Bot js file" ,
"description" : "The file that starts the bot." ,
"env_variable" : "BOT_JS_FILE" ,
"default_value" : "index.js" ,
"user_viewable" : 1 ,
"user_editable" : 1 ,
"rules" : "required|string"
2020-06-30 05:11:32 +08:00
} ,
{
"name" : "Additional Node packages" ,
2020-08-30 23:09:47 +08:00
"description" : "Install additional node packages.\r\n\r\nUse spaces to separate." ,
2020-06-30 05:11:32 +08:00
"env_variable" : "NODE_PACKAGES" ,
"default_value" : "" ,
"user_viewable" : 1 ,
"user_editable" : 1 ,
2020-07-19 11:16:13 +08:00
"rules" : "nullable|string"
2019-04-01 21:45:21 +08:00
}
]
2020-08-30 23:09:47 +08:00
}