Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update egg-python-generic.json #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions python/egg-python-generic.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "PTDL_v2",
"update_url": null
},
"exported_at": "2024-04-02T14:11:47+02:00",
"exported_at": "2024-05-17T20:12:24+02:00",
"name": "python generic",
"author": "[email protected]",
"description": "A Generic Python Egg for Pterodactyl\r\n\r\nTested with: https:\/\/github.com\/Ispira\/pixel-bot",
Expand All @@ -19,7 +19,7 @@
"Python 2.7": "ghcr.io\/parkervcp\/yolks:python_2.7"
},
"file_denylist": [],
"startup": "if [[ -d .git ]] && [[ \"{{AUTO_UPDATE}}\" == \"1\" ]]; then git pull; fi; if [[ ! -z \"{{PY_PACKAGES}}\" ]]; then pip install -U --prefix .local {{PY_PACKAGES}}; fi; if [[ -f \/home\/container\/${REQUIREMENTS_FILE} ]]; then pip install -U --prefix .local -r ${REQUIREMENTS_FILE}; fi; \/usr\/local\/bin\/python \/home\/container\/{{PY_FILE}}",
"startup": "if [[ -d .git ]] && [[ \"{{AUTO_UPDATE}}\" == \"1\" ]]; then git stash;git stash drop; git pull; fi; if [[ ! -z \"{{PY_PACKAGES}}\" ]]; then pip install -U --prefix .local {{PY_PACKAGES}}; fi; if [[ -f \/home\/container\/${REQUIREMENTS_FILE} ]]; then pip install -U --prefix .local -r ${REQUIREMENTS_FILE}; fi; \/usr\/local\/bin\/python \/home\/container\/{{PY_FILE}}",
"config": {
"files": "{}",
"startup": "{\r\n \"done\": \"change this part\"\r\n}",
Expand All @@ -28,7 +28,7 @@
},
"scripts": {
"installation": {
"script": "#!\/bin\/bash\r\n# Python 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++ libtool\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 python 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\n\r\nfi\r\n\r\nexport HOME=\/mnt\/server\r\n\r\necho \"Installing python requirements into folder\"\r\nif [[ ! -z ${PY_PACKAGES} ]]; then\r\n pip install -U --prefix .local ${PY_PACKAGES}\r\nfi\r\n\r\nif [ -f \/mnt\/server\/requirements.txt ]; then\r\n pip install -U --prefix .local -r ${REQUIREMENTS_FILE}\r\nfi\r\n\r\necho -e \"install complete\"\r\nexit 0",
"script": "#!\/bin\/bash\r\n# Python 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++ libtool\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\nif [ \"${USER_UPLOAD}\" == \"true\" ] || [ \"${USER_UPLOAD}\" == \"1\" ]; then\r\necho -e \"assuming user knows what they are doing have a good day.\"\r\nexit 0\r\nfi\r\n## add git ending if it's not on the address\r\nif [[ ${GIT_ADDRESS} != *.git ]]; then\r\nGIT_ADDRESS=${GIT_ADDRESS}.git\r\nfi\r\nif [ -z \"${USERNAME}\" ] && [ -z \"${ACCESS_TOKEN}\" ]; then\r\necho -e \"using anon api call\"\r\nelse\r\nGIT_ADDRESS=\"https:\/\/${USERNAME}:${ACCESS_TOKEN}@$(echo -e ${GIT_ADDRESS} | cut -d\/ -f3-)\"\r\nfi\r\n## pull git python repo\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\necho -e \"\/mnt\/server directory is not empty.\"\r\nif [ -d .git ]; then\r\necho -e \".git directory exists\"\r\nif [ -f .git\/config ]; then\r\necho -e \"loading info from git config\"\r\nORIGIN=$(git config --get remote.origin.url)\r\nelse\r\necho -e \"files found with no git config\"\r\necho -e \"closing out without touching things to not break anything\"\r\nexit 10\r\nfi\r\nfi\r\nif [ \"${ORIGIN}\" == \"${GIT_ADDRESS}\" ]; then\r\necho \"pulling latest from github\"\r\ngit pull\r\nfi\r\nelse\r\necho -e \"\/mnt\/server is empty.\\ncloning files into repo\"\r\nif [ -z ${BRANCH} ]; then\r\necho -e \"cloning default branch\"\r\ngit clone ${GIT_ADDRESS} .\r\nelse\r\necho -e \"cloning ${BRANCH}'\"\r\ngit clone --single-branch --branch ${BRANCH} ${GIT_ADDRESS} .\r\nfi\r\ngit stash;git stash drop\r\nfi\r\nexport HOME=\/mnt\/server\r\necho \"Installing python requirements into folder\"\r\nif [[ ! -z ${PY_PACKAGES} ]]; then\r\npip install -U --prefix .local ${PY_PACKAGES}\r\nfi\r\nif [ -f \/mnt\/server\/requirements.txt ]; then\r\npip install -U --prefix .local -r ${REQUIREMENTS_FILE}\r\nfi\r\necho -e \"install complete\"\r\nexit 0",
"container": "python:3.8-slim-bookworm",
"entrypoint": "bash"
}
Expand Down Expand Up @@ -125,4 +125,4 @@
"field_type": "text"
}
]
}
}