Skip to content

Instantly share code, notes, and snippets.

@Neodevils
Created November 13, 2023 21:09
Show Gist options
  • Save Neodevils/bb3a447e71d3ae21e399616de1fa9ab2 to your computer and use it in GitHub Desktop.
Save Neodevils/bb3a447e71d3ae21e399616de1fa9ab2 to your computer and use it in GitHub Desktop.
Connecting Your GitHub Repository to Pterodactyl Panel

Step 0. If you have a private repository

First create a personal access token as instructed on https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token.

Skip step 1, go to 2, remove # from all the lines except first one and fill your details.

Step 1. Cloning your repository.

Set your startup command 1 to git clone https://github.com/awesumperson/bot (change the URL to the URL of your repo) in Daki panel settings, then run the bot. This should clone your repository into a folder inside your Daki container, which you should be then able to see inside Daki file manager. ‎ Make sure to remove the git clone from your startup command 1 once you have successfully cloned your repository into a folder on daki, one clone should suffice forever. To update your repository, read part 2.

Step 2. Updating your repository.

To update your repository, you need to fetch and pull inside it's folder. ‎ You can add to your startup script/create a startup script at /home/container/startup.sh, so that every time you start your bot it fetches and pulls. ‎ Inside /home/container/startup.sh:

#! /bin/bash
#git config --global user.name "usename"
#git config --global user.password "access token"
#git clone https://github.com/awesumperson/bot
cd bot
git fetch
git pull
node run_bot.js

‎ Replace bot with whatever your bot repo folder is named (the one you got from git cloning) and node run_bot.js with whatever command you use to start your bot. ‎ If your script is named startup.sh and it is in /home/container, simply specify sh startup.sh in startup command 1 to execute it when your bot is started. ‎ If you adjust this script according to your requirements while keeping the fetch and pull lines, your copy of the repo on daki will be updated every restart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment